about summary refs log tree commit diff
path: root/src
diff options
context:
space:
mode:
authorkennytm <kennytm@gmail.com>2018-04-28 03:32:16 +0800
committerGitHub <noreply@github.com>2018-04-28 03:32:16 +0800
commit0da4bdeb2a749ac6ef8ffacf67cd807ccddd096c (patch)
treef45bd8aea89bd6aaaf90d1e1efc935bb02d19bf7 /src
parent1c1fd2758e9da2c183d46f119a19ea119dbef0d9 (diff)
parent20ad427af014aa6f8734629baa922c52f1ee8b77 (diff)
downloadrust-0da4bdeb2a749ac6ef8ffacf67cd807ccddd096c.tar.gz
rust-0da4bdeb2a749ac6ef8ffacf67cd807ccddd096c.zip
Rollup merge of #50263 - alexcrichton:uwtable-allcoators, r=eddyb
rustc: Emit `uwtable` for allocator shims

This commit emits the `uwtable` attribute to LLVM for platforms that require it
for the allocator shims that we generate to ensure that they can hopefully get
unwound past. This is a stab in the dark at helping
https://bugzilla.mozilla.org/show_bug.cgi?id=1456150 along.
Diffstat (limited to 'src')
-rw-r--r--src/librustc_trans/allocator.rs4
1 files changed, 4 insertions, 0 deletions
diff --git a/src/librustc_trans/allocator.rs b/src/librustc_trans/allocator.rs
index ffebb959ebf..871fe98ec01 100644
--- a/src/librustc_trans/allocator.rs
+++ b/src/librustc_trans/allocator.rs
@@ -11,6 +11,7 @@
 use std::ffi::CString;
 use std::ptr;
 
+use attributes;
 use libc::c_uint;
 use rustc::middle::allocator::AllocatorKind;
 use rustc::ty::TyCtxt;
@@ -67,6 +68,9 @@ pub(crate) unsafe fn trans(tcx: TyCtxt, mods: &ModuleLlvm, kind: AllocatorKind)
         if tcx.sess.target.target.options.default_hidden_visibility {
             llvm::LLVMRustSetVisibility(llfn, llvm::Visibility::Hidden);
         }
+       if tcx.sess.target.target.options.requires_uwtable {
+           attributes::emit_uwtable(llfn, true);
+       }
 
         let callee = CString::new(kind.fn_name(method.name)).unwrap();
         let callee = llvm::LLVMRustGetOrInsertFunction(llmod,