Skip to content

Commit f4a7f02

Browse files
committed
---
yaml --- r: 223931 b: refs/heads/beta c: 7f0e733 h: refs/heads/master i: 223929: 1ec9f07 223927: 95a56cd v: v3
1 parent 8760c92 commit f4a7f02

File tree

5 files changed

+29
-11
lines changed

5 files changed

+29
-11
lines changed

[refs]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ refs/tags/0.9: 36870b185fc5f5486636d4515f0e22677493f225
2323
refs/tags/0.10: ac33f2b15782272ae348dbd7b14b8257b2148b5a
2424
refs/tags/0.11.0: e1247cb1d0d681be034adb4b558b5a0c0d5720f9
2525
refs/tags/0.12.0: f0c419429ef30723ceaf6b42f9b5a2aeb5d2e2d1
26-
refs/heads/beta: c55d3f1ba1e78466d2f5703a9e291f4849ddcc94
26+
refs/heads/beta: 7f0e733f1d8e597faee4bff0fc04838867725fad
2727
refs/tags/1.0.0-alpha: e42bd6d93a1d3433c486200587f8f9e12590a4d7
2828
refs/heads/tmp: 938f5d7af401e2d8238522fed4a612943b6e77fd
2929
refs/tags/1.0.0-alpha.2: 4c705f6bc559886632d3871b04f58aab093bfa2f

branches/beta/src/librustc_llvm/lib.rs

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1136,12 +1136,13 @@ extern {
11361136
Catch: BasicBlockRef,
11371137
Name: *const c_char)
11381138
-> ValueRef;
1139-
pub fn LLVMBuildLandingPad(B: BuilderRef,
1140-
Ty: TypeRef,
1141-
PersFn: ValueRef,
1142-
NumClauses: c_uint,
1143-
Name: *const c_char)
1144-
-> ValueRef;
1139+
pub fn LLVMRustBuildLandingPad(B: BuilderRef,
1140+
Ty: TypeRef,
1141+
PersFn: ValueRef,
1142+
NumClauses: c_uint,
1143+
Name: *const c_char,
1144+
F: ValueRef)
1145+
-> ValueRef;
11451146
pub fn LLVMBuildResume(B: BuilderRef, Exn: ValueRef) -> ValueRef;
11461147
pub fn LLVMBuildUnreachable(B: BuilderRef) -> ValueRef;
11471148

branches/beta/src/librustc_trans/trans/build.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1039,7 +1039,7 @@ pub fn LandingPad(cx: Block, ty: Type, pers_fn: ValueRef,
10391039
num_clauses: usize) -> ValueRef {
10401040
check_not_terminated(cx);
10411041
assert!(!cx.unreachable.get());
1042-
B(cx).landing_pad(ty, pers_fn, num_clauses)
1042+
B(cx).landing_pad(ty, pers_fn, num_clauses, cx.fcx.llfn)
10431043
}
10441044

10451045
pub fn SetCleanup(cx: Block, landing_pad: ValueRef) {

branches/beta/src/librustc_trans/trans/builder.rs

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -927,11 +927,13 @@ impl<'a, 'tcx> Builder<'a, 'tcx> {
927927
}
928928
}
929929

930-
pub fn landing_pad(&self, ty: Type, pers_fn: ValueRef, num_clauses: usize) -> ValueRef {
930+
pub fn landing_pad(&self, ty: Type, pers_fn: ValueRef,
931+
num_clauses: usize,
932+
llfn: ValueRef) -> ValueRef {
931933
self.count_insn("landingpad");
932934
unsafe {
933-
llvm::LLVMBuildLandingPad(
934-
self.llbuilder, ty.to_ref(), pers_fn, num_clauses as c_uint, noname())
935+
llvm::LLVMRustBuildLandingPad(self.llbuilder, ty.to_ref(), pers_fn,
936+
num_clauses as c_uint, noname(), llfn)
935937
}
936938
}
937939

branches/beta/src/rustllvm/RustWrapper.cpp

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -942,3 +942,18 @@ extern "C" void LLVMWriteSMDiagnosticToString(LLVMSMDiagnosticRef d, RustStringR
942942
raw_rust_string_ostream os(str);
943943
unwrap(d)->print("", os);
944944
}
945+
946+
extern "C" LLVMValueRef
947+
LLVMRustBuildLandingPad(LLVMBuilderRef Builder,
948+
LLVMTypeRef Ty,
949+
LLVMValueRef PersFn,
950+
unsigned NumClauses,
951+
const char* Name,
952+
LLVMValueRef F) {
953+
#if LLVM_VERSION_MINOR >= 7
954+
unwrap<Function>(F)->setPersonalityFn(unwrap<Constant>(PersFn));
955+
return LLVMBuildLandingPad(Builder, Ty, NumClauses, Name);
956+
#else
957+
return LLVMBuildLandingPad(Builder, Ty, PersFn, NumClauses, Name);
958+
#endif
959+
}

0 commit comments

Comments
 (0)