Skip to content

Commit 89a47da

Browse files
committed
---
yaml --- r: 235514 b: refs/heads/stable c: 7f0e733 h: refs/heads/master v: v3
1 parent ee108fd commit 89a47da

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
@@ -29,7 +29,7 @@ refs/heads/tmp: afae2ff723393b3ab4ccffef6ac7c6d1809e2da0
2929
refs/tags/1.0.0-alpha.2: 4c705f6bc559886632d3871b04f58aab093bfa2f
3030
refs/tags/homu-tmp: f859507de8c410b648d934d8f5ec1c52daac971d
3131
refs/tags/1.0.0-beta: 8cbb92b53468ee2b0c2d3eeb8567005953d40828
32-
refs/heads/stable: c55d3f1ba1e78466d2f5703a9e291f4849ddcc94
32+
refs/heads/stable: 7f0e733f1d8e597faee4bff0fc04838867725fad
3333
refs/tags/1.0.0: 55bd4f8ff2b323f317ae89e254ce87162d52a375
3434
refs/tags/1.1.0: bc3c16f09287e5545c1d3f76b7abd54f2eca868b
3535
refs/tags/1.2.0: f557861f822c34f07270347b94b5280de20a597e

branches/stable/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/stable/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/stable/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/stable/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)