Skip to content

Commit

Permalink
rustc: rename FnAbi::new to FnAbi::of_fn_ptr.
Browse files Browse the repository at this point in the history
  • Loading branch information
eddyb committed Dec 3, 2019
1 parent 052d0ed commit 2b921d5
Show file tree
Hide file tree
Showing 5 changed files with 6 additions and 6 deletions.
4 changes: 2 additions & 2 deletions src/librustc/ty/layout.rs
Expand Up @@ -2347,7 +2347,7 @@ where
+ HasTyCtxt<'tcx>
+ HasParamEnv<'tcx>,
{
fn new(cx: &C, sig: ty::FnSig<'tcx>, extra_args: &[Ty<'tcx>]) -> Self;
fn of_fn_ptr(cx: &C, sig: ty::FnSig<'tcx>, extra_args: &[Ty<'tcx>]) -> Self;
fn of_instance(cx: &C, instance: ty::Instance<'tcx>, extra_args: &[Ty<'tcx>]) -> Self;
fn new_internal(
cx: &C,
Expand All @@ -2366,7 +2366,7 @@ where
+ HasTyCtxt<'tcx>
+ HasParamEnv<'tcx>,
{
fn new(cx: &C, sig: ty::FnSig<'tcx>, extra_args: &[Ty<'tcx>]) -> Self {
fn of_fn_ptr(cx: &C, sig: ty::FnSig<'tcx>, extra_args: &[Ty<'tcx>]) -> Self {
call::FnAbi::new_internal(cx, sig, extra_args, |ty, _| ArgAbi::new(cx.layout_of(ty)))
}

Expand Down
2 changes: 1 addition & 1 deletion src/librustc_codegen_llvm/context.rs
Expand Up @@ -421,7 +421,7 @@ impl MiscMethods<'tcx> for CodegenCx<'ll, 'tcx> {
Abi::C
);

let fn_abi = FnAbi::new(self, sig, &[]);
let fn_abi = FnAbi::of_fn_ptr(self, sig, &[]);
let llfn = self.declare_fn("rust_eh_unwind_resume", &fn_abi);
attributes::apply_target_cpu_attr(self, llfn);
unwresume.set(Some(llfn));
Expand Down
2 changes: 1 addition & 1 deletion src/librustc_codegen_llvm/intrinsic.rs
Expand Up @@ -1012,7 +1012,7 @@ fn gen_fn<'ll, 'tcx>(
hir::Unsafety::Unsafe,
Abi::Rust
);
let fn_abi = FnAbi::new(cx, rust_fn_sig, &[]);
let fn_abi = FnAbi::of_fn_ptr(cx, rust_fn_sig, &[]);
let llfn = cx.declare_fn(name, &fn_abi);
// FIXME(eddyb) find a nicer way to do this.
unsafe { llvm::LLVMRustSetLinkage(llfn, llvm::Linkage::InternalLinkage) };
Expand Down
2 changes: 1 addition & 1 deletion src/librustc_codegen_llvm/type_of.rs
Expand Up @@ -239,7 +239,7 @@ impl<'tcx> LayoutLlvmExt<'tcx> for TyLayout<'tcx> {
ty::ParamEnv::reveal_all(),
&sig,
);
cx.fn_ptr_backend_type(&FnAbi::new(cx, sig, &[]))
cx.fn_ptr_backend_type(&FnAbi::of_fn_ptr(cx, sig, &[]))
}
_ => self.scalar_llvm_type_at(cx, scalar, Size::ZERO)
};
Expand Down
2 changes: 1 addition & 1 deletion src/librustc_codegen_ssa/mir/block.rs
Expand Up @@ -529,7 +529,7 @@ impl<'a, 'tcx, Bx: BuilderMethods<'a, 'tcx>> FunctionCx<'a, 'tcx, Bx> {

let fn_abi = match instance {
Some(instance) => FnAbi::of_instance(&bx, instance, &extra_args),
None => FnAbi::new(&bx, sig, &extra_args)
None => FnAbi::of_fn_ptr(&bx, sig, &extra_args)
};

// For normal codegen, this Miri-specific intrinsic is just a NOP.
Expand Down

0 comments on commit 2b921d5

Please sign in to comment.