Skip to content

Commit d7bbd30

Browse files
committed
Remove outdated LLVMRustBuildLandingPad() wrapper
The function was added as a wrapper to handle compatibility with older LLVM versions that we no longer support, so it can be removed. Refs #46437
1 parent 0f4ebf9 commit d7bbd30

File tree

5 files changed

+11
-20
lines changed

5 files changed

+11
-20
lines changed

src/librustc_llvm/ffi.rs

+6-7
Original file line numberDiff line numberDiff line change
@@ -812,13 +812,12 @@ extern "C" {
812812
Bundle: OperandBundleDefRef,
813813
Name: *const c_char)
814814
-> ValueRef;
815-
pub fn LLVMRustBuildLandingPad(B: BuilderRef,
816-
Ty: TypeRef,
817-
PersFn: ValueRef,
818-
NumClauses: c_uint,
819-
Name: *const c_char,
820-
F: ValueRef)
821-
-> ValueRef;
815+
pub fn LLVMBuildLandingPad(B: BuilderRef,
816+
Ty: TypeRef,
817+
PersFn: ValueRef,
818+
NumClauses: c_uint,
819+
Name: *const c_char)
820+
-> ValueRef;
822821
pub fn LLVMBuildResume(B: BuilderRef, Exn: ValueRef) -> ValueRef;
823822
pub fn LLVMBuildUnreachable(B: BuilderRef) -> ValueRef;
824823

src/librustc_trans/builder.rs

+3-4
Original file line numberDiff line numberDiff line change
@@ -1012,12 +1012,11 @@ impl<'a, 'tcx> Builder<'a, 'tcx> {
10121012
}
10131013

10141014
pub fn landing_pad(&self, ty: Type, pers_fn: ValueRef,
1015-
num_clauses: usize,
1016-
llfn: ValueRef) -> ValueRef {
1015+
num_clauses: usize) -> ValueRef {
10171016
self.count_insn("landingpad");
10181017
unsafe {
1019-
llvm::LLVMRustBuildLandingPad(self.llbuilder, ty.to_ref(), pers_fn,
1020-
num_clauses as c_uint, noname(), llfn)
1018+
llvm::LLVMBuildLandingPad(self.llbuilder, ty.to_ref(), pers_fn,
1019+
num_clauses as c_uint, noname())
10211020
}
10221021
}
10231022

src/librustc_trans/intrinsic.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -925,7 +925,7 @@ fn trans_gnu_try<'a, 'tcx>(bcx: &Builder<'a, 'tcx>,
925925
// rust_try ignores the selector.
926926
let lpad_ty = Type::struct_(ccx, &[Type::i8p(ccx), Type::i32(ccx)],
927927
false);
928-
let vals = catch.landing_pad(lpad_ty, bcx.ccx.eh_personality(), 1, catch.llfn());
928+
let vals = catch.landing_pad(lpad_ty, bcx.ccx.eh_personality(), 1);
929929
catch.add_clause(vals, C_null(Type::i8p(ccx)));
930930
let ptr = catch.extract_value(vals, 0);
931931
let ptr_align = bcx.tcx().data_layout.pointer_align;

src/librustc_trans/mir/block.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -753,7 +753,7 @@ impl<'a, 'tcx> MirContext<'a, 'tcx> {
753753

754754
let llpersonality = self.ccx.eh_personality();
755755
let llretty = self.landing_pad_type();
756-
let lp = bcx.landing_pad(llretty, llpersonality, 1, self.llfn);
756+
let lp = bcx.landing_pad(llretty, llpersonality, 1);
757757
bcx.set_cleanup(lp);
758758

759759
let slot = self.get_personality_slot(&bcx);

src/rustllvm/RustWrapper.cpp

-7
Original file line numberDiff line numberDiff line change
@@ -1144,13 +1144,6 @@ extern "C" void LLVMRustWriteSMDiagnosticToString(LLVMSMDiagnosticRef D,
11441144
unwrap(D)->print("", OS);
11451145
}
11461146

1147-
extern "C" LLVMValueRef
1148-
LLVMRustBuildLandingPad(LLVMBuilderRef B, LLVMTypeRef Ty,
1149-
LLVMValueRef PersFn, unsigned NumClauses,
1150-
const char *Name, LLVMValueRef F) {
1151-
return LLVMBuildLandingPad(B, Ty, PersFn, NumClauses, Name);
1152-
}
1153-
11541147
extern "C" LLVMValueRef LLVMRustBuildCleanupPad(LLVMBuilderRef B,
11551148
LLVMValueRef ParentPad,
11561149
unsigned ArgCount,

0 commit comments

Comments
 (0)