mirror of
https://github.com/rust-lang/rust.git
synced 2026-05-16 04:55:22 +03:00
Set no-unwind attribute on all upcalls other than fail.
This commit is contained in:
@@ -38,7 +38,11 @@ fn decl(llmod: ModuleRef, prefix: str, name: str,
|
||||
let mut arg_tys: [TypeRef] = [];
|
||||
for tys.each {|t| arg_tys += [t]; }
|
||||
let fn_ty = T_fn(arg_tys, rv);
|
||||
ret base::decl_cdecl_fn(llmod, prefix + name, fn_ty);
|
||||
let f = base::decl_cdecl_fn(llmod, prefix + name, fn_ty);
|
||||
if name != "fail" {
|
||||
base::set_no_unwind(f);
|
||||
}
|
||||
ret f;
|
||||
}
|
||||
let d = bind decl(llmod, "upcall_", _, _, _);
|
||||
let dv = bind decl(llmod, "upcall_", _, _, T_void());
|
||||
|
||||
@@ -393,6 +393,11 @@ fn set_no_inline(f: ValueRef) {
|
||||
0u as c_uint);
|
||||
}
|
||||
|
||||
fn set_no_unwind(f: ValueRef) {
|
||||
llvm::LLVMAddFunctionAttr(f, lib::llvm::NoUnwindAttribute as c_uint,
|
||||
0u as c_uint);
|
||||
}
|
||||
|
||||
// Tell LLVM to emit the information necessary to unwind the stack for the
|
||||
// function f.
|
||||
fn set_uwtable(f: ValueRef) {
|
||||
|
||||
Reference in New Issue
Block a user