summaryrefslogtreecommitdiff
path: root/gcc/context.h
AgeCommit message (Collapse)Author
2020-01-01Update copyright years.Jakub Jelinek
From-SVN: r279813
2019-01-01Update copyright years.Jakub Jelinek
From-SVN: r267494
2018-01-03Update copyright years.Jakub Jelinek
From-SVN: r256169
2017-05-19context.h (context::set_passes): New.Nathan Sidwell
* context.h (context::set_passes): New. * context.c (context::context): Do not create pass manager. * toplev.c (general_init): Create pass manager here. From-SVN: r248268
2017-01-01Update copyright years.Jakub Jelinek
From-SVN: r243994
2016-01-04Update copyright years.Jakub Jelinek
From-SVN: r232055
2015-01-05Update copyright years.Jakub Jelinek
From-SVN: r219188
2014-11-19PR jit/63854: Fix memory leaks within context/pass_manager/dump_managerDavid Malcolm
gcc/ChangeLog: PR jit/63854 * config/alpha/alpha.c (alpha_option_override): Remove static from "handle_trap_shadows_info" and "align_insns_info". * config/i386/i386.c (ix86_option_override): Likewise for "insert_vzeroupper_info". * config/rl78/rl78.c (rl78_asm_file_start): Likewise for "rl78_devirt_info" and "rl78_move_elim_info". * config/rs6000/rs6000.c (rs6000_option_override): Likewise for "analyze_swaps_info". * context.c (gcc::context::~context): New. * context.h (gcc::context::~context): New. * dumpfile.c (dump_files): Add "false" initializers for new field "owns_strings". (gcc::dump_manager::~dump_manager): New. (gcc::dump_manager::dump_register): Add param "take_ownership". * dumpfile.h (struct dump_file_info): Add field "owns_strings". (gcc::dump_manager::~dump_manager): New. (gcc::dump_manager::dump_register): Add param "take_ownership". * pass_manager.h (gcc::pass_manager::operator delete): New. (gcc::pass_manager::~pass_manager): New. * passes.c (pass_manager::register_one_dump_file): Pass "true" to new "owns_strings" argument to dump_register. (pass_manager::operator delete): New. (delete_pass_tree): New function. (pass_manager::~pass_manager): New. * statistics.c (statistics_early_init): Pass "false" to new "owns_strings" argument to dump_register. * toplev.c (toplev::finalize): Clean up the context and thus the things it owns. From-SVN: r217793
2014-11-13[PATCH 2/7] OpenMP 4.0 offloading infrastructure: LTO streaming.Ilya Verbin
gcc/ * cgraph.c: Include context.h. (cgraph_node::create): Set node->offloadable and g->have_offload if decl have "omp declare target" attribute. * cgraph.h (symtab_node): Add need_lto_streaming and offloadable flags. * cgraphunit.c: Include lto-section-names.h. (ipa_passes): Call ipa_write_summaries if there is something to write to OFFLOAD_SECTION_NAME_PREFIX sections. (symbol_table::compile): Set flag_generate_lto if there is something to offload. Replace flag_lto with flag_generate_lto before lto_streamer_hooks_init. * context.c (gcc::context::context): Initialize have_offload with false. * context.h (class context): Add have_offload flag. * ipa-inline-analysis.c (inline_generate_summary): Do not exit under flag_generate_lto. (inline_free_summary): Always remove hooks. * lto-cgraph.c (referenced_from_other_partition_p): Ignore references from non-offloadable nodes while streaming a node into offload section. (reachable_from_other_partition_p): Likewise. (select_what_to_stream): New function. (compute_ltrans_boundary): Do not call lto_set_symtab_encoder_in_partition if the node should not be streamed. * lto-section-names.h (OFFLOAD_SECTION_NAME_PREFIX): Define. (section_name_prefix): Declare. * lto-streamer.c (section_name_prefix): New variable. (lto_get_section_name): Use section_name_prefix instead of LTO_SECTION_NAME_PREFIX. * lto-streamer.h (select_what_to_stream): Declare. * omp-low.c: Include context.h. (is_targetreg_ctx): New function. (scan_sharing_clauses): Use offloadable flag, instead of an attribute. (create_omp_child_function, check_omp_nesting_restrictions): Use new is_targetreg_ctx function. Replace usage of "omp declare target" attribute with a cgraph_node flag offloadable. (expand_omp_target): Set mark_force_output for offloadable functions. (lower_omp_critical): Set offloadable flag for omp critical symbol. * passes.c (ipa_write_summaries): New argument offload_lto_mode. Call select_what_to_stream. Do not call lto_set_symtab_encoder_in_partition if the node should not be streamed out. * tree-pass.h (ipa_write_summaries): New bool argument. * varpool.c: Include context.h. (varpool_node::get_create): Set node->offloadable and g->have_offload if decl have "omp declare target" attribute. gcc/lto/ * lto-object.c (lto_obj_add_section): Use section_name_prefix instead of LTO_SECTION_NAME_PREFIX. * lto-partition.c (lto_promote_cross_file_statics): Call select_what_to_stream. * lto.c (lto_section_with_id): Use section_name_prefix instead of LTO_SECTION_NAME_PREFIX. (read_cgraph_and_symbols): Read OFFLOAD_SECTION_NAME_PREFIX sections, if being built as an offload compiler. Co-Authored-By: Andrey Turetskiy <andrey.turetskiy@intel.com> Co-Authored-By: Bernd Schmidt <bernds@codesourcery.com> Co-Authored-By: Michael Zolotukhin <michael.v.zolotukhin@intel.com> From-SVN: r217486
2014-01-02Update copyright years in gcc/Richard Sandiford
From-SVN: r206289
2013-10-14Introduce gcc::dump_manager classDavid Malcolm
gcc/ * dumpfile.h (gcc::dump_manager): New class, to hold state relating to dumpfile management. (get_dump_file_name): Remove in favor of method of dump_manager. (dump_initialized_p): Likewise. (dump_start): Likewise. (dump_finish): Likewise. (dump_switch_p): Likewise. (dump_register): Likewise. (get_dump_file_info): Likewise. * context.c (gcc::context::context): Construct the dump_manager instance. * context.h (gcc::context::get_dumps): New. (gcc::context::m_dumps): New. * coverage.c (coverage_init): Port to dump_manager API. * dumpfile.c (extra_dump_files): Convert to field of gcc::dump_manager. (extra_dump_files_in_use): Likewise. (extra_dump_files_alloced): Likewise. (gcc::dump_manager::dump_manager): New. (dump_register): Convert to... (gcc::dump_manager::dump_register): ...method, replacing function-static next_dump with m_next_dump field. (get_dump_file_info): Convert to... (gcc::dump_manager::get_dump_file_info): ...method. (get_dump_file_name): Convert to... (gcc::dump_manager::get_dump_file_name): ...method. (dump_start): Convert to... (gcc::dump_manager::dump_start): ...method. (dump_finish): Convert to... (gcc::dump_manager::dump_finish): ...method. (dump_begin): Replace body with... (gcc::dump_manager::dump_begin): ...new method. (dump_phase_enabled_p): Convert to... (gcc::dump_manager::dump_phase_enabled_p): ...method. (dump_phase_enabled_p): Convert to... (gcc::dump_manager::dump_phase_enabled_p): ...method. (dump_initialized_p): Convert to... (gcc::dump_manager::dump_initialized_p): ...method. (dump_flag_name): Replace body with... (gcc::dump_manager::dump_flag_name): ...new method. (dump_enable_all): Convert to... (gcc::dump_manager::dump_enable_all): ...new method. (opt_info_enable_passes): Convert to... (gcc::dump_manager::opt_info_enable_passes): ...new method. (dump_switch_p_1): Convert to... (gcc::dump_manager::dump_switch_p_1): ...new method. (dump_switch_p): Convert to... (gcc::dump_manager::dump_switch_p): ...new method. (opt_info_switch_p): Port to dump_manager API. (enable_rtl_dump_file): Likewise. * opts-global.c (handle_common_deferred_options): Port to new dump_manager API. * passes.c (pass_manager::finish_optimization_passes): Likewise. (pass_manager::register_one_dump_file): Likewise. (pass_manager::register_pass): Likewise. (pass_init_dump_file): Likewise. (pass_fini_dump_file): Likewise. * statistics.c (statistics_early_init): Likewise. gcc/java/ * lang.c (java_handle_option): Update for introduction of gcc::dump_manager. From-SVN: r203569
2013-09-30basic-block.h (edge_list): Prefix member names with "m_".Richard Sandiford
gcc/ * basic-block.h (edge_list): Prefix member names with "m_". * context.h (context): Likewise. * domwalk.h (dom_walker): Likewise. * gengtype-state.c (s_expr_writer, state_writer): Likewise. * graphite-sese-to-poly.c (sese_dom_walker): Likewise. * hash-table.h (hash_table): Likewise. * machmode.h (bit_field_mode_iterator): Likewise. * pass_manager.h (pass_list): Likewise. * tree-into-ssa.c (mark_def_dom_walker): Likewise. * tree-pass.h (pass_data): Likewise. * tree-ssa-dom.c (dom_opt_dom_walker): Likewise. * tree-ssa-phiopt.c (nontrapping_dom_walker): Likewise, * tree-ssa-uncprop.c (uncprop_dom_walker): Likewise. * asan.c (pass_data_asan): Update accordingly. * cfganal.c (control_dependences::find_control_dependence): Likewise. (control_dependences::control_dependences): Likewise. (control_dependences::~control_dependences): Likewise. (control_dependences::~control_dependences): Likewise. (control_dependences::get_edges_dependent_on): Likewise. * cgraphbuild.c (pass_data_rebuild_cgraph_edges::clone): Likewise. (pass_data_remove_cgraph_callee_edges::clone): Likewise. * context.c (gcc::context::context): Likewise. * cprop.c (pass_rtl_cprop::clone): Likewise. * domwalk.c (dom_walker::walk): Likewise. * ipa-inline-analysis.c (pass_inline_parameters::clone): Likewise. * ipa-pure-const.c (pass_local_pure_const::clone): Likewise. * mode-switching.c (pass_mode_switching::clone): Likewise. * passes.c (opt_pass::opt_pass): Likewise. (pass_manager::pass_manager): Likewise. * predict.c (pass_strip_predict_hints::clone): Likewise. * recog.c (pass_data pass_data_peephole2::clone): Likewise. (pass_split_all_insns::clone): Likewise. * stor-layout.c (bit_field_mode_iterator::bit_field_mode_iterator): Likewise. (bit_field_mode_iterator::next_mode): Likewise. (bit_field_mode_iterator::prefer_smaller_modes): Likewise. * tree-cfg.c (pass_split_crit_edges::clone): Likewise. * tree-cfgcleanup.c (pass_merge_phi::clone): Likewise. * tree-complex.c (pass_lower_complex::clone): Likewise. * tree-eh.c (pass_cleanup_eh::clone): Likewise. * tree-object-size.c (pass_object_sizes::clone): Likewise. * tree-optimize.c (pass_fixup_cfg::clone): Likewise. * tree-ssa-ccp.c (pass_data_ccp::clone): Likewise. (pass_fold_builtins::clone): Likewise. * tree-ssa-copy.c (pass_data_copy_prop::clone): Likewise. * tree-ssa-copyrename.c (pass_rename_ssa_copies::clone): Likewise. * tree-ssa-dce.c (pass_dce::clone, pass_dce_loop::clone): Likewise. (pass_cd_dce::clone): Likewise. * tree-ssa-dom.c (pass_dominator::clone): Likewise. (pass_phi_only_cprop::clone): Likewise. * tree-ssa-dse.c (pass_dse::clone): Likewise. * tree-ssa-forwprop.c (pass_forwprop::clone): Likewise. * tree-ssa-loop.c (pass_lim::clone): Likewise. * tree-ssa-phiopt.c (pass_phiopt::clone): Likewise. * tree-ssa-pre.c (pass_fre::clone): Likewise. * tree-ssa-reassoc.c (pass_reassoc::clone): Likewise. * tree-ssa-uninit.c (pass_late_warn_uninitialized::clone): Likewise. * tree-tailcall.c (pass_tail_recursion::clone): Likewise. * tree-vect-generic.c (pass_lower_vector_ssa::clone): Likewise. * tree-vrp.c (pass_vrp::clone): Likewise. * tsan.c (pass_tsan::clone): Likewise. From-SVN: r203046
2013-09-28alloc-pool.c, [...]: Add missing whitespace before "(".Richard Sandiford
gcc/ * alloc-pool.c, asan.c, auto-inc-dec.c, basic-block.h, bb-reorder.c, bitmap.c, bitmap.h, bt-load.c, builtins.c, calls.c, cfgcleanup.c, cfgexpand.c, cfghooks.c, cfgloop.c, cfgloopmanip.c, cfgrtl.c, cgraph.c, cgraph.h, cgraphbuild.c, cgraphclones.c, cgraphunit.c, collect2.c, combine-stack-adj.c, combine.c, compare-elim.c, context.c, context.h, cprop.c, cse.c, cselib.c, dbxout.c, dce.c, defaults.h, df-core.c, df-problems.c, df-scan.c, df.h, diagnostic.c, double-int.c, dse.c, dumpfile.c, dwarf2asm.c, dwarf2cfi.c, dwarf2out.c, emit-rtl.c, errors.c, except.c, expmed.c, expr.c, file-find.c, final.c, fixed-value.c, fold-const.c, function.c, fwprop.c, gcc-ar.c, gcc.c, gcov-io.c, gcov-io.h, gcov.c, gcse.c, genattr-common.c, genattr.c, genattrtab.c, genautomata.c, genconfig.c, genemit.c, genextract.c, genflags.c, gengenrtl.c, gengtype-state.c, gengtype.c, genmodes.c, genopinit.c, genoutput.c, genpeep.c, genpreds.c, genrecog.c, gensupport.c, ggc-common.c, ggc-page.c, gimple-fold.c, gimple-low.c, gimple-pretty-print.c, gimple-ssa-strength-reduction.c, gimple.c, gimple.h, godump.c, graphite-clast-to-gimple.c, graphite-optimize-isl.c, graphite-poly.h, graphite-sese-to-poly.c, graphite.c, haifa-sched.c, hash-table.c, hash-table.h, hwint.c, hwint.h, ifcvt.c, incpath.c, init-regs.c, input.h, intl.c, intl.h, ipa-cp.c, ipa-devirt.c, ipa-inline-analysis.c, ipa-inline.c, ipa-profile.c, ipa-pure-const.c, ipa-reference.c, ipa-split.c, ipa-utils.c, ipa.c, ira-build.c, ira.c, jump.c, loop-doloop.c, loop-init.c, loop-invariant.c, loop-iv.c, lower-subreg.c, lto-cgraph.c, lto-streamer-in.c, lto-streamer-out.c, lto-wrapper.c, mcf.c, mode-switching.c, modulo-sched.c, omp-low.c, optabs.c, opts.c, pass_manager.h, passes.c, plugin.c, postreload-gcse.c, postreload.c, predict.c, prefix.c, pretty-print.c, print-rtl.c, print-tree.c, profile.c, read-md.c, real.c, real.h, recog.c, ree.c, reg-stack.c, regcprop.c, reginfo.c, regmove.c, regrename.c, regs.h, regstat.c, reload1.c, reorg.c, rtl.c, rtl.h, rtlanal.c, sbitmap.c, sched-rgn.c, sdbout.c, sel-sched-ir.c, sel-sched.c, sparseset.c, stack-ptr-mod.c, statistics.c, stmt.c, stor-layout.c, store-motion.c, streamer-hooks.h, system.h, target-hooks-macros.h, targhooks.c, targhooks.h, toplev.c, tracer.c, trans-mem.c, tree-browser.c, tree-call-cdce.c, tree-cfg.c, tree-cfgcleanup.c, tree-complex.c, tree-data-ref.c, tree-data-ref.h, tree-eh.c, tree-emutls.c, tree-flow.h, tree-if-conv.c, tree-into-ssa.c, tree-iterator.c, tree-loop-distribution.c, tree-mudflap.c, tree-nested.c, tree-nomudflap.c, tree-nrv.c, tree-object-size.c, tree-optimize.c, tree-pass.h, tree-pretty-print.c, tree-profile.c, tree-scalar-evolution.c, tree-sra.c, tree-ssa-ccp.c, tree-ssa-coalesce.c, tree-ssa-copy.c, tree-ssa-copyrename.c, tree-ssa-dce.c, tree-ssa-dom.c, tree-ssa-dse.c, tree-ssa-forwprop.c, tree-ssa-ifcombine.c, tree-ssa-live.c, tree-ssa-loop-ch.c, tree-ssa-loop-im.c, tree-ssa-loop-ivopts.c, tree-ssa-loop-prefetch.c, tree-ssa-loop.c, tree-ssa-math-opts.c, tree-ssa-operands.c, tree-ssa-phiopt.c, tree-ssa-phiprop.c, tree-ssa-pre.c, tree-ssa-reassoc.c, tree-ssa-sink.c, tree-ssa-strlen.c, tree-ssa-structalias.c, tree-ssa-threadedge.c, tree-ssa-threadupdate.c, tree-ssa-uncprop.c, tree-ssa-uninit.c, tree-ssa.c, tree-ssanames.c, tree-stdarg.c, tree-switch-conversion.c, tree-tailcall.c, tree-vect-data-refs.c, tree-vect-generic.c, tree-vect-loop-manip.c, tree-vect-stmts.c, tree-vectorizer.c, tree-vectorizer.h, tree-vrp.c, tree.c, tree.h, tsan.c, tsystem.h, value-prof.c, var-tracking.c, varasm.c, vec.h, vmsdbgout.c, vtable-verify.c, web.c: Add missing whitespace before "(". From-SVN: r203004
2013-08-20Revert my last two changes, r201865 and r201864David Malcolm
2013-08-20 David Malcolm <dmalcolm@redhat.com> Revert my last two changes, r201865 and r201864: Revert r201865: 2013-08-20 David Malcolm <dmalcolm@redhat.com> Make opt_pass and gcc::pass_manager be GC-managed, so that pass instances can own GC refs. * Makefile.in (GTFILES): Add pass_manager.h and tree-pass.h. * context.c (gcc::context::gt_ggc_mx): Traverse passes_. (gcc::context::gt_pch_nx): Likewise. (gcc::context::gt_pch_nx): Likewise. * ggc.h (gt_ggc_mx <T>): New. (gt_pch_nx_with_op <T>): New. (gt_pch_nx <T>): New. * passes.c (opt_pass::gt_ggc_mx): New. (opt_pass::gt_pch_nx): New. (opt_pass::gt_pch_nx_with_op): New. (pass_manager::gt_ggc_mx): New. (pass_manager::gt_pch_nx): New. (pass_manager::gt_pch_nx_with_op): New. (pass_manager::operator new): Use ggc_internal_cleared_alloc_stat rather than xcalloc. * pass_manager.h (class pass_manager): Add GTY((user)) marking. (pass_manager::gt_ggc_mx): New. (pass_manager::gt_pch_nx): New. (pass_manager::gt_pch_nx_with_op): New. * tree-pass.h (class opt_pass): Add GTY((user)) marking. (opt_pass::operator new): New. (opt_pass::gt_ggc_mx): New. (opt_pass::gt_pch_nx): New. (opt_pass::gt_pch_nx_with_op): New. Revert r201864: 2013-08-20 David Malcolm <dmalcolm@redhat.com> * Makefile.in (GTFILES): Add context.h. * context.c (gcc::context::operator new): New. (gcc::context::gt_ggc_mx): New. (gcc::context::gt_pch_nx): New. (gcc::context::gt_pch_nx): New. * context.h (gcc::context): Add GTY((user)) marking. (gcc::context::operator new): New. (gcc::context::gt_ggc_mx): New. (gcc::context::gt_pch_nx): New. (gcc::context::gt_pch_nx): New. (g): Add GTY marking. (gt_ggc_mx (gcc::context *)): New. (gt_pch_nx (gcc::context *)): New. (gt_pch_nx (gcc::context *ctxt, gt_pointer_operator op, void *cookie)): New. * gengtype.c (open_base_files) <ifiles>: Add context.h. From-SVN: r201887
2013-08-20Make gcc::context be GC-managedDavid Malcolm
* Makefile.in (GTFILES): Add context.h. * context.c (gcc::context::operator new): New. (gcc::context::gt_ggc_mx): New. (gcc::context::gt_pch_nx): New. (gcc::context::gt_pch_nx): New. * context.h (gcc::context): Add GTY((user)) marking. (gcc::context::operator new): New. (gcc::context::gt_ggc_mx): New. (gcc::context::gt_pch_nx): New. (gcc::context::gt_pch_nx): New. (g): Add GTY marking. (gt_ggc_mx (gcc::context *)): New. (gt_pch_nx (gcc::context *)): New. (gt_pch_nx (gcc::context *ctxt, gt_pointer_operator op, void *cookie)): New. * gengtype.c (open_base_files) <ifiles>: Add context.h. From-SVN: r201864
2013-07-30Introduce beginnings of a pass_manager class.David Malcolm
This patch introduces a gcc::pass_manager class and moves various non-GTY globals relating to pass management into it. The gcc::context gains its first field: a pointer to the gcc::pass_manager instance. gcc/ * Makefile.in (PASS_MANAGER_H): New. (lto-cgraph.o): Depend on CONTEXT_H and PASS_MANAGER_H. (passes.o): Likewise. (statistics.o): Likewise. (cgraphunit.o): Likewise. (context.o): Depend on PASS_MANAGER_H. * pass_manager.h: New. * cgraphunit.c (cgraph_add_new_function): Update for moves of globals to fields of pass_manager. (analyze_function): Likewise. (expand_function): Likewise. (ipa_passes): Likewise. (compile): Likewise. * context.c (context::context): New. * context.h (context::context): New. (context::get_passes): New. (context::passes_): New. * lto-cgraph.c (input_node): Update for moves of globals to fields of pass_manager. * passes.c (all_passes): Remove, in favor of a field of the same name within the new class pass_manager. (all_small_ipa_passes): Likewise. (all_lowering_passes): Likewise. (all_regular_ipa_passes): Likewise. (all_late_ipa_passes): Likewise. (all_lto_gen_passes): Likewise. (passes_by_id): Likewise. (passes_by_id_size): Likewise. (gcc_pass_lists): Remove, in favor of "pass_lists" field within the new class pass_manager. (set_pass_for_id): Convert to... (pass_manager::set_pass_for_id): ...method. (get_pass_for_id): Convert to... (pass_manager::get_pass_for_id): ...method. (register_one_dump_file): Move body of implementation into... (pass_manager::register_one_dump_file): ...here. (register_dump_files_1): Convert to... (pass_manager::register_dump_files_1): ...method. (register_dump_files): Convert to... (pass_manager::register_dump_files): ...method. (create_pass_tab): Update for moves of globals to fields of pass_manager. (dump_passes): Move body of implementation into... (pass_manager::dump_passes): ...here. (register_pass): Move body of implementation into... (pass_manager::register_pass): ...here. (init_optimization_passes): Convert into... (pass_manager::pass_manager): ...constructor for new pass_manager class, and initialize the pass_lists array. (check_profile_consistency): Update for moves of globals to fields of pass_manager. (dump_profile_report): Move body of implementation into... (pass_manager::dump_profile_report): ...here. (ipa_write_summaries_1): Update for moves of pass lists from being globals to fields of pass_manager. (ipa_write_optimization_summaries): Likewise. (ipa_read_summaries): Likewise. (ipa_read_optimization_summaries): Likewise. (execute_all_ipa_stmt_fixups): Likewise. * statistics.c (statistics_fini): Update for moves of globals to fields of pass_manager. * toplev.c (general_init): Replace call to init_optimization_passes with construction of the pass_manager instance. * tree-pass.h (all_passes): Remove, in favor of a field of the same name within the new class pass_manager. (all_small_ipa_passes): Likewise. (all_lowering_passes): Likewise. (all_regular_ipa_passes): Likewise. (all_lto_gen_passes): Likewise. (all_late_ipa_passes): Likewise. (passes_by_id): Likewise. (passes_by_id_size): Likewise. (gcc_pass_lists): Remove, in favor of "pass_lists" field within the new class pass_manager. (get_pass_for_id): Remove. gcc/lto/ * Make-lang.in (lto/lto.o:): Depend on CONTEXT_H and PASS_MANAGER_H. * lto.c (do_whole_program_analysis): Update for move of all_regular_ipa_passes from a global to a field of class pass_manager. From-SVN: r201351
2013-07-25Introduce context class.David Malcolm
2013-07-24 David Malcolm <dmalcolm@redhat.com> Introduce context class. * Makefile.in (CONTEXT_H): New. (OBJS): Add context.o. (toplev.o): Add CONTEXT_H to dependencies. (context.o): New. * toplev.c (general_init): Create the singleton gcc::context instance. * context.c: New. * context.h: New. From-SVN: r201230