@@ -278,7 +278,11 @@ fn main() {
278
278
}
279
279
} ) ,
280
280
) ;
281
-
281
+ if * NO_UNWIND {
282
+ cilly:: builtins:: insert_exeception_stub ( & mut final_assembly, & mut overrides) ;
283
+ } else {
284
+ cilly:: builtins:: insert_exception ( & mut final_assembly, & mut overrides) ;
285
+ } ;
282
286
// Override allocator
283
287
if !* C_MODE {
284
288
// Get the marshal class
@@ -343,16 +347,16 @@ fn main() {
343
347
MethodImpl :: MethodBody {
344
348
blocks : vec ! [ cilly:: BasicBlock :: from_v1(
345
349
& cilly:: basic_block:: BasicBlock :: new(
346
- vec![ cilly :: cil_root :: V1Root :: Throw (
347
- cilly:: cil_node :: V1Node :: NewObj ( Box :: new (
348
- cilly:: cil_node:: CallOpArgs {
350
+ vec![
351
+ cilly:: cil_root :: V1Root :: Throw ( cilly :: cil_node :: V1Node :: NewObj (
352
+ Box :: new ( cilly:: cil_node:: CallOpArgs {
349
353
args: Box :: new( [ conv_usize!( arg0) ] ) ,
350
354
site: asm. alloc_methodref( exception_ctor) ,
351
355
is_pure: IsPure :: NOT ,
352
- } ,
353
- ) ) ,
354
- )
355
- . into ( ) ] ,
356
+ } ) ,
357
+ ) )
358
+ . into ( ) ,
359
+ ] ,
356
360
0 ,
357
361
None ,
358
362
) ,
@@ -455,7 +459,6 @@ fn main() {
455
459
cilly:: builtins:: math:: bitreverse ( & mut final_assembly, & mut overrides) ;
456
460
457
461
if * C_MODE {
458
- cilly:: builtins:: insert_exeception_stub ( & mut final_assembly, & mut overrides) ;
459
462
externs. insert ( "__dso_handle" , LIBC . clone ( ) ) ;
460
463
externs. insert ( "_mm_malloc" , LIBC . clone ( ) ) ;
461
464
externs. insert ( "_mm_free" , LIBC . clone ( ) ) ;
@@ -499,7 +502,7 @@ fn main() {
499
502
cilly:: builtins:: instert_threading ( & mut final_assembly, & mut overrides) ;
500
503
cilly:: builtins:: math:: math ( & mut final_assembly, & mut overrides) ;
501
504
cilly:: builtins:: simd:: simd ( & mut final_assembly, & mut overrides) ;
502
- cilly :: builtins :: insert_exception ( & mut final_assembly , & mut overrides ) ;
505
+
503
506
cilly:: builtins:: argc_argv_init ( & mut final_assembly, & mut overrides) ;
504
507
}
505
508
@@ -648,28 +651,6 @@ fn bootstrap_source(fpath: &Path, output_file_path: &str, jumpstart_cmd: &str) -
648
651
config ! ( NATIVE_PASSTROUGH , bool , false ) ;
649
652
config ! ( ABORT_ON_ERROR , bool , false ) ;
650
653
config ! ( C_MODE , bool , false ) ;
654
+ config ! ( NO_UNWIND , bool , false ) ;
651
655
config ! ( JAVA_MODE , bool , false ) ;
652
656
config ! ( PANIC_MANAGED_BT , bool , false ) ;
653
- /*
654
- lazy_static! {
655
- #[doc = "Tells the linker to not remove any dead code."]pub static ref KEEP_DEAD_CODE:bool = {
656
- std::env::vars().find_map(|(key,value)|if key == stringify!(KEEP_DEAD_CODE){
657
- Some(value)
658
- }else {
659
- None
660
- }).map(|value|match value.as_ref(){
661
- "0"|"false"|"False"|"FALSE" => false,"1"|"true"|"True"|"TRUE" => true,_ => panic!("Boolean enviroment variable {} has invalid value {}",stringify!(KEEP_DEAD_CODE),value),
662
- }).unwrap_or(false)
663
- };
664
- }
665
- lazy_static! {
666
- #[doc = "Tells the codegen to emmit JS source files."]pub static ref JS_MODE:bool = {
667
- std::env::vars().find_map(|(key,value)|if key == stringify!(JS_MODE){
668
- Some(value)
669
- }else {
670
- None
671
- }).map(|value|match value.as_ref(){
672
- "0"|"false"|"False"|"FALSE" => false,"1"|"true"|"True"|"TRUE" => true,_ => panic!("Boolean enviroment variable {} has invalid value {}",stringify!(JS_MODE),value),
673
- }).unwrap_or(false)
674
- };
675
- }*/
0 commit comments