File tree 2 files changed +7
-12
lines changed
compiler/rustc_codegen_llvm/src
2 files changed +7
-12
lines changed Original file line number Diff line number Diff line change @@ -99,12 +99,12 @@ unsafe fn configure_llvm(sess: &Session) {
99
99
}
100
100
}
101
101
102
- if sess . panic_strategy ( ) == PanicStrategy :: Unwind {
103
- if sess . target . os == "emscripten" {
104
- add ( "-enable-emscripten-cxx-exceptions" , false ) ;
105
- } else if wants_wasm_eh ( sess ) {
106
- add ( "-wasm-enable-eh" , false ) ;
107
- }
102
+ if wants_wasm_eh ( sess ) {
103
+ add ( "-wasm-enable-eh" , false ) ;
104
+ }
105
+
106
+ if sess . target . os == "emscripten" && sess . panic_strategy ( ) == PanicStrategy :: Unwind {
107
+ add ( "-enable-emscripten-cxx-exceptions" , false ) ;
108
108
}
109
109
110
110
// HACK(eddyb) LLVM inserts `llvm.assume` calls to preserve align attributes
Original file line number Diff line number Diff line change @@ -60,12 +60,7 @@ cfg_if::cfg_if! {
60
60
) ) ] {
61
61
#[ path = "gcc.rs" ]
62
62
mod real_imp;
63
- } else if #[ cfg( all( target_family = "wasm" , panic = "unwind" ) ) ] {
64
- // for now, PanicStrategy::Unwind is not the default for wasm targets,
65
- // so we need the panic = "unwind" in the cfg above. to use llvm.wasm.throw,
66
- // we need to pass -wasm-enable-eh to LLVM, but that only happens if rustc
67
- // is compiling with -C panic=unwind. So, this lets us -Zbuild-std with
68
- // panic=unwind, while keeping the default panic=abort working.
63
+ } else if #[ cfg( target_family = "wasm" ) ] {
69
64
#[ path = "wasm.rs" ]
70
65
mod real_imp;
71
66
} else {
You can’t perform that action at this time.
0 commit comments