diff options
| author | Graydon Hoare <graydon@mozilla.com> | 2012-04-25 15:38:56 -0700 |
|---|---|---|
| committer | Graydon Hoare <graydon@mozilla.com> | 2012-04-25 17:19:36 -0700 |
| commit | fa6c68a025337072fd61fe3d5f71e7f079ce0652 (patch) | |
| tree | bfba15d6501a7cd827daffaa1a0ea1f3de9b34e5 /src/rustc | |
| parent | a2f04efd593a6da5b9368ec85e02ed46631cb594 (diff) | |
| download | rust-fa6c68a025337072fd61fe3d5f71e7f079ce0652.tar.gz rust-fa6c68a025337072fd61fe3d5f71e7f079ce0652.zip | |
Set no-unwind attribute on all upcalls other than fail.
Diffstat (limited to 'src/rustc')
| -rw-r--r-- | src/rustc/back/upcall.rs | 6 | ||||
| -rw-r--r-- | src/rustc/middle/trans/base.rs | 5 |
2 files changed, 10 insertions, 1 deletions
diff --git a/src/rustc/back/upcall.rs b/src/rustc/back/upcall.rs index f43ef4a5c12..d3946a5de14 100644 --- a/src/rustc/back/upcall.rs +++ b/src/rustc/back/upcall.rs @@ -38,7 +38,11 @@ fn declare_upcalls(targ_cfg: @session::config, 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()); diff --git a/src/rustc/middle/trans/base.rs b/src/rustc/middle/trans/base.rs index bc4d9c3e673..88df4687d61 100644 --- a/src/rustc/middle/trans/base.rs +++ b/src/rustc/middle/trans/base.rs @@ -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) { |
