diff --git a/cranelift/codegen/src/isa/aarch64/abi.rs b/cranelift/codegen/src/isa/aarch64/abi.rs index 671a17b19448..8a7b7bde83f4 100644 --- a/cranelift/codegen/src/isa/aarch64/abi.rs +++ b/cranelift/codegen/src/isa/aarch64/abi.rs @@ -24,7 +24,7 @@ use smallvec::{smallvec, SmallVec}; pub(crate) type AArch64Callee = Callee; /// Support for the AArch64 ABI from the caller side (at a callsite). -pub(crate) type AArch64Caller = Caller; +pub(crate) type AArch64CallSite = CallSite; /// This is the limit for the size of argument and return-value areas on the /// stack. We place a reasonable limit here to avoid integer overflow issues diff --git a/cranelift/codegen/src/isa/aarch64/lower/isle.rs b/cranelift/codegen/src/isa/aarch64/lower/isle.rs index 8310ff28d0bd..729f1ad23dfa 100644 --- a/cranelift/codegen/src/isa/aarch64/lower/isle.rs +++ b/cranelift/codegen/src/isa/aarch64/lower/isle.rs @@ -26,7 +26,7 @@ use crate::{ immediates::*, types::*, AtomicRmwOp, BlockCall, ExternalName, Inst, InstructionData, MemFlags, TrapCode, Value, ValueList, }, - isa::aarch64::abi::AArch64Caller, + isa::aarch64::abi::AArch64CallSite, isa::aarch64::inst::args::{ShiftOp, ShiftOpShiftImm}, isa::unwind::UnwindInst, machinst::{ @@ -76,12 +76,15 @@ pub struct ExtendedValue { } impl IsleContext<'_, '_, MInst, AArch64Backend> { - isle_prelude_method_helpers!(AArch64Caller); + isle_prelude_method_helpers!(AArch64CallSite); } impl Context for IsleContext<'_, '_, MInst, AArch64Backend> { isle_lower_prelude_methods!(); - isle_prelude_caller_methods!(crate::isa::aarch64::abi::AArch64MachineDeps, AArch64Caller); + isle_prelude_caller_methods!( + crate::isa::aarch64::abi::AArch64MachineDeps, + AArch64CallSite + ); fn sign_return_address_disabled(&mut self) -> Option<()> { if self.backend.isa_flags.sign_return_address() { diff --git a/cranelift/codegen/src/isa/riscv64/abi.rs b/cranelift/codegen/src/isa/riscv64/abi.rs index 1dc9a6d9fc4e..06b41d2d863d 100644 --- a/cranelift/codegen/src/isa/riscv64/abi.rs +++ b/cranelift/codegen/src/isa/riscv64/abi.rs @@ -30,7 +30,7 @@ use smallvec::{smallvec, SmallVec}; pub(crate) type Riscv64Callee = Callee; /// Support for the Riscv64 ABI from the caller side (at a callsite). -pub(crate) type Riscv64ABICaller = Caller; +pub(crate) type Riscv64ABICallSite = CallSite; /// This is the limit for the size of argument and return-value areas on the /// stack. We place a reasonable limit here to avoid integer overflow issues diff --git a/cranelift/codegen/src/isa/riscv64/lower/isle.rs b/cranelift/codegen/src/isa/riscv64/lower/isle.rs index b18a5049266c..c5c7f5eb9289 100644 --- a/cranelift/codegen/src/isa/riscv64/lower/isle.rs +++ b/cranelift/codegen/src/isa/riscv64/lower/isle.rs @@ -7,7 +7,7 @@ use generated_code::{Context, ExtendOp, MInst}; // Types that the generated ISLE code uses via `use super::*`. use super::{writable_zero_reg, zero_reg}; -use crate::isa::riscv64::abi::Riscv64ABICaller; +use crate::isa::riscv64::abi::Riscv64ABICallSite; use crate::isa::riscv64::Riscv64Backend; use crate::machinst::Reg; use crate::machinst::{isle::*, MachInst, SmallInstVec}; @@ -46,7 +46,7 @@ where } impl<'a, 'b> RV64IsleContext<'a, 'b, MInst, Riscv64Backend> { - isle_prelude_method_helpers!(Riscv64ABICaller); + isle_prelude_method_helpers!(Riscv64ABICallSite); fn new(lower_ctx: &'a mut Lower<'b, MInst>, backend: &'a Riscv64Backend) -> Self { Self { @@ -95,7 +95,7 @@ impl<'a, 'b> RV64IsleContext<'a, 'b, MInst, Riscv64Backend> { impl generated_code::Context for RV64IsleContext<'_, '_, MInst, Riscv64Backend> { isle_lower_prelude_methods!(); - isle_prelude_caller_methods!(Riscv64MachineDeps, Riscv64ABICaller); + isle_prelude_caller_methods!(Riscv64MachineDeps, Riscv64ABICallSite); fn vec_writable_to_regs(&mut self, val: &VecWritableReg) -> ValueRegs { match val.len() { diff --git a/cranelift/codegen/src/isa/x64/abi.rs b/cranelift/codegen/src/isa/x64/abi.rs index 9999320cada8..af6e696d6bca 100644 --- a/cranelift/codegen/src/isa/x64/abi.rs +++ b/cranelift/codegen/src/isa/x64/abi.rs @@ -24,7 +24,7 @@ static STACK_ARG_RET_SIZE_LIMIT: u32 = 128 * 1024 * 1024; pub(crate) type X64Callee = Callee; /// Support for the x64 ABI from the caller side (at a callsite). -pub(crate) type X64Caller = Caller; +pub(crate) type X64CallSite = CallSite; /// Implementation of ABI primitives for x64. pub struct X64ABIMachineSpec; diff --git a/cranelift/codegen/src/isa/x64/lower.rs b/cranelift/codegen/src/isa/x64/lower.rs index d40eaecdc4bb..bebbaf6c7c85 100644 --- a/cranelift/codegen/src/isa/x64/lower.rs +++ b/cranelift/codegen/src/isa/x64/lower.rs @@ -159,7 +159,7 @@ fn emit_vm_call( } let mut abi = - X64Caller::from_libcall(ctx.sigs(), &sig, &extname, dist, caller_conv, flags.clone())?; + X64CallSite::from_libcall(ctx.sigs(), &sig, &extname, dist, caller_conv, flags.clone())?; abi.emit_stack_pre_adjust(ctx); diff --git a/cranelift/codegen/src/isa/x64/lower/isle.rs b/cranelift/codegen/src/isa/x64/lower/isle.rs index 6a5c21e6ec86..68764e5b4a65 100644 --- a/cranelift/codegen/src/isa/x64/lower/isle.rs +++ b/cranelift/codegen/src/isa/x64/lower/isle.rs @@ -25,7 +25,7 @@ use crate::{ isa::{ unwind::UnwindInst, x64::{ - abi::X64Caller, + abi::X64CallSite, inst::{args::*, regs, CallInfo}, }, }, @@ -77,7 +77,7 @@ pub(crate) fn lower_branch( impl Context for IsleContext<'_, '_, MInst, X64Backend> { isle_lower_prelude_methods!(); - isle_prelude_caller_methods!(X64ABIMachineSpec, X64Caller); + isle_prelude_caller_methods!(X64ABIMachineSpec, X64CallSite); #[inline] fn operand_size_of_type_32_64(&mut self, ty: Type) -> OperandSize { @@ -1070,7 +1070,7 @@ impl Context for IsleContext<'_, '_, MInst, X64Backend> { } impl IsleContext<'_, '_, MInst, X64Backend> { - isle_prelude_method_helpers!(X64Caller); + isle_prelude_method_helpers!(X64CallSite); fn load_xmm_unaligned(&mut self, addr: SyntheticAmode) -> Xmm { let tmp = self.lower_ctx.alloc_tmp(types::F32X4).only_reg().unwrap(); diff --git a/cranelift/codegen/src/machinst/abi.rs b/cranelift/codegen/src/machinst/abi.rs index 530bfbb4a57f..d73896dc42dd 100644 --- a/cranelift/codegen/src/machinst/abi.rs +++ b/cranelift/codegen/src/machinst/abi.rs @@ -1987,7 +1987,7 @@ pub type CallArgList = SmallVec<[CallArgPair; 8]>; pub type CallRetList = SmallVec<[CallRetPair; 8]>; /// ABI object for a callsite. -pub struct Caller { +pub struct CallSite { /// The called function's signature. sig: Sig, /// All register uses for the callsite, i.e., function args, with @@ -2018,7 +2018,7 @@ pub enum CallDest { Reg(Reg), } -impl Caller { +impl CallSite { /// Create a callsite ABI object for a call directly to the specified function. pub fn from_func( sigs: &SigSet, @@ -2027,10 +2027,10 @@ impl Caller { dist: RelocDistance, caller_conv: isa::CallConv, flags: settings::Flags, - ) -> CodegenResult> { + ) -> CodegenResult> { let sig = sigs.abi_sig_for_sig_ref(sig_ref); let clobbers = sigs.call_clobbers::(sig); - Ok(Caller { + Ok(CallSite { sig, uses: smallvec![], defs: smallvec![], @@ -2052,10 +2052,10 @@ impl Caller { dist: RelocDistance, caller_conv: isa::CallConv, flags: settings::Flags, - ) -> CodegenResult> { + ) -> CodegenResult> { let sig = sigs.abi_sig_for_signature(sig); let clobbers = sigs.call_clobbers::(sig); - Ok(Caller { + Ok(CallSite { sig, uses: smallvec![], defs: smallvec![], @@ -2077,10 +2077,10 @@ impl Caller { opcode: ir::Opcode, caller_conv: isa::CallConv, flags: settings::Flags, - ) -> CodegenResult> { + ) -> CodegenResult> { let sig = sigs.abi_sig_for_sig_ref(sig_ref); let clobbers = sigs.call_clobbers::(sig); - Ok(Caller { + Ok(CallSite { sig, uses: smallvec![], defs: smallvec![], @@ -2105,7 +2105,7 @@ fn adjust_stack_and_nominal_sp(ctx: &mut Lower, off: i3 ctx.emit(M::gen_nominal_sp_adj(-amt)); } -impl Caller { +impl CallSite { /// Get the number of arguments expected. pub fn num_args(&self, sigs: &SigSet) -> usize { sigs.num_args(self.sig) @@ -2358,7 +2358,7 @@ impl Caller { /// sense.) /// /// This function should only be called once, as it is allowed to re-use - /// parts of the `Caller` object in emitting instructions. + /// parts of the `CallSite` object in emitting instructions. pub fn emit_call(&mut self, ctx: &mut Lower) { let word_type = M::word_type(); if let Some(i) = ctx.sigs()[self.sig].stack_ret_arg { diff --git a/cranelift/codegen/src/machinst/isle.rs b/cranelift/codegen/src/machinst/isle.rs index ce4bdd241dd5..8064439a8f8e 100644 --- a/cranelift/codegen/src/machinst/isle.rs +++ b/cranelift/codegen/src/machinst/isle.rs @@ -659,7 +659,7 @@ pub fn shuffle_imm_as_le_lane_idx(size: u8, bytes: &[u8]) -> Option { Some(bytes[0] / size) } -/// Helpers specifically for machines that use ABICaller. +/// Helpers specifically for machines that use `abi::CallSite`. #[macro_export] #[doc(hidden)] macro_rules! isle_prelude_caller_methods {