diff options
| author | bors <bors@rust-lang.org> | 2020-04-30 07:04:43 +0000 |
|---|---|---|
| committer | bors <bors@rust-lang.org> | 2020-04-30 07:04:43 +0000 |
| commit | bf459752d41a93eb6df0e9513de4ef807883a80c (patch) | |
| tree | 6a6e05a05077a1f72fcf055196b69be3eb341b6a /src/librustc_codegen_llvm | |
| parent | 7c8dbd969dd0ef2af6d8bab9e03ba7ce6cac41a2 (diff) | |
| parent | c6817ffb2cadae7f80414e13d99e89ec83db9a77 (diff) | |
| download | rust-bf459752d41a93eb6df0e9513de4ef807883a80c.tar.gz rust-bf459752d41a93eb6df0e9513de4ef807883a80c.zip | |
Auto merge of #70175 - Amanieu:remove_nlp, r=pnkfelix
Remove -Z no-landing-pads flag Since #67502, `-Z no-landing-pads` will cause all attempted unwinds to abort since we don't generate a `try` / `catch`. This previously worked because `__rust_try` was located in libpanic_unwind which is always compiled with `-C panic=unwind`, but `__rust_try` is now directly inline into the crate that uses `catch_unwind`. As such, `-Z no-landing-pads` is now mostly useless and people should use `-C panic=abort` instead.
Diffstat (limited to 'src/librustc_codegen_llvm')
| -rw-r--r-- | src/librustc_codegen_llvm/attributes.rs | 5 | ||||
| -rw-r--r-- | src/librustc_codegen_llvm/intrinsic.rs | 3 |
2 files changed, 6 insertions, 2 deletions
diff --git a/src/librustc_codegen_llvm/attributes.rs b/src/librustc_codegen_llvm/attributes.rs index ba286e5f40d..6ef303c848d 100644 --- a/src/librustc_codegen_llvm/attributes.rs +++ b/src/librustc_codegen_llvm/attributes.rs @@ -13,6 +13,7 @@ use rustc_middle::ty::query::Providers; use rustc_middle::ty::{self, TyCtxt}; use rustc_session::config::{OptLevel, Sanitizer}; use rustc_session::Session; +use rustc_target::spec::PanicStrategy; use crate::attributes; use crate::llvm::AttributePlace::Function; @@ -270,7 +271,9 @@ pub fn from_fn_attrs(cx: &CodegenCx<'ll, 'tcx>, llfn: &'ll Value, instance: ty:: // // You can also find more info on why Windows is whitelisted here in: // https://bugzilla.mozilla.org/show_bug.cgi?id=1302078 - if !cx.sess().no_landing_pads() || cx.sess().target.target.options.requires_uwtable { + if cx.sess().panic_strategy() == PanicStrategy::Unwind + || cx.sess().target.target.options.requires_uwtable + { attributes::emit_uwtable(llfn, true); } diff --git a/src/librustc_codegen_llvm/intrinsic.rs b/src/librustc_codegen_llvm/intrinsic.rs index 86d10e91d6d..ddf21ff6338 100644 --- a/src/librustc_codegen_llvm/intrinsic.rs +++ b/src/librustc_codegen_llvm/intrinsic.rs @@ -22,6 +22,7 @@ use rustc_middle::ty::{self, Ty}; use rustc_middle::{bug, span_bug}; use rustc_span::Span; use rustc_target::abi::{self, HasDataLayout, LayoutOf, Primitive}; +use rustc_target::spec::PanicStrategy; use std::cmp::Ordering; use std::iter; @@ -804,7 +805,7 @@ fn try_intrinsic( catch_func: &'ll Value, dest: &'ll Value, ) { - if bx.sess().no_landing_pads() { + if bx.sess().panic_strategy() == PanicStrategy::Abort { bx.call(try_func, &[data], None); // Return 0 unconditionally from the intrinsic call; // we can never unwind. |
