Add panic=immediate-abort
This commit is contained in:
@@ -15,9 +15,9 @@ use rustc_middle::mir::mono::Visibility;
|
||||
use rustc_middle::ty::TyCtxt;
|
||||
use rustc_session::config::DebugInfo;
|
||||
use rustc_span::Symbol;
|
||||
use rustc_target::spec::RelocModel;
|
||||
#[cfg(feature = "master")]
|
||||
use rustc_target::spec::SymbolVisibility;
|
||||
use rustc_target::spec::{PanicStrategy, RelocModel};
|
||||
|
||||
use crate::builder::Builder;
|
||||
use crate::context::CodegenCx;
|
||||
@@ -101,7 +101,7 @@ pub fn compile_codegen_unit(
|
||||
// Instantiate monomorphizations without filling out definitions yet...
|
||||
let context = new_context(tcx);
|
||||
|
||||
if tcx.sess.panic_strategy() == PanicStrategy::Unwind {
|
||||
if tcx.sess.panic_strategy().unwinds() {
|
||||
context.add_command_line_option("-fexceptions");
|
||||
context.add_driver_option("-fexceptions");
|
||||
}
|
||||
|
||||
@@ -29,7 +29,6 @@ use rustc_middle::ty::layout::LayoutOf;
|
||||
use rustc_middle::ty::{self, Instance, Ty};
|
||||
use rustc_span::{Span, Symbol, sym};
|
||||
use rustc_target::callconv::{ArgAbi, PassMode};
|
||||
use rustc_target::spec::PanicStrategy;
|
||||
|
||||
#[cfg(feature = "master")]
|
||||
use crate::abi::FnAbiGccExt;
|
||||
@@ -1334,7 +1333,7 @@ fn try_intrinsic<'a, 'b, 'gcc, 'tcx>(
|
||||
_catch_func: RValue<'gcc>,
|
||||
dest: PlaceRef<'tcx, RValue<'gcc>>,
|
||||
) {
|
||||
if bx.sess().panic_strategy() == PanicStrategy::Abort {
|
||||
if !bx.sess().panic_strategy().unwinds() {
|
||||
bx.call(bx.type_void(), None, None, try_func, &[data], None, None);
|
||||
// Return 0 unconditionally from the intrinsic call;
|
||||
// we can never unwind.
|
||||
|
||||
Reference in New Issue
Block a user