@@ -278,7 +278,11 @@ fn main() {
278278 }
279279 } ) ,
280280 ) ;
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+ } ;
282286 // Override allocator
283287 if !* C_MODE {
284288 // Get the marshal class
@@ -343,16 +347,16 @@ fn main() {
343347 MethodImpl :: MethodBody {
344348 blocks : vec ! [ cilly:: BasicBlock :: from_v1(
345349 & 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 {
349353 args: Box :: new( [ conv_usize!( arg0) ] ) ,
350354 site: asm. alloc_methodref( exception_ctor) ,
351355 is_pure: IsPure :: NOT ,
352- } ,
353- ) ) ,
354- )
355- . into ( ) ] ,
356+ } ) ,
357+ ) )
358+ . into ( ) ,
359+ ] ,
356360 0 ,
357361 None ,
358362 ) ,
@@ -455,7 +459,6 @@ fn main() {
455459 cilly:: builtins:: math:: bitreverse ( & mut final_assembly, & mut overrides) ;
456460
457461 if * C_MODE {
458- cilly:: builtins:: insert_exeception_stub ( & mut final_assembly, & mut overrides) ;
459462 externs. insert ( "__dso_handle" , LIBC . clone ( ) ) ;
460463 externs. insert ( "_mm_malloc" , LIBC . clone ( ) ) ;
461464 externs. insert ( "_mm_free" , LIBC . clone ( ) ) ;
@@ -499,7 +502,7 @@ fn main() {
499502 cilly:: builtins:: instert_threading ( & mut final_assembly, & mut overrides) ;
500503 cilly:: builtins:: math:: math ( & mut final_assembly, & mut overrides) ;
501504 cilly:: builtins:: simd:: simd ( & mut final_assembly, & mut overrides) ;
502- cilly :: builtins :: insert_exception ( & mut final_assembly , & mut overrides ) ;
505+
503506 cilly:: builtins:: argc_argv_init ( & mut final_assembly, & mut overrides) ;
504507 }
505508
@@ -648,28 +651,6 @@ fn bootstrap_source(fpath: &Path, output_file_path: &str, jumpstart_cmd: &str) -
648651config ! ( NATIVE_PASSTROUGH , bool , false ) ;
649652config ! ( ABORT_ON_ERROR , bool , false ) ;
650653config ! ( C_MODE , bool , false ) ;
654+ config ! ( NO_UNWIND , bool , false ) ;
651655config ! ( JAVA_MODE , bool , false ) ;
652656config ! ( 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