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 Nov 3, 2019
1 parent a0ed842 commit 0b65020
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
Original file line number Diff line number Diff line change
Expand Up @@ -2495,7 +2495,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 @@ -2514,7 +2514,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
Original file line number Diff line number Diff line change
Expand Up @@ -417,7 +417,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
Original file line number Diff line number Diff line change
Expand Up @@ -1008,7 +1008,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
Original file line number Diff line number Diff line change
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
Original file line number Diff line number Diff line change
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)
};

// Emit a panic or a no-op for `panic_if_uninhabited`.
Expand Down

0 comments on commit 0b65020

Please sign in to comment.