summaryrefslogtreecommitdiff
path: root/gcc/dwarf2out.c
diff options
context:
space:
mode:
authordmalcolm <dmalcolm@138bc75d-0d04-0410-961f-82ee72b054a4>2014-10-21 16:55:38 +0000
committerdmalcolm <dmalcolm@138bc75d-0d04-0410-961f-82ee72b054a4>2014-10-21 16:55:38 +0000
commit415309e2ead97ad7cfed19baeb1ea9eb20b05756 (patch)
treec3163bb97d62851d6b1e3f51f6a8d28cd498be0b /gcc/dwarf2out.c
parentd87e6a0301d7ed61fa27329f383a03dd0fade76d (diff)
downloadgcc-415309e2ead97ad7cfed19baeb1ea9eb20b05756.tar.gz
State cleanups from jit branch
gcc/ChangeLog: * cgraph.c (cgraph_c_finalize): New function. * cgraph.h (cgraph_c_finalize): New prototype. (cgraphunit_c_finalize): New prototype. * cgraphunit.c (first_analyzed): Move from analyze_functions to file-scope. (first_analyzed_var): Likewise. (analyze_functions): Move static variables into file-scope. (cgraphunit_c_finalize): New function. * diagnostic.c (diagnostic_finish): Free the memory for context->classify_diagnostic and context->printer, running the destructor for the latter. (bt_stop): Use toplev::main. * dwarf2out.c (dwarf2out_finalize): New function. * dwarf2out.h (dwarf2out_c_finalize): New prototype. * gcse.c (gcse_c_finalize): New function. * gcse.h (gcse_c_finalize): New prototype. * ggc-page.c (init_ggc): Make idempotent. * input.c (input_location): Initialize to UNKNOWN_LOCATION. * ipa-cp.c (ipa_cp_c_finalize): New function. * ipa-prop.h (ipa_cp_c_finalize): New prototype. * ipa-pure-const.c (function_insertion_hook_holder): Move to be a field of class pass_ipa_pure_const. (node_duplication_hook_holder): Likewise. (node_removal_hook_holder): Likewise. (register_hooks): Convert to method... (pass_ipa_pure_const::register_hooks): ...here, converting static variable init_p into... (pass_ipa_pure_const::init_p): ...new field. (pure_const_generate_summary): Update invocation of register_hooks to invoke as a method of current_pass. (pure_const_read_summary): Likewise. (propagate): Convert to... (pass_ipa_pure_const::execute): ...method. * ipa-reference.c (ipa_init): Move static bool init_p from here to... (ipa_init_p): New file-scope variable, so that it can be reset when repeatedly invoking the compiler within one process by... (ipa_reference_c_finalize): New function. * ipa-reference.h (ipa_reference_c_finalize): New. * main.c (main): Replace invocation of toplev_main with construction of a toplev instance, and call its "main" method. * params.c (global_init_params): Add an assert that params_finished is false. (params_c_finalize): New. * params.h (params_c_finalize): New. * passes.c (execute_ipa_summary_passes): Set "current_pass" before invoking generate_summary, for the benefit of pass_ipa_pure_const. (ipa_write_summaries_2): Assign "pass" to "current_pass" global before calling write_summary hook. (ipa_write_optimization_summaries_1): Likewise when calling write_optimization_summary hook. (ipa_read_summaries_1): Likewise for read_summary hook. (ipa_read_optimization_summaries_1): Likewise for read_optimization_summary hook. (execute_ipa_stmt_fixups): Likewise. * stringpool.c (init_stringpool): Clean up if we're called more than once. * timevar.c (timevar_init): Ignore repeated calls. * toplev.c: Include "dwarf2out.h", "ipa-reference.h", "gcse.h", "ipa-prop.h". (general_init): Reset "input_location" to UNKNOWN_LOCATION. (initialize_rtl): Move static local "initialized_once" into file scope, and rename to... (rtl_initialized): New variable. (do_compile): Move timevar initialization from here to toplev::start_timevars. (toplev::toplev, toplev::~toplev, toplev::start_timevars, toplev::finalize): New functions. (toplev_main): Rename to... (toplev::main): ...this. * toplev.h (class toplev): New class. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@216522 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/dwarf2out.c')
-rw-r--r--gcc/dwarf2out.c86
1 files changed, 86 insertions, 0 deletions
diff --git a/gcc/dwarf2out.c b/gcc/dwarf2out.c
index 8c651766f0b..a87f9c0997e 100644
--- a/gcc/dwarf2out.c
+++ b/gcc/dwarf2out.c
@@ -24619,4 +24619,90 @@ dwarf2out_finish (const char *filename)
output_indirect_strings ();
}
+/* Reset all state within dwarf2out.c so that we can rerun the compiler
+ within the same process. For use by toplev::finalize. */
+
+void
+dwarf2out_c_finalize (void)
+{
+ last_var_location_insn = NULL;
+ cached_next_real_insn = NULL;
+ used_rtx_array = NULL;
+ incomplete_types = NULL;
+ decl_scope_table = NULL;
+ debug_info_section = NULL;
+ debug_skeleton_info_section = NULL;
+ debug_abbrev_section = NULL;
+ debug_skeleton_abbrev_section = NULL;
+ debug_aranges_section = NULL;
+ debug_addr_section = NULL;
+ debug_macinfo_section = NULL;
+ debug_line_section = NULL;
+ debug_skeleton_line_section = NULL;
+ debug_loc_section = NULL;
+ debug_pubnames_section = NULL;
+ debug_pubtypes_section = NULL;
+ debug_str_section = NULL;
+ debug_str_dwo_section = NULL;
+ debug_str_offsets_section = NULL;
+ debug_ranges_section = NULL;
+ debug_frame_section = NULL;
+ fde_vec = NULL;
+ debug_str_hash = NULL;
+ skeleton_debug_str_hash = NULL;
+ dw2_string_counter = 0;
+ have_multiple_function_sections = false;
+ text_section_used = false;
+ cold_text_section_used = false;
+ cold_text_section = NULL;
+ current_unit_personality = NULL;
+
+ deferred_locations_list = NULL;
+
+ next_die_offset = 0;
+ single_comp_unit_die = NULL;
+ comdat_type_list = NULL;
+ limbo_die_list = NULL;
+ deferred_asm_name = NULL;
+ file_table = NULL;
+ decl_die_table = NULL;
+ common_block_die_table = NULL;
+ decl_loc_table = NULL;
+ call_arg_locations = NULL;
+ call_arg_loc_last = NULL;
+ call_site_count = -1;
+ tail_call_site_count = -1;
+ //block_map = NULL;
+ cached_dw_loc_list_table = NULL;
+ abbrev_die_table = NULL;
+ abbrev_die_table_allocated = 0;
+ abbrev_die_table_in_use = 0;
+ line_info_label_num = 0;
+ cur_line_info_table = NULL;
+ text_section_line_info = NULL;
+ cold_text_section_line_info = NULL;
+ separate_line_info = NULL;
+ info_section_emitted = false;
+ pubname_table = NULL;
+ pubtype_table = NULL;
+ macinfo_table = NULL;
+ ranges_table = NULL;
+ ranges_table_allocated = 0;
+ ranges_table_in_use = 0;
+ ranges_by_label = 0;
+ ranges_by_label_allocated = 0;
+ ranges_by_label_in_use = 0;
+ have_location_lists = false;
+ loclabel_num = 0;
+ poc_label_num = 0;
+ last_emitted_file = NULL;
+ label_num = 0;
+ file_table_last_lookup = NULL;
+ tmpl_value_parm_die_table = NULL;
+ generic_type_instances = NULL;
+ frame_pointer_fb_offset = 0;
+ frame_pointer_fb_offset_valid = false;
+ base_types.release ();
+}
+
#include "gt-dwarf2out.h"