/* Initialization common to C and Objective-C front ends. */ bool c_objc_common_init (void) { static const enum tree_code stmt_codes[] = { c_common_stmt_codes }; INIT_STATEMENT_CODES (stmt_codes); c_init_decl_processing (); if (c_common_init () == false) return false; lang_expand_decl_stmt = c_expand_decl_stmt; /* These were not defined in the Objective-C front end, but I'm putting them here anyway. The diagnostic format decoder might want an enhanced ObjC implementation. */ diagnostic_format_decoder (global_dc) = &c_tree_printer; lang_missing_noreturn_ok_p = &c_missing_noreturn_ok_p; /* If still unspecified, make it match -std=c99 (allowing for -pedantic-errors). */ if (mesg_implicit_function_declaration < 0) { if (flag_isoc99) mesg_implicit_function_declaration = flag_pedantic_errors ? 2 : 1; else mesg_implicit_function_declaration = 0; } return true; }
/* Initialization common to C and Objective-C front ends. */ bool c_objc_common_init (void) { c_init_decl_processing (); if (c_common_init () == false) return false; /* These were not defined in the Objective-C front end, but I'm putting them here anyway. The diagnostic format decoder might want an enhanced ObjC implementation. */ diagnostic_format_decoder (global_dc) = &c_tree_printer; /* If still unspecified, make it match -std=c99 (allowing for -pedantic-errors). */ if (mesg_implicit_function_declaration < 0) { if (flag_isoc99) mesg_implicit_function_declaration = flag_pedantic_errors ? 2 : 1; else mesg_implicit_function_declaration = 0; } return true; }
/* Initialization common to C and Objective-C front ends. */ bool c_objc_common_init (void) { c_init_decl_processing (); if (c_common_init () == false) return false; /* These were not defined in the Objective-C front end, but I'm putting them here anyway. The diagnostic format decoder might want an enhanced ObjC implementation. */ diagnostic_format_decoder (global_dc) = &c_tree_printer; return true; }
/* Initialize the C++ front end. This function is very sensitive to the exact order that things are done here. It would be nice if the initialization done by this routine were moved to its subroutines, and the ordering dependencies clarified and reduced. */ bool cxx_init (void) { location_t saved_loc; unsigned int i; static const enum tree_code stmt_codes[] = { CTOR_INITIALIZER, TRY_BLOCK, HANDLER, EH_SPEC_BLOCK, USING_STMT, TAG_DEFN, IF_STMT, CLEANUP_STMT, FOR_STMT, RANGE_FOR_STMT, WHILE_STMT, DO_STMT, BREAK_STMT, CONTINUE_STMT, SWITCH_STMT, EXPR_STMT }; memset (&statement_code_p, 0, sizeof (statement_code_p)); for (i = 0; i < ARRAY_SIZE (stmt_codes); i++) statement_code_p[stmt_codes[i]] = true; saved_loc = input_location; input_location = BUILTINS_LOCATION; init_reswords (); init_tree (); init_cp_semantics (); init_operators (); init_method (); init_error (); current_function_decl = NULL; class_type_node = ridpointers[(int) RID_CLASS]; cxx_init_decl_processing (); if (c_common_init () == false) { input_location = saved_loc; return false; } init_cp_pragma (); init_repo (); input_location = saved_loc; return true; }
/* Initialize the C++ front end. This function is very sensitive to the exact order that things are done here. It would be nice if the initialization done by this routine were moved to its subroutines, and the ordering dependencies clarified and reduced. */ bool cxx_init (void) { unsigned int i; static const enum tree_code stmt_codes[] = { CTOR_INITIALIZER, TRY_BLOCK, HANDLER, EH_SPEC_BLOCK, USING_STMT, TAG_DEFN, IF_STMT, CLEANUP_STMT, FOR_STMT, WHILE_STMT, DO_STMT, BREAK_STMT, CONTINUE_STMT, SWITCH_STMT, EXPR_STMT }; memset (&statement_code_p, 0, sizeof (statement_code_p)); for (i = 0; i < ARRAY_SIZE (stmt_codes); i++) statement_code_p[stmt_codes[i]] = true; /* We cannot just assign to input_filename because it has already been initialized and will be used later as an N_BINCL for stabs+ debugging. */ #ifdef USE_MAPPED_LOCATION push_srcloc (BUILTINS_LOCATION); #else push_srcloc ("<built-in>", 0); #endif init_reswords (); init_tree (); init_cp_semantics (); init_operators (); init_method (); init_error (); current_function_decl = NULL; class_type_node = ridpointers[(int) RID_CLASS]; cxx_init_decl_processing (); /* The fact that G++ uses COMDAT for many entities (inline functions, template instantiations, virtual tables, etc.) mean that it is fundamentally unreliable to try to make decisions about whether or not to output a particular entity until the end of the compilation. However, the inliner requires that functions be provided to the back end if they are to be inlined. Therefore, we always use unit-at-a-time mode; in that mode, we can provide entities to the back end and it will decide what to emit based on what is actually needed. */ flag_unit_at_a_time = 1; if (c_common_init () == false) { pop_srcloc(); return false; } init_cp_pragma (); init_repo (); pop_srcloc(); return true; }