gcc/gcc/dumpfile.c

1230 lines
32 KiB
C
Raw Normal View History

/* Dump infrastructure for optimizations and intermediate representation.
Copyright (C) 2012-2018 Free Software Foundation, Inc.
This file is part of GCC.
GCC is free software; you can redistribute it and/or modify it under
the terms of the GNU General Public License as published by the Free
Software Foundation; either version 3, or (at your option) any later
version.
GCC is distributed in the hope that it will be useful, but WITHOUT ANY
WARRANTY; without even the implied warranty of MERCHANTABILITY or
FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
for more details.
You should have received a copy of the GNU General Public License
along with GCC; see the file COPYING3. If not see
<http://www.gnu.org/licenses/>. */
#include "config.h"
#include "system.h"
#include "coretypes.h"
alias.c: Reorder #include statements and remove duplicates. 2015-10-29 Andrew MacLeod <amacleod@redhat.com> * alias.c: Reorder #include statements and remove duplicates. * asan.c: Likewise. * attribs.c: Likewise. * auto-inc-dec.c: Likewise. * auto-profile.c: Likewise. * bb-reorder.c: Likewise. * bt-load.c: Likewise. * builtins.c: Likewise. * caller-save.c: Likewise. * calls.c: Likewise. * ccmp.c: Likewise. * cfg.c: Likewise. * cfganal.c: Likewise. * cfgbuild.c: Likewise. * cfgcleanup.c: Likewise. * cfgexpand.c: Likewise. * cfghooks.c: Likewise. * cfgloop.c: Likewise. * cfgloopanal.c: Likewise. * cfgloopmanip.c: Likewise. * cfgrtl.c: Likewise. * cgraph.c: Likewise. * cgraphbuild.c: Likewise. * cgraphclones.c: Likewise. * cgraphunit.c: Likewise. * cilk-common.c: Likewise. * combine-stack-adj.c: Likewise. * combine.c: Likewise. * compare-elim.c: Likewise. * convert.c: Likewise. * coverage.c: Likewise. * cppbuiltin.c: Likewise. * cprop.c: Likewise. * cse.c: Likewise. * cselib.c: Likewise. * data-streamer-in.c: Likewise. * data-streamer-out.c: Likewise. * data-streamer.c: Likewise. * dbxout.c: Likewise. * dce.c: Likewise. * ddg.c: Likewise. * debug.c: Likewise. * df-core.c: Likewise. * df-problems.c: Likewise. * df-scan.c: Likewise. * dfp.c: Likewise. * dojump.c: Likewise. * dominance.c: Likewise. * double-int.c: Likewise. * dse.c: Likewise. * dumpfile.c: Likewise. * dwarf2asm.c: Likewise. * dwarf2cfi.c: Likewise. * dwarf2out.c: Likewise. * emit-rtl.c: Likewise. * except.c: Likewise. * explow.c: Likewise. * expmed.c: Likewise. * expr.c: Likewise. * final.c: Likewise. * fixed-value.c: Likewise. * fold-const.c: Likewise. * function.c: Likewise. * fwprop.c: Likewise. * gcse.c: Likewise. * generic-match-head.c: Likewise. * ggc-common.c: Likewise. * gimple-builder.c: Likewise. * gimple-expr.c: Likewise. * gimple-fold.c: Likewise. * gimple-iterator.c: Likewise. * gimple-low.c: Likewise. * gimple-match-head.c: Likewise. * gimple-pretty-print.c: Likewise. * gimple-ssa-isolate-paths.c: Likewise. * gimple-ssa-strength-reduction.c: Likewise. * gimple-streamer-in.c: Likewise. * gimple-streamer-out.c: Likewise. * gimple-walk.c: Likewise. * gimple.c: Likewise. * gimplify-me.c: Likewise. * gimplify.c: Likewise. * godump.c: Likewise. * graph.c: Likewise. * graphite-poly.c: Likewise. * haifa-sched.c: Likewise. * hw-doloop.c: Likewise. * ifcvt.c: Likewise. * incpath.c: Likewise. * init-regs.c: Likewise. * internal-fn.c: Likewise. * ipa-chkp.c: Likewise. * ipa-comdats.c: Likewise. * ipa-cp.c: Likewise. * ipa-devirt.c: Likewise. * ipa-icf-gimple.c: Likewise. * ipa-icf.c: Likewise. * ipa-inline-analysis.c: Likewise. * ipa-inline-transform.c: Likewise. * ipa-inline.c: Likewise. * ipa-polymorphic-call.c: Likewise. * ipa-profile.c: Likewise. * ipa-prop.c: Likewise. * ipa-pure-const.c: Likewise. * ipa-ref.c: Likewise. * ipa-reference.c: Likewise. * ipa-split.c: Likewise. * ipa-utils.c: Likewise. * ipa-visibility.c: Likewise. * ipa.c: Likewise. * ira-build.c: Likewise. * ira-color.c: Likewise. * ira-conflicts.c: Likewise. * ira-costs.c: Likewise. * ira-emit.c: Likewise. * ira-lives.c: Likewise. * ira.c: Likewise. * jump.c: Likewise. * langhooks.c: Likewise. * lcm.c: Likewise. * lists.c: Likewise. * loop-doloop.c: Likewise. * loop-init.c: Likewise. * loop-invariant.c: Likewise. * loop-iv.c: Likewise. * loop-unroll.c: Likewise. * lower-subreg.c: Likewise. * lra-assigns.c: Likewise. * lra-coalesce.c: Likewise. * lra-constraints.c: Likewise. * lra-eliminations.c: Likewise. * lra-lives.c: Likewise. * lra-remat.c: Likewise. * lra-spills.c: Likewise. * lra.c: Likewise. * lto-cgraph.c: Likewise. * lto-compress.c: Likewise. * lto-opts.c: Likewise. * lto-section-in.c: Likewise. * lto-section-out.c: Likewise. * lto-streamer-in.c: Likewise. * lto-streamer-out.c: Likewise. * lto-streamer.c: Likewise. * mode-switching.c: Likewise. * modulo-sched.c: Likewise. * omp-low.c: Likewise. * optabs.c: Likewise. * opts-global.c: Likewise. * passes.c: Likewise. * plugin.c: Likewise. * postreload-gcse.c: Likewise. * postreload.c: Likewise. * predict.c: Likewise. * print-tree.c: Likewise. * profile.c: Likewise. * real.c: Likewise. * realmpfr.c: Likewise. * recog.c: Likewise. * ree.c: Likewise. * reg-stack.c: Likewise. * regcprop.c: Likewise. * reginfo.c: Likewise. * regrename.c: Likewise. * regstat.c: Likewise. * reload.c: Likewise. * reload1.c: Likewise. * reorg.c: Likewise. * resource.c: Likewise. * rtl-chkp.c: Likewise. * rtl-error.c: Likewise. * rtlanal.c: Likewise. * rtlhooks.c: Likewise. * sanopt.c: Likewise. * sched-deps.c: Likewise. * sched-ebb.c: Likewise. * sched-rgn.c: Likewise. * sese.c: Likewise. * shrink-wrap.c: Likewise. * simplify-rtx.c: Likewise. * stack-ptr-mod.c: Likewise. * statistics.c: Likewise. * stmt.c: Likewise. * stor-layout.c: Likewise. * store-motion.c: Likewise. * stringpool.c: Likewise. * symtab.c: Likewise. * target-globals.c: Likewise. * targhooks.c: Likewise. * toplev.c: Likewise. * tracer.c: Likewise. * trans-mem.c: Likewise. * tree-affine.c: Likewise. * tree-call-cdce.c: Likewise. * tree-cfg.c: Likewise. * tree-cfgcleanup.c: Likewise. * tree-chkp-opt.c: Likewise. * tree-chkp.c: Likewise. * tree-chrec.c: Likewise. * tree-complex.c: Likewise. * tree-data-ref.c: Likewise. * tree-dfa.c: Likewise. * tree-diagnostic.c: Likewise. * tree-dump.c: Likewise. * tree-eh.c: Likewise. * tree-emutls.c: Likewise. * tree-if-conv.c: Likewise. * tree-inline.c: Likewise. * tree-into-ssa.c: Likewise. * tree-iterator.c: Likewise. * tree-loop-distribution.c: Likewise. * tree-nested.c: Likewise. * tree-nrv.c: Likewise. * tree-object-size.c: Likewise. * tree-outof-ssa.c: Likewise. * tree-parloops.c: Likewise. * tree-phinodes.c: Likewise. * tree-predcom.c: Likewise. * tree-pretty-print.c: Likewise. * tree-profile.c: Likewise. * tree-scalar-evolution.c: Likewise. * tree-sra.c: Likewise. * tree-ssa-address.c: Likewise. * tree-ssa-alias.c: Likewise. * tree-ssa-ccp.c: Likewise. * tree-ssa-coalesce.c: Likewise. * tree-ssa-copy.c: Likewise. * tree-ssa-dce.c: Likewise. * tree-ssa-dom.c: Likewise. * tree-ssa-dse.c: Likewise. * tree-ssa-forwprop.c: Likewise. * tree-ssa-ifcombine.c: Likewise. * tree-ssa-live.c: Likewise. * tree-ssa-loop-ch.c: Likewise. * tree-ssa-loop-im.c: Likewise. * tree-ssa-loop-ivcanon.c: Likewise. * tree-ssa-loop-ivopts.c: Likewise. * tree-ssa-loop-manip.c: Likewise. * tree-ssa-loop-niter.c: Likewise. * tree-ssa-loop-prefetch.c: Likewise. * tree-ssa-loop-unswitch.c: Likewise. * tree-ssa-loop.c: Likewise. * tree-ssa-math-opts.c: Likewise. * tree-ssa-operands.c: Likewise. * tree-ssa-phiopt.c: Likewise. * tree-ssa-phiprop.c: Likewise. * tree-ssa-pre.c: Likewise. * tree-ssa-propagate.c: Likewise. * tree-ssa-reassoc.c: Likewise. * tree-ssa-sccvn.c: Likewise. * tree-ssa-scopedtables.c: Likewise. * tree-ssa-sink.c: Likewise. * tree-ssa-strlen.c: Likewise. * tree-ssa-structalias.c: Likewise. * tree-ssa-tail-merge.c: Likewise. * tree-ssa-ter.c: Likewise. * tree-ssa-threadedge.c: Likewise. * tree-ssa-threadupdate.c: Likewise. * tree-ssa-uncprop.c: Likewise. * tree-ssa-uninit.c: Likewise. * tree-ssa.c: Likewise. * tree-ssanames.c: Likewise. * tree-stdarg.c: Likewise. * tree-streamer-in.c: Likewise. * tree-streamer-out.c: Likewise. * tree-streamer.c: Likewise. * tree-switch-conversion.c: Likewise. * tree-tailcall.c: Likewise. * tree-vect-data-refs.c: Likewise. * tree-vect-generic.c: Likewise. * tree-vect-loop-manip.c: Likewise. * tree-vect-loop.c: Likewise. * tree-vect-patterns.c: Likewise. * tree-vect-slp.c: Likewise. * tree-vect-stmts.c: Likewise. * tree-vectorizer.c: Likewise. * tree-vrp.c: Likewise. * tree.c: Likewise. * tsan.c: Likewise. * ubsan.c: Likewise. * value-prof.c: Likewise. * var-tracking.c: Likewise. * varasm.c: Likewise. * varpool.c: Likewise. * vtable-verify.c: Likewise. * web.c: Likewise. * wide-int-print.cc: Likewise. * wide-int.cc: Likewise. * xcoffout.c: Likewise. From-SVN: r229526
2015-10-29 14:57:32 +01:00
#include "options.h"
#include "tree.h"
#include "gimple-pretty-print.h"
#include "diagnostic-core.h"
#include "dumpfile.h"
Introduce gcc::dump_manager class 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-10-14 18:15:38 +02:00
#include "context.h"
#include "profile-count.h"
#include "tree-cfg.h"
#include "langhooks.h"
Introduce dump_location_t gcc/ChangeLog: * cfgloop.c (get_loop_location): Convert return type from location_t to dump_user_location_t, replacing INSN_LOCATION lookups by implicit construction from rtx_insn *, and using dump_user_location_t::from_function_decl for the fallback case. * cfgloop.h (get_loop_location): Convert return type from location_t to dump_user_location_t. * cgraphunit.c (walk_polymorphic_call_targets): Update call to dump_printf_loc to pass in a dump_location_t rather than a location_t, via the gimple stmt. * coverage.c (get_coverage_counts): Update calls to dump_printf_loc to pass in dump_location_t rather than a location_t. * doc/optinfo.texi (Dump types): Convert example of dump_printf_loc from taking "locus" to taking "insn". Update description of the "_loc" calls to cover dump_location_t. * dumpfile.c: Include "backend.h", "gimple.h", "rtl.h", and "selftest.h". (dump_user_location_t::dump_user_location_t): New constructors, from gimple *stmt and rtx_insn *. (dump_user_location_t::from_function_decl): New function. (dump_loc): Make static. (dump_gimple_stmt_loc): Convert param "loc" from location_t to const dump_location_t &. (dump_generic_expr_loc): Delete. (dump_printf_loc): Convert param "loc" from location_t to const dump_location_t &. (selftest::test_impl_location): New function. (selftest::dumpfile_c_tests): New function. * dumpfile.h: Include "profile-count.h". (class dump_user_location_t): New class. (struct dump_impl_location_t): New struct. (class dump_location_t): New class. (dump_printf_loc): Convert 2nd param from source_location to const dump_location_t &. (dump_generic_expr_loc): Delete. (dump_gimple_stmt_loc): Convert 2nd param from source_location to const dump_location_t &. * gimple-fold.c (fold_gimple_assign): Update call to dump_printf_loc to pass in a dump_location_t rather than a location_t, via the gimple stmt. (gimple_fold_call): Likewise. * gimple-loop-interchange.cc (loop_cand::analyze_iloop_reduction_var): Update for change to check_reduction_path. (tree_loop_interchange::interchange): Update for change to find_loop_location. * graphite-isl-ast-to-gimple.c (scop_to_isl_ast): Update for change in return-type of find_loop_location. (graphite_regenerate_ast_isl): Likewise. * graphite-optimize-isl.c (optimize_isl): Likewise. * graphite.c (graphite_transform_loops): Likewise. * ipa-devirt.c (ipa_devirt): Update call to dump_printf_loc to pass in a dump_location_t rather than a location_t, via the gimple stmt. * ipa-prop.c (ipa_make_edge_direct_to_target): Likewise. * ipa.c (walk_polymorphic_call_targets): Likewise. * loop-unroll.c (report_unroll): Convert "locus" param from location_t to dump_location_t. (decide_unrolling): Update for change to get_loop_location's return type. * omp-grid.c (struct grid_prop): Convert field "target_loc" from location_t to dump_user_location_t. (grid_find_single_omp_among_assignments_1): Updates calls to dump_printf_loc to pass in a dump_location_t rather than a location_t, via the gimple stmt. (grid_parallel_clauses_gridifiable): Convert "tloc" from location_t to dump_location_t. Updates calls to dump_printf_loc to pass in a dump_location_t rather than a location_t, via the gimple stmt. (grid_inner_loop_gridifiable_p): Likewise. (grid_dist_follows_simple_pattern): Likewise. (grid_gfor_follows_tiling_pattern): Likewise. (grid_target_follows_gridifiable_pattern): Likewise. (grid_attempt_target_gridification): Convert initialization of local "grid" from memset to zero-initialization; FIXME: does this require C++11? Update call to dump_printf_loc to pass in a optinfo_location rather than a location_t, via the gimple stmt. * profile.c (read_profile_edge_counts): Updates call to dump_printf_loc to pass in a dump_location_t rather than a location_t (compute_branch_probabilities): Likewise. * selftest-run-tests.c (selftest::run_tests): Call dumpfile_c_tests. * selftest.h (dumpfile_c_tests): New decl. * tree-loop-distribution.c (pass_loop_distribution::execute): Update for change in return type of find_loop_location. * tree-parloops.c (parallelize_loops): Likewise. * tree-ssa-loop-ivcanon.c (try_unroll_loop_completely): Convert "locus" from location_t to dump_user_location_t. (canonicalize_loop_induction_variables): Likewise. * tree-ssa-loop-ivopts.c (tree_ssa_iv_optimize_loop): Update for change in return type of find_loop_location. * tree-ssa-loop-niter.c (number_of_iterations_exit): Update call to dump_printf_loc to pass in a dump_location_t rather than a location_t, via the stmt. * tree-ssa-sccvn.c (eliminate_dom_walker::before_dom_children): Likewise. * tree-vect-loop-manip.c (find_loop_location): Convert return type from source_location to dump_user_location_t. (vect_do_peeling): Update for above change. (vect_loop_versioning): Update for change in type of vect_location. * tree-vect-loop.c (check_reduction_path): Convert "loc" param from location_t to dump_user_location_t. (vect_estimate_min_profitable_iters): Update for change in type of vect_location. * tree-vect-slp.c (vect_print_slp_tree): Convert param "loc" from location_t to dump_location_t. (vect_slp_bb): Update for change in type of vect_location. * tree-vectorizer.c (vect_location): Convert from source_location to dump_user_location_t. (try_vectorize_loop_1): Update for change in vect_location's type. (vectorize_loops): Likewise. (increase_alignment): Likewise. * tree-vectorizer.h (vect_location): Convert from source_location to dump_user_location_t. (find_loop_location): Convert return type from source_location to dump_user_location_t. (check_reduction_path): Convert 1st param from location_t to dump_user_location_t. * value-prof.c (check_counter): Update call to dump_printf_loc to pass in a dump_user_location_t rather than a location_t; update call to error_at for change in type of "locus". (check_ic_target): Update call to dump_printf_loc to pass in a dump_user_location_t rather than a location_t, via the call_stmt. From-SVN: r262149
2018-06-26 15:34:59 +02:00
#include "backend.h" /* for gimple.h. */
#include "gimple.h" /* for dump_user_location_t ctor. */
#include "rtl.h" /* for dump_user_location_t ctor. */
#include "selftest.h"
/* If non-NULL, return one past-the-end of the matching SUBPART of
the WHOLE string. */
#define skip_leading_substring(whole, part) \
(strncmp (whole, part, strlen (part)) ? NULL : whole + strlen (part))
Introduce dump_flags_t type and use it instead of int type. 2017-05-17 Martin Liska <mliska@suse.cz> * class.c (dump_class_hierarchy): Introduce dump_flags_t type and use it instead of int type. (dump_vtable): Likewise. (dump_vtt): Likewise. * decl2.c (dump_tu): Likewise. 2017-05-17 Martin Liska <mliska@suse.cz> * c-common.h: Introduce dump_flags_t type and use it instead of int type. * c-gimplify.c (c_genericize): Likewise. * c-opts.c: Likewise. 2017-05-17 Martin Liska <mliska@suse.cz> * c-decl.c (c_parse_final_cleanups): Introduce dump_flags_t type and use it instead of int type. 2017-05-17 Martin Liska <mliska@suse.cz> * cfg.c: Introduce dump_flags_t type and use it instead of int type. * cfg.h: Likewise. * cfghooks.c: Likewise. * cfghooks.h (struct cfg_hooks): Likewise. * cfgrtl.c: Likewise. * cfgrtl.h: Likewise. * cgraph.c (cgraph_node::get_body): Likewise. * coretypes.h: Likewise. * domwalk.c: Likewise. * domwalk.h: Likewise. * dumpfile.c (struct dump_option_value_info): Likewise. (dump_enable_all): Likewise. (dump_switch_p_1): Likewise. (opt_info_switch_p): Likewise. * dumpfile.h (enum tree_dump_index): Likewise. (struct dump_file_info): Likewise. * genemit.c: Likewise. * generic-match-head.c: Likewise. * gengtype.c (open_base_files): Likewise. * gimple-pretty-print.c: Likewise. * gimple-pretty-print.h: Likewise. * graph.c (print_graph_cfg): Likewise. * graphite-scop-detection.c (dot_all_sese): Likewise. * ipa-devirt.c (build_type_inheritance_graph): Likewise. * loop-unroll.c (report_unroll): Likewise. * passes.c (pass_manager::register_one_dump_file): Likewise. * print-tree.c: Likewise. * statistics.c: Likewise. * tree-cfg.c: Likewise. * tree-cfg.h: Likewise. * tree-dfa.c: Likewise. * tree-dfa.h: Likewise. * tree-dump.c (dump_function): Likewise. * tree-dump.h (struct dump_info): Likewise. * tree-pretty-print.c: Likewise. * tree-pretty-print.h: Likewise. * tree-ssa-live.c: Likewise. * tree-ssa-live.h: Likewise. * tree-ssa-loop-ivcanon.c (try_unroll_loop_completely): Likewise. * tree-vect-loop.c: Likewise. * tree-vect-slp.c: Likewise. From-SVN: r248140
2017-05-17 11:01:36 +02:00
static dump_flags_t pflags; /* current dump_flags */
Introduce dump_flags_t type and use it instead of int type. 2017-05-17 Martin Liska <mliska@suse.cz> * class.c (dump_class_hierarchy): Introduce dump_flags_t type and use it instead of int type. (dump_vtable): Likewise. (dump_vtt): Likewise. * decl2.c (dump_tu): Likewise. 2017-05-17 Martin Liska <mliska@suse.cz> * c-common.h: Introduce dump_flags_t type and use it instead of int type. * c-gimplify.c (c_genericize): Likewise. * c-opts.c: Likewise. 2017-05-17 Martin Liska <mliska@suse.cz> * c-decl.c (c_parse_final_cleanups): Introduce dump_flags_t type and use it instead of int type. 2017-05-17 Martin Liska <mliska@suse.cz> * cfg.c: Introduce dump_flags_t type and use it instead of int type. * cfg.h: Likewise. * cfghooks.c: Likewise. * cfghooks.h (struct cfg_hooks): Likewise. * cfgrtl.c: Likewise. * cfgrtl.h: Likewise. * cgraph.c (cgraph_node::get_body): Likewise. * coretypes.h: Likewise. * domwalk.c: Likewise. * domwalk.h: Likewise. * dumpfile.c (struct dump_option_value_info): Likewise. (dump_enable_all): Likewise. (dump_switch_p_1): Likewise. (opt_info_switch_p): Likewise. * dumpfile.h (enum tree_dump_index): Likewise. (struct dump_file_info): Likewise. * genemit.c: Likewise. * generic-match-head.c: Likewise. * gengtype.c (open_base_files): Likewise. * gimple-pretty-print.c: Likewise. * gimple-pretty-print.h: Likewise. * graph.c (print_graph_cfg): Likewise. * graphite-scop-detection.c (dot_all_sese): Likewise. * ipa-devirt.c (build_type_inheritance_graph): Likewise. * loop-unroll.c (report_unroll): Likewise. * passes.c (pass_manager::register_one_dump_file): Likewise. * print-tree.c: Likewise. * statistics.c: Likewise. * tree-cfg.c: Likewise. * tree-cfg.h: Likewise. * tree-dfa.c: Likewise. * tree-dfa.h: Likewise. * tree-dump.c (dump_function): Likewise. * tree-dump.h (struct dump_info): Likewise. * tree-pretty-print.c: Likewise. * tree-pretty-print.h: Likewise. * tree-ssa-live.c: Likewise. * tree-ssa-live.h: Likewise. * tree-ssa-loop-ivcanon.c (try_unroll_loop_completely): Likewise. * tree-vect-loop.c: Likewise. * tree-vect-slp.c: Likewise. From-SVN: r248140
2017-05-17 11:01:36 +02:00
static void dump_loc (dump_flags_t, FILE *, source_location);
/* Current -fopt-info output stream, if any, and flags. */
static FILE *alt_dump_file = NULL;
static dump_flags_t alt_flags;
static FILE *dump_open_alternate_stream (struct dump_file_info *);
/* These are currently used for communicating between passes.
However, instead of accessing them directly, the passes can use
dump_printf () for dumps. */
FILE *dump_file = NULL;
const char *dump_file_name;
Introduce dump_flags_t type and use it instead of int type. 2017-05-17 Martin Liska <mliska@suse.cz> * class.c (dump_class_hierarchy): Introduce dump_flags_t type and use it instead of int type. (dump_vtable): Likewise. (dump_vtt): Likewise. * decl2.c (dump_tu): Likewise. 2017-05-17 Martin Liska <mliska@suse.cz> * c-common.h: Introduce dump_flags_t type and use it instead of int type. * c-gimplify.c (c_genericize): Likewise. * c-opts.c: Likewise. 2017-05-17 Martin Liska <mliska@suse.cz> * c-decl.c (c_parse_final_cleanups): Introduce dump_flags_t type and use it instead of int type. 2017-05-17 Martin Liska <mliska@suse.cz> * cfg.c: Introduce dump_flags_t type and use it instead of int type. * cfg.h: Likewise. * cfghooks.c: Likewise. * cfghooks.h (struct cfg_hooks): Likewise. * cfgrtl.c: Likewise. * cfgrtl.h: Likewise. * cgraph.c (cgraph_node::get_body): Likewise. * coretypes.h: Likewise. * domwalk.c: Likewise. * domwalk.h: Likewise. * dumpfile.c (struct dump_option_value_info): Likewise. (dump_enable_all): Likewise. (dump_switch_p_1): Likewise. (opt_info_switch_p): Likewise. * dumpfile.h (enum tree_dump_index): Likewise. (struct dump_file_info): Likewise. * genemit.c: Likewise. * generic-match-head.c: Likewise. * gengtype.c (open_base_files): Likewise. * gimple-pretty-print.c: Likewise. * gimple-pretty-print.h: Likewise. * graph.c (print_graph_cfg): Likewise. * graphite-scop-detection.c (dot_all_sese): Likewise. * ipa-devirt.c (build_type_inheritance_graph): Likewise. * loop-unroll.c (report_unroll): Likewise. * passes.c (pass_manager::register_one_dump_file): Likewise. * print-tree.c: Likewise. * statistics.c: Likewise. * tree-cfg.c: Likewise. * tree-cfg.h: Likewise. * tree-dfa.c: Likewise. * tree-dfa.h: Likewise. * tree-dump.c (dump_function): Likewise. * tree-dump.h (struct dump_info): Likewise. * tree-pretty-print.c: Likewise. * tree-pretty-print.h: Likewise. * tree-ssa-live.c: Likewise. * tree-ssa-live.h: Likewise. * tree-ssa-loop-ivcanon.c (try_unroll_loop_completely): Likewise. * tree-vect-loop.c: Likewise. * tree-vect-slp.c: Likewise. From-SVN: r248140
2017-05-17 11:01:36 +02:00
dump_flags_t dump_flags;
bool dumps_are_enabled = false;
/* Update the "dumps_are_enabled" global; to be called whenever dump_file
or alt_dump_file change. */
static void
refresh_dumps_are_enabled ()
{
dumps_are_enabled = (dump_file || alt_dump_file);
}
/* Set global "dump_file" to NEW_DUMP_FILE, refreshing the "dumps_are_enabled"
global. */
void
set_dump_file (FILE *new_dump_file)
{
dump_file = new_dump_file;
refresh_dumps_are_enabled ();
}
/* Set "alt_dump_file" to NEW_ALT_DUMP_FILE, refreshing the "dumps_are_enabled"
global. */
static void
set_alt_dump_file (FILE *new_alt_dump_file)
{
alt_dump_file = new_alt_dump_file;
refresh_dumps_are_enabled ();
}
#define DUMP_FILE_INFO(suffix, swtch, dkind, num) \
Convert dump and optgroup flags to enums gcc/brig/ChangeLog: * brigfrontend/brig-to-generic.cc (brig_to_generic::write_globals): Use TDF_NONE rather than 0. (dump_function): Likewise. gcc/c-family/ChangeLog: * c-pretty-print.c (c_pretty_printer::statement): Use TDF_NONE rather than 0. gcc/ChangeLog: * cfg.c (debug): Use TDF_NONE rather than 0. * cfghooks.c (debug): Likewise. * dumpfile.c (DUMP_FILE_INFO): Likewise; also for OPTGROUP. (struct dump_option_value_info): Convert to... (struct kv_pair): ...this template type. (dump_options): Convert to kv_pair<dump_flags_t>; use TDF_NONE rather than 0. (optinfo_verbosity_options): Likewise. (optgroup_options): Convert to kv_pair<optgroup_flags_t>; use OPTGROUP_NONE. (gcc::dump_manager::dump_register): Use optgroup_flags_t rather than int for "optgroup_flags" param. (dump_generic_expr_loc): Use dump_flags_t rather than int for "dump_kind" param. (dump_dec): Likewise. (dump_finish): Use TDF_NONE rather than 0. (gcc::dump_manager::opt_info_enable_passes): Use optgroup_flags_t rather than int for "optgroup_flags" param. Use TDF_NONE rather than 0. Update for change to option_ptr. (opt_info_switch_p_1): Convert "optgroup_flags" param from int * to optgroup_flags_t *. Use TDF_NONE and OPTGROUP_NONE rather than 0. Update for changes to optinfo_verbosity_options and optgroup_options. (opt_info_switch_p): Convert optgroup_flags from int to optgroup_flags_t. (dump_basic_block): Use dump_flags_t rather than int for "dump_kind" param. * dumpfile.h (TDF_ADDRESS, TDF_SLIM, TDF_RAW, TDF_DETAILS, TDF_STATS, TDF_BLOCKS, TDF_VOPS, TDF_LINENO, TDF_UID) TDF_STMTADDR, TDF_GRAPH, TDF_MEMSYMS, TDF_RHS_ONLY, TDF_ASMNAME, TDF_EH, TDF_NOUID, TDF_ALIAS, TDF_ENUMERATE_LOCALS, TDF_CSELIB, TDF_SCEV, TDF_GIMPLE, TDF_FOLDING, MSG_OPTIMIZED_LOCATIONS, MSG_MISSED_OPTIMIZATION, MSG_NOTE, MSG_ALL, TDF_COMPARE_DEBUG, TDF_NONE): Convert from macros to... (enum dump_flag): ...this new enum. (dump_flags_t): Update to use enum. (operator|, operator&, operator~, operator|=, operator&=): Implement for dump_flags_t. (OPTGROUP_NONE, OPTGROUP_IPA, OPTGROUP_LOOP, OPTGROUP_INLINE, OPTGROUP_OMP, OPTGROUP_VEC, OPTGROUP_OTHER, OPTGROUP_ALL): Convert from macros to... (enum optgroup_flag): ...this new enum. (optgroup_flags_t): New typedef. (operator|, operator|=): Implement for optgroup_flags_t. (struct dump_file_info): Convert field "alt_flags" to dump_flags_t. Convert field "optgroup_flags" to optgroup_flags_t. (dump_basic_block): Use dump_flags_t rather than int for param. (dump_generic_expr_loc): Likewise. (dump_dec): Likewise. (dump_register): Convert param "optgroup_flags" to optgroup_flags_t. (opt_info_enable_passes): Likewise. * early-remat.c (early_remat::dump_edge_list): Use TDF_NONE rather than 0. * gimple-pretty-print.c (debug): Likewise. * gimple-ssa-store-merging.c (bswap_replace): Likewise. (merged_store_group::apply_stores): Likewise. * gimple-ssa-strength-reduction.c (insert_initializers): Likewise. * gimple.c (verify_gimple_pp): Likewise. * graphite-poly.c (print_pbb_body): Likewise. * passes.c (pass_manager::register_one_dump_file): Convert local "optgroup_flags" to optgroup_flags_t. * print-tree.c (print_node): Use TDF_NONE rather than 0. (debug): Likewise. (debug_body): Likewise. * tree-pass.h (struct pass_data): Convert field "optgroup_flags" to optgroup_flags_t. * tree-pretty-print.c (print_struct_decl): Use TDF_NONE rather than 0. * tree-ssa-math-opts.c (convert_mult_to_fma_1): Likewise. (convert_mult_to_fma): Likewise. * tree-ssa-reassoc.c (undistribute_ops_list): Likewise. * tree-ssa-sccvn.c (vn_eliminate): Likewise. * tree-vect-data-refs.c (dump_lower_bound): Convert param "dump_kind" to dump_flags_t. From-SVN: r261325
2018-06-08 14:50:19 +02:00
{suffix, swtch, NULL, NULL, NULL, NULL, NULL, dkind, TDF_NONE, TDF_NONE, \
OPTGROUP_NONE, 0, 0, num, false, false}
/* Table of tree dump switches. This must be consistent with the
TREE_DUMP_INDEX enumeration in dumpfile.h. */
static struct dump_file_info dump_files[TDI_end] =
{
DUMP_FILE_INFO (NULL, NULL, DK_none, 0),
DUMP_FILE_INFO (".cgraph", "ipa-cgraph", DK_ipa, 0),
DUMP_FILE_INFO (".type-inheritance", "ipa-type-inheritance", DK_ipa, 0),
DUMP_FILE_INFO (".ipa-clones", "ipa-clones", DK_ipa, 0),
DUMP_FILE_INFO (".original", "tree-original", DK_tree, 0),
DUMP_FILE_INFO (".gimple", "tree-gimple", DK_tree, 0),
DUMP_FILE_INFO (".nested", "tree-nested", DK_tree, 0),
DUMP_FILE_INFO (".lto-stream-out", "ipa-lto-stream-out", DK_ipa, 0),
#define FIRST_AUTO_NUMBERED_DUMP 1
#define FIRST_ME_AUTO_NUMBERED_DUMP 4
DUMP_FILE_INFO (NULL, "lang-all", DK_lang, 0),
DUMP_FILE_INFO (NULL, "tree-all", DK_tree, 0),
DUMP_FILE_INFO (NULL, "rtl-all", DK_rtl, 0),
DUMP_FILE_INFO (NULL, "ipa-all", DK_ipa, 0),
};
/* Define a name->number mapping for a dump flag value. */
Convert dump and optgroup flags to enums gcc/brig/ChangeLog: * brigfrontend/brig-to-generic.cc (brig_to_generic::write_globals): Use TDF_NONE rather than 0. (dump_function): Likewise. gcc/c-family/ChangeLog: * c-pretty-print.c (c_pretty_printer::statement): Use TDF_NONE rather than 0. gcc/ChangeLog: * cfg.c (debug): Use TDF_NONE rather than 0. * cfghooks.c (debug): Likewise. * dumpfile.c (DUMP_FILE_INFO): Likewise; also for OPTGROUP. (struct dump_option_value_info): Convert to... (struct kv_pair): ...this template type. (dump_options): Convert to kv_pair<dump_flags_t>; use TDF_NONE rather than 0. (optinfo_verbosity_options): Likewise. (optgroup_options): Convert to kv_pair<optgroup_flags_t>; use OPTGROUP_NONE. (gcc::dump_manager::dump_register): Use optgroup_flags_t rather than int for "optgroup_flags" param. (dump_generic_expr_loc): Use dump_flags_t rather than int for "dump_kind" param. (dump_dec): Likewise. (dump_finish): Use TDF_NONE rather than 0. (gcc::dump_manager::opt_info_enable_passes): Use optgroup_flags_t rather than int for "optgroup_flags" param. Use TDF_NONE rather than 0. Update for change to option_ptr. (opt_info_switch_p_1): Convert "optgroup_flags" param from int * to optgroup_flags_t *. Use TDF_NONE and OPTGROUP_NONE rather than 0. Update for changes to optinfo_verbosity_options and optgroup_options. (opt_info_switch_p): Convert optgroup_flags from int to optgroup_flags_t. (dump_basic_block): Use dump_flags_t rather than int for "dump_kind" param. * dumpfile.h (TDF_ADDRESS, TDF_SLIM, TDF_RAW, TDF_DETAILS, TDF_STATS, TDF_BLOCKS, TDF_VOPS, TDF_LINENO, TDF_UID) TDF_STMTADDR, TDF_GRAPH, TDF_MEMSYMS, TDF_RHS_ONLY, TDF_ASMNAME, TDF_EH, TDF_NOUID, TDF_ALIAS, TDF_ENUMERATE_LOCALS, TDF_CSELIB, TDF_SCEV, TDF_GIMPLE, TDF_FOLDING, MSG_OPTIMIZED_LOCATIONS, MSG_MISSED_OPTIMIZATION, MSG_NOTE, MSG_ALL, TDF_COMPARE_DEBUG, TDF_NONE): Convert from macros to... (enum dump_flag): ...this new enum. (dump_flags_t): Update to use enum. (operator|, operator&, operator~, operator|=, operator&=): Implement for dump_flags_t. (OPTGROUP_NONE, OPTGROUP_IPA, OPTGROUP_LOOP, OPTGROUP_INLINE, OPTGROUP_OMP, OPTGROUP_VEC, OPTGROUP_OTHER, OPTGROUP_ALL): Convert from macros to... (enum optgroup_flag): ...this new enum. (optgroup_flags_t): New typedef. (operator|, operator|=): Implement for optgroup_flags_t. (struct dump_file_info): Convert field "alt_flags" to dump_flags_t. Convert field "optgroup_flags" to optgroup_flags_t. (dump_basic_block): Use dump_flags_t rather than int for param. (dump_generic_expr_loc): Likewise. (dump_dec): Likewise. (dump_register): Convert param "optgroup_flags" to optgroup_flags_t. (opt_info_enable_passes): Likewise. * early-remat.c (early_remat::dump_edge_list): Use TDF_NONE rather than 0. * gimple-pretty-print.c (debug): Likewise. * gimple-ssa-store-merging.c (bswap_replace): Likewise. (merged_store_group::apply_stores): Likewise. * gimple-ssa-strength-reduction.c (insert_initializers): Likewise. * gimple.c (verify_gimple_pp): Likewise. * graphite-poly.c (print_pbb_body): Likewise. * passes.c (pass_manager::register_one_dump_file): Convert local "optgroup_flags" to optgroup_flags_t. * print-tree.c (print_node): Use TDF_NONE rather than 0. (debug): Likewise. (debug_body): Likewise. * tree-pass.h (struct pass_data): Convert field "optgroup_flags" to optgroup_flags_t. * tree-pretty-print.c (print_struct_decl): Use TDF_NONE rather than 0. * tree-ssa-math-opts.c (convert_mult_to_fma_1): Likewise. (convert_mult_to_fma): Likewise. * tree-ssa-reassoc.c (undistribute_ops_list): Likewise. * tree-ssa-sccvn.c (vn_eliminate): Likewise. * tree-vect-data-refs.c (dump_lower_bound): Convert param "dump_kind" to dump_flags_t. From-SVN: r261325
2018-06-08 14:50:19 +02:00
template <typename ValueType>
struct kv_pair
{
const char *const name; /* the name of the value */
Convert dump and optgroup flags to enums gcc/brig/ChangeLog: * brigfrontend/brig-to-generic.cc (brig_to_generic::write_globals): Use TDF_NONE rather than 0. (dump_function): Likewise. gcc/c-family/ChangeLog: * c-pretty-print.c (c_pretty_printer::statement): Use TDF_NONE rather than 0. gcc/ChangeLog: * cfg.c (debug): Use TDF_NONE rather than 0. * cfghooks.c (debug): Likewise. * dumpfile.c (DUMP_FILE_INFO): Likewise; also for OPTGROUP. (struct dump_option_value_info): Convert to... (struct kv_pair): ...this template type. (dump_options): Convert to kv_pair<dump_flags_t>; use TDF_NONE rather than 0. (optinfo_verbosity_options): Likewise. (optgroup_options): Convert to kv_pair<optgroup_flags_t>; use OPTGROUP_NONE. (gcc::dump_manager::dump_register): Use optgroup_flags_t rather than int for "optgroup_flags" param. (dump_generic_expr_loc): Use dump_flags_t rather than int for "dump_kind" param. (dump_dec): Likewise. (dump_finish): Use TDF_NONE rather than 0. (gcc::dump_manager::opt_info_enable_passes): Use optgroup_flags_t rather than int for "optgroup_flags" param. Use TDF_NONE rather than 0. Update for change to option_ptr. (opt_info_switch_p_1): Convert "optgroup_flags" param from int * to optgroup_flags_t *. Use TDF_NONE and OPTGROUP_NONE rather than 0. Update for changes to optinfo_verbosity_options and optgroup_options. (opt_info_switch_p): Convert optgroup_flags from int to optgroup_flags_t. (dump_basic_block): Use dump_flags_t rather than int for "dump_kind" param. * dumpfile.h (TDF_ADDRESS, TDF_SLIM, TDF_RAW, TDF_DETAILS, TDF_STATS, TDF_BLOCKS, TDF_VOPS, TDF_LINENO, TDF_UID) TDF_STMTADDR, TDF_GRAPH, TDF_MEMSYMS, TDF_RHS_ONLY, TDF_ASMNAME, TDF_EH, TDF_NOUID, TDF_ALIAS, TDF_ENUMERATE_LOCALS, TDF_CSELIB, TDF_SCEV, TDF_GIMPLE, TDF_FOLDING, MSG_OPTIMIZED_LOCATIONS, MSG_MISSED_OPTIMIZATION, MSG_NOTE, MSG_ALL, TDF_COMPARE_DEBUG, TDF_NONE): Convert from macros to... (enum dump_flag): ...this new enum. (dump_flags_t): Update to use enum. (operator|, operator&, operator~, operator|=, operator&=): Implement for dump_flags_t. (OPTGROUP_NONE, OPTGROUP_IPA, OPTGROUP_LOOP, OPTGROUP_INLINE, OPTGROUP_OMP, OPTGROUP_VEC, OPTGROUP_OTHER, OPTGROUP_ALL): Convert from macros to... (enum optgroup_flag): ...this new enum. (optgroup_flags_t): New typedef. (operator|, operator|=): Implement for optgroup_flags_t. (struct dump_file_info): Convert field "alt_flags" to dump_flags_t. Convert field "optgroup_flags" to optgroup_flags_t. (dump_basic_block): Use dump_flags_t rather than int for param. (dump_generic_expr_loc): Likewise. (dump_dec): Likewise. (dump_register): Convert param "optgroup_flags" to optgroup_flags_t. (opt_info_enable_passes): Likewise. * early-remat.c (early_remat::dump_edge_list): Use TDF_NONE rather than 0. * gimple-pretty-print.c (debug): Likewise. * gimple-ssa-store-merging.c (bswap_replace): Likewise. (merged_store_group::apply_stores): Likewise. * gimple-ssa-strength-reduction.c (insert_initializers): Likewise. * gimple.c (verify_gimple_pp): Likewise. * graphite-poly.c (print_pbb_body): Likewise. * passes.c (pass_manager::register_one_dump_file): Convert local "optgroup_flags" to optgroup_flags_t. * print-tree.c (print_node): Use TDF_NONE rather than 0. (debug): Likewise. (debug_body): Likewise. * tree-pass.h (struct pass_data): Convert field "optgroup_flags" to optgroup_flags_t. * tree-pretty-print.c (print_struct_decl): Use TDF_NONE rather than 0. * tree-ssa-math-opts.c (convert_mult_to_fma_1): Likewise. (convert_mult_to_fma): Likewise. * tree-ssa-reassoc.c (undistribute_ops_list): Likewise. * tree-ssa-sccvn.c (vn_eliminate): Likewise. * tree-vect-data-refs.c (dump_lower_bound): Convert param "dump_kind" to dump_flags_t. From-SVN: r261325
2018-06-08 14:50:19 +02:00
const ValueType value; /* the value of the name */
};
/* Table of dump options. This must be consistent with the TDF_* flags
in dumpfile.h and opt_info_options below. */
Convert dump and optgroup flags to enums gcc/brig/ChangeLog: * brigfrontend/brig-to-generic.cc (brig_to_generic::write_globals): Use TDF_NONE rather than 0. (dump_function): Likewise. gcc/c-family/ChangeLog: * c-pretty-print.c (c_pretty_printer::statement): Use TDF_NONE rather than 0. gcc/ChangeLog: * cfg.c (debug): Use TDF_NONE rather than 0. * cfghooks.c (debug): Likewise. * dumpfile.c (DUMP_FILE_INFO): Likewise; also for OPTGROUP. (struct dump_option_value_info): Convert to... (struct kv_pair): ...this template type. (dump_options): Convert to kv_pair<dump_flags_t>; use TDF_NONE rather than 0. (optinfo_verbosity_options): Likewise. (optgroup_options): Convert to kv_pair<optgroup_flags_t>; use OPTGROUP_NONE. (gcc::dump_manager::dump_register): Use optgroup_flags_t rather than int for "optgroup_flags" param. (dump_generic_expr_loc): Use dump_flags_t rather than int for "dump_kind" param. (dump_dec): Likewise. (dump_finish): Use TDF_NONE rather than 0. (gcc::dump_manager::opt_info_enable_passes): Use optgroup_flags_t rather than int for "optgroup_flags" param. Use TDF_NONE rather than 0. Update for change to option_ptr. (opt_info_switch_p_1): Convert "optgroup_flags" param from int * to optgroup_flags_t *. Use TDF_NONE and OPTGROUP_NONE rather than 0. Update for changes to optinfo_verbosity_options and optgroup_options. (opt_info_switch_p): Convert optgroup_flags from int to optgroup_flags_t. (dump_basic_block): Use dump_flags_t rather than int for "dump_kind" param. * dumpfile.h (TDF_ADDRESS, TDF_SLIM, TDF_RAW, TDF_DETAILS, TDF_STATS, TDF_BLOCKS, TDF_VOPS, TDF_LINENO, TDF_UID) TDF_STMTADDR, TDF_GRAPH, TDF_MEMSYMS, TDF_RHS_ONLY, TDF_ASMNAME, TDF_EH, TDF_NOUID, TDF_ALIAS, TDF_ENUMERATE_LOCALS, TDF_CSELIB, TDF_SCEV, TDF_GIMPLE, TDF_FOLDING, MSG_OPTIMIZED_LOCATIONS, MSG_MISSED_OPTIMIZATION, MSG_NOTE, MSG_ALL, TDF_COMPARE_DEBUG, TDF_NONE): Convert from macros to... (enum dump_flag): ...this new enum. (dump_flags_t): Update to use enum. (operator|, operator&, operator~, operator|=, operator&=): Implement for dump_flags_t. (OPTGROUP_NONE, OPTGROUP_IPA, OPTGROUP_LOOP, OPTGROUP_INLINE, OPTGROUP_OMP, OPTGROUP_VEC, OPTGROUP_OTHER, OPTGROUP_ALL): Convert from macros to... (enum optgroup_flag): ...this new enum. (optgroup_flags_t): New typedef. (operator|, operator|=): Implement for optgroup_flags_t. (struct dump_file_info): Convert field "alt_flags" to dump_flags_t. Convert field "optgroup_flags" to optgroup_flags_t. (dump_basic_block): Use dump_flags_t rather than int for param. (dump_generic_expr_loc): Likewise. (dump_dec): Likewise. (dump_register): Convert param "optgroup_flags" to optgroup_flags_t. (opt_info_enable_passes): Likewise. * early-remat.c (early_remat::dump_edge_list): Use TDF_NONE rather than 0. * gimple-pretty-print.c (debug): Likewise. * gimple-ssa-store-merging.c (bswap_replace): Likewise. (merged_store_group::apply_stores): Likewise. * gimple-ssa-strength-reduction.c (insert_initializers): Likewise. * gimple.c (verify_gimple_pp): Likewise. * graphite-poly.c (print_pbb_body): Likewise. * passes.c (pass_manager::register_one_dump_file): Convert local "optgroup_flags" to optgroup_flags_t. * print-tree.c (print_node): Use TDF_NONE rather than 0. (debug): Likewise. (debug_body): Likewise. * tree-pass.h (struct pass_data): Convert field "optgroup_flags" to optgroup_flags_t. * tree-pretty-print.c (print_struct_decl): Use TDF_NONE rather than 0. * tree-ssa-math-opts.c (convert_mult_to_fma_1): Likewise. (convert_mult_to_fma): Likewise. * tree-ssa-reassoc.c (undistribute_ops_list): Likewise. * tree-ssa-sccvn.c (vn_eliminate): Likewise. * tree-vect-data-refs.c (dump_lower_bound): Convert param "dump_kind" to dump_flags_t. From-SVN: r261325
2018-06-08 14:50:19 +02:00
static const kv_pair<dump_flags_t> dump_options[] =
{
{"address", TDF_ADDRESS},
{"asmname", TDF_ASMNAME},
{"slim", TDF_SLIM},
{"raw", TDF_RAW},
{"graph", TDF_GRAPH},
{"details", (TDF_DETAILS | MSG_OPTIMIZED_LOCATIONS
| MSG_MISSED_OPTIMIZATION
| MSG_NOTE)},
{"cselib", TDF_CSELIB},
{"stats", TDF_STATS},
{"blocks", TDF_BLOCKS},
{"vops", TDF_VOPS},
{"lineno", TDF_LINENO},
{"uid", TDF_UID},
{"stmtaddr", TDF_STMTADDR},
{"memsyms", TDF_MEMSYMS},
{"eh", TDF_EH},
{"alias", TDF_ALIAS},
{"nouid", TDF_NOUID},
{"enumerate_locals", TDF_ENUMERATE_LOCALS},
{"scev", TDF_SCEV},
Make-lang.in (C_AND_OBJC_OBJS): Add gimple-parser.o. 2016-11-14 Prasad Ghangal <prasad.ghangal@gmail.com> Richard Biener <rguenther@suse.de> c/ * Make-lang.in (C_AND_OBJC_OBJS): Add gimple-parser.o. * config-lang.in (gtfiles): Add c/c-parser.h. * c-tree.h (enum c_declspec_word): Add cdw_gimple. (struct c_declspecs): Add gimple_pass member and gimple_p flag. * c-parser.c (enum c_id_kind, struct c_token, c_parser_next_token_is, c_parser_next_token_is_not, c_parser_next_token_is_keyword, enum c_lookahead_kind, enum c_dtr_syn, enum c_parser_prec): Split out to ... * c-parser.h: ... new header. * c-parser.c: Include c-parser.h and gimple-parser.h. (c_parser_peek_token, c_parser_peek_2nd_token, c_token_starts_typename, c_parser_next_token_starts_declspecs, c_parser_next_tokens_start_declaration, c_parser_consume_token, c_parser_error, c_parser_require, c_parser_skip_until_found, c_parser_declspecs, c_parser_declarator, c_parser_peek_nth_token, c_parser_type_name): Export. (c_parser_tokens_buf): New function. (c_parser_error): Likewise. (c_parser_set_error): Likewise. (c_parser_declspecs): Handle RID_GIMPLE. (c_parser_declaration_or_fndef): Parse __GIMPLE marked body via c_parser_parse_gimple_body. * c-parser.h (c_parser_peek_token, c_parser_peek_2nd_token, c_token_starts_typename, c_parser_next_token_starts_declspecs, c_parser_next_tokens_start_declaration, c_parser_consume_token, c_parser_error, c_parser_require, c_parser_skip_until_found, c_parser_declspecs, c_parser_declarator, c_parser_peek_nth_token, c_parser_type_name): Declare. (struct c_parser): Declare forward. (c_parser_tokens_buf): Declare. (c_parser_error): Likewise. (c_parser_set_error): Likewise. * gimple-parser.c: New file. * gimple-parser.h: Likewise. obj-c/ * config-lang.in (gtfiles): Add c/c-parser.h. c-family/ * c-common.h (c_common_resword): Add RID_GIMPLE, RID_PHI types. * c-common.h (enum rid): Add RID_GIMPLE, RID_PHI. * c.opt (fgimple): New option. * doc/invoke.texi (fgimple): Document. * dumpfile.h (TDF_GIMPLE): Add. * dumpfile.c (dump_options): Add gimple. * gimple-pretty-print.c (dump_gimple_switch): Adjust dump for TDF_GIMPLE. (dump_gimple_label): Likewise. (dump_gimple_phi): Likewise. (dump_gimple_bb_header): Likewise. (dump_phi_nodes): Likewise. (pp_cfg_jump): Likewise. Pass in dump flags. (dump_implicit_edges): Adjust. * passes.c (pass_init_dump_file): Do not dump function header for TDF_GIMPLE. * tree-cfg.c (dump_function_to_file): Dump function return type and __GIMPLE keyword for TDF_GIMPLE. Change guard for dumping GIMPLE stmts. * tree-pretty-print.c (dump_decl_name): Adjust dump for TDF_GIMPLE. (dump_generic_node): Likewise. * function.h (struct function): Add pass_startwith member. * passes.c (execute_one_pass): Implement startwith. * tree-ssanames.c (make_ssa_name_fn): New argument, check for version and assign proper version for parsed ssa names. * tree-ssanames.h (make_ssa_name_fn): Add new argument to the function. * internal-fn.c (expand_PHI): New function. * internal-fn.h (expand_PHI): Declared here. * internal-fn.def: New defination for PHI. * tree-cfg.c (lower_phi_internal_fn): New function. (build_gimple_cfg): Call it. (verify_gimple_call): Condition for passing label as arg in internal function PHI. * tree-into-ssa.c (rewrite_add_phi_arguments): Handle already present PHIs with arguments. testsuite/ * gcc.dg/gimplefe-1.c: New testcase. * gcc.dg/gimplefe-2.c: Likewise. * gcc.dg/gimplefe-3.c: Likewise. * gcc.dg/gimplefe-4.c: Likewise. * gcc.dg/gimplefe-5.c: Likewise. * gcc.dg/gimplefe-6.c: Likewise. * gcc.dg/gimplefe-7.c: Likewise. * gcc.dg/gimplefe-8.c: Likewise. * gcc.dg/gimplefe-9.c: Likewise. * gcc.dg/gimplefe-10.c: Likewise. * gcc.dg/gimplefe-11.c: Likewise. * gcc.dg/gimplefe-12.c: Likewise. * gcc.dg/gimplefe-13.c: Likewise. * gcc.dg/gimplefe-14.c: Likewise. * gcc.dg/gimplefe-15.c: Likewise. * gcc.dg/gimplefe-16.c: Likewise. * gcc.dg/gimplefe-17.c: Likewise. * gcc.dg/gimplefe-18.c: Likewise. Co-Authored-By: Richard Biener <rguenther@suse.de> From-SVN: r242387
2016-11-14 14:51:48 +01:00
{"gimple", TDF_GIMPLE},
{"folding", TDF_FOLDING},
{"optimized", MSG_OPTIMIZED_LOCATIONS},
{"missed", MSG_MISSED_OPTIMIZATION},
{"note", MSG_NOTE},
{"optall", MSG_ALL},
{"all", dump_flags_t (~(TDF_RAW | TDF_SLIM | TDF_LINENO | TDF_GRAPH
| TDF_STMTADDR | TDF_RHS_ONLY | TDF_NOUID
| TDF_ENUMERATE_LOCALS | TDF_SCEV | TDF_GIMPLE))},
Convert dump and optgroup flags to enums gcc/brig/ChangeLog: * brigfrontend/brig-to-generic.cc (brig_to_generic::write_globals): Use TDF_NONE rather than 0. (dump_function): Likewise. gcc/c-family/ChangeLog: * c-pretty-print.c (c_pretty_printer::statement): Use TDF_NONE rather than 0. gcc/ChangeLog: * cfg.c (debug): Use TDF_NONE rather than 0. * cfghooks.c (debug): Likewise. * dumpfile.c (DUMP_FILE_INFO): Likewise; also for OPTGROUP. (struct dump_option_value_info): Convert to... (struct kv_pair): ...this template type. (dump_options): Convert to kv_pair<dump_flags_t>; use TDF_NONE rather than 0. (optinfo_verbosity_options): Likewise. (optgroup_options): Convert to kv_pair<optgroup_flags_t>; use OPTGROUP_NONE. (gcc::dump_manager::dump_register): Use optgroup_flags_t rather than int for "optgroup_flags" param. (dump_generic_expr_loc): Use dump_flags_t rather than int for "dump_kind" param. (dump_dec): Likewise. (dump_finish): Use TDF_NONE rather than 0. (gcc::dump_manager::opt_info_enable_passes): Use optgroup_flags_t rather than int for "optgroup_flags" param. Use TDF_NONE rather than 0. Update for change to option_ptr. (opt_info_switch_p_1): Convert "optgroup_flags" param from int * to optgroup_flags_t *. Use TDF_NONE and OPTGROUP_NONE rather than 0. Update for changes to optinfo_verbosity_options and optgroup_options. (opt_info_switch_p): Convert optgroup_flags from int to optgroup_flags_t. (dump_basic_block): Use dump_flags_t rather than int for "dump_kind" param. * dumpfile.h (TDF_ADDRESS, TDF_SLIM, TDF_RAW, TDF_DETAILS, TDF_STATS, TDF_BLOCKS, TDF_VOPS, TDF_LINENO, TDF_UID) TDF_STMTADDR, TDF_GRAPH, TDF_MEMSYMS, TDF_RHS_ONLY, TDF_ASMNAME, TDF_EH, TDF_NOUID, TDF_ALIAS, TDF_ENUMERATE_LOCALS, TDF_CSELIB, TDF_SCEV, TDF_GIMPLE, TDF_FOLDING, MSG_OPTIMIZED_LOCATIONS, MSG_MISSED_OPTIMIZATION, MSG_NOTE, MSG_ALL, TDF_COMPARE_DEBUG, TDF_NONE): Convert from macros to... (enum dump_flag): ...this new enum. (dump_flags_t): Update to use enum. (operator|, operator&, operator~, operator|=, operator&=): Implement for dump_flags_t. (OPTGROUP_NONE, OPTGROUP_IPA, OPTGROUP_LOOP, OPTGROUP_INLINE, OPTGROUP_OMP, OPTGROUP_VEC, OPTGROUP_OTHER, OPTGROUP_ALL): Convert from macros to... (enum optgroup_flag): ...this new enum. (optgroup_flags_t): New typedef. (operator|, operator|=): Implement for optgroup_flags_t. (struct dump_file_info): Convert field "alt_flags" to dump_flags_t. Convert field "optgroup_flags" to optgroup_flags_t. (dump_basic_block): Use dump_flags_t rather than int for param. (dump_generic_expr_loc): Likewise. (dump_dec): Likewise. (dump_register): Convert param "optgroup_flags" to optgroup_flags_t. (opt_info_enable_passes): Likewise. * early-remat.c (early_remat::dump_edge_list): Use TDF_NONE rather than 0. * gimple-pretty-print.c (debug): Likewise. * gimple-ssa-store-merging.c (bswap_replace): Likewise. (merged_store_group::apply_stores): Likewise. * gimple-ssa-strength-reduction.c (insert_initializers): Likewise. * gimple.c (verify_gimple_pp): Likewise. * graphite-poly.c (print_pbb_body): Likewise. * passes.c (pass_manager::register_one_dump_file): Convert local "optgroup_flags" to optgroup_flags_t. * print-tree.c (print_node): Use TDF_NONE rather than 0. (debug): Likewise. (debug_body): Likewise. * tree-pass.h (struct pass_data): Convert field "optgroup_flags" to optgroup_flags_t. * tree-pretty-print.c (print_struct_decl): Use TDF_NONE rather than 0. * tree-ssa-math-opts.c (convert_mult_to_fma_1): Likewise. (convert_mult_to_fma): Likewise. * tree-ssa-reassoc.c (undistribute_ops_list): Likewise. * tree-ssa-sccvn.c (vn_eliminate): Likewise. * tree-vect-data-refs.c (dump_lower_bound): Convert param "dump_kind" to dump_flags_t. From-SVN: r261325
2018-06-08 14:50:19 +02:00
{NULL, TDF_NONE}
};
invoke.texi: Update -fopt-info documentation. 2012-11-01 Sharad Singhai <singhai@google.com> * doc/invoke.texi: Update -fopt-info documentation. * dumpfile.c: Move dump_flags here from passes.c. Rename opt_info_options to optinfo_verbosity_options. Add optgroup_options. (dump_files): Add field for optinfo_flags in the static initializer. (dump_register): Handle additional parameter for optgroup_flags. (opt_info_enable_passes): Renamed opt_info_enable_all. Handle optgroup_flags. Fix documentation. (opt_info_switch_p_1): Handle optgroup options. (opt_info_switch_p): Handle optgroup_flags. Warn on multiple files. * dumpfile.h (dump_register): Additional argument for optgroup_flags. All callers updated. (struct dump_file_info): Add field for optgroup_flags. Define OPTGROUP_* flags. * tree-pass.h (struct opt_pass): Add addtional field for optinfo_flags. All opt_pass static initializers updated. * opts-global.c (dump_remap_tree_vectorizer_verbose): Use 'all' instead of 'optall'. (handle_common_deferred_options): Fix typo in error message. * passes.c (register_one_dump_file): Add argument for optgroup_flags. Turn on OPTGROUP_IPA for IPA passes. Move dump_flags from here to dumpfile.c. * statistics.c (statistics_early_init): Use OPTGROUP_NONE in call to dump_register. testsuite/ChangeLog * testsuite/gcc.dg/plugin/selfassign.c: Add opgtroup_flags initializer. * testsuite/gcc.dg/plugin/one_time_plugin.c: Likewise. * testsuite/g++.dg/plugin/selfassign.c: Likewise. * testsuite/g++.dg/plugin/dumb_plugin.c: Likewise. From-SVN: r193061
2012-11-01 08:34:44 +01:00
/* A subset of the dump_options table which is used for -fopt-info
types. This must be consistent with the MSG_* flags in dumpfile.h.
*/
Convert dump and optgroup flags to enums gcc/brig/ChangeLog: * brigfrontend/brig-to-generic.cc (brig_to_generic::write_globals): Use TDF_NONE rather than 0. (dump_function): Likewise. gcc/c-family/ChangeLog: * c-pretty-print.c (c_pretty_printer::statement): Use TDF_NONE rather than 0. gcc/ChangeLog: * cfg.c (debug): Use TDF_NONE rather than 0. * cfghooks.c (debug): Likewise. * dumpfile.c (DUMP_FILE_INFO): Likewise; also for OPTGROUP. (struct dump_option_value_info): Convert to... (struct kv_pair): ...this template type. (dump_options): Convert to kv_pair<dump_flags_t>; use TDF_NONE rather than 0. (optinfo_verbosity_options): Likewise. (optgroup_options): Convert to kv_pair<optgroup_flags_t>; use OPTGROUP_NONE. (gcc::dump_manager::dump_register): Use optgroup_flags_t rather than int for "optgroup_flags" param. (dump_generic_expr_loc): Use dump_flags_t rather than int for "dump_kind" param. (dump_dec): Likewise. (dump_finish): Use TDF_NONE rather than 0. (gcc::dump_manager::opt_info_enable_passes): Use optgroup_flags_t rather than int for "optgroup_flags" param. Use TDF_NONE rather than 0. Update for change to option_ptr. (opt_info_switch_p_1): Convert "optgroup_flags" param from int * to optgroup_flags_t *. Use TDF_NONE and OPTGROUP_NONE rather than 0. Update for changes to optinfo_verbosity_options and optgroup_options. (opt_info_switch_p): Convert optgroup_flags from int to optgroup_flags_t. (dump_basic_block): Use dump_flags_t rather than int for "dump_kind" param. * dumpfile.h (TDF_ADDRESS, TDF_SLIM, TDF_RAW, TDF_DETAILS, TDF_STATS, TDF_BLOCKS, TDF_VOPS, TDF_LINENO, TDF_UID) TDF_STMTADDR, TDF_GRAPH, TDF_MEMSYMS, TDF_RHS_ONLY, TDF_ASMNAME, TDF_EH, TDF_NOUID, TDF_ALIAS, TDF_ENUMERATE_LOCALS, TDF_CSELIB, TDF_SCEV, TDF_GIMPLE, TDF_FOLDING, MSG_OPTIMIZED_LOCATIONS, MSG_MISSED_OPTIMIZATION, MSG_NOTE, MSG_ALL, TDF_COMPARE_DEBUG, TDF_NONE): Convert from macros to... (enum dump_flag): ...this new enum. (dump_flags_t): Update to use enum. (operator|, operator&, operator~, operator|=, operator&=): Implement for dump_flags_t. (OPTGROUP_NONE, OPTGROUP_IPA, OPTGROUP_LOOP, OPTGROUP_INLINE, OPTGROUP_OMP, OPTGROUP_VEC, OPTGROUP_OTHER, OPTGROUP_ALL): Convert from macros to... (enum optgroup_flag): ...this new enum. (optgroup_flags_t): New typedef. (operator|, operator|=): Implement for optgroup_flags_t. (struct dump_file_info): Convert field "alt_flags" to dump_flags_t. Convert field "optgroup_flags" to optgroup_flags_t. (dump_basic_block): Use dump_flags_t rather than int for param. (dump_generic_expr_loc): Likewise. (dump_dec): Likewise. (dump_register): Convert param "optgroup_flags" to optgroup_flags_t. (opt_info_enable_passes): Likewise. * early-remat.c (early_remat::dump_edge_list): Use TDF_NONE rather than 0. * gimple-pretty-print.c (debug): Likewise. * gimple-ssa-store-merging.c (bswap_replace): Likewise. (merged_store_group::apply_stores): Likewise. * gimple-ssa-strength-reduction.c (insert_initializers): Likewise. * gimple.c (verify_gimple_pp): Likewise. * graphite-poly.c (print_pbb_body): Likewise. * passes.c (pass_manager::register_one_dump_file): Convert local "optgroup_flags" to optgroup_flags_t. * print-tree.c (print_node): Use TDF_NONE rather than 0. (debug): Likewise. (debug_body): Likewise. * tree-pass.h (struct pass_data): Convert field "optgroup_flags" to optgroup_flags_t. * tree-pretty-print.c (print_struct_decl): Use TDF_NONE rather than 0. * tree-ssa-math-opts.c (convert_mult_to_fma_1): Likewise. (convert_mult_to_fma): Likewise. * tree-ssa-reassoc.c (undistribute_ops_list): Likewise. * tree-ssa-sccvn.c (vn_eliminate): Likewise. * tree-vect-data-refs.c (dump_lower_bound): Convert param "dump_kind" to dump_flags_t. From-SVN: r261325
2018-06-08 14:50:19 +02:00
static const kv_pair<dump_flags_t> optinfo_verbosity_options[] =
{
{"optimized", MSG_OPTIMIZED_LOCATIONS},
{"missed", MSG_MISSED_OPTIMIZATION},
{"note", MSG_NOTE},
invoke.texi: Update -fopt-info documentation. 2012-11-01 Sharad Singhai <singhai@google.com> * doc/invoke.texi: Update -fopt-info documentation. * dumpfile.c: Move dump_flags here from passes.c. Rename opt_info_options to optinfo_verbosity_options. Add optgroup_options. (dump_files): Add field for optinfo_flags in the static initializer. (dump_register): Handle additional parameter for optgroup_flags. (opt_info_enable_passes): Renamed opt_info_enable_all. Handle optgroup_flags. Fix documentation. (opt_info_switch_p_1): Handle optgroup options. (opt_info_switch_p): Handle optgroup_flags. Warn on multiple files. * dumpfile.h (dump_register): Additional argument for optgroup_flags. All callers updated. (struct dump_file_info): Add field for optgroup_flags. Define OPTGROUP_* flags. * tree-pass.h (struct opt_pass): Add addtional field for optinfo_flags. All opt_pass static initializers updated. * opts-global.c (dump_remap_tree_vectorizer_verbose): Use 'all' instead of 'optall'. (handle_common_deferred_options): Fix typo in error message. * passes.c (register_one_dump_file): Add argument for optgroup_flags. Turn on OPTGROUP_IPA for IPA passes. Move dump_flags from here to dumpfile.c. * statistics.c (statistics_early_init): Use OPTGROUP_NONE in call to dump_register. testsuite/ChangeLog * testsuite/gcc.dg/plugin/selfassign.c: Add opgtroup_flags initializer. * testsuite/gcc.dg/plugin/one_time_plugin.c: Likewise. * testsuite/g++.dg/plugin/selfassign.c: Likewise. * testsuite/g++.dg/plugin/dumb_plugin.c: Likewise. From-SVN: r193061
2012-11-01 08:34:44 +01:00
{"all", MSG_ALL},
Convert dump and optgroup flags to enums gcc/brig/ChangeLog: * brigfrontend/brig-to-generic.cc (brig_to_generic::write_globals): Use TDF_NONE rather than 0. (dump_function): Likewise. gcc/c-family/ChangeLog: * c-pretty-print.c (c_pretty_printer::statement): Use TDF_NONE rather than 0. gcc/ChangeLog: * cfg.c (debug): Use TDF_NONE rather than 0. * cfghooks.c (debug): Likewise. * dumpfile.c (DUMP_FILE_INFO): Likewise; also for OPTGROUP. (struct dump_option_value_info): Convert to... (struct kv_pair): ...this template type. (dump_options): Convert to kv_pair<dump_flags_t>; use TDF_NONE rather than 0. (optinfo_verbosity_options): Likewise. (optgroup_options): Convert to kv_pair<optgroup_flags_t>; use OPTGROUP_NONE. (gcc::dump_manager::dump_register): Use optgroup_flags_t rather than int for "optgroup_flags" param. (dump_generic_expr_loc): Use dump_flags_t rather than int for "dump_kind" param. (dump_dec): Likewise. (dump_finish): Use TDF_NONE rather than 0. (gcc::dump_manager::opt_info_enable_passes): Use optgroup_flags_t rather than int for "optgroup_flags" param. Use TDF_NONE rather than 0. Update for change to option_ptr. (opt_info_switch_p_1): Convert "optgroup_flags" param from int * to optgroup_flags_t *. Use TDF_NONE and OPTGROUP_NONE rather than 0. Update for changes to optinfo_verbosity_options and optgroup_options. (opt_info_switch_p): Convert optgroup_flags from int to optgroup_flags_t. (dump_basic_block): Use dump_flags_t rather than int for "dump_kind" param. * dumpfile.h (TDF_ADDRESS, TDF_SLIM, TDF_RAW, TDF_DETAILS, TDF_STATS, TDF_BLOCKS, TDF_VOPS, TDF_LINENO, TDF_UID) TDF_STMTADDR, TDF_GRAPH, TDF_MEMSYMS, TDF_RHS_ONLY, TDF_ASMNAME, TDF_EH, TDF_NOUID, TDF_ALIAS, TDF_ENUMERATE_LOCALS, TDF_CSELIB, TDF_SCEV, TDF_GIMPLE, TDF_FOLDING, MSG_OPTIMIZED_LOCATIONS, MSG_MISSED_OPTIMIZATION, MSG_NOTE, MSG_ALL, TDF_COMPARE_DEBUG, TDF_NONE): Convert from macros to... (enum dump_flag): ...this new enum. (dump_flags_t): Update to use enum. (operator|, operator&, operator~, operator|=, operator&=): Implement for dump_flags_t. (OPTGROUP_NONE, OPTGROUP_IPA, OPTGROUP_LOOP, OPTGROUP_INLINE, OPTGROUP_OMP, OPTGROUP_VEC, OPTGROUP_OTHER, OPTGROUP_ALL): Convert from macros to... (enum optgroup_flag): ...this new enum. (optgroup_flags_t): New typedef. (operator|, operator|=): Implement for optgroup_flags_t. (struct dump_file_info): Convert field "alt_flags" to dump_flags_t. Convert field "optgroup_flags" to optgroup_flags_t. (dump_basic_block): Use dump_flags_t rather than int for param. (dump_generic_expr_loc): Likewise. (dump_dec): Likewise. (dump_register): Convert param "optgroup_flags" to optgroup_flags_t. (opt_info_enable_passes): Likewise. * early-remat.c (early_remat::dump_edge_list): Use TDF_NONE rather than 0. * gimple-pretty-print.c (debug): Likewise. * gimple-ssa-store-merging.c (bswap_replace): Likewise. (merged_store_group::apply_stores): Likewise. * gimple-ssa-strength-reduction.c (insert_initializers): Likewise. * gimple.c (verify_gimple_pp): Likewise. * graphite-poly.c (print_pbb_body): Likewise. * passes.c (pass_manager::register_one_dump_file): Convert local "optgroup_flags" to optgroup_flags_t. * print-tree.c (print_node): Use TDF_NONE rather than 0. (debug): Likewise. (debug_body): Likewise. * tree-pass.h (struct pass_data): Convert field "optgroup_flags" to optgroup_flags_t. * tree-pretty-print.c (print_struct_decl): Use TDF_NONE rather than 0. * tree-ssa-math-opts.c (convert_mult_to_fma_1): Likewise. (convert_mult_to_fma): Likewise. * tree-ssa-reassoc.c (undistribute_ops_list): Likewise. * tree-ssa-sccvn.c (vn_eliminate): Likewise. * tree-vect-data-refs.c (dump_lower_bound): Convert param "dump_kind" to dump_flags_t. From-SVN: r261325
2018-06-08 14:50:19 +02:00
{NULL, TDF_NONE}
invoke.texi: Update -fopt-info documentation. 2012-11-01 Sharad Singhai <singhai@google.com> * doc/invoke.texi: Update -fopt-info documentation. * dumpfile.c: Move dump_flags here from passes.c. Rename opt_info_options to optinfo_verbosity_options. Add optgroup_options. (dump_files): Add field for optinfo_flags in the static initializer. (dump_register): Handle additional parameter for optgroup_flags. (opt_info_enable_passes): Renamed opt_info_enable_all. Handle optgroup_flags. Fix documentation. (opt_info_switch_p_1): Handle optgroup options. (opt_info_switch_p): Handle optgroup_flags. Warn on multiple files. * dumpfile.h (dump_register): Additional argument for optgroup_flags. All callers updated. (struct dump_file_info): Add field for optgroup_flags. Define OPTGROUP_* flags. * tree-pass.h (struct opt_pass): Add addtional field for optinfo_flags. All opt_pass static initializers updated. * opts-global.c (dump_remap_tree_vectorizer_verbose): Use 'all' instead of 'optall'. (handle_common_deferred_options): Fix typo in error message. * passes.c (register_one_dump_file): Add argument for optgroup_flags. Turn on OPTGROUP_IPA for IPA passes. Move dump_flags from here to dumpfile.c. * statistics.c (statistics_early_init): Use OPTGROUP_NONE in call to dump_register. testsuite/ChangeLog * testsuite/gcc.dg/plugin/selfassign.c: Add opgtroup_flags initializer. * testsuite/gcc.dg/plugin/one_time_plugin.c: Likewise. * testsuite/g++.dg/plugin/selfassign.c: Likewise. * testsuite/g++.dg/plugin/dumb_plugin.c: Likewise. From-SVN: r193061
2012-11-01 08:34:44 +01:00
};
/* Flags used for -fopt-info groups. */
Convert dump and optgroup flags to enums gcc/brig/ChangeLog: * brigfrontend/brig-to-generic.cc (brig_to_generic::write_globals): Use TDF_NONE rather than 0. (dump_function): Likewise. gcc/c-family/ChangeLog: * c-pretty-print.c (c_pretty_printer::statement): Use TDF_NONE rather than 0. gcc/ChangeLog: * cfg.c (debug): Use TDF_NONE rather than 0. * cfghooks.c (debug): Likewise. * dumpfile.c (DUMP_FILE_INFO): Likewise; also for OPTGROUP. (struct dump_option_value_info): Convert to... (struct kv_pair): ...this template type. (dump_options): Convert to kv_pair<dump_flags_t>; use TDF_NONE rather than 0. (optinfo_verbosity_options): Likewise. (optgroup_options): Convert to kv_pair<optgroup_flags_t>; use OPTGROUP_NONE. (gcc::dump_manager::dump_register): Use optgroup_flags_t rather than int for "optgroup_flags" param. (dump_generic_expr_loc): Use dump_flags_t rather than int for "dump_kind" param. (dump_dec): Likewise. (dump_finish): Use TDF_NONE rather than 0. (gcc::dump_manager::opt_info_enable_passes): Use optgroup_flags_t rather than int for "optgroup_flags" param. Use TDF_NONE rather than 0. Update for change to option_ptr. (opt_info_switch_p_1): Convert "optgroup_flags" param from int * to optgroup_flags_t *. Use TDF_NONE and OPTGROUP_NONE rather than 0. Update for changes to optinfo_verbosity_options and optgroup_options. (opt_info_switch_p): Convert optgroup_flags from int to optgroup_flags_t. (dump_basic_block): Use dump_flags_t rather than int for "dump_kind" param. * dumpfile.h (TDF_ADDRESS, TDF_SLIM, TDF_RAW, TDF_DETAILS, TDF_STATS, TDF_BLOCKS, TDF_VOPS, TDF_LINENO, TDF_UID) TDF_STMTADDR, TDF_GRAPH, TDF_MEMSYMS, TDF_RHS_ONLY, TDF_ASMNAME, TDF_EH, TDF_NOUID, TDF_ALIAS, TDF_ENUMERATE_LOCALS, TDF_CSELIB, TDF_SCEV, TDF_GIMPLE, TDF_FOLDING, MSG_OPTIMIZED_LOCATIONS, MSG_MISSED_OPTIMIZATION, MSG_NOTE, MSG_ALL, TDF_COMPARE_DEBUG, TDF_NONE): Convert from macros to... (enum dump_flag): ...this new enum. (dump_flags_t): Update to use enum. (operator|, operator&, operator~, operator|=, operator&=): Implement for dump_flags_t. (OPTGROUP_NONE, OPTGROUP_IPA, OPTGROUP_LOOP, OPTGROUP_INLINE, OPTGROUP_OMP, OPTGROUP_VEC, OPTGROUP_OTHER, OPTGROUP_ALL): Convert from macros to... (enum optgroup_flag): ...this new enum. (optgroup_flags_t): New typedef. (operator|, operator|=): Implement for optgroup_flags_t. (struct dump_file_info): Convert field "alt_flags" to dump_flags_t. Convert field "optgroup_flags" to optgroup_flags_t. (dump_basic_block): Use dump_flags_t rather than int for param. (dump_generic_expr_loc): Likewise. (dump_dec): Likewise. (dump_register): Convert param "optgroup_flags" to optgroup_flags_t. (opt_info_enable_passes): Likewise. * early-remat.c (early_remat::dump_edge_list): Use TDF_NONE rather than 0. * gimple-pretty-print.c (debug): Likewise. * gimple-ssa-store-merging.c (bswap_replace): Likewise. (merged_store_group::apply_stores): Likewise. * gimple-ssa-strength-reduction.c (insert_initializers): Likewise. * gimple.c (verify_gimple_pp): Likewise. * graphite-poly.c (print_pbb_body): Likewise. * passes.c (pass_manager::register_one_dump_file): Convert local "optgroup_flags" to optgroup_flags_t. * print-tree.c (print_node): Use TDF_NONE rather than 0. (debug): Likewise. (debug_body): Likewise. * tree-pass.h (struct pass_data): Convert field "optgroup_flags" to optgroup_flags_t. * tree-pretty-print.c (print_struct_decl): Use TDF_NONE rather than 0. * tree-ssa-math-opts.c (convert_mult_to_fma_1): Likewise. (convert_mult_to_fma): Likewise. * tree-ssa-reassoc.c (undistribute_ops_list): Likewise. * tree-ssa-sccvn.c (vn_eliminate): Likewise. * tree-vect-data-refs.c (dump_lower_bound): Convert param "dump_kind" to dump_flags_t. From-SVN: r261325
2018-06-08 14:50:19 +02:00
static const kv_pair<optgroup_flags_t> optgroup_options[] =
invoke.texi: Update -fopt-info documentation. 2012-11-01 Sharad Singhai <singhai@google.com> * doc/invoke.texi: Update -fopt-info documentation. * dumpfile.c: Move dump_flags here from passes.c. Rename opt_info_options to optinfo_verbosity_options. Add optgroup_options. (dump_files): Add field for optinfo_flags in the static initializer. (dump_register): Handle additional parameter for optgroup_flags. (opt_info_enable_passes): Renamed opt_info_enable_all. Handle optgroup_flags. Fix documentation. (opt_info_switch_p_1): Handle optgroup options. (opt_info_switch_p): Handle optgroup_flags. Warn on multiple files. * dumpfile.h (dump_register): Additional argument for optgroup_flags. All callers updated. (struct dump_file_info): Add field for optgroup_flags. Define OPTGROUP_* flags. * tree-pass.h (struct opt_pass): Add addtional field for optinfo_flags. All opt_pass static initializers updated. * opts-global.c (dump_remap_tree_vectorizer_verbose): Use 'all' instead of 'optall'. (handle_common_deferred_options): Fix typo in error message. * passes.c (register_one_dump_file): Add argument for optgroup_flags. Turn on OPTGROUP_IPA for IPA passes. Move dump_flags from here to dumpfile.c. * statistics.c (statistics_early_init): Use OPTGROUP_NONE in call to dump_register. testsuite/ChangeLog * testsuite/gcc.dg/plugin/selfassign.c: Add opgtroup_flags initializer. * testsuite/gcc.dg/plugin/one_time_plugin.c: Likewise. * testsuite/g++.dg/plugin/selfassign.c: Likewise. * testsuite/g++.dg/plugin/dumb_plugin.c: Likewise. From-SVN: r193061
2012-11-01 08:34:44 +01:00
{
{"ipa", OPTGROUP_IPA},
{"loop", OPTGROUP_LOOP},
{"inline", OPTGROUP_INLINE},
{"omp", OPTGROUP_OMP},
invoke.texi: Update -fopt-info documentation. 2012-11-01 Sharad Singhai <singhai@google.com> * doc/invoke.texi: Update -fopt-info documentation. * dumpfile.c: Move dump_flags here from passes.c. Rename opt_info_options to optinfo_verbosity_options. Add optgroup_options. (dump_files): Add field for optinfo_flags in the static initializer. (dump_register): Handle additional parameter for optgroup_flags. (opt_info_enable_passes): Renamed opt_info_enable_all. Handle optgroup_flags. Fix documentation. (opt_info_switch_p_1): Handle optgroup options. (opt_info_switch_p): Handle optgroup_flags. Warn on multiple files. * dumpfile.h (dump_register): Additional argument for optgroup_flags. All callers updated. (struct dump_file_info): Add field for optgroup_flags. Define OPTGROUP_* flags. * tree-pass.h (struct opt_pass): Add addtional field for optinfo_flags. All opt_pass static initializers updated. * opts-global.c (dump_remap_tree_vectorizer_verbose): Use 'all' instead of 'optall'. (handle_common_deferred_options): Fix typo in error message. * passes.c (register_one_dump_file): Add argument for optgroup_flags. Turn on OPTGROUP_IPA for IPA passes. Move dump_flags from here to dumpfile.c. * statistics.c (statistics_early_init): Use OPTGROUP_NONE in call to dump_register. testsuite/ChangeLog * testsuite/gcc.dg/plugin/selfassign.c: Add opgtroup_flags initializer. * testsuite/gcc.dg/plugin/one_time_plugin.c: Likewise. * testsuite/g++.dg/plugin/selfassign.c: Likewise. * testsuite/g++.dg/plugin/dumb_plugin.c: Likewise. From-SVN: r193061
2012-11-01 08:34:44 +01:00
{"vec", OPTGROUP_VEC},
{"optall", OPTGROUP_ALL},
Convert dump and optgroup flags to enums gcc/brig/ChangeLog: * brigfrontend/brig-to-generic.cc (brig_to_generic::write_globals): Use TDF_NONE rather than 0. (dump_function): Likewise. gcc/c-family/ChangeLog: * c-pretty-print.c (c_pretty_printer::statement): Use TDF_NONE rather than 0. gcc/ChangeLog: * cfg.c (debug): Use TDF_NONE rather than 0. * cfghooks.c (debug): Likewise. * dumpfile.c (DUMP_FILE_INFO): Likewise; also for OPTGROUP. (struct dump_option_value_info): Convert to... (struct kv_pair): ...this template type. (dump_options): Convert to kv_pair<dump_flags_t>; use TDF_NONE rather than 0. (optinfo_verbosity_options): Likewise. (optgroup_options): Convert to kv_pair<optgroup_flags_t>; use OPTGROUP_NONE. (gcc::dump_manager::dump_register): Use optgroup_flags_t rather than int for "optgroup_flags" param. (dump_generic_expr_loc): Use dump_flags_t rather than int for "dump_kind" param. (dump_dec): Likewise. (dump_finish): Use TDF_NONE rather than 0. (gcc::dump_manager::opt_info_enable_passes): Use optgroup_flags_t rather than int for "optgroup_flags" param. Use TDF_NONE rather than 0. Update for change to option_ptr. (opt_info_switch_p_1): Convert "optgroup_flags" param from int * to optgroup_flags_t *. Use TDF_NONE and OPTGROUP_NONE rather than 0. Update for changes to optinfo_verbosity_options and optgroup_options. (opt_info_switch_p): Convert optgroup_flags from int to optgroup_flags_t. (dump_basic_block): Use dump_flags_t rather than int for "dump_kind" param. * dumpfile.h (TDF_ADDRESS, TDF_SLIM, TDF_RAW, TDF_DETAILS, TDF_STATS, TDF_BLOCKS, TDF_VOPS, TDF_LINENO, TDF_UID) TDF_STMTADDR, TDF_GRAPH, TDF_MEMSYMS, TDF_RHS_ONLY, TDF_ASMNAME, TDF_EH, TDF_NOUID, TDF_ALIAS, TDF_ENUMERATE_LOCALS, TDF_CSELIB, TDF_SCEV, TDF_GIMPLE, TDF_FOLDING, MSG_OPTIMIZED_LOCATIONS, MSG_MISSED_OPTIMIZATION, MSG_NOTE, MSG_ALL, TDF_COMPARE_DEBUG, TDF_NONE): Convert from macros to... (enum dump_flag): ...this new enum. (dump_flags_t): Update to use enum. (operator|, operator&, operator~, operator|=, operator&=): Implement for dump_flags_t. (OPTGROUP_NONE, OPTGROUP_IPA, OPTGROUP_LOOP, OPTGROUP_INLINE, OPTGROUP_OMP, OPTGROUP_VEC, OPTGROUP_OTHER, OPTGROUP_ALL): Convert from macros to... (enum optgroup_flag): ...this new enum. (optgroup_flags_t): New typedef. (operator|, operator|=): Implement for optgroup_flags_t. (struct dump_file_info): Convert field "alt_flags" to dump_flags_t. Convert field "optgroup_flags" to optgroup_flags_t. (dump_basic_block): Use dump_flags_t rather than int for param. (dump_generic_expr_loc): Likewise. (dump_dec): Likewise. (dump_register): Convert param "optgroup_flags" to optgroup_flags_t. (opt_info_enable_passes): Likewise. * early-remat.c (early_remat::dump_edge_list): Use TDF_NONE rather than 0. * gimple-pretty-print.c (debug): Likewise. * gimple-ssa-store-merging.c (bswap_replace): Likewise. (merged_store_group::apply_stores): Likewise. * gimple-ssa-strength-reduction.c (insert_initializers): Likewise. * gimple.c (verify_gimple_pp): Likewise. * graphite-poly.c (print_pbb_body): Likewise. * passes.c (pass_manager::register_one_dump_file): Convert local "optgroup_flags" to optgroup_flags_t. * print-tree.c (print_node): Use TDF_NONE rather than 0. (debug): Likewise. (debug_body): Likewise. * tree-pass.h (struct pass_data): Convert field "optgroup_flags" to optgroup_flags_t. * tree-pretty-print.c (print_struct_decl): Use TDF_NONE rather than 0. * tree-ssa-math-opts.c (convert_mult_to_fma_1): Likewise. (convert_mult_to_fma): Likewise. * tree-ssa-reassoc.c (undistribute_ops_list): Likewise. * tree-ssa-sccvn.c (vn_eliminate): Likewise. * tree-vect-data-refs.c (dump_lower_bound): Convert param "dump_kind" to dump_flags_t. From-SVN: r261325
2018-06-08 14:50:19 +02:00
{NULL, OPTGROUP_NONE}
};
Introduce gcc::dump_manager class 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-10-14 18:15:38 +02:00
gcc::dump_manager::dump_manager ():
m_next_dump (FIRST_AUTO_NUMBERED_DUMP),
m_extra_dump_files (NULL),
m_extra_dump_files_in_use (0),
m_extra_dump_files_alloced (0)
{
}
gcc::dump_manager::~dump_manager ()
{
for (size_t i = 0; i < m_extra_dump_files_in_use; i++)
{
dump_file_info *dfi = &m_extra_dump_files[i];
/* suffix, swtch, glob are statically allocated for the entries
in dump_files, and for statistics, but are dynamically allocated
for those for passes. */
if (dfi->owns_strings)
{
XDELETEVEC (const_cast <char *> (dfi->suffix));
XDELETEVEC (const_cast <char *> (dfi->swtch));
XDELETEVEC (const_cast <char *> (dfi->glob));
}
/* These, if non-NULL, are always dynamically allocated. */
XDELETEVEC (const_cast <char *> (dfi->pfilename));
XDELETEVEC (const_cast <char *> (dfi->alt_filename));
}
XDELETEVEC (m_extra_dump_files);
}
unsigned int
Introduce gcc::dump_manager class 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-10-14 18:15:38 +02:00
gcc::dump_manager::
dump_register (const char *suffix, const char *swtch, const char *glob,
Convert dump and optgroup flags to enums gcc/brig/ChangeLog: * brigfrontend/brig-to-generic.cc (brig_to_generic::write_globals): Use TDF_NONE rather than 0. (dump_function): Likewise. gcc/c-family/ChangeLog: * c-pretty-print.c (c_pretty_printer::statement): Use TDF_NONE rather than 0. gcc/ChangeLog: * cfg.c (debug): Use TDF_NONE rather than 0. * cfghooks.c (debug): Likewise. * dumpfile.c (DUMP_FILE_INFO): Likewise; also for OPTGROUP. (struct dump_option_value_info): Convert to... (struct kv_pair): ...this template type. (dump_options): Convert to kv_pair<dump_flags_t>; use TDF_NONE rather than 0. (optinfo_verbosity_options): Likewise. (optgroup_options): Convert to kv_pair<optgroup_flags_t>; use OPTGROUP_NONE. (gcc::dump_manager::dump_register): Use optgroup_flags_t rather than int for "optgroup_flags" param. (dump_generic_expr_loc): Use dump_flags_t rather than int for "dump_kind" param. (dump_dec): Likewise. (dump_finish): Use TDF_NONE rather than 0. (gcc::dump_manager::opt_info_enable_passes): Use optgroup_flags_t rather than int for "optgroup_flags" param. Use TDF_NONE rather than 0. Update for change to option_ptr. (opt_info_switch_p_1): Convert "optgroup_flags" param from int * to optgroup_flags_t *. Use TDF_NONE and OPTGROUP_NONE rather than 0. Update for changes to optinfo_verbosity_options and optgroup_options. (opt_info_switch_p): Convert optgroup_flags from int to optgroup_flags_t. (dump_basic_block): Use dump_flags_t rather than int for "dump_kind" param. * dumpfile.h (TDF_ADDRESS, TDF_SLIM, TDF_RAW, TDF_DETAILS, TDF_STATS, TDF_BLOCKS, TDF_VOPS, TDF_LINENO, TDF_UID) TDF_STMTADDR, TDF_GRAPH, TDF_MEMSYMS, TDF_RHS_ONLY, TDF_ASMNAME, TDF_EH, TDF_NOUID, TDF_ALIAS, TDF_ENUMERATE_LOCALS, TDF_CSELIB, TDF_SCEV, TDF_GIMPLE, TDF_FOLDING, MSG_OPTIMIZED_LOCATIONS, MSG_MISSED_OPTIMIZATION, MSG_NOTE, MSG_ALL, TDF_COMPARE_DEBUG, TDF_NONE): Convert from macros to... (enum dump_flag): ...this new enum. (dump_flags_t): Update to use enum. (operator|, operator&, operator~, operator|=, operator&=): Implement for dump_flags_t. (OPTGROUP_NONE, OPTGROUP_IPA, OPTGROUP_LOOP, OPTGROUP_INLINE, OPTGROUP_OMP, OPTGROUP_VEC, OPTGROUP_OTHER, OPTGROUP_ALL): Convert from macros to... (enum optgroup_flag): ...this new enum. (optgroup_flags_t): New typedef. (operator|, operator|=): Implement for optgroup_flags_t. (struct dump_file_info): Convert field "alt_flags" to dump_flags_t. Convert field "optgroup_flags" to optgroup_flags_t. (dump_basic_block): Use dump_flags_t rather than int for param. (dump_generic_expr_loc): Likewise. (dump_dec): Likewise. (dump_register): Convert param "optgroup_flags" to optgroup_flags_t. (opt_info_enable_passes): Likewise. * early-remat.c (early_remat::dump_edge_list): Use TDF_NONE rather than 0. * gimple-pretty-print.c (debug): Likewise. * gimple-ssa-store-merging.c (bswap_replace): Likewise. (merged_store_group::apply_stores): Likewise. * gimple-ssa-strength-reduction.c (insert_initializers): Likewise. * gimple.c (verify_gimple_pp): Likewise. * graphite-poly.c (print_pbb_body): Likewise. * passes.c (pass_manager::register_one_dump_file): Convert local "optgroup_flags" to optgroup_flags_t. * print-tree.c (print_node): Use TDF_NONE rather than 0. (debug): Likewise. (debug_body): Likewise. * tree-pass.h (struct pass_data): Convert field "optgroup_flags" to optgroup_flags_t. * tree-pretty-print.c (print_struct_decl): Use TDF_NONE rather than 0. * tree-ssa-math-opts.c (convert_mult_to_fma_1): Likewise. (convert_mult_to_fma): Likewise. * tree-ssa-reassoc.c (undistribute_ops_list): Likewise. * tree-ssa-sccvn.c (vn_eliminate): Likewise. * tree-vect-data-refs.c (dump_lower_bound): Convert param "dump_kind" to dump_flags_t. From-SVN: r261325
2018-06-08 14:50:19 +02:00
dump_kind dkind, optgroup_flags_t optgroup_flags,
bool take_ownership)
{
Introduce gcc::dump_manager class 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-10-14 18:15:38 +02:00
int num = m_next_dump++;
Introduce gcc::dump_manager class 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-10-14 18:15:38 +02:00
size_t count = m_extra_dump_files_in_use++;
Introduce gcc::dump_manager class 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-10-14 18:15:38 +02:00
if (count >= m_extra_dump_files_alloced)
{
Introduce gcc::dump_manager class 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-10-14 18:15:38 +02:00
if (m_extra_dump_files_alloced == 0)
m_extra_dump_files_alloced = 512;
else
Introduce gcc::dump_manager class 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-10-14 18:15:38 +02:00
m_extra_dump_files_alloced *= 2;
m_extra_dump_files = XRESIZEVEC (struct dump_file_info,
m_extra_dump_files,
m_extra_dump_files_alloced);
PR c++/80560 - warn on undefined memory operations involving non-trivial types gcc/c-family/ChangeLog: PR c++/80560 * c.opt (-Wclass-memaccess): New option. gcc/cp/ChangeLog: PR c++/80560 * call.c (first_non_public_field, maybe_warn_class_memaccess): New functions. (has_trivial_copy_assign_p, has_trivial_copy_p): Ditto. (build_cxx_call): Call maybe_warn_class_memaccess. gcc/ChangeLog: PR c++/80560 * dumpfile.c (dump_register): Avoid calling memset to initialize a class with a default ctor. * gcc.c (struct compiler): Remove const qualification. * genattrtab.c (gen_insn_reserv): Replace memset with initialization. * hash-table.h: Ditto. * ipa-cp.c (allocate_and_init_ipcp_value): Replace memset with assignment. * ipa-prop.c (ipa_free_edge_args_substructures): Ditto. * omp-low.c (lower_omp_ordered_clauses): Replace memset with default ctor. * params.h (struct param_info): Make struct members non-const. * tree-switch-conversion.c (emit_case_bit_tests): Replace memset with default initialization. * vec.h (vec_copy_construct, vec_default_construct): New helper functions. (vec<T>::copy, vec<T>::splice, vec<T>::reserve): Replace memcpy with vec_copy_construct. (vect<T>::quick_grow_cleared): Replace memset with default ctor. (vect<T>::vec_safe_grow_cleared, vec_safe_grow_cleared): Same. * doc/invoke.texi (-Wclass-memaccess): Document. libcpp/ChangeLog: PR c++/80560 * line-map.c (line_maps::~line_maps): Avoid calling htab_delete with a null pointer. (linemap_init): Avoid calling memset on an object of a non-trivial type. libitm/ChangeLog: PR c++/80560 * beginend.cc (GTM::gtm_thread::rollback): Avoid calling memset on an object of a non-trivial type. (GTM::gtm_transaction_cp::commit): Use assignment instead of memcpy to copy an object. * method-ml.cc (orec_iterator::reinit): Avoid -Wclass-memaccess. gcc/testsuite/ChangeLog: PR c++/80560 * g++.dg/Wclass-memaccess.C: New test. From-SVN: r249234
2017-06-16 05:48:59 +02:00
/* Construct a new object in the space allocated above. */
new (m_extra_dump_files + count) dump_file_info ();
}
else
{
/* Zero out the already constructed object. */
m_extra_dump_files[count] = dump_file_info ();
}
Introduce gcc::dump_manager class 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-10-14 18:15:38 +02:00
m_extra_dump_files[count].suffix = suffix;
m_extra_dump_files[count].swtch = swtch;
m_extra_dump_files[count].glob = glob;
m_extra_dump_files[count].dkind = dkind;
Introduce gcc::dump_manager class 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-10-14 18:15:38 +02:00
m_extra_dump_files[count].optgroup_flags = optgroup_flags;
m_extra_dump_files[count].num = num;
m_extra_dump_files[count].owns_strings = take_ownership;
return count + TDI_end;
}
/* Allow languages and middle-end to register their dumps before the
optimization passes. */
void
gcc::dump_manager::
register_dumps ()
{
lang_hooks.register_dumps (this);
/* If this assert fails, some FE registered more than
FIRST_ME_AUTO_NUMBERED_DUMP - FIRST_AUTO_NUMBERED_DUMP
dump files. Bump FIRST_ME_AUTO_NUMBERED_DUMP accordingly. */
gcc_assert (m_next_dump <= FIRST_ME_AUTO_NUMBERED_DUMP);
m_next_dump = FIRST_ME_AUTO_NUMBERED_DUMP;
dump_files[TDI_original].num = m_next_dump++;
dump_files[TDI_gimple].num = m_next_dump++;
dump_files[TDI_nested].num = m_next_dump++;
}
/* Return the dump_file_info for the given phase. */
struct dump_file_info *
Introduce gcc::dump_manager class 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-10-14 18:15:38 +02:00
gcc::dump_manager::
get_dump_file_info (int phase) const
{
if (phase < TDI_end)
return &dump_files[phase];
Introduce gcc::dump_manager class 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-10-14 18:15:38 +02:00
else if ((size_t) (phase - TDI_end) >= m_extra_dump_files_in_use)
return NULL;
else
Introduce gcc::dump_manager class 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-10-14 18:15:38 +02:00
return m_extra_dump_files + (phase - TDI_end);
}
/* Locate the dump_file_info with swtch equal to SWTCH,
or return NULL if no such dump_file_info exists. */
struct dump_file_info *
gcc::dump_manager::
get_dump_file_info_by_switch (const char *swtch) const
{
for (unsigned i = 0; i < m_extra_dump_files_in_use; i++)
read-rtl.c (parse_reg_note_name): Replace Yoda conditions with typical order conditions. * read-rtl.c (parse_reg_note_name): Replace Yoda conditions with typical order conditions. * sel-sched.c (extract_new_fences_from): Likewise. * config/visium/constraints.md (J, K, L): Likewise. * config/visium/predicates.md (const_shift_operand): Likewise. * config/visium/visium.c (visium_legitimize_address, visium_legitimize_reload_address): Likewise. * config/m68k/m68k.c (output_reg_adjust, emit_reg_adjust): Likewise. * config/arm/arm.c (arm_block_move_unaligned_straight): Likewise. * config/avr/constraints.md (Y01, Ym1, Y02, Ym2): Likewise. * config/avr/avr-log.c (avr_vdump, avr_log_set_avr_log, SET_DUMP_DETAIL): Likewise. * config/avr/predicates.md (const_8_16_24_operand): Likewise. * config/avr/avr.c (STR_PREFIX_P, avr_popcount_each_byte, avr_is_casesi_sequence, avr_casei_sequence_check_operands, avr_set_core_architecture, avr_set_current_function, avr_legitimize_reload_address, avr_asm_len, avr_print_operand, output_movqi, output_movsisf, avr_out_plus, avr_out_bitop, avr_out_fract, avr_adjust_insn_length, avr_encode_section_info, avr_2word_insn_p, output_reload_in_const, avr_has_nibble_0xf, avr_map_decompose, avr_fold_builtin): Likewise. * config/avr/driver-avr.c (avr_devicespecs_file): Likewise. * config/avr/gen-avr-mmcu-specs.c (str_prefix_p, print_mcu): Likewise. * config/i386/i386.c (ix86_parse_stringop_strategy_string): Likewise. * config/m32c/m32c-pragma.c (m32c_pragma_memregs): Likewise. * config/m32c/m32c.c (m32c_conditional_register_usage, m32c_address_cost): Likewise. * config/m32c/predicates.md (shiftcount_operand, longshiftcount_operand): Likewise. * config/iq2000/iq2000.c (iq2000_expand_prologue): Likewise. * config/nios2/nios2.c (nios2_handle_custom_fpu_insn_option, can_use_cdx_ldstw): Likewise. * config/nios2/nios2.h (CDX_REG_P): Likewise. * config/cr16/cr16.h (RETURN_ADDR_RTX, REGNO_MODE_OK_FOR_BASE_P): Likewise. * config/cr16/cr16.md (*mov<mode>_double): Likewise. * config/cr16/cr16.c (cr16_create_dwarf_for_multi_push): Likewise. * config/h8300/h8300.c (h8300_rtx_costs, get_shift_alg): Likewise. * config/vax/constraints.md (U06, U08, U16, CN6, S08, S16): Likewise. * config/vax/vax.c (adjacent_operands_p): Likewise. * config/ft32/constraints.md (L, b, KA): Likewise. * config/ft32/ft32.c (ft32_load_immediate, ft32_expand_prologue): Likewise. * cfgexpand.c (expand_stack_alignment): Likewise. * gcse.c (insert_expr_in_table): Likewise. * print-rtl.c (rtx_writer::print_rtx_operand_codes_E_and_V): Likewise. * cgraphunit.c (cgraph_node::expand): Likewise. * ira-build.c (setup_min_max_allocno_live_range_point): Likewise. * emit-rtl.c (add_insn): Likewise. * input.c (dump_location_info): Likewise. * passes.c (NEXT_PASS): Likewise. * read-rtl-function.c (parse_note_insn_name, function_reader::read_rtx_operand_r, function_reader::parse_mem_expr): Likewise. * sched-rgn.c (sched_rgn_init): Likewise. * diagnostic-show-locus.c (layout::show_ruler): Likewise. * combine.c (find_split_point, simplify_if_then_else, force_to_mode, if_then_else_cond, simplify_shift_const_1, simplify_comparison): Likewise. * explow.c (eliminate_constant_term): Likewise. * final.c (leaf_renumber_regs_insn): Likewise. * cfgrtl.c (print_rtl_with_bb): Likewise. * genhooks.c (emit_init_macros): Likewise. * poly-int.h (maybe_ne, maybe_le, maybe_lt): Likewise. * tree-data-ref.c (conflict_fn): Likewise. * selftest.c (assert_streq): Likewise. * expr.c (store_constructor_field, expand_expr_real_1): Likewise. * fold-const.c (fold_range_test, extract_muldiv_1, fold_truth_andor, fold_binary_loc, multiple_of_p): Likewise. * reload.c (push_reload, find_equiv_reg): Likewise. * et-forest.c (et_nca, et_below): Likewise. * dbxout.c (dbxout_symbol_location): Likewise. * reorg.c (relax_delay_slots): Likewise. * dojump.c (do_compare_rtx_and_jump): Likewise. * gengtype-parse.c (type): Likewise. * simplify-rtx.c (simplify_gen_ternary, simplify_gen_relational, simplify_const_relational_operation): Likewise. * reload1.c (do_output_reload): Likewise. * dumpfile.c (get_dump_file_info_by_switch): Likewise. * gengtype.c (type_for_name): Likewise. * gimple-ssa-sprintf.c (format_directive): Likewise. ada/ * gcc-interface/trans.c (Loop_Statement_to_gnu): Replace Yoda conditions with typical order conditions. * gcc-interface/misc.c (gnat_get_array_descr_info, default_pass_by_ref): Likewise. * gcc-interface/decl.c (gnat_to_gnu_entity): Likewise. * adaint.c (__gnat_tmp_name): Likewise. c-family/ * known-headers.cc (get_stdlib_header_for_name): Replace Yoda conditions with typical order conditions. c/ * c-typeck.c (comptypes_internal, function_types_compatible_p, perform_integral_promotions, digest_init): Replace Yoda conditions with typical order conditions. * c-decl.c (check_bitfield_type_and_width): Likewise. cp/ * name-lookup.c (get_std_name_hint): Replace Yoda conditions with typical order conditions. * class.c (check_bitfield_decl): Likewise. * pt.c (convert_template_argument): Likewise. * decl.c (duplicate_decls): Likewise. * typeck.c (commonparms): Likewise. fortran/ * scanner.c (preprocessor_line): Replace Yoda conditions with typical order conditions. * dependency.c (check_section_vs_section): Likewise. * trans-array.c (gfc_conv_expr_descriptor): Likewise. jit/ * jit-playback.c (get_type, playback::compile_to_file::copy_file, playback::context::acquire_mutex): Replace Yoda conditions with typical order conditions. * libgccjit.c (gcc_jit_context_new_struct_type, gcc_jit_struct_set_fields, gcc_jit_context_new_union_type, gcc_jit_context_new_function, gcc_jit_timer_pop): Likewise. * jit-builtins.c (matches_builtin): Likewise. * jit-recording.c (recording::compound_type::set_fields, recording::fields::write_reproducer, recording::rvalue::set_scope, recording::function::validate): Likewise. * jit-logging.c (logger::decref): Likewise. From-SVN: r255831
2017-12-19 18:11:57 +01:00
if (strcmp (m_extra_dump_files[i].swtch, swtch) == 0)
return &m_extra_dump_files[i];
/* Not found. */
return NULL;
}
/* Return the name of the dump file for the given phase.
The caller is responsible for calling free on the returned
buffer.
If the dump is not enabled, returns NULL. */
char *
Introduce gcc::dump_manager class 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-10-14 18:15:38 +02:00
gcc::dump_manager::
get_dump_file_name (int phase) const
{
struct dump_file_info *dfi;
if (phase == TDI_none)
return NULL;
dfi = get_dump_file_info (phase);
return get_dump_file_name (dfi);
}
/* Return the name of the dump file for the given dump_file_info.
The caller is responsible for calling free on the returned
buffer.
If the dump is not enabled, returns NULL. */
char *
gcc::dump_manager::
get_dump_file_name (struct dump_file_info *dfi) const
{
char dump_id[10];
gcc_assert (dfi);
if (dfi->pstate == 0)
return NULL;
/* If available, use the command line dump filename. */
if (dfi->pfilename)
return xstrdup (dfi->pfilename);
if (dfi->num < 0)
dump_id[0] = '\0';
else
{
/* (null), LANG, TREE, RTL, IPA. */
char suffix = " ltri"[dfi->dkind];
if (snprintf (dump_id, sizeof (dump_id), ".%03d%c", dfi->num, suffix) < 0)
dump_id[0] = '\0';
}
return concat (dump_base_name, dump_id, dfi->suffix, NULL);
}
/* Open a dump file called FILENAME. Some filenames are special and
refer to the standard streams. TRUNC indicates whether this is the
first open (so the file should be truncated, rather than appended).
An error message is emitted in the event of failure. */
static FILE *
dump_open (const char *filename, bool trunc)
{
if (strcmp ("stderr", filename) == 0)
return stderr;
if (strcmp ("stdout", filename) == 0
|| strcmp ("-", filename) == 0)
return stdout;
FILE *stream = fopen (filename, trunc ? "w" : "a");
if (!stream)
error ("could not open dump file %qs: %m", filename);
return stream;
}
/* For a given DFI, open an alternate dump filename (which could also
be a standard stream such as stdout/stderr). If the alternate dump
file cannot be opened, return NULL. */
static FILE *
dump_open_alternate_stream (struct dump_file_info *dfi)
{
if (!dfi->alt_filename)
return NULL;
if (dfi->alt_stream)
return dfi->alt_stream;
FILE *stream = dump_open (dfi->alt_filename, dfi->alt_state < 0);
if (stream)
dfi->alt_state = 1;
return stream;
}
Introduce dump_location_t gcc/ChangeLog: * cfgloop.c (get_loop_location): Convert return type from location_t to dump_user_location_t, replacing INSN_LOCATION lookups by implicit construction from rtx_insn *, and using dump_user_location_t::from_function_decl for the fallback case. * cfgloop.h (get_loop_location): Convert return type from location_t to dump_user_location_t. * cgraphunit.c (walk_polymorphic_call_targets): Update call to dump_printf_loc to pass in a dump_location_t rather than a location_t, via the gimple stmt. * coverage.c (get_coverage_counts): Update calls to dump_printf_loc to pass in dump_location_t rather than a location_t. * doc/optinfo.texi (Dump types): Convert example of dump_printf_loc from taking "locus" to taking "insn". Update description of the "_loc" calls to cover dump_location_t. * dumpfile.c: Include "backend.h", "gimple.h", "rtl.h", and "selftest.h". (dump_user_location_t::dump_user_location_t): New constructors, from gimple *stmt and rtx_insn *. (dump_user_location_t::from_function_decl): New function. (dump_loc): Make static. (dump_gimple_stmt_loc): Convert param "loc" from location_t to const dump_location_t &. (dump_generic_expr_loc): Delete. (dump_printf_loc): Convert param "loc" from location_t to const dump_location_t &. (selftest::test_impl_location): New function. (selftest::dumpfile_c_tests): New function. * dumpfile.h: Include "profile-count.h". (class dump_user_location_t): New class. (struct dump_impl_location_t): New struct. (class dump_location_t): New class. (dump_printf_loc): Convert 2nd param from source_location to const dump_location_t &. (dump_generic_expr_loc): Delete. (dump_gimple_stmt_loc): Convert 2nd param from source_location to const dump_location_t &. * gimple-fold.c (fold_gimple_assign): Update call to dump_printf_loc to pass in a dump_location_t rather than a location_t, via the gimple stmt. (gimple_fold_call): Likewise. * gimple-loop-interchange.cc (loop_cand::analyze_iloop_reduction_var): Update for change to check_reduction_path. (tree_loop_interchange::interchange): Update for change to find_loop_location. * graphite-isl-ast-to-gimple.c (scop_to_isl_ast): Update for change in return-type of find_loop_location. (graphite_regenerate_ast_isl): Likewise. * graphite-optimize-isl.c (optimize_isl): Likewise. * graphite.c (graphite_transform_loops): Likewise. * ipa-devirt.c (ipa_devirt): Update call to dump_printf_loc to pass in a dump_location_t rather than a location_t, via the gimple stmt. * ipa-prop.c (ipa_make_edge_direct_to_target): Likewise. * ipa.c (walk_polymorphic_call_targets): Likewise. * loop-unroll.c (report_unroll): Convert "locus" param from location_t to dump_location_t. (decide_unrolling): Update for change to get_loop_location's return type. * omp-grid.c (struct grid_prop): Convert field "target_loc" from location_t to dump_user_location_t. (grid_find_single_omp_among_assignments_1): Updates calls to dump_printf_loc to pass in a dump_location_t rather than a location_t, via the gimple stmt. (grid_parallel_clauses_gridifiable): Convert "tloc" from location_t to dump_location_t. Updates calls to dump_printf_loc to pass in a dump_location_t rather than a location_t, via the gimple stmt. (grid_inner_loop_gridifiable_p): Likewise. (grid_dist_follows_simple_pattern): Likewise. (grid_gfor_follows_tiling_pattern): Likewise. (grid_target_follows_gridifiable_pattern): Likewise. (grid_attempt_target_gridification): Convert initialization of local "grid" from memset to zero-initialization; FIXME: does this require C++11? Update call to dump_printf_loc to pass in a optinfo_location rather than a location_t, via the gimple stmt. * profile.c (read_profile_edge_counts): Updates call to dump_printf_loc to pass in a dump_location_t rather than a location_t (compute_branch_probabilities): Likewise. * selftest-run-tests.c (selftest::run_tests): Call dumpfile_c_tests. * selftest.h (dumpfile_c_tests): New decl. * tree-loop-distribution.c (pass_loop_distribution::execute): Update for change in return type of find_loop_location. * tree-parloops.c (parallelize_loops): Likewise. * tree-ssa-loop-ivcanon.c (try_unroll_loop_completely): Convert "locus" from location_t to dump_user_location_t. (canonicalize_loop_induction_variables): Likewise. * tree-ssa-loop-ivopts.c (tree_ssa_iv_optimize_loop): Update for change in return type of find_loop_location. * tree-ssa-loop-niter.c (number_of_iterations_exit): Update call to dump_printf_loc to pass in a dump_location_t rather than a location_t, via the stmt. * tree-ssa-sccvn.c (eliminate_dom_walker::before_dom_children): Likewise. * tree-vect-loop-manip.c (find_loop_location): Convert return type from source_location to dump_user_location_t. (vect_do_peeling): Update for above change. (vect_loop_versioning): Update for change in type of vect_location. * tree-vect-loop.c (check_reduction_path): Convert "loc" param from location_t to dump_user_location_t. (vect_estimate_min_profitable_iters): Update for change in type of vect_location. * tree-vect-slp.c (vect_print_slp_tree): Convert param "loc" from location_t to dump_location_t. (vect_slp_bb): Update for change in type of vect_location. * tree-vectorizer.c (vect_location): Convert from source_location to dump_user_location_t. (try_vectorize_loop_1): Update for change in vect_location's type. (vectorize_loops): Likewise. (increase_alignment): Likewise. * tree-vectorizer.h (vect_location): Convert from source_location to dump_user_location_t. (find_loop_location): Convert return type from source_location to dump_user_location_t. (check_reduction_path): Convert 1st param from location_t to dump_user_location_t. * value-prof.c (check_counter): Update call to dump_printf_loc to pass in a dump_user_location_t rather than a location_t; update call to error_at for change in type of "locus". (check_ic_target): Update call to dump_printf_loc to pass in a dump_user_location_t rather than a location_t, via the call_stmt. From-SVN: r262149
2018-06-26 15:34:59 +02:00
/* Construct a dump_user_location_t from STMT (using its location and
hotness). */
dump_user_location_t::dump_user_location_t (gimple *stmt)
: m_count (), m_loc (UNKNOWN_LOCATION)
{
if (stmt)
{
if (stmt->bb)
m_count = stmt->bb->count;
m_loc = gimple_location (stmt);
}
}
/* Construct a dump_user_location_t from an RTL instruction (using its
location and hotness). */
dump_user_location_t::dump_user_location_t (rtx_insn *insn)
: m_count (), m_loc (UNKNOWN_LOCATION)
{
if (insn)
{
basic_block bb = BLOCK_FOR_INSN (insn);
if (bb)
m_count = bb->count;
m_loc = INSN_LOCATION (insn);
}
}
/* Construct from a function declaration. This one requires spelling out
to avoid accidentally constructing from other kinds of tree. */
dump_user_location_t
dump_user_location_t::from_function_decl (tree fndecl)
{
gcc_assert (fndecl);
// FIXME: profile count for function?
return dump_user_location_t (profile_count (),
DECL_SOURCE_LOCATION (fndecl));
}
/* Print source location on DFILE if enabled. */
Introduce dump_location_t gcc/ChangeLog: * cfgloop.c (get_loop_location): Convert return type from location_t to dump_user_location_t, replacing INSN_LOCATION lookups by implicit construction from rtx_insn *, and using dump_user_location_t::from_function_decl for the fallback case. * cfgloop.h (get_loop_location): Convert return type from location_t to dump_user_location_t. * cgraphunit.c (walk_polymorphic_call_targets): Update call to dump_printf_loc to pass in a dump_location_t rather than a location_t, via the gimple stmt. * coverage.c (get_coverage_counts): Update calls to dump_printf_loc to pass in dump_location_t rather than a location_t. * doc/optinfo.texi (Dump types): Convert example of dump_printf_loc from taking "locus" to taking "insn". Update description of the "_loc" calls to cover dump_location_t. * dumpfile.c: Include "backend.h", "gimple.h", "rtl.h", and "selftest.h". (dump_user_location_t::dump_user_location_t): New constructors, from gimple *stmt and rtx_insn *. (dump_user_location_t::from_function_decl): New function. (dump_loc): Make static. (dump_gimple_stmt_loc): Convert param "loc" from location_t to const dump_location_t &. (dump_generic_expr_loc): Delete. (dump_printf_loc): Convert param "loc" from location_t to const dump_location_t &. (selftest::test_impl_location): New function. (selftest::dumpfile_c_tests): New function. * dumpfile.h: Include "profile-count.h". (class dump_user_location_t): New class. (struct dump_impl_location_t): New struct. (class dump_location_t): New class. (dump_printf_loc): Convert 2nd param from source_location to const dump_location_t &. (dump_generic_expr_loc): Delete. (dump_gimple_stmt_loc): Convert 2nd param from source_location to const dump_location_t &. * gimple-fold.c (fold_gimple_assign): Update call to dump_printf_loc to pass in a dump_location_t rather than a location_t, via the gimple stmt. (gimple_fold_call): Likewise. * gimple-loop-interchange.cc (loop_cand::analyze_iloop_reduction_var): Update for change to check_reduction_path. (tree_loop_interchange::interchange): Update for change to find_loop_location. * graphite-isl-ast-to-gimple.c (scop_to_isl_ast): Update for change in return-type of find_loop_location. (graphite_regenerate_ast_isl): Likewise. * graphite-optimize-isl.c (optimize_isl): Likewise. * graphite.c (graphite_transform_loops): Likewise. * ipa-devirt.c (ipa_devirt): Update call to dump_printf_loc to pass in a dump_location_t rather than a location_t, via the gimple stmt. * ipa-prop.c (ipa_make_edge_direct_to_target): Likewise. * ipa.c (walk_polymorphic_call_targets): Likewise. * loop-unroll.c (report_unroll): Convert "locus" param from location_t to dump_location_t. (decide_unrolling): Update for change to get_loop_location's return type. * omp-grid.c (struct grid_prop): Convert field "target_loc" from location_t to dump_user_location_t. (grid_find_single_omp_among_assignments_1): Updates calls to dump_printf_loc to pass in a dump_location_t rather than a location_t, via the gimple stmt. (grid_parallel_clauses_gridifiable): Convert "tloc" from location_t to dump_location_t. Updates calls to dump_printf_loc to pass in a dump_location_t rather than a location_t, via the gimple stmt. (grid_inner_loop_gridifiable_p): Likewise. (grid_dist_follows_simple_pattern): Likewise. (grid_gfor_follows_tiling_pattern): Likewise. (grid_target_follows_gridifiable_pattern): Likewise. (grid_attempt_target_gridification): Convert initialization of local "grid" from memset to zero-initialization; FIXME: does this require C++11? Update call to dump_printf_loc to pass in a optinfo_location rather than a location_t, via the gimple stmt. * profile.c (read_profile_edge_counts): Updates call to dump_printf_loc to pass in a dump_location_t rather than a location_t (compute_branch_probabilities): Likewise. * selftest-run-tests.c (selftest::run_tests): Call dumpfile_c_tests. * selftest.h (dumpfile_c_tests): New decl. * tree-loop-distribution.c (pass_loop_distribution::execute): Update for change in return type of find_loop_location. * tree-parloops.c (parallelize_loops): Likewise. * tree-ssa-loop-ivcanon.c (try_unroll_loop_completely): Convert "locus" from location_t to dump_user_location_t. (canonicalize_loop_induction_variables): Likewise. * tree-ssa-loop-ivopts.c (tree_ssa_iv_optimize_loop): Update for change in return type of find_loop_location. * tree-ssa-loop-niter.c (number_of_iterations_exit): Update call to dump_printf_loc to pass in a dump_location_t rather than a location_t, via the stmt. * tree-ssa-sccvn.c (eliminate_dom_walker::before_dom_children): Likewise. * tree-vect-loop-manip.c (find_loop_location): Convert return type from source_location to dump_user_location_t. (vect_do_peeling): Update for above change. (vect_loop_versioning): Update for change in type of vect_location. * tree-vect-loop.c (check_reduction_path): Convert "loc" param from location_t to dump_user_location_t. (vect_estimate_min_profitable_iters): Update for change in type of vect_location. * tree-vect-slp.c (vect_print_slp_tree): Convert param "loc" from location_t to dump_location_t. (vect_slp_bb): Update for change in type of vect_location. * tree-vectorizer.c (vect_location): Convert from source_location to dump_user_location_t. (try_vectorize_loop_1): Update for change in vect_location's type. (vectorize_loops): Likewise. (increase_alignment): Likewise. * tree-vectorizer.h (vect_location): Convert from source_location to dump_user_location_t. (find_loop_location): Convert return type from source_location to dump_user_location_t. (check_reduction_path): Convert 1st param from location_t to dump_user_location_t. * value-prof.c (check_counter): Update call to dump_printf_loc to pass in a dump_user_location_t rather than a location_t; update call to error_at for change in type of "locus". (check_ic_target): Update call to dump_printf_loc to pass in a dump_user_location_t rather than a location_t, via the call_stmt. From-SVN: r262149
2018-06-26 15:34:59 +02:00
static void
Introduce dump_flags_t type and use it instead of int type. 2017-05-17 Martin Liska <mliska@suse.cz> * class.c (dump_class_hierarchy): Introduce dump_flags_t type and use it instead of int type. (dump_vtable): Likewise. (dump_vtt): Likewise. * decl2.c (dump_tu): Likewise. 2017-05-17 Martin Liska <mliska@suse.cz> * c-common.h: Introduce dump_flags_t type and use it instead of int type. * c-gimplify.c (c_genericize): Likewise. * c-opts.c: Likewise. 2017-05-17 Martin Liska <mliska@suse.cz> * c-decl.c (c_parse_final_cleanups): Introduce dump_flags_t type and use it instead of int type. 2017-05-17 Martin Liska <mliska@suse.cz> * cfg.c: Introduce dump_flags_t type and use it instead of int type. * cfg.h: Likewise. * cfghooks.c: Likewise. * cfghooks.h (struct cfg_hooks): Likewise. * cfgrtl.c: Likewise. * cfgrtl.h: Likewise. * cgraph.c (cgraph_node::get_body): Likewise. * coretypes.h: Likewise. * domwalk.c: Likewise. * domwalk.h: Likewise. * dumpfile.c (struct dump_option_value_info): Likewise. (dump_enable_all): Likewise. (dump_switch_p_1): Likewise. (opt_info_switch_p): Likewise. * dumpfile.h (enum tree_dump_index): Likewise. (struct dump_file_info): Likewise. * genemit.c: Likewise. * generic-match-head.c: Likewise. * gengtype.c (open_base_files): Likewise. * gimple-pretty-print.c: Likewise. * gimple-pretty-print.h: Likewise. * graph.c (print_graph_cfg): Likewise. * graphite-scop-detection.c (dot_all_sese): Likewise. * ipa-devirt.c (build_type_inheritance_graph): Likewise. * loop-unroll.c (report_unroll): Likewise. * passes.c (pass_manager::register_one_dump_file): Likewise. * print-tree.c: Likewise. * statistics.c: Likewise. * tree-cfg.c: Likewise. * tree-cfg.h: Likewise. * tree-dfa.c: Likewise. * tree-dfa.h: Likewise. * tree-dump.c (dump_function): Likewise. * tree-dump.h (struct dump_info): Likewise. * tree-pretty-print.c: Likewise. * tree-pretty-print.h: Likewise. * tree-ssa-live.c: Likewise. * tree-ssa-live.h: Likewise. * tree-ssa-loop-ivcanon.c (try_unroll_loop_completely): Likewise. * tree-vect-loop.c: Likewise. * tree-vect-slp.c: Likewise. From-SVN: r248140
2017-05-17 11:01:36 +02:00
dump_loc (dump_flags_t dump_kind, FILE *dfile, source_location loc)
{
if (dump_kind)
{
if (LOCATION_LOCUS (loc) > BUILTINS_LOCATION)
dumpfile.c (dump_loc): Remove newline emission. 2013-09-16 Teresa Johnson <tejohnson@google.com> * dumpfile.c (dump_loc): Remove newline emission. * tree-vect-data-refs.c (vect_lanes_optab_supported_p): Add newline emission to dump_printf_loc calls where missing. (vect_mark_for_runtime_alias_test): Ditto. (vect_analyze_data_ref_dependence): Ditto. (vect_analyze_data_ref_dependences): Ditto. (vect_slp_analyze_data_ref_dependence): Ditto. (vect_slp_analyze_data_ref_dependences): Ditto. (vect_compute_data_ref_alignment): Ditto. (vect_update_misalignment_for_peel): Ditto. (vect_verify_datarefs_alignment): Ditto. (vector_alignment_reachable_p): Ditto. (vect_get_data_access_cost): Ditto. (vect_enhance_data_refs_alignment): Ditto. (vect_find_same_alignment_drs): Ditto. (vect_analyze_data_refs_alignment): Ditto. (vect_analyze_group_access): Ditto. (vect_analyze_data_ref_access): Ditto. (vect_analyze_data_ref_accesses): Ditto. (vect_prune_runtime_alias_test_list): Ditto. (vect_analyze_data_refs): Ditto. (vect_create_addr_base_for_vector_ref): Ditto. (vect_create_data_ref_ptr): Ditto. (vect_grouped_store_supported): Ditto. (vect_grouped_load_supported): Ditto. * value-prof.c (check_counter): Ditto. (check_ic_target): Ditto. * tree-vect-patterns.c (vect_recog_dot_prod_pattern): Ditto. (vect_recog_widen_mult_pattern): Ditto. (vect_recog_widen_sum_pattern): Ditto. (vect_recog_over_widening_pattern): Ditto. (vect_recog_widen_shift_pattern): Ditto. (vect_recog_rotate_pattern): Ditto. (vect_recog_vector_vector_shift_pattern): Ditto. (vect_recog_divmod_pattern): Ditto. (vect_recog_mixed_size_cond_pattern): Ditto. (vect_recog_bool_pattern): Ditto. (vect_pattern_recog_1): Ditto. (vect_pattern_recog): Ditto. * tree-vect-loop.c (vect_determine_vectorization_factor): Ditto. (vect_is_simple_iv_evolution): Ditto. (vect_analyze_scalar_cycles_1): Ditto. (vect_get_loop_niters): Ditto. (vect_analyze_loop_1): Ditto. (vect_analyze_loop_form): Ditto. (vect_analyze_loop_operations): Ditto. (vect_analyze_loop_2): Ditto. (vect_analyze_loop): Ditto. (report_vect_op): Ditto. (vect_is_slp_reduction): Ditto. (vect_is_simple_reduction_1): Ditto. (vect_get_known_peeling_cost): Ditto. (vect_estimate_min_profitable_iters): Ditto. (vect_model_reduction_cost): Ditto. (vect_model_induction_cost): Ditto. (get_initial_def_for_induction): Ditto. (vect_create_epilog_for_reduction): Ditto. (vectorizable_reduction): Ditto. (vectorizable_induction): Ditto. (vectorizable_live_operation): Ditto. (vect_loop_kill_debug_uses): Ditto. (vect_transform_loop): Ditto. * tree-vect-stmts.c (vect_mark_relevant): Ditto. (vect_stmt_relevant_p): Ditto. (process_use): Ditto. (vect_mark_stmts_to_be_vectorized): Ditto. (vect_model_simple_cost): Ditto. (vect_model_promotion_demotion_cost): Ditto. (vect_model_store_cost): Ditto. (vect_get_store_cost): Ditto. (vect_model_load_cost): Ditto. (vect_get_load_cost): Ditto. (vect_init_vector_1): Ditto. (vect_get_vec_def_for_operand): Ditto. (vect_finish_stmt_generation): Ditto. (vectorizable_call): Ditto. (vectorizable_conversion): Ditto. (vectorizable_assignment): Ditto. (vectorizable_shift): Ditto. (vectorizable_operation): Ditto. (vectorizable_store): Ditto. (vectorizable_load): Ditto. (vectorizable_condition): Ditto. (vect_analyze_stmt): Ditto. (vect_transform_stmt): Ditto. (vect_is_simple_use): Ditto. * tree-vect-loop-manip.c (slpeel_make_loop_iterate_ntimes): Ditto. (vect_can_advance_ivs_p): Ditto. (vect_update_ivs_after_vectorizer): Ditto. (vect_do_peeling_for_loop_bound): Ditto. (vect_gen_niters_for_prolog_loop): Ditto. (vect_update_inits_of_drs): Ditto. (vect_create_cond_for_alias_checks): Ditto. * tree-vect-slp.c (vect_get_and_check_slp_defs): Ditto. (vect_build_slp_tree_1): Ditto. (vect_supported_load_permutation_p): Ditto. (vect_analyze_slp_instance): Ditto. (vect_analyze_slp): Ditto. (vect_make_slp_decision): Ditto. (vect_detect_hybrid_slp): Ditto. (vect_bb_vectorization_profitable_p): Ditto. (vect_slp_analyze_bb_1): Ditto. (vect_update_slp_costs_according_to_vf): Ditto. (vect_get_mask_element): Ditto. (vect_transform_slp_perm_load): Ditto. (vect_schedule_slp_instance): Ditto. (vect_schedule_slp): Ditto. (vect_slp_transform_bb): Ditto. * profile.c (read_profile_edge_counts): Ditto. (compute_branch_probabilities): Ditto. * coverage.c (get_coverage_counts): Ditto. From-SVN: r202628
2013-09-16 15:40:02 +02:00
fprintf (dfile, "%s:%d:%d: note: ", LOCATION_FILE (loc),
LOCATION_LINE (loc), LOCATION_COLUMN (loc));
else if (current_function_decl)
dumpfile.c (dump_loc): Remove newline emission. 2013-09-16 Teresa Johnson <tejohnson@google.com> * dumpfile.c (dump_loc): Remove newline emission. * tree-vect-data-refs.c (vect_lanes_optab_supported_p): Add newline emission to dump_printf_loc calls where missing. (vect_mark_for_runtime_alias_test): Ditto. (vect_analyze_data_ref_dependence): Ditto. (vect_analyze_data_ref_dependences): Ditto. (vect_slp_analyze_data_ref_dependence): Ditto. (vect_slp_analyze_data_ref_dependences): Ditto. (vect_compute_data_ref_alignment): Ditto. (vect_update_misalignment_for_peel): Ditto. (vect_verify_datarefs_alignment): Ditto. (vector_alignment_reachable_p): Ditto. (vect_get_data_access_cost): Ditto. (vect_enhance_data_refs_alignment): Ditto. (vect_find_same_alignment_drs): Ditto. (vect_analyze_data_refs_alignment): Ditto. (vect_analyze_group_access): Ditto. (vect_analyze_data_ref_access): Ditto. (vect_analyze_data_ref_accesses): Ditto. (vect_prune_runtime_alias_test_list): Ditto. (vect_analyze_data_refs): Ditto. (vect_create_addr_base_for_vector_ref): Ditto. (vect_create_data_ref_ptr): Ditto. (vect_grouped_store_supported): Ditto. (vect_grouped_load_supported): Ditto. * value-prof.c (check_counter): Ditto. (check_ic_target): Ditto. * tree-vect-patterns.c (vect_recog_dot_prod_pattern): Ditto. (vect_recog_widen_mult_pattern): Ditto. (vect_recog_widen_sum_pattern): Ditto. (vect_recog_over_widening_pattern): Ditto. (vect_recog_widen_shift_pattern): Ditto. (vect_recog_rotate_pattern): Ditto. (vect_recog_vector_vector_shift_pattern): Ditto. (vect_recog_divmod_pattern): Ditto. (vect_recog_mixed_size_cond_pattern): Ditto. (vect_recog_bool_pattern): Ditto. (vect_pattern_recog_1): Ditto. (vect_pattern_recog): Ditto. * tree-vect-loop.c (vect_determine_vectorization_factor): Ditto. (vect_is_simple_iv_evolution): Ditto. (vect_analyze_scalar_cycles_1): Ditto. (vect_get_loop_niters): Ditto. (vect_analyze_loop_1): Ditto. (vect_analyze_loop_form): Ditto. (vect_analyze_loop_operations): Ditto. (vect_analyze_loop_2): Ditto. (vect_analyze_loop): Ditto. (report_vect_op): Ditto. (vect_is_slp_reduction): Ditto. (vect_is_simple_reduction_1): Ditto. (vect_get_known_peeling_cost): Ditto. (vect_estimate_min_profitable_iters): Ditto. (vect_model_reduction_cost): Ditto. (vect_model_induction_cost): Ditto. (get_initial_def_for_induction): Ditto. (vect_create_epilog_for_reduction): Ditto. (vectorizable_reduction): Ditto. (vectorizable_induction): Ditto. (vectorizable_live_operation): Ditto. (vect_loop_kill_debug_uses): Ditto. (vect_transform_loop): Ditto. * tree-vect-stmts.c (vect_mark_relevant): Ditto. (vect_stmt_relevant_p): Ditto. (process_use): Ditto. (vect_mark_stmts_to_be_vectorized): Ditto. (vect_model_simple_cost): Ditto. (vect_model_promotion_demotion_cost): Ditto. (vect_model_store_cost): Ditto. (vect_get_store_cost): Ditto. (vect_model_load_cost): Ditto. (vect_get_load_cost): Ditto. (vect_init_vector_1): Ditto. (vect_get_vec_def_for_operand): Ditto. (vect_finish_stmt_generation): Ditto. (vectorizable_call): Ditto. (vectorizable_conversion): Ditto. (vectorizable_assignment): Ditto. (vectorizable_shift): Ditto. (vectorizable_operation): Ditto. (vectorizable_store): Ditto. (vectorizable_load): Ditto. (vectorizable_condition): Ditto. (vect_analyze_stmt): Ditto. (vect_transform_stmt): Ditto. (vect_is_simple_use): Ditto. * tree-vect-loop-manip.c (slpeel_make_loop_iterate_ntimes): Ditto. (vect_can_advance_ivs_p): Ditto. (vect_update_ivs_after_vectorizer): Ditto. (vect_do_peeling_for_loop_bound): Ditto. (vect_gen_niters_for_prolog_loop): Ditto. (vect_update_inits_of_drs): Ditto. (vect_create_cond_for_alias_checks): Ditto. * tree-vect-slp.c (vect_get_and_check_slp_defs): Ditto. (vect_build_slp_tree_1): Ditto. (vect_supported_load_permutation_p): Ditto. (vect_analyze_slp_instance): Ditto. (vect_analyze_slp): Ditto. (vect_make_slp_decision): Ditto. (vect_detect_hybrid_slp): Ditto. (vect_bb_vectorization_profitable_p): Ditto. (vect_slp_analyze_bb_1): Ditto. (vect_update_slp_costs_according_to_vf): Ditto. (vect_get_mask_element): Ditto. (vect_transform_slp_perm_load): Ditto. (vect_schedule_slp_instance): Ditto. (vect_schedule_slp): Ditto. (vect_slp_transform_bb): Ditto. * profile.c (read_profile_edge_counts): Ditto. (compute_branch_probabilities): Ditto. * coverage.c (get_coverage_counts): Ditto. From-SVN: r202628
2013-09-16 15:40:02 +02:00
fprintf (dfile, "%s:%d:%d: note: ",
DECL_SOURCE_FILE (current_function_decl),
DECL_SOURCE_LINE (current_function_decl),
DECL_SOURCE_COLUMN (current_function_decl));
dumpfile.c: add indentation via DUMP_VECT_SCOPE This patch adds a concept of nested "scopes" to dumpfile.c's dump_*_loc calls, and wires it up to the DUMP_VECT_SCOPE macro in tree-vectorizer.h, so that the nested structure is shown in -fopt-info by indentation. For example, this converts -fopt-info-all e.g. from: test.c:8:3: note: === analyzing loop === test.c:8:3: note: === analyze_loop_nest === test.c:8:3: note: === vect_analyze_loop_form === test.c:8:3: note: === get_loop_niters === test.c:8:3: note: symbolic number of iterations is (unsigned int) n_9(D) test.c:8:3: note: not vectorized: loop contains function calls or data references that cannot be analyzed test.c:8:3: note: vectorized 0 loops in function to: test.c:8:3: note: === analyzing loop === test.c:8:3: note: === analyze_loop_nest === test.c:8:3: note: === vect_analyze_loop_form === test.c:8:3: note: === get_loop_niters === test.c:8:3: note: symbolic number of iterations is (unsigned int) n_9(D) test.c:8:3: note: not vectorized: loop contains function calls or data references that cannot be analyzed test.c:8:3: note: vectorized 0 loops in function showing that the "symbolic number of iterations" message is within the "=== analyze_loop_nest ===" (and not within the "=== vect_analyze_loop_form ==="). This is also enabling work for followups involving optimization records (allowing the records to directly capture the nested structure of the dump messages). gcc/ChangeLog: * dumpfile.c (dump_loc): Add indentation based on scope depth. (dump_scope_depth): New variable. (get_dump_scope_depth): New function. (dump_begin_scope): New function. (dump_end_scope): New function. * dumpfile.h (get_dump_scope_depth): New declaration. (dump_begin_scope): New declaration. (dump_end_scope): New declaration. (class auto_dump_scope): New class. (AUTO_DUMP_SCOPE): New macro. * tree-vectorizer.h (DUMP_VECT_SCOPE): Reimplement in terms of AUTO_DUMP_SCOPE. From-SVN: r262246
2018-06-29 11:56:40 +02:00
/* Indentation based on scope depth. */
fprintf (dfile, "%*s", get_dump_scope_depth (), "");
}
}
/* Dump gimple statement GS with SPC indentation spaces and
EXTRA_DUMP_FLAGS on the dump streams if DUMP_KIND is enabled. */
void
Introduce dump_flags_t type and use it instead of int type. 2017-05-17 Martin Liska <mliska@suse.cz> * class.c (dump_class_hierarchy): Introduce dump_flags_t type and use it instead of int type. (dump_vtable): Likewise. (dump_vtt): Likewise. * decl2.c (dump_tu): Likewise. 2017-05-17 Martin Liska <mliska@suse.cz> * c-common.h: Introduce dump_flags_t type and use it instead of int type. * c-gimplify.c (c_genericize): Likewise. * c-opts.c: Likewise. 2017-05-17 Martin Liska <mliska@suse.cz> * c-decl.c (c_parse_final_cleanups): Introduce dump_flags_t type and use it instead of int type. 2017-05-17 Martin Liska <mliska@suse.cz> * cfg.c: Introduce dump_flags_t type and use it instead of int type. * cfg.h: Likewise. * cfghooks.c: Likewise. * cfghooks.h (struct cfg_hooks): Likewise. * cfgrtl.c: Likewise. * cfgrtl.h: Likewise. * cgraph.c (cgraph_node::get_body): Likewise. * coretypes.h: Likewise. * domwalk.c: Likewise. * domwalk.h: Likewise. * dumpfile.c (struct dump_option_value_info): Likewise. (dump_enable_all): Likewise. (dump_switch_p_1): Likewise. (opt_info_switch_p): Likewise. * dumpfile.h (enum tree_dump_index): Likewise. (struct dump_file_info): Likewise. * genemit.c: Likewise. * generic-match-head.c: Likewise. * gengtype.c (open_base_files): Likewise. * gimple-pretty-print.c: Likewise. * gimple-pretty-print.h: Likewise. * graph.c (print_graph_cfg): Likewise. * graphite-scop-detection.c (dot_all_sese): Likewise. * ipa-devirt.c (build_type_inheritance_graph): Likewise. * loop-unroll.c (report_unroll): Likewise. * passes.c (pass_manager::register_one_dump_file): Likewise. * print-tree.c: Likewise. * statistics.c: Likewise. * tree-cfg.c: Likewise. * tree-cfg.h: Likewise. * tree-dfa.c: Likewise. * tree-dfa.h: Likewise. * tree-dump.c (dump_function): Likewise. * tree-dump.h (struct dump_info): Likewise. * tree-pretty-print.c: Likewise. * tree-pretty-print.h: Likewise. * tree-ssa-live.c: Likewise. * tree-ssa-live.h: Likewise. * tree-ssa-loop-ivcanon.c (try_unroll_loop_completely): Likewise. * tree-vect-loop.c: Likewise. * tree-vect-slp.c: Likewise. From-SVN: r248140
2017-05-17 11:01:36 +02:00
dump_gimple_stmt (dump_flags_t dump_kind, dump_flags_t extra_dump_flags,
gimple *gs, int spc)
{
if (dump_file && (dump_kind & pflags))
print_gimple_stmt (dump_file, gs, spc, dump_flags | extra_dump_flags);
if (alt_dump_file && (dump_kind & alt_flags))
print_gimple_stmt (alt_dump_file, gs, spc, dump_flags | extra_dump_flags);
}
/* Similar to dump_gimple_stmt, except additionally print source location. */
void
Introduce dump_location_t gcc/ChangeLog: * cfgloop.c (get_loop_location): Convert return type from location_t to dump_user_location_t, replacing INSN_LOCATION lookups by implicit construction from rtx_insn *, and using dump_user_location_t::from_function_decl for the fallback case. * cfgloop.h (get_loop_location): Convert return type from location_t to dump_user_location_t. * cgraphunit.c (walk_polymorphic_call_targets): Update call to dump_printf_loc to pass in a dump_location_t rather than a location_t, via the gimple stmt. * coverage.c (get_coverage_counts): Update calls to dump_printf_loc to pass in dump_location_t rather than a location_t. * doc/optinfo.texi (Dump types): Convert example of dump_printf_loc from taking "locus" to taking "insn". Update description of the "_loc" calls to cover dump_location_t. * dumpfile.c: Include "backend.h", "gimple.h", "rtl.h", and "selftest.h". (dump_user_location_t::dump_user_location_t): New constructors, from gimple *stmt and rtx_insn *. (dump_user_location_t::from_function_decl): New function. (dump_loc): Make static. (dump_gimple_stmt_loc): Convert param "loc" from location_t to const dump_location_t &. (dump_generic_expr_loc): Delete. (dump_printf_loc): Convert param "loc" from location_t to const dump_location_t &. (selftest::test_impl_location): New function. (selftest::dumpfile_c_tests): New function. * dumpfile.h: Include "profile-count.h". (class dump_user_location_t): New class. (struct dump_impl_location_t): New struct. (class dump_location_t): New class. (dump_printf_loc): Convert 2nd param from source_location to const dump_location_t &. (dump_generic_expr_loc): Delete. (dump_gimple_stmt_loc): Convert 2nd param from source_location to const dump_location_t &. * gimple-fold.c (fold_gimple_assign): Update call to dump_printf_loc to pass in a dump_location_t rather than a location_t, via the gimple stmt. (gimple_fold_call): Likewise. * gimple-loop-interchange.cc (loop_cand::analyze_iloop_reduction_var): Update for change to check_reduction_path. (tree_loop_interchange::interchange): Update for change to find_loop_location. * graphite-isl-ast-to-gimple.c (scop_to_isl_ast): Update for change in return-type of find_loop_location. (graphite_regenerate_ast_isl): Likewise. * graphite-optimize-isl.c (optimize_isl): Likewise. * graphite.c (graphite_transform_loops): Likewise. * ipa-devirt.c (ipa_devirt): Update call to dump_printf_loc to pass in a dump_location_t rather than a location_t, via the gimple stmt. * ipa-prop.c (ipa_make_edge_direct_to_target): Likewise. * ipa.c (walk_polymorphic_call_targets): Likewise. * loop-unroll.c (report_unroll): Convert "locus" param from location_t to dump_location_t. (decide_unrolling): Update for change to get_loop_location's return type. * omp-grid.c (struct grid_prop): Convert field "target_loc" from location_t to dump_user_location_t. (grid_find_single_omp_among_assignments_1): Updates calls to dump_printf_loc to pass in a dump_location_t rather than a location_t, via the gimple stmt. (grid_parallel_clauses_gridifiable): Convert "tloc" from location_t to dump_location_t. Updates calls to dump_printf_loc to pass in a dump_location_t rather than a location_t, via the gimple stmt. (grid_inner_loop_gridifiable_p): Likewise. (grid_dist_follows_simple_pattern): Likewise. (grid_gfor_follows_tiling_pattern): Likewise. (grid_target_follows_gridifiable_pattern): Likewise. (grid_attempt_target_gridification): Convert initialization of local "grid" from memset to zero-initialization; FIXME: does this require C++11? Update call to dump_printf_loc to pass in a optinfo_location rather than a location_t, via the gimple stmt. * profile.c (read_profile_edge_counts): Updates call to dump_printf_loc to pass in a dump_location_t rather than a location_t (compute_branch_probabilities): Likewise. * selftest-run-tests.c (selftest::run_tests): Call dumpfile_c_tests. * selftest.h (dumpfile_c_tests): New decl. * tree-loop-distribution.c (pass_loop_distribution::execute): Update for change in return type of find_loop_location. * tree-parloops.c (parallelize_loops): Likewise. * tree-ssa-loop-ivcanon.c (try_unroll_loop_completely): Convert "locus" from location_t to dump_user_location_t. (canonicalize_loop_induction_variables): Likewise. * tree-ssa-loop-ivopts.c (tree_ssa_iv_optimize_loop): Update for change in return type of find_loop_location. * tree-ssa-loop-niter.c (number_of_iterations_exit): Update call to dump_printf_loc to pass in a dump_location_t rather than a location_t, via the stmt. * tree-ssa-sccvn.c (eliminate_dom_walker::before_dom_children): Likewise. * tree-vect-loop-manip.c (find_loop_location): Convert return type from source_location to dump_user_location_t. (vect_do_peeling): Update for above change. (vect_loop_versioning): Update for change in type of vect_location. * tree-vect-loop.c (check_reduction_path): Convert "loc" param from location_t to dump_user_location_t. (vect_estimate_min_profitable_iters): Update for change in type of vect_location. * tree-vect-slp.c (vect_print_slp_tree): Convert param "loc" from location_t to dump_location_t. (vect_slp_bb): Update for change in type of vect_location. * tree-vectorizer.c (vect_location): Convert from source_location to dump_user_location_t. (try_vectorize_loop_1): Update for change in vect_location's type. (vectorize_loops): Likewise. (increase_alignment): Likewise. * tree-vectorizer.h (vect_location): Convert from source_location to dump_user_location_t. (find_loop_location): Convert return type from source_location to dump_user_location_t. (check_reduction_path): Convert 1st param from location_t to dump_user_location_t. * value-prof.c (check_counter): Update call to dump_printf_loc to pass in a dump_user_location_t rather than a location_t; update call to error_at for change in type of "locus". (check_ic_target): Update call to dump_printf_loc to pass in a dump_user_location_t rather than a location_t, via the call_stmt. From-SVN: r262149
2018-06-26 15:34:59 +02:00
dump_gimple_stmt_loc (dump_flags_t dump_kind, const dump_location_t &loc,
Introduce dump_flags_t type and use it instead of int type. 2017-05-17 Martin Liska <mliska@suse.cz> * class.c (dump_class_hierarchy): Introduce dump_flags_t type and use it instead of int type. (dump_vtable): Likewise. (dump_vtt): Likewise. * decl2.c (dump_tu): Likewise. 2017-05-17 Martin Liska <mliska@suse.cz> * c-common.h: Introduce dump_flags_t type and use it instead of int type. * c-gimplify.c (c_genericize): Likewise. * c-opts.c: Likewise. 2017-05-17 Martin Liska <mliska@suse.cz> * c-decl.c (c_parse_final_cleanups): Introduce dump_flags_t type and use it instead of int type. 2017-05-17 Martin Liska <mliska@suse.cz> * cfg.c: Introduce dump_flags_t type and use it instead of int type. * cfg.h: Likewise. * cfghooks.c: Likewise. * cfghooks.h (struct cfg_hooks): Likewise. * cfgrtl.c: Likewise. * cfgrtl.h: Likewise. * cgraph.c (cgraph_node::get_body): Likewise. * coretypes.h: Likewise. * domwalk.c: Likewise. * domwalk.h: Likewise. * dumpfile.c (struct dump_option_value_info): Likewise. (dump_enable_all): Likewise. (dump_switch_p_1): Likewise. (opt_info_switch_p): Likewise. * dumpfile.h (enum tree_dump_index): Likewise. (struct dump_file_info): Likewise. * genemit.c: Likewise. * generic-match-head.c: Likewise. * gengtype.c (open_base_files): Likewise. * gimple-pretty-print.c: Likewise. * gimple-pretty-print.h: Likewise. * graph.c (print_graph_cfg): Likewise. * graphite-scop-detection.c (dot_all_sese): Likewise. * ipa-devirt.c (build_type_inheritance_graph): Likewise. * loop-unroll.c (report_unroll): Likewise. * passes.c (pass_manager::register_one_dump_file): Likewise. * print-tree.c: Likewise. * statistics.c: Likewise. * tree-cfg.c: Likewise. * tree-cfg.h: Likewise. * tree-dfa.c: Likewise. * tree-dfa.h: Likewise. * tree-dump.c (dump_function): Likewise. * tree-dump.h (struct dump_info): Likewise. * tree-pretty-print.c: Likewise. * tree-pretty-print.h: Likewise. * tree-ssa-live.c: Likewise. * tree-ssa-live.h: Likewise. * tree-ssa-loop-ivcanon.c (try_unroll_loop_completely): Likewise. * tree-vect-loop.c: Likewise. * tree-vect-slp.c: Likewise. From-SVN: r248140
2017-05-17 11:01:36 +02:00
dump_flags_t extra_dump_flags, gimple *gs, int spc)
{
Introduce dump_location_t gcc/ChangeLog: * cfgloop.c (get_loop_location): Convert return type from location_t to dump_user_location_t, replacing INSN_LOCATION lookups by implicit construction from rtx_insn *, and using dump_user_location_t::from_function_decl for the fallback case. * cfgloop.h (get_loop_location): Convert return type from location_t to dump_user_location_t. * cgraphunit.c (walk_polymorphic_call_targets): Update call to dump_printf_loc to pass in a dump_location_t rather than a location_t, via the gimple stmt. * coverage.c (get_coverage_counts): Update calls to dump_printf_loc to pass in dump_location_t rather than a location_t. * doc/optinfo.texi (Dump types): Convert example of dump_printf_loc from taking "locus" to taking "insn". Update description of the "_loc" calls to cover dump_location_t. * dumpfile.c: Include "backend.h", "gimple.h", "rtl.h", and "selftest.h". (dump_user_location_t::dump_user_location_t): New constructors, from gimple *stmt and rtx_insn *. (dump_user_location_t::from_function_decl): New function. (dump_loc): Make static. (dump_gimple_stmt_loc): Convert param "loc" from location_t to const dump_location_t &. (dump_generic_expr_loc): Delete. (dump_printf_loc): Convert param "loc" from location_t to const dump_location_t &. (selftest::test_impl_location): New function. (selftest::dumpfile_c_tests): New function. * dumpfile.h: Include "profile-count.h". (class dump_user_location_t): New class. (struct dump_impl_location_t): New struct. (class dump_location_t): New class. (dump_printf_loc): Convert 2nd param from source_location to const dump_location_t &. (dump_generic_expr_loc): Delete. (dump_gimple_stmt_loc): Convert 2nd param from source_location to const dump_location_t &. * gimple-fold.c (fold_gimple_assign): Update call to dump_printf_loc to pass in a dump_location_t rather than a location_t, via the gimple stmt. (gimple_fold_call): Likewise. * gimple-loop-interchange.cc (loop_cand::analyze_iloop_reduction_var): Update for change to check_reduction_path. (tree_loop_interchange::interchange): Update for change to find_loop_location. * graphite-isl-ast-to-gimple.c (scop_to_isl_ast): Update for change in return-type of find_loop_location. (graphite_regenerate_ast_isl): Likewise. * graphite-optimize-isl.c (optimize_isl): Likewise. * graphite.c (graphite_transform_loops): Likewise. * ipa-devirt.c (ipa_devirt): Update call to dump_printf_loc to pass in a dump_location_t rather than a location_t, via the gimple stmt. * ipa-prop.c (ipa_make_edge_direct_to_target): Likewise. * ipa.c (walk_polymorphic_call_targets): Likewise. * loop-unroll.c (report_unroll): Convert "locus" param from location_t to dump_location_t. (decide_unrolling): Update for change to get_loop_location's return type. * omp-grid.c (struct grid_prop): Convert field "target_loc" from location_t to dump_user_location_t. (grid_find_single_omp_among_assignments_1): Updates calls to dump_printf_loc to pass in a dump_location_t rather than a location_t, via the gimple stmt. (grid_parallel_clauses_gridifiable): Convert "tloc" from location_t to dump_location_t. Updates calls to dump_printf_loc to pass in a dump_location_t rather than a location_t, via the gimple stmt. (grid_inner_loop_gridifiable_p): Likewise. (grid_dist_follows_simple_pattern): Likewise. (grid_gfor_follows_tiling_pattern): Likewise. (grid_target_follows_gridifiable_pattern): Likewise. (grid_attempt_target_gridification): Convert initialization of local "grid" from memset to zero-initialization; FIXME: does this require C++11? Update call to dump_printf_loc to pass in a optinfo_location rather than a location_t, via the gimple stmt. * profile.c (read_profile_edge_counts): Updates call to dump_printf_loc to pass in a dump_location_t rather than a location_t (compute_branch_probabilities): Likewise. * selftest-run-tests.c (selftest::run_tests): Call dumpfile_c_tests. * selftest.h (dumpfile_c_tests): New decl. * tree-loop-distribution.c (pass_loop_distribution::execute): Update for change in return type of find_loop_location. * tree-parloops.c (parallelize_loops): Likewise. * tree-ssa-loop-ivcanon.c (try_unroll_loop_completely): Convert "locus" from location_t to dump_user_location_t. (canonicalize_loop_induction_variables): Likewise. * tree-ssa-loop-ivopts.c (tree_ssa_iv_optimize_loop): Update for change in return type of find_loop_location. * tree-ssa-loop-niter.c (number_of_iterations_exit): Update call to dump_printf_loc to pass in a dump_location_t rather than a location_t, via the stmt. * tree-ssa-sccvn.c (eliminate_dom_walker::before_dom_children): Likewise. * tree-vect-loop-manip.c (find_loop_location): Convert return type from source_location to dump_user_location_t. (vect_do_peeling): Update for above change. (vect_loop_versioning): Update for change in type of vect_location. * tree-vect-loop.c (check_reduction_path): Convert "loc" param from location_t to dump_user_location_t. (vect_estimate_min_profitable_iters): Update for change in type of vect_location. * tree-vect-slp.c (vect_print_slp_tree): Convert param "loc" from location_t to dump_location_t. (vect_slp_bb): Update for change in type of vect_location. * tree-vectorizer.c (vect_location): Convert from source_location to dump_user_location_t. (try_vectorize_loop_1): Update for change in vect_location's type. (vectorize_loops): Likewise. (increase_alignment): Likewise. * tree-vectorizer.h (vect_location): Convert from source_location to dump_user_location_t. (find_loop_location): Convert return type from source_location to dump_user_location_t. (check_reduction_path): Convert 1st param from location_t to dump_user_location_t. * value-prof.c (check_counter): Update call to dump_printf_loc to pass in a dump_user_location_t rather than a location_t; update call to error_at for change in type of "locus". (check_ic_target): Update call to dump_printf_loc to pass in a dump_user_location_t rather than a location_t, via the call_stmt. From-SVN: r262149
2018-06-26 15:34:59 +02:00
location_t srcloc = loc.get_location_t ();
if (dump_file && (dump_kind & pflags))
{
Introduce dump_location_t gcc/ChangeLog: * cfgloop.c (get_loop_location): Convert return type from location_t to dump_user_location_t, replacing INSN_LOCATION lookups by implicit construction from rtx_insn *, and using dump_user_location_t::from_function_decl for the fallback case. * cfgloop.h (get_loop_location): Convert return type from location_t to dump_user_location_t. * cgraphunit.c (walk_polymorphic_call_targets): Update call to dump_printf_loc to pass in a dump_location_t rather than a location_t, via the gimple stmt. * coverage.c (get_coverage_counts): Update calls to dump_printf_loc to pass in dump_location_t rather than a location_t. * doc/optinfo.texi (Dump types): Convert example of dump_printf_loc from taking "locus" to taking "insn". Update description of the "_loc" calls to cover dump_location_t. * dumpfile.c: Include "backend.h", "gimple.h", "rtl.h", and "selftest.h". (dump_user_location_t::dump_user_location_t): New constructors, from gimple *stmt and rtx_insn *. (dump_user_location_t::from_function_decl): New function. (dump_loc): Make static. (dump_gimple_stmt_loc): Convert param "loc" from location_t to const dump_location_t &. (dump_generic_expr_loc): Delete. (dump_printf_loc): Convert param "loc" from location_t to const dump_location_t &. (selftest::test_impl_location): New function. (selftest::dumpfile_c_tests): New function. * dumpfile.h: Include "profile-count.h". (class dump_user_location_t): New class. (struct dump_impl_location_t): New struct. (class dump_location_t): New class. (dump_printf_loc): Convert 2nd param from source_location to const dump_location_t &. (dump_generic_expr_loc): Delete. (dump_gimple_stmt_loc): Convert 2nd param from source_location to const dump_location_t &. * gimple-fold.c (fold_gimple_assign): Update call to dump_printf_loc to pass in a dump_location_t rather than a location_t, via the gimple stmt. (gimple_fold_call): Likewise. * gimple-loop-interchange.cc (loop_cand::analyze_iloop_reduction_var): Update for change to check_reduction_path. (tree_loop_interchange::interchange): Update for change to find_loop_location. * graphite-isl-ast-to-gimple.c (scop_to_isl_ast): Update for change in return-type of find_loop_location. (graphite_regenerate_ast_isl): Likewise. * graphite-optimize-isl.c (optimize_isl): Likewise. * graphite.c (graphite_transform_loops): Likewise. * ipa-devirt.c (ipa_devirt): Update call to dump_printf_loc to pass in a dump_location_t rather than a location_t, via the gimple stmt. * ipa-prop.c (ipa_make_edge_direct_to_target): Likewise. * ipa.c (walk_polymorphic_call_targets): Likewise. * loop-unroll.c (report_unroll): Convert "locus" param from location_t to dump_location_t. (decide_unrolling): Update for change to get_loop_location's return type. * omp-grid.c (struct grid_prop): Convert field "target_loc" from location_t to dump_user_location_t. (grid_find_single_omp_among_assignments_1): Updates calls to dump_printf_loc to pass in a dump_location_t rather than a location_t, via the gimple stmt. (grid_parallel_clauses_gridifiable): Convert "tloc" from location_t to dump_location_t. Updates calls to dump_printf_loc to pass in a dump_location_t rather than a location_t, via the gimple stmt. (grid_inner_loop_gridifiable_p): Likewise. (grid_dist_follows_simple_pattern): Likewise. (grid_gfor_follows_tiling_pattern): Likewise. (grid_target_follows_gridifiable_pattern): Likewise. (grid_attempt_target_gridification): Convert initialization of local "grid" from memset to zero-initialization; FIXME: does this require C++11? Update call to dump_printf_loc to pass in a optinfo_location rather than a location_t, via the gimple stmt. * profile.c (read_profile_edge_counts): Updates call to dump_printf_loc to pass in a dump_location_t rather than a location_t (compute_branch_probabilities): Likewise. * selftest-run-tests.c (selftest::run_tests): Call dumpfile_c_tests. * selftest.h (dumpfile_c_tests): New decl. * tree-loop-distribution.c (pass_loop_distribution::execute): Update for change in return type of find_loop_location. * tree-parloops.c (parallelize_loops): Likewise. * tree-ssa-loop-ivcanon.c (try_unroll_loop_completely): Convert "locus" from location_t to dump_user_location_t. (canonicalize_loop_induction_variables): Likewise. * tree-ssa-loop-ivopts.c (tree_ssa_iv_optimize_loop): Update for change in return type of find_loop_location. * tree-ssa-loop-niter.c (number_of_iterations_exit): Update call to dump_printf_loc to pass in a dump_location_t rather than a location_t, via the stmt. * tree-ssa-sccvn.c (eliminate_dom_walker::before_dom_children): Likewise. * tree-vect-loop-manip.c (find_loop_location): Convert return type from source_location to dump_user_location_t. (vect_do_peeling): Update for above change. (vect_loop_versioning): Update for change in type of vect_location. * tree-vect-loop.c (check_reduction_path): Convert "loc" param from location_t to dump_user_location_t. (vect_estimate_min_profitable_iters): Update for change in type of vect_location. * tree-vect-slp.c (vect_print_slp_tree): Convert param "loc" from location_t to dump_location_t. (vect_slp_bb): Update for change in type of vect_location. * tree-vectorizer.c (vect_location): Convert from source_location to dump_user_location_t. (try_vectorize_loop_1): Update for change in vect_location's type. (vectorize_loops): Likewise. (increase_alignment): Likewise. * tree-vectorizer.h (vect_location): Convert from source_location to dump_user_location_t. (find_loop_location): Convert return type from source_location to dump_user_location_t. (check_reduction_path): Convert 1st param from location_t to dump_user_location_t. * value-prof.c (check_counter): Update call to dump_printf_loc to pass in a dump_user_location_t rather than a location_t; update call to error_at for change in type of "locus". (check_ic_target): Update call to dump_printf_loc to pass in a dump_user_location_t rather than a location_t, via the call_stmt. From-SVN: r262149
2018-06-26 15:34:59 +02:00
dump_loc (dump_kind, dump_file, srcloc);
print_gimple_stmt (dump_file, gs, spc, dump_flags | extra_dump_flags);
}
if (alt_dump_file && (dump_kind & alt_flags))
{
Introduce dump_location_t gcc/ChangeLog: * cfgloop.c (get_loop_location): Convert return type from location_t to dump_user_location_t, replacing INSN_LOCATION lookups by implicit construction from rtx_insn *, and using dump_user_location_t::from_function_decl for the fallback case. * cfgloop.h (get_loop_location): Convert return type from location_t to dump_user_location_t. * cgraphunit.c (walk_polymorphic_call_targets): Update call to dump_printf_loc to pass in a dump_location_t rather than a location_t, via the gimple stmt. * coverage.c (get_coverage_counts): Update calls to dump_printf_loc to pass in dump_location_t rather than a location_t. * doc/optinfo.texi (Dump types): Convert example of dump_printf_loc from taking "locus" to taking "insn". Update description of the "_loc" calls to cover dump_location_t. * dumpfile.c: Include "backend.h", "gimple.h", "rtl.h", and "selftest.h". (dump_user_location_t::dump_user_location_t): New constructors, from gimple *stmt and rtx_insn *. (dump_user_location_t::from_function_decl): New function. (dump_loc): Make static. (dump_gimple_stmt_loc): Convert param "loc" from location_t to const dump_location_t &. (dump_generic_expr_loc): Delete. (dump_printf_loc): Convert param "loc" from location_t to const dump_location_t &. (selftest::test_impl_location): New function. (selftest::dumpfile_c_tests): New function. * dumpfile.h: Include "profile-count.h". (class dump_user_location_t): New class. (struct dump_impl_location_t): New struct. (class dump_location_t): New class. (dump_printf_loc): Convert 2nd param from source_location to const dump_location_t &. (dump_generic_expr_loc): Delete. (dump_gimple_stmt_loc): Convert 2nd param from source_location to const dump_location_t &. * gimple-fold.c (fold_gimple_assign): Update call to dump_printf_loc to pass in a dump_location_t rather than a location_t, via the gimple stmt. (gimple_fold_call): Likewise. * gimple-loop-interchange.cc (loop_cand::analyze_iloop_reduction_var): Update for change to check_reduction_path. (tree_loop_interchange::interchange): Update for change to find_loop_location. * graphite-isl-ast-to-gimple.c (scop_to_isl_ast): Update for change in return-type of find_loop_location. (graphite_regenerate_ast_isl): Likewise. * graphite-optimize-isl.c (optimize_isl): Likewise. * graphite.c (graphite_transform_loops): Likewise. * ipa-devirt.c (ipa_devirt): Update call to dump_printf_loc to pass in a dump_location_t rather than a location_t, via the gimple stmt. * ipa-prop.c (ipa_make_edge_direct_to_target): Likewise. * ipa.c (walk_polymorphic_call_targets): Likewise. * loop-unroll.c (report_unroll): Convert "locus" param from location_t to dump_location_t. (decide_unrolling): Update for change to get_loop_location's return type. * omp-grid.c (struct grid_prop): Convert field "target_loc" from location_t to dump_user_location_t. (grid_find_single_omp_among_assignments_1): Updates calls to dump_printf_loc to pass in a dump_location_t rather than a location_t, via the gimple stmt. (grid_parallel_clauses_gridifiable): Convert "tloc" from location_t to dump_location_t. Updates calls to dump_printf_loc to pass in a dump_location_t rather than a location_t, via the gimple stmt. (grid_inner_loop_gridifiable_p): Likewise. (grid_dist_follows_simple_pattern): Likewise. (grid_gfor_follows_tiling_pattern): Likewise. (grid_target_follows_gridifiable_pattern): Likewise. (grid_attempt_target_gridification): Convert initialization of local "grid" from memset to zero-initialization; FIXME: does this require C++11? Update call to dump_printf_loc to pass in a optinfo_location rather than a location_t, via the gimple stmt. * profile.c (read_profile_edge_counts): Updates call to dump_printf_loc to pass in a dump_location_t rather than a location_t (compute_branch_probabilities): Likewise. * selftest-run-tests.c (selftest::run_tests): Call dumpfile_c_tests. * selftest.h (dumpfile_c_tests): New decl. * tree-loop-distribution.c (pass_loop_distribution::execute): Update for change in return type of find_loop_location. * tree-parloops.c (parallelize_loops): Likewise. * tree-ssa-loop-ivcanon.c (try_unroll_loop_completely): Convert "locus" from location_t to dump_user_location_t. (canonicalize_loop_induction_variables): Likewise. * tree-ssa-loop-ivopts.c (tree_ssa_iv_optimize_loop): Update for change in return type of find_loop_location. * tree-ssa-loop-niter.c (number_of_iterations_exit): Update call to dump_printf_loc to pass in a dump_location_t rather than a location_t, via the stmt. * tree-ssa-sccvn.c (eliminate_dom_walker::before_dom_children): Likewise. * tree-vect-loop-manip.c (find_loop_location): Convert return type from source_location to dump_user_location_t. (vect_do_peeling): Update for above change. (vect_loop_versioning): Update for change in type of vect_location. * tree-vect-loop.c (check_reduction_path): Convert "loc" param from location_t to dump_user_location_t. (vect_estimate_min_profitable_iters): Update for change in type of vect_location. * tree-vect-slp.c (vect_print_slp_tree): Convert param "loc" from location_t to dump_location_t. (vect_slp_bb): Update for change in type of vect_location. * tree-vectorizer.c (vect_location): Convert from source_location to dump_user_location_t. (try_vectorize_loop_1): Update for change in vect_location's type. (vectorize_loops): Likewise. (increase_alignment): Likewise. * tree-vectorizer.h (vect_location): Convert from source_location to dump_user_location_t. (find_loop_location): Convert return type from source_location to dump_user_location_t. (check_reduction_path): Convert 1st param from location_t to dump_user_location_t. * value-prof.c (check_counter): Update call to dump_printf_loc to pass in a dump_user_location_t rather than a location_t; update call to error_at for change in type of "locus". (check_ic_target): Update call to dump_printf_loc to pass in a dump_user_location_t rather than a location_t, via the call_stmt. From-SVN: r262149
2018-06-26 15:34:59 +02:00
dump_loc (dump_kind, alt_dump_file, srcloc);
print_gimple_stmt (alt_dump_file, gs, spc, dump_flags | extra_dump_flags);
}
}
/* Dump expression tree T using EXTRA_DUMP_FLAGS on dump streams if
DUMP_KIND is enabled. */
void
Introduce dump_flags_t type and use it instead of int type. 2017-05-17 Martin Liska <mliska@suse.cz> * class.c (dump_class_hierarchy): Introduce dump_flags_t type and use it instead of int type. (dump_vtable): Likewise. (dump_vtt): Likewise. * decl2.c (dump_tu): Likewise. 2017-05-17 Martin Liska <mliska@suse.cz> * c-common.h: Introduce dump_flags_t type and use it instead of int type. * c-gimplify.c (c_genericize): Likewise. * c-opts.c: Likewise. 2017-05-17 Martin Liska <mliska@suse.cz> * c-decl.c (c_parse_final_cleanups): Introduce dump_flags_t type and use it instead of int type. 2017-05-17 Martin Liska <mliska@suse.cz> * cfg.c: Introduce dump_flags_t type and use it instead of int type. * cfg.h: Likewise. * cfghooks.c: Likewise. * cfghooks.h (struct cfg_hooks): Likewise. * cfgrtl.c: Likewise. * cfgrtl.h: Likewise. * cgraph.c (cgraph_node::get_body): Likewise. * coretypes.h: Likewise. * domwalk.c: Likewise. * domwalk.h: Likewise. * dumpfile.c (struct dump_option_value_info): Likewise. (dump_enable_all): Likewise. (dump_switch_p_1): Likewise. (opt_info_switch_p): Likewise. * dumpfile.h (enum tree_dump_index): Likewise. (struct dump_file_info): Likewise. * genemit.c: Likewise. * generic-match-head.c: Likewise. * gengtype.c (open_base_files): Likewise. * gimple-pretty-print.c: Likewise. * gimple-pretty-print.h: Likewise. * graph.c (print_graph_cfg): Likewise. * graphite-scop-detection.c (dot_all_sese): Likewise. * ipa-devirt.c (build_type_inheritance_graph): Likewise. * loop-unroll.c (report_unroll): Likewise. * passes.c (pass_manager::register_one_dump_file): Likewise. * print-tree.c: Likewise. * statistics.c: Likewise. * tree-cfg.c: Likewise. * tree-cfg.h: Likewise. * tree-dfa.c: Likewise. * tree-dfa.h: Likewise. * tree-dump.c (dump_function): Likewise. * tree-dump.h (struct dump_info): Likewise. * tree-pretty-print.c: Likewise. * tree-pretty-print.h: Likewise. * tree-ssa-live.c: Likewise. * tree-ssa-live.h: Likewise. * tree-ssa-loop-ivcanon.c (try_unroll_loop_completely): Likewise. * tree-vect-loop.c: Likewise. * tree-vect-slp.c: Likewise. From-SVN: r248140
2017-05-17 11:01:36 +02:00
dump_generic_expr (dump_flags_t dump_kind, dump_flags_t extra_dump_flags,
tree t)
{
if (dump_file && (dump_kind & pflags))
print_generic_expr (dump_file, t, dump_flags | extra_dump_flags);
if (alt_dump_file && (dump_kind & alt_flags))
print_generic_expr (alt_dump_file, t, dump_flags | extra_dump_flags);
}
/* Similar to dump_generic_expr, except additionally print the source
location. */
void
dump_generic_expr_loc (dump_flags_t dump_kind, const dump_location_t &loc,
dump_flags_t extra_dump_flags, tree t)
{
location_t srcloc = loc.get_location_t ();
if (dump_file && (dump_kind & pflags))
{
dump_loc (dump_kind, dump_file, srcloc);
print_generic_expr (dump_file, t, dump_flags | extra_dump_flags);
}
if (alt_dump_file && (dump_kind & alt_flags))
{
dump_loc (dump_kind, alt_dump_file, srcloc);
print_generic_expr (alt_dump_file, t, dump_flags | extra_dump_flags);
}
}
/* Output a formatted message using FORMAT on appropriate dump streams. */
void
Introduce dump_flags_t type and use it instead of int type. 2017-05-17 Martin Liska <mliska@suse.cz> * class.c (dump_class_hierarchy): Introduce dump_flags_t type and use it instead of int type. (dump_vtable): Likewise. (dump_vtt): Likewise. * decl2.c (dump_tu): Likewise. 2017-05-17 Martin Liska <mliska@suse.cz> * c-common.h: Introduce dump_flags_t type and use it instead of int type. * c-gimplify.c (c_genericize): Likewise. * c-opts.c: Likewise. 2017-05-17 Martin Liska <mliska@suse.cz> * c-decl.c (c_parse_final_cleanups): Introduce dump_flags_t type and use it instead of int type. 2017-05-17 Martin Liska <mliska@suse.cz> * cfg.c: Introduce dump_flags_t type and use it instead of int type. * cfg.h: Likewise. * cfghooks.c: Likewise. * cfghooks.h (struct cfg_hooks): Likewise. * cfgrtl.c: Likewise. * cfgrtl.h: Likewise. * cgraph.c (cgraph_node::get_body): Likewise. * coretypes.h: Likewise. * domwalk.c: Likewise. * domwalk.h: Likewise. * dumpfile.c (struct dump_option_value_info): Likewise. (dump_enable_all): Likewise. (dump_switch_p_1): Likewise. (opt_info_switch_p): Likewise. * dumpfile.h (enum tree_dump_index): Likewise. (struct dump_file_info): Likewise. * genemit.c: Likewise. * generic-match-head.c: Likewise. * gengtype.c (open_base_files): Likewise. * gimple-pretty-print.c: Likewise. * gimple-pretty-print.h: Likewise. * graph.c (print_graph_cfg): Likewise. * graphite-scop-detection.c (dot_all_sese): Likewise. * ipa-devirt.c (build_type_inheritance_graph): Likewise. * loop-unroll.c (report_unroll): Likewise. * passes.c (pass_manager::register_one_dump_file): Likewise. * print-tree.c: Likewise. * statistics.c: Likewise. * tree-cfg.c: Likewise. * tree-cfg.h: Likewise. * tree-dfa.c: Likewise. * tree-dfa.h: Likewise. * tree-dump.c (dump_function): Likewise. * tree-dump.h (struct dump_info): Likewise. * tree-pretty-print.c: Likewise. * tree-pretty-print.h: Likewise. * tree-ssa-live.c: Likewise. * tree-ssa-live.h: Likewise. * tree-ssa-loop-ivcanon.c (try_unroll_loop_completely): Likewise. * tree-vect-loop.c: Likewise. * tree-vect-slp.c: Likewise. From-SVN: r248140
2017-05-17 11:01:36 +02:00
dump_printf (dump_flags_t dump_kind, const char *format, ...)
{
if (dump_file && (dump_kind & pflags))
{
va_list ap;
va_start (ap, format);
vfprintf (dump_file, format, ap);
va_end (ap);
}
if (alt_dump_file && (dump_kind & alt_flags))
{
va_list ap;
va_start (ap, format);
vfprintf (alt_dump_file, format, ap);
va_end (ap);
}
}
/* Similar to dump_printf, except source location is also printed. */
void
Introduce dump_location_t gcc/ChangeLog: * cfgloop.c (get_loop_location): Convert return type from location_t to dump_user_location_t, replacing INSN_LOCATION lookups by implicit construction from rtx_insn *, and using dump_user_location_t::from_function_decl for the fallback case. * cfgloop.h (get_loop_location): Convert return type from location_t to dump_user_location_t. * cgraphunit.c (walk_polymorphic_call_targets): Update call to dump_printf_loc to pass in a dump_location_t rather than a location_t, via the gimple stmt. * coverage.c (get_coverage_counts): Update calls to dump_printf_loc to pass in dump_location_t rather than a location_t. * doc/optinfo.texi (Dump types): Convert example of dump_printf_loc from taking "locus" to taking "insn". Update description of the "_loc" calls to cover dump_location_t. * dumpfile.c: Include "backend.h", "gimple.h", "rtl.h", and "selftest.h". (dump_user_location_t::dump_user_location_t): New constructors, from gimple *stmt and rtx_insn *. (dump_user_location_t::from_function_decl): New function. (dump_loc): Make static. (dump_gimple_stmt_loc): Convert param "loc" from location_t to const dump_location_t &. (dump_generic_expr_loc): Delete. (dump_printf_loc): Convert param "loc" from location_t to const dump_location_t &. (selftest::test_impl_location): New function. (selftest::dumpfile_c_tests): New function. * dumpfile.h: Include "profile-count.h". (class dump_user_location_t): New class. (struct dump_impl_location_t): New struct. (class dump_location_t): New class. (dump_printf_loc): Convert 2nd param from source_location to const dump_location_t &. (dump_generic_expr_loc): Delete. (dump_gimple_stmt_loc): Convert 2nd param from source_location to const dump_location_t &. * gimple-fold.c (fold_gimple_assign): Update call to dump_printf_loc to pass in a dump_location_t rather than a location_t, via the gimple stmt. (gimple_fold_call): Likewise. * gimple-loop-interchange.cc (loop_cand::analyze_iloop_reduction_var): Update for change to check_reduction_path. (tree_loop_interchange::interchange): Update for change to find_loop_location. * graphite-isl-ast-to-gimple.c (scop_to_isl_ast): Update for change in return-type of find_loop_location. (graphite_regenerate_ast_isl): Likewise. * graphite-optimize-isl.c (optimize_isl): Likewise. * graphite.c (graphite_transform_loops): Likewise. * ipa-devirt.c (ipa_devirt): Update call to dump_printf_loc to pass in a dump_location_t rather than a location_t, via the gimple stmt. * ipa-prop.c (ipa_make_edge_direct_to_target): Likewise. * ipa.c (walk_polymorphic_call_targets): Likewise. * loop-unroll.c (report_unroll): Convert "locus" param from location_t to dump_location_t. (decide_unrolling): Update for change to get_loop_location's return type. * omp-grid.c (struct grid_prop): Convert field "target_loc" from location_t to dump_user_location_t. (grid_find_single_omp_among_assignments_1): Updates calls to dump_printf_loc to pass in a dump_location_t rather than a location_t, via the gimple stmt. (grid_parallel_clauses_gridifiable): Convert "tloc" from location_t to dump_location_t. Updates calls to dump_printf_loc to pass in a dump_location_t rather than a location_t, via the gimple stmt. (grid_inner_loop_gridifiable_p): Likewise. (grid_dist_follows_simple_pattern): Likewise. (grid_gfor_follows_tiling_pattern): Likewise. (grid_target_follows_gridifiable_pattern): Likewise. (grid_attempt_target_gridification): Convert initialization of local "grid" from memset to zero-initialization; FIXME: does this require C++11? Update call to dump_printf_loc to pass in a optinfo_location rather than a location_t, via the gimple stmt. * profile.c (read_profile_edge_counts): Updates call to dump_printf_loc to pass in a dump_location_t rather than a location_t (compute_branch_probabilities): Likewise. * selftest-run-tests.c (selftest::run_tests): Call dumpfile_c_tests. * selftest.h (dumpfile_c_tests): New decl. * tree-loop-distribution.c (pass_loop_distribution::execute): Update for change in return type of find_loop_location. * tree-parloops.c (parallelize_loops): Likewise. * tree-ssa-loop-ivcanon.c (try_unroll_loop_completely): Convert "locus" from location_t to dump_user_location_t. (canonicalize_loop_induction_variables): Likewise. * tree-ssa-loop-ivopts.c (tree_ssa_iv_optimize_loop): Update for change in return type of find_loop_location. * tree-ssa-loop-niter.c (number_of_iterations_exit): Update call to dump_printf_loc to pass in a dump_location_t rather than a location_t, via the stmt. * tree-ssa-sccvn.c (eliminate_dom_walker::before_dom_children): Likewise. * tree-vect-loop-manip.c (find_loop_location): Convert return type from source_location to dump_user_location_t. (vect_do_peeling): Update for above change. (vect_loop_versioning): Update for change in type of vect_location. * tree-vect-loop.c (check_reduction_path): Convert "loc" param from location_t to dump_user_location_t. (vect_estimate_min_profitable_iters): Update for change in type of vect_location. * tree-vect-slp.c (vect_print_slp_tree): Convert param "loc" from location_t to dump_location_t. (vect_slp_bb): Update for change in type of vect_location. * tree-vectorizer.c (vect_location): Convert from source_location to dump_user_location_t. (try_vectorize_loop_1): Update for change in vect_location's type. (vectorize_loops): Likewise. (increase_alignment): Likewise. * tree-vectorizer.h (vect_location): Convert from source_location to dump_user_location_t. (find_loop_location): Convert return type from source_location to dump_user_location_t. (check_reduction_path): Convert 1st param from location_t to dump_user_location_t. * value-prof.c (check_counter): Update call to dump_printf_loc to pass in a dump_user_location_t rather than a location_t; update call to error_at for change in type of "locus". (check_ic_target): Update call to dump_printf_loc to pass in a dump_user_location_t rather than a location_t, via the call_stmt. From-SVN: r262149
2018-06-26 15:34:59 +02:00
dump_printf_loc (dump_flags_t dump_kind, const dump_location_t &loc,
Introduce dump_flags_t type and use it instead of int type. 2017-05-17 Martin Liska <mliska@suse.cz> * class.c (dump_class_hierarchy): Introduce dump_flags_t type and use it instead of int type. (dump_vtable): Likewise. (dump_vtt): Likewise. * decl2.c (dump_tu): Likewise. 2017-05-17 Martin Liska <mliska@suse.cz> * c-common.h: Introduce dump_flags_t type and use it instead of int type. * c-gimplify.c (c_genericize): Likewise. * c-opts.c: Likewise. 2017-05-17 Martin Liska <mliska@suse.cz> * c-decl.c (c_parse_final_cleanups): Introduce dump_flags_t type and use it instead of int type. 2017-05-17 Martin Liska <mliska@suse.cz> * cfg.c: Introduce dump_flags_t type and use it instead of int type. * cfg.h: Likewise. * cfghooks.c: Likewise. * cfghooks.h (struct cfg_hooks): Likewise. * cfgrtl.c: Likewise. * cfgrtl.h: Likewise. * cgraph.c (cgraph_node::get_body): Likewise. * coretypes.h: Likewise. * domwalk.c: Likewise. * domwalk.h: Likewise. * dumpfile.c (struct dump_option_value_info): Likewise. (dump_enable_all): Likewise. (dump_switch_p_1): Likewise. (opt_info_switch_p): Likewise. * dumpfile.h (enum tree_dump_index): Likewise. (struct dump_file_info): Likewise. * genemit.c: Likewise. * generic-match-head.c: Likewise. * gengtype.c (open_base_files): Likewise. * gimple-pretty-print.c: Likewise. * gimple-pretty-print.h: Likewise. * graph.c (print_graph_cfg): Likewise. * graphite-scop-detection.c (dot_all_sese): Likewise. * ipa-devirt.c (build_type_inheritance_graph): Likewise. * loop-unroll.c (report_unroll): Likewise. * passes.c (pass_manager::register_one_dump_file): Likewise. * print-tree.c: Likewise. * statistics.c: Likewise. * tree-cfg.c: Likewise. * tree-cfg.h: Likewise. * tree-dfa.c: Likewise. * tree-dfa.h: Likewise. * tree-dump.c (dump_function): Likewise. * tree-dump.h (struct dump_info): Likewise. * tree-pretty-print.c: Likewise. * tree-pretty-print.h: Likewise. * tree-ssa-live.c: Likewise. * tree-ssa-live.h: Likewise. * tree-ssa-loop-ivcanon.c (try_unroll_loop_completely): Likewise. * tree-vect-loop.c: Likewise. * tree-vect-slp.c: Likewise. From-SVN: r248140
2017-05-17 11:01:36 +02:00
const char *format, ...)
{
Introduce dump_location_t gcc/ChangeLog: * cfgloop.c (get_loop_location): Convert return type from location_t to dump_user_location_t, replacing INSN_LOCATION lookups by implicit construction from rtx_insn *, and using dump_user_location_t::from_function_decl for the fallback case. * cfgloop.h (get_loop_location): Convert return type from location_t to dump_user_location_t. * cgraphunit.c (walk_polymorphic_call_targets): Update call to dump_printf_loc to pass in a dump_location_t rather than a location_t, via the gimple stmt. * coverage.c (get_coverage_counts): Update calls to dump_printf_loc to pass in dump_location_t rather than a location_t. * doc/optinfo.texi (Dump types): Convert example of dump_printf_loc from taking "locus" to taking "insn". Update description of the "_loc" calls to cover dump_location_t. * dumpfile.c: Include "backend.h", "gimple.h", "rtl.h", and "selftest.h". (dump_user_location_t::dump_user_location_t): New constructors, from gimple *stmt and rtx_insn *. (dump_user_location_t::from_function_decl): New function. (dump_loc): Make static. (dump_gimple_stmt_loc): Convert param "loc" from location_t to const dump_location_t &. (dump_generic_expr_loc): Delete. (dump_printf_loc): Convert param "loc" from location_t to const dump_location_t &. (selftest::test_impl_location): New function. (selftest::dumpfile_c_tests): New function. * dumpfile.h: Include "profile-count.h". (class dump_user_location_t): New class. (struct dump_impl_location_t): New struct. (class dump_location_t): New class. (dump_printf_loc): Convert 2nd param from source_location to const dump_location_t &. (dump_generic_expr_loc): Delete. (dump_gimple_stmt_loc): Convert 2nd param from source_location to const dump_location_t &. * gimple-fold.c (fold_gimple_assign): Update call to dump_printf_loc to pass in a dump_location_t rather than a location_t, via the gimple stmt. (gimple_fold_call): Likewise. * gimple-loop-interchange.cc (loop_cand::analyze_iloop_reduction_var): Update for change to check_reduction_path. (tree_loop_interchange::interchange): Update for change to find_loop_location. * graphite-isl-ast-to-gimple.c (scop_to_isl_ast): Update for change in return-type of find_loop_location. (graphite_regenerate_ast_isl): Likewise. * graphite-optimize-isl.c (optimize_isl): Likewise. * graphite.c (graphite_transform_loops): Likewise. * ipa-devirt.c (ipa_devirt): Update call to dump_printf_loc to pass in a dump_location_t rather than a location_t, via the gimple stmt. * ipa-prop.c (ipa_make_edge_direct_to_target): Likewise. * ipa.c (walk_polymorphic_call_targets): Likewise. * loop-unroll.c (report_unroll): Convert "locus" param from location_t to dump_location_t. (decide_unrolling): Update for change to get_loop_location's return type. * omp-grid.c (struct grid_prop): Convert field "target_loc" from location_t to dump_user_location_t. (grid_find_single_omp_among_assignments_1): Updates calls to dump_printf_loc to pass in a dump_location_t rather than a location_t, via the gimple stmt. (grid_parallel_clauses_gridifiable): Convert "tloc" from location_t to dump_location_t. Updates calls to dump_printf_loc to pass in a dump_location_t rather than a location_t, via the gimple stmt. (grid_inner_loop_gridifiable_p): Likewise. (grid_dist_follows_simple_pattern): Likewise. (grid_gfor_follows_tiling_pattern): Likewise. (grid_target_follows_gridifiable_pattern): Likewise. (grid_attempt_target_gridification): Convert initialization of local "grid" from memset to zero-initialization; FIXME: does this require C++11? Update call to dump_printf_loc to pass in a optinfo_location rather than a location_t, via the gimple stmt. * profile.c (read_profile_edge_counts): Updates call to dump_printf_loc to pass in a dump_location_t rather than a location_t (compute_branch_probabilities): Likewise. * selftest-run-tests.c (selftest::run_tests): Call dumpfile_c_tests. * selftest.h (dumpfile_c_tests): New decl. * tree-loop-distribution.c (pass_loop_distribution::execute): Update for change in return type of find_loop_location. * tree-parloops.c (parallelize_loops): Likewise. * tree-ssa-loop-ivcanon.c (try_unroll_loop_completely): Convert "locus" from location_t to dump_user_location_t. (canonicalize_loop_induction_variables): Likewise. * tree-ssa-loop-ivopts.c (tree_ssa_iv_optimize_loop): Update for change in return type of find_loop_location. * tree-ssa-loop-niter.c (number_of_iterations_exit): Update call to dump_printf_loc to pass in a dump_location_t rather than a location_t, via the stmt. * tree-ssa-sccvn.c (eliminate_dom_walker::before_dom_children): Likewise. * tree-vect-loop-manip.c (find_loop_location): Convert return type from source_location to dump_user_location_t. (vect_do_peeling): Update for above change. (vect_loop_versioning): Update for change in type of vect_location. * tree-vect-loop.c (check_reduction_path): Convert "loc" param from location_t to dump_user_location_t. (vect_estimate_min_profitable_iters): Update for change in type of vect_location. * tree-vect-slp.c (vect_print_slp_tree): Convert param "loc" from location_t to dump_location_t. (vect_slp_bb): Update for change in type of vect_location. * tree-vectorizer.c (vect_location): Convert from source_location to dump_user_location_t. (try_vectorize_loop_1): Update for change in vect_location's type. (vectorize_loops): Likewise. (increase_alignment): Likewise. * tree-vectorizer.h (vect_location): Convert from source_location to dump_user_location_t. (find_loop_location): Convert return type from source_location to dump_user_location_t. (check_reduction_path): Convert 1st param from location_t to dump_user_location_t. * value-prof.c (check_counter): Update call to dump_printf_loc to pass in a dump_user_location_t rather than a location_t; update call to error_at for change in type of "locus". (check_ic_target): Update call to dump_printf_loc to pass in a dump_user_location_t rather than a location_t, via the call_stmt. From-SVN: r262149
2018-06-26 15:34:59 +02:00
location_t srcloc = loc.get_location_t ();
if (dump_file && (dump_kind & pflags))
{
va_list ap;
Introduce dump_location_t gcc/ChangeLog: * cfgloop.c (get_loop_location): Convert return type from location_t to dump_user_location_t, replacing INSN_LOCATION lookups by implicit construction from rtx_insn *, and using dump_user_location_t::from_function_decl for the fallback case. * cfgloop.h (get_loop_location): Convert return type from location_t to dump_user_location_t. * cgraphunit.c (walk_polymorphic_call_targets): Update call to dump_printf_loc to pass in a dump_location_t rather than a location_t, via the gimple stmt. * coverage.c (get_coverage_counts): Update calls to dump_printf_loc to pass in dump_location_t rather than a location_t. * doc/optinfo.texi (Dump types): Convert example of dump_printf_loc from taking "locus" to taking "insn". Update description of the "_loc" calls to cover dump_location_t. * dumpfile.c: Include "backend.h", "gimple.h", "rtl.h", and "selftest.h". (dump_user_location_t::dump_user_location_t): New constructors, from gimple *stmt and rtx_insn *. (dump_user_location_t::from_function_decl): New function. (dump_loc): Make static. (dump_gimple_stmt_loc): Convert param "loc" from location_t to const dump_location_t &. (dump_generic_expr_loc): Delete. (dump_printf_loc): Convert param "loc" from location_t to const dump_location_t &. (selftest::test_impl_location): New function. (selftest::dumpfile_c_tests): New function. * dumpfile.h: Include "profile-count.h". (class dump_user_location_t): New class. (struct dump_impl_location_t): New struct. (class dump_location_t): New class. (dump_printf_loc): Convert 2nd param from source_location to const dump_location_t &. (dump_generic_expr_loc): Delete. (dump_gimple_stmt_loc): Convert 2nd param from source_location to const dump_location_t &. * gimple-fold.c (fold_gimple_assign): Update call to dump_printf_loc to pass in a dump_location_t rather than a location_t, via the gimple stmt. (gimple_fold_call): Likewise. * gimple-loop-interchange.cc (loop_cand::analyze_iloop_reduction_var): Update for change to check_reduction_path. (tree_loop_interchange::interchange): Update for change to find_loop_location. * graphite-isl-ast-to-gimple.c (scop_to_isl_ast): Update for change in return-type of find_loop_location. (graphite_regenerate_ast_isl): Likewise. * graphite-optimize-isl.c (optimize_isl): Likewise. * graphite.c (graphite_transform_loops): Likewise. * ipa-devirt.c (ipa_devirt): Update call to dump_printf_loc to pass in a dump_location_t rather than a location_t, via the gimple stmt. * ipa-prop.c (ipa_make_edge_direct_to_target): Likewise. * ipa.c (walk_polymorphic_call_targets): Likewise. * loop-unroll.c (report_unroll): Convert "locus" param from location_t to dump_location_t. (decide_unrolling): Update for change to get_loop_location's return type. * omp-grid.c (struct grid_prop): Convert field "target_loc" from location_t to dump_user_location_t. (grid_find_single_omp_among_assignments_1): Updates calls to dump_printf_loc to pass in a dump_location_t rather than a location_t, via the gimple stmt. (grid_parallel_clauses_gridifiable): Convert "tloc" from location_t to dump_location_t. Updates calls to dump_printf_loc to pass in a dump_location_t rather than a location_t, via the gimple stmt. (grid_inner_loop_gridifiable_p): Likewise. (grid_dist_follows_simple_pattern): Likewise. (grid_gfor_follows_tiling_pattern): Likewise. (grid_target_follows_gridifiable_pattern): Likewise. (grid_attempt_target_gridification): Convert initialization of local "grid" from memset to zero-initialization; FIXME: does this require C++11? Update call to dump_printf_loc to pass in a optinfo_location rather than a location_t, via the gimple stmt. * profile.c (read_profile_edge_counts): Updates call to dump_printf_loc to pass in a dump_location_t rather than a location_t (compute_branch_probabilities): Likewise. * selftest-run-tests.c (selftest::run_tests): Call dumpfile_c_tests. * selftest.h (dumpfile_c_tests): New decl. * tree-loop-distribution.c (pass_loop_distribution::execute): Update for change in return type of find_loop_location. * tree-parloops.c (parallelize_loops): Likewise. * tree-ssa-loop-ivcanon.c (try_unroll_loop_completely): Convert "locus" from location_t to dump_user_location_t. (canonicalize_loop_induction_variables): Likewise. * tree-ssa-loop-ivopts.c (tree_ssa_iv_optimize_loop): Update for change in return type of find_loop_location. * tree-ssa-loop-niter.c (number_of_iterations_exit): Update call to dump_printf_loc to pass in a dump_location_t rather than a location_t, via the stmt. * tree-ssa-sccvn.c (eliminate_dom_walker::before_dom_children): Likewise. * tree-vect-loop-manip.c (find_loop_location): Convert return type from source_location to dump_user_location_t. (vect_do_peeling): Update for above change. (vect_loop_versioning): Update for change in type of vect_location. * tree-vect-loop.c (check_reduction_path): Convert "loc" param from location_t to dump_user_location_t. (vect_estimate_min_profitable_iters): Update for change in type of vect_location. * tree-vect-slp.c (vect_print_slp_tree): Convert param "loc" from location_t to dump_location_t. (vect_slp_bb): Update for change in type of vect_location. * tree-vectorizer.c (vect_location): Convert from source_location to dump_user_location_t. (try_vectorize_loop_1): Update for change in vect_location's type. (vectorize_loops): Likewise. (increase_alignment): Likewise. * tree-vectorizer.h (vect_location): Convert from source_location to dump_user_location_t. (find_loop_location): Convert return type from source_location to dump_user_location_t. (check_reduction_path): Convert 1st param from location_t to dump_user_location_t. * value-prof.c (check_counter): Update call to dump_printf_loc to pass in a dump_user_location_t rather than a location_t; update call to error_at for change in type of "locus". (check_ic_target): Update call to dump_printf_loc to pass in a dump_user_location_t rather than a location_t, via the call_stmt. From-SVN: r262149
2018-06-26 15:34:59 +02:00
dump_loc (dump_kind, dump_file, srcloc);
va_start (ap, format);
vfprintf (dump_file, format, ap);
va_end (ap);
}
if (alt_dump_file && (dump_kind & alt_flags))
{
va_list ap;
Introduce dump_location_t gcc/ChangeLog: * cfgloop.c (get_loop_location): Convert return type from location_t to dump_user_location_t, replacing INSN_LOCATION lookups by implicit construction from rtx_insn *, and using dump_user_location_t::from_function_decl for the fallback case. * cfgloop.h (get_loop_location): Convert return type from location_t to dump_user_location_t. * cgraphunit.c (walk_polymorphic_call_targets): Update call to dump_printf_loc to pass in a dump_location_t rather than a location_t, via the gimple stmt. * coverage.c (get_coverage_counts): Update calls to dump_printf_loc to pass in dump_location_t rather than a location_t. * doc/optinfo.texi (Dump types): Convert example of dump_printf_loc from taking "locus" to taking "insn". Update description of the "_loc" calls to cover dump_location_t. * dumpfile.c: Include "backend.h", "gimple.h", "rtl.h", and "selftest.h". (dump_user_location_t::dump_user_location_t): New constructors, from gimple *stmt and rtx_insn *. (dump_user_location_t::from_function_decl): New function. (dump_loc): Make static. (dump_gimple_stmt_loc): Convert param "loc" from location_t to const dump_location_t &. (dump_generic_expr_loc): Delete. (dump_printf_loc): Convert param "loc" from location_t to const dump_location_t &. (selftest::test_impl_location): New function. (selftest::dumpfile_c_tests): New function. * dumpfile.h: Include "profile-count.h". (class dump_user_location_t): New class. (struct dump_impl_location_t): New struct. (class dump_location_t): New class. (dump_printf_loc): Convert 2nd param from source_location to const dump_location_t &. (dump_generic_expr_loc): Delete. (dump_gimple_stmt_loc): Convert 2nd param from source_location to const dump_location_t &. * gimple-fold.c (fold_gimple_assign): Update call to dump_printf_loc to pass in a dump_location_t rather than a location_t, via the gimple stmt. (gimple_fold_call): Likewise. * gimple-loop-interchange.cc (loop_cand::analyze_iloop_reduction_var): Update for change to check_reduction_path. (tree_loop_interchange::interchange): Update for change to find_loop_location. * graphite-isl-ast-to-gimple.c (scop_to_isl_ast): Update for change in return-type of find_loop_location. (graphite_regenerate_ast_isl): Likewise. * graphite-optimize-isl.c (optimize_isl): Likewise. * graphite.c (graphite_transform_loops): Likewise. * ipa-devirt.c (ipa_devirt): Update call to dump_printf_loc to pass in a dump_location_t rather than a location_t, via the gimple stmt. * ipa-prop.c (ipa_make_edge_direct_to_target): Likewise. * ipa.c (walk_polymorphic_call_targets): Likewise. * loop-unroll.c (report_unroll): Convert "locus" param from location_t to dump_location_t. (decide_unrolling): Update for change to get_loop_location's return type. * omp-grid.c (struct grid_prop): Convert field "target_loc" from location_t to dump_user_location_t. (grid_find_single_omp_among_assignments_1): Updates calls to dump_printf_loc to pass in a dump_location_t rather than a location_t, via the gimple stmt. (grid_parallel_clauses_gridifiable): Convert "tloc" from location_t to dump_location_t. Updates calls to dump_printf_loc to pass in a dump_location_t rather than a location_t, via the gimple stmt. (grid_inner_loop_gridifiable_p): Likewise. (grid_dist_follows_simple_pattern): Likewise. (grid_gfor_follows_tiling_pattern): Likewise. (grid_target_follows_gridifiable_pattern): Likewise. (grid_attempt_target_gridification): Convert initialization of local "grid" from memset to zero-initialization; FIXME: does this require C++11? Update call to dump_printf_loc to pass in a optinfo_location rather than a location_t, via the gimple stmt. * profile.c (read_profile_edge_counts): Updates call to dump_printf_loc to pass in a dump_location_t rather than a location_t (compute_branch_probabilities): Likewise. * selftest-run-tests.c (selftest::run_tests): Call dumpfile_c_tests. * selftest.h (dumpfile_c_tests): New decl. * tree-loop-distribution.c (pass_loop_distribution::execute): Update for change in return type of find_loop_location. * tree-parloops.c (parallelize_loops): Likewise. * tree-ssa-loop-ivcanon.c (try_unroll_loop_completely): Convert "locus" from location_t to dump_user_location_t. (canonicalize_loop_induction_variables): Likewise. * tree-ssa-loop-ivopts.c (tree_ssa_iv_optimize_loop): Update for change in return type of find_loop_location. * tree-ssa-loop-niter.c (number_of_iterations_exit): Update call to dump_printf_loc to pass in a dump_location_t rather than a location_t, via the stmt. * tree-ssa-sccvn.c (eliminate_dom_walker::before_dom_children): Likewise. * tree-vect-loop-manip.c (find_loop_location): Convert return type from source_location to dump_user_location_t. (vect_do_peeling): Update for above change. (vect_loop_versioning): Update for change in type of vect_location. * tree-vect-loop.c (check_reduction_path): Convert "loc" param from location_t to dump_user_location_t. (vect_estimate_min_profitable_iters): Update for change in type of vect_location. * tree-vect-slp.c (vect_print_slp_tree): Convert param "loc" from location_t to dump_location_t. (vect_slp_bb): Update for change in type of vect_location. * tree-vectorizer.c (vect_location): Convert from source_location to dump_user_location_t. (try_vectorize_loop_1): Update for change in vect_location's type. (vectorize_loops): Likewise. (increase_alignment): Likewise. * tree-vectorizer.h (vect_location): Convert from source_location to dump_user_location_t. (find_loop_location): Convert return type from source_location to dump_user_location_t. (check_reduction_path): Convert 1st param from location_t to dump_user_location_t. * value-prof.c (check_counter): Update call to dump_printf_loc to pass in a dump_user_location_t rather than a location_t; update call to error_at for change in type of "locus". (check_ic_target): Update call to dump_printf_loc to pass in a dump_user_location_t rather than a location_t, via the call_stmt. From-SVN: r262149
2018-06-26 15:34:59 +02:00
dump_loc (dump_kind, alt_dump_file, srcloc);
va_start (ap, format);
vfprintf (alt_dump_file, format, ap);
va_end (ap);
}
}
/* Output VALUE in decimal to appropriate dump streams. */
template<unsigned int N, typename C>
void
Convert dump and optgroup flags to enums gcc/brig/ChangeLog: * brigfrontend/brig-to-generic.cc (brig_to_generic::write_globals): Use TDF_NONE rather than 0. (dump_function): Likewise. gcc/c-family/ChangeLog: * c-pretty-print.c (c_pretty_printer::statement): Use TDF_NONE rather than 0. gcc/ChangeLog: * cfg.c (debug): Use TDF_NONE rather than 0. * cfghooks.c (debug): Likewise. * dumpfile.c (DUMP_FILE_INFO): Likewise; also for OPTGROUP. (struct dump_option_value_info): Convert to... (struct kv_pair): ...this template type. (dump_options): Convert to kv_pair<dump_flags_t>; use TDF_NONE rather than 0. (optinfo_verbosity_options): Likewise. (optgroup_options): Convert to kv_pair<optgroup_flags_t>; use OPTGROUP_NONE. (gcc::dump_manager::dump_register): Use optgroup_flags_t rather than int for "optgroup_flags" param. (dump_generic_expr_loc): Use dump_flags_t rather than int for "dump_kind" param. (dump_dec): Likewise. (dump_finish): Use TDF_NONE rather than 0. (gcc::dump_manager::opt_info_enable_passes): Use optgroup_flags_t rather than int for "optgroup_flags" param. Use TDF_NONE rather than 0. Update for change to option_ptr. (opt_info_switch_p_1): Convert "optgroup_flags" param from int * to optgroup_flags_t *. Use TDF_NONE and OPTGROUP_NONE rather than 0. Update for changes to optinfo_verbosity_options and optgroup_options. (opt_info_switch_p): Convert optgroup_flags from int to optgroup_flags_t. (dump_basic_block): Use dump_flags_t rather than int for "dump_kind" param. * dumpfile.h (TDF_ADDRESS, TDF_SLIM, TDF_RAW, TDF_DETAILS, TDF_STATS, TDF_BLOCKS, TDF_VOPS, TDF_LINENO, TDF_UID) TDF_STMTADDR, TDF_GRAPH, TDF_MEMSYMS, TDF_RHS_ONLY, TDF_ASMNAME, TDF_EH, TDF_NOUID, TDF_ALIAS, TDF_ENUMERATE_LOCALS, TDF_CSELIB, TDF_SCEV, TDF_GIMPLE, TDF_FOLDING, MSG_OPTIMIZED_LOCATIONS, MSG_MISSED_OPTIMIZATION, MSG_NOTE, MSG_ALL, TDF_COMPARE_DEBUG, TDF_NONE): Convert from macros to... (enum dump_flag): ...this new enum. (dump_flags_t): Update to use enum. (operator|, operator&, operator~, operator|=, operator&=): Implement for dump_flags_t. (OPTGROUP_NONE, OPTGROUP_IPA, OPTGROUP_LOOP, OPTGROUP_INLINE, OPTGROUP_OMP, OPTGROUP_VEC, OPTGROUP_OTHER, OPTGROUP_ALL): Convert from macros to... (enum optgroup_flag): ...this new enum. (optgroup_flags_t): New typedef. (operator|, operator|=): Implement for optgroup_flags_t. (struct dump_file_info): Convert field "alt_flags" to dump_flags_t. Convert field "optgroup_flags" to optgroup_flags_t. (dump_basic_block): Use dump_flags_t rather than int for param. (dump_generic_expr_loc): Likewise. (dump_dec): Likewise. (dump_register): Convert param "optgroup_flags" to optgroup_flags_t. (opt_info_enable_passes): Likewise. * early-remat.c (early_remat::dump_edge_list): Use TDF_NONE rather than 0. * gimple-pretty-print.c (debug): Likewise. * gimple-ssa-store-merging.c (bswap_replace): Likewise. (merged_store_group::apply_stores): Likewise. * gimple-ssa-strength-reduction.c (insert_initializers): Likewise. * gimple.c (verify_gimple_pp): Likewise. * graphite-poly.c (print_pbb_body): Likewise. * passes.c (pass_manager::register_one_dump_file): Convert local "optgroup_flags" to optgroup_flags_t. * print-tree.c (print_node): Use TDF_NONE rather than 0. (debug): Likewise. (debug_body): Likewise. * tree-pass.h (struct pass_data): Convert field "optgroup_flags" to optgroup_flags_t. * tree-pretty-print.c (print_struct_decl): Use TDF_NONE rather than 0. * tree-ssa-math-opts.c (convert_mult_to_fma_1): Likewise. (convert_mult_to_fma): Likewise. * tree-ssa-reassoc.c (undistribute_ops_list): Likewise. * tree-ssa-sccvn.c (vn_eliminate): Likewise. * tree-vect-data-refs.c (dump_lower_bound): Convert param "dump_kind" to dump_flags_t. From-SVN: r261325
2018-06-08 14:50:19 +02:00
dump_dec (dump_flags_t dump_kind, const poly_int<N, C> &value)
{
STATIC_ASSERT (poly_coeff_traits<C>::signedness >= 0);
signop sgn = poly_coeff_traits<C>::signedness ? SIGNED : UNSIGNED;
if (dump_file && (dump_kind & pflags))
print_dec (value, dump_file, sgn);
if (alt_dump_file && (dump_kind & alt_flags))
print_dec (value, alt_dump_file, sgn);
}
Convert dump and optgroup flags to enums gcc/brig/ChangeLog: * brigfrontend/brig-to-generic.cc (brig_to_generic::write_globals): Use TDF_NONE rather than 0. (dump_function): Likewise. gcc/c-family/ChangeLog: * c-pretty-print.c (c_pretty_printer::statement): Use TDF_NONE rather than 0. gcc/ChangeLog: * cfg.c (debug): Use TDF_NONE rather than 0. * cfghooks.c (debug): Likewise. * dumpfile.c (DUMP_FILE_INFO): Likewise; also for OPTGROUP. (struct dump_option_value_info): Convert to... (struct kv_pair): ...this template type. (dump_options): Convert to kv_pair<dump_flags_t>; use TDF_NONE rather than 0. (optinfo_verbosity_options): Likewise. (optgroup_options): Convert to kv_pair<optgroup_flags_t>; use OPTGROUP_NONE. (gcc::dump_manager::dump_register): Use optgroup_flags_t rather than int for "optgroup_flags" param. (dump_generic_expr_loc): Use dump_flags_t rather than int for "dump_kind" param. (dump_dec): Likewise. (dump_finish): Use TDF_NONE rather than 0. (gcc::dump_manager::opt_info_enable_passes): Use optgroup_flags_t rather than int for "optgroup_flags" param. Use TDF_NONE rather than 0. Update for change to option_ptr. (opt_info_switch_p_1): Convert "optgroup_flags" param from int * to optgroup_flags_t *. Use TDF_NONE and OPTGROUP_NONE rather than 0. Update for changes to optinfo_verbosity_options and optgroup_options. (opt_info_switch_p): Convert optgroup_flags from int to optgroup_flags_t. (dump_basic_block): Use dump_flags_t rather than int for "dump_kind" param. * dumpfile.h (TDF_ADDRESS, TDF_SLIM, TDF_RAW, TDF_DETAILS, TDF_STATS, TDF_BLOCKS, TDF_VOPS, TDF_LINENO, TDF_UID) TDF_STMTADDR, TDF_GRAPH, TDF_MEMSYMS, TDF_RHS_ONLY, TDF_ASMNAME, TDF_EH, TDF_NOUID, TDF_ALIAS, TDF_ENUMERATE_LOCALS, TDF_CSELIB, TDF_SCEV, TDF_GIMPLE, TDF_FOLDING, MSG_OPTIMIZED_LOCATIONS, MSG_MISSED_OPTIMIZATION, MSG_NOTE, MSG_ALL, TDF_COMPARE_DEBUG, TDF_NONE): Convert from macros to... (enum dump_flag): ...this new enum. (dump_flags_t): Update to use enum. (operator|, operator&, operator~, operator|=, operator&=): Implement for dump_flags_t. (OPTGROUP_NONE, OPTGROUP_IPA, OPTGROUP_LOOP, OPTGROUP_INLINE, OPTGROUP_OMP, OPTGROUP_VEC, OPTGROUP_OTHER, OPTGROUP_ALL): Convert from macros to... (enum optgroup_flag): ...this new enum. (optgroup_flags_t): New typedef. (operator|, operator|=): Implement for optgroup_flags_t. (struct dump_file_info): Convert field "alt_flags" to dump_flags_t. Convert field "optgroup_flags" to optgroup_flags_t. (dump_basic_block): Use dump_flags_t rather than int for param. (dump_generic_expr_loc): Likewise. (dump_dec): Likewise. (dump_register): Convert param "optgroup_flags" to optgroup_flags_t. (opt_info_enable_passes): Likewise. * early-remat.c (early_remat::dump_edge_list): Use TDF_NONE rather than 0. * gimple-pretty-print.c (debug): Likewise. * gimple-ssa-store-merging.c (bswap_replace): Likewise. (merged_store_group::apply_stores): Likewise. * gimple-ssa-strength-reduction.c (insert_initializers): Likewise. * gimple.c (verify_gimple_pp): Likewise. * graphite-poly.c (print_pbb_body): Likewise. * passes.c (pass_manager::register_one_dump_file): Convert local "optgroup_flags" to optgroup_flags_t. * print-tree.c (print_node): Use TDF_NONE rather than 0. (debug): Likewise. (debug_body): Likewise. * tree-pass.h (struct pass_data): Convert field "optgroup_flags" to optgroup_flags_t. * tree-pretty-print.c (print_struct_decl): Use TDF_NONE rather than 0. * tree-ssa-math-opts.c (convert_mult_to_fma_1): Likewise. (convert_mult_to_fma): Likewise. * tree-ssa-reassoc.c (undistribute_ops_list): Likewise. * tree-ssa-sccvn.c (vn_eliminate): Likewise. * tree-vect-data-refs.c (dump_lower_bound): Convert param "dump_kind" to dump_flags_t. From-SVN: r261325
2018-06-08 14:50:19 +02:00
template void dump_dec (dump_flags_t, const poly_uint16 &);
template void dump_dec (dump_flags_t, const poly_int64 &);
template void dump_dec (dump_flags_t, const poly_uint64 &);
template void dump_dec (dump_flags_t, const poly_offset_int &);
template void dump_dec (dump_flags_t, const poly_widest_int &);
dumpfile.c: add indentation via DUMP_VECT_SCOPE This patch adds a concept of nested "scopes" to dumpfile.c's dump_*_loc calls, and wires it up to the DUMP_VECT_SCOPE macro in tree-vectorizer.h, so that the nested structure is shown in -fopt-info by indentation. For example, this converts -fopt-info-all e.g. from: test.c:8:3: note: === analyzing loop === test.c:8:3: note: === analyze_loop_nest === test.c:8:3: note: === vect_analyze_loop_form === test.c:8:3: note: === get_loop_niters === test.c:8:3: note: symbolic number of iterations is (unsigned int) n_9(D) test.c:8:3: note: not vectorized: loop contains function calls or data references that cannot be analyzed test.c:8:3: note: vectorized 0 loops in function to: test.c:8:3: note: === analyzing loop === test.c:8:3: note: === analyze_loop_nest === test.c:8:3: note: === vect_analyze_loop_form === test.c:8:3: note: === get_loop_niters === test.c:8:3: note: symbolic number of iterations is (unsigned int) n_9(D) test.c:8:3: note: not vectorized: loop contains function calls or data references that cannot be analyzed test.c:8:3: note: vectorized 0 loops in function showing that the "symbolic number of iterations" message is within the "=== analyze_loop_nest ===" (and not within the "=== vect_analyze_loop_form ==="). This is also enabling work for followups involving optimization records (allowing the records to directly capture the nested structure of the dump messages). gcc/ChangeLog: * dumpfile.c (dump_loc): Add indentation based on scope depth. (dump_scope_depth): New variable. (get_dump_scope_depth): New function. (dump_begin_scope): New function. (dump_end_scope): New function. * dumpfile.h (get_dump_scope_depth): New declaration. (dump_begin_scope): New declaration. (dump_end_scope): New declaration. (class auto_dump_scope): New class. (AUTO_DUMP_SCOPE): New macro. * tree-vectorizer.h (DUMP_VECT_SCOPE): Reimplement in terms of AUTO_DUMP_SCOPE. From-SVN: r262246
2018-06-29 11:56:40 +02:00
/* The current dump scope-nesting depth. */
static int dump_scope_depth;
/* Get the current dump scope-nesting depth.
For use by dump_*_loc (for showing nesting via indentation). */
unsigned int
get_dump_scope_depth ()
{
return dump_scope_depth;
}
/* Push a nested dump scope.
Print "=== NAME ===\n" to the dumpfile, if any, and to the -fopt-info
destination, if any.
Increment the scope depth. */
void
dump_begin_scope (const char *name, const dump_location_t &loc)
{
dump_printf_loc (MSG_NOTE, loc, "=== %s ===\n", name);
dump_scope_depth++;
}
/* Pop a nested dump scope. */
void
dump_end_scope ()
{
dump_scope_depth--;
}
/* Start a dump for PHASE. Store user-supplied dump flags in
*FLAG_PTR. Return the number of streams opened. Set globals
DUMP_FILE, and ALT_DUMP_FILE to point to the opened streams, and
invoke.texi: Update -fopt-info documentation. 2012-11-01 Sharad Singhai <singhai@google.com> * doc/invoke.texi: Update -fopt-info documentation. * dumpfile.c: Move dump_flags here from passes.c. Rename opt_info_options to optinfo_verbosity_options. Add optgroup_options. (dump_files): Add field for optinfo_flags in the static initializer. (dump_register): Handle additional parameter for optgroup_flags. (opt_info_enable_passes): Renamed opt_info_enable_all. Handle optgroup_flags. Fix documentation. (opt_info_switch_p_1): Handle optgroup options. (opt_info_switch_p): Handle optgroup_flags. Warn on multiple files. * dumpfile.h (dump_register): Additional argument for optgroup_flags. All callers updated. (struct dump_file_info): Add field for optgroup_flags. Define OPTGROUP_* flags. * tree-pass.h (struct opt_pass): Add addtional field for optinfo_flags. All opt_pass static initializers updated. * opts-global.c (dump_remap_tree_vectorizer_verbose): Use 'all' instead of 'optall'. (handle_common_deferred_options): Fix typo in error message. * passes.c (register_one_dump_file): Add argument for optgroup_flags. Turn on OPTGROUP_IPA for IPA passes. Move dump_flags from here to dumpfile.c. * statistics.c (statistics_early_init): Use OPTGROUP_NONE in call to dump_register. testsuite/ChangeLog * testsuite/gcc.dg/plugin/selfassign.c: Add opgtroup_flags initializer. * testsuite/gcc.dg/plugin/one_time_plugin.c: Likewise. * testsuite/g++.dg/plugin/selfassign.c: Likewise. * testsuite/g++.dg/plugin/dumb_plugin.c: Likewise. From-SVN: r193061
2012-11-01 08:34:44 +01:00
set dump_flags appropriately for both pass dump stream and
-fopt-info stream. */
int
Introduce gcc::dump_manager class 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-10-14 18:15:38 +02:00
gcc::dump_manager::
Introduce dump_flags_t type and use it instead of int type. 2017-05-17 Martin Liska <mliska@suse.cz> * class.c (dump_class_hierarchy): Introduce dump_flags_t type and use it instead of int type. (dump_vtable): Likewise. (dump_vtt): Likewise. * decl2.c (dump_tu): Likewise. 2017-05-17 Martin Liska <mliska@suse.cz> * c-common.h: Introduce dump_flags_t type and use it instead of int type. * c-gimplify.c (c_genericize): Likewise. * c-opts.c: Likewise. 2017-05-17 Martin Liska <mliska@suse.cz> * c-decl.c (c_parse_final_cleanups): Introduce dump_flags_t type and use it instead of int type. 2017-05-17 Martin Liska <mliska@suse.cz> * cfg.c: Introduce dump_flags_t type and use it instead of int type. * cfg.h: Likewise. * cfghooks.c: Likewise. * cfghooks.h (struct cfg_hooks): Likewise. * cfgrtl.c: Likewise. * cfgrtl.h: Likewise. * cgraph.c (cgraph_node::get_body): Likewise. * coretypes.h: Likewise. * domwalk.c: Likewise. * domwalk.h: Likewise. * dumpfile.c (struct dump_option_value_info): Likewise. (dump_enable_all): Likewise. (dump_switch_p_1): Likewise. (opt_info_switch_p): Likewise. * dumpfile.h (enum tree_dump_index): Likewise. (struct dump_file_info): Likewise. * genemit.c: Likewise. * generic-match-head.c: Likewise. * gengtype.c (open_base_files): Likewise. * gimple-pretty-print.c: Likewise. * gimple-pretty-print.h: Likewise. * graph.c (print_graph_cfg): Likewise. * graphite-scop-detection.c (dot_all_sese): Likewise. * ipa-devirt.c (build_type_inheritance_graph): Likewise. * loop-unroll.c (report_unroll): Likewise. * passes.c (pass_manager::register_one_dump_file): Likewise. * print-tree.c: Likewise. * statistics.c: Likewise. * tree-cfg.c: Likewise. * tree-cfg.h: Likewise. * tree-dfa.c: Likewise. * tree-dfa.h: Likewise. * tree-dump.c (dump_function): Likewise. * tree-dump.h (struct dump_info): Likewise. * tree-pretty-print.c: Likewise. * tree-pretty-print.h: Likewise. * tree-ssa-live.c: Likewise. * tree-ssa-live.h: Likewise. * tree-ssa-loop-ivcanon.c (try_unroll_loop_completely): Likewise. * tree-vect-loop.c: Likewise. * tree-vect-slp.c: Likewise. From-SVN: r248140
2017-05-17 11:01:36 +02:00
dump_start (int phase, dump_flags_t *flag_ptr)
{
int count = 0;
char *name;
struct dump_file_info *dfi;
FILE *stream;
if (phase == TDI_none || !dump_phase_enabled_p (phase))
return 0;
dfi = get_dump_file_info (phase);
name = get_dump_file_name (phase);
if (name)
{
stream = dump_open (name, dfi->pstate < 0);
if (stream)
{
dfi->pstate = 1;
count++;
}
free (name);
dfi->pstream = stream;
set_dump_file (dfi->pstream);
/* Initialize current dump flags. */
pflags = dfi->pflags;
}
stream = dump_open_alternate_stream (dfi);
if (stream)
{
dfi->alt_stream = stream;
count++;
set_alt_dump_file (dfi->alt_stream);
invoke.texi: Update -fopt-info documentation. 2012-11-01 Sharad Singhai <singhai@google.com> * doc/invoke.texi: Update -fopt-info documentation. * dumpfile.c: Move dump_flags here from passes.c. Rename opt_info_options to optinfo_verbosity_options. Add optgroup_options. (dump_files): Add field for optinfo_flags in the static initializer. (dump_register): Handle additional parameter for optgroup_flags. (opt_info_enable_passes): Renamed opt_info_enable_all. Handle optgroup_flags. Fix documentation. (opt_info_switch_p_1): Handle optgroup options. (opt_info_switch_p): Handle optgroup_flags. Warn on multiple files. * dumpfile.h (dump_register): Additional argument for optgroup_flags. All callers updated. (struct dump_file_info): Add field for optgroup_flags. Define OPTGROUP_* flags. * tree-pass.h (struct opt_pass): Add addtional field for optinfo_flags. All opt_pass static initializers updated. * opts-global.c (dump_remap_tree_vectorizer_verbose): Use 'all' instead of 'optall'. (handle_common_deferred_options): Fix typo in error message. * passes.c (register_one_dump_file): Add argument for optgroup_flags. Turn on OPTGROUP_IPA for IPA passes. Move dump_flags from here to dumpfile.c. * statistics.c (statistics_early_init): Use OPTGROUP_NONE in call to dump_register. testsuite/ChangeLog * testsuite/gcc.dg/plugin/selfassign.c: Add opgtroup_flags initializer. * testsuite/gcc.dg/plugin/one_time_plugin.c: Likewise. * testsuite/g++.dg/plugin/selfassign.c: Likewise. * testsuite/g++.dg/plugin/dumb_plugin.c: Likewise. From-SVN: r193061
2012-11-01 08:34:44 +01:00
/* Initialize current -fopt-info flags. */
alt_flags = dfi->alt_flags;
}
if (flag_ptr)
*flag_ptr = dfi->pflags;
return count;
}
/* Finish a tree dump for PHASE and close associated dump streams. Also
reset the globals DUMP_FILE, ALT_DUMP_FILE, and DUMP_FLAGS. */
void
Introduce gcc::dump_manager class 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-10-14 18:15:38 +02:00
gcc::dump_manager::
dump_finish (int phase)
{
struct dump_file_info *dfi;
if (phase < 0)
return;
dfi = get_dump_file_info (phase);
if (dfi->pstream && dfi->pstream != stdout && dfi->pstream != stderr)
fclose (dfi->pstream);
if (dfi->alt_stream && dfi->alt_stream != stdout && dfi->alt_stream != stderr)
fclose (dfi->alt_stream);
dfi->alt_stream = NULL;
dfi->pstream = NULL;
set_dump_file (NULL);
set_alt_dump_file (NULL);
Convert dump and optgroup flags to enums gcc/brig/ChangeLog: * brigfrontend/brig-to-generic.cc (brig_to_generic::write_globals): Use TDF_NONE rather than 0. (dump_function): Likewise. gcc/c-family/ChangeLog: * c-pretty-print.c (c_pretty_printer::statement): Use TDF_NONE rather than 0. gcc/ChangeLog: * cfg.c (debug): Use TDF_NONE rather than 0. * cfghooks.c (debug): Likewise. * dumpfile.c (DUMP_FILE_INFO): Likewise; also for OPTGROUP. (struct dump_option_value_info): Convert to... (struct kv_pair): ...this template type. (dump_options): Convert to kv_pair<dump_flags_t>; use TDF_NONE rather than 0. (optinfo_verbosity_options): Likewise. (optgroup_options): Convert to kv_pair<optgroup_flags_t>; use OPTGROUP_NONE. (gcc::dump_manager::dump_register): Use optgroup_flags_t rather than int for "optgroup_flags" param. (dump_generic_expr_loc): Use dump_flags_t rather than int for "dump_kind" param. (dump_dec): Likewise. (dump_finish): Use TDF_NONE rather than 0. (gcc::dump_manager::opt_info_enable_passes): Use optgroup_flags_t rather than int for "optgroup_flags" param. Use TDF_NONE rather than 0. Update for change to option_ptr. (opt_info_switch_p_1): Convert "optgroup_flags" param from int * to optgroup_flags_t *. Use TDF_NONE and OPTGROUP_NONE rather than 0. Update for changes to optinfo_verbosity_options and optgroup_options. (opt_info_switch_p): Convert optgroup_flags from int to optgroup_flags_t. (dump_basic_block): Use dump_flags_t rather than int for "dump_kind" param. * dumpfile.h (TDF_ADDRESS, TDF_SLIM, TDF_RAW, TDF_DETAILS, TDF_STATS, TDF_BLOCKS, TDF_VOPS, TDF_LINENO, TDF_UID) TDF_STMTADDR, TDF_GRAPH, TDF_MEMSYMS, TDF_RHS_ONLY, TDF_ASMNAME, TDF_EH, TDF_NOUID, TDF_ALIAS, TDF_ENUMERATE_LOCALS, TDF_CSELIB, TDF_SCEV, TDF_GIMPLE, TDF_FOLDING, MSG_OPTIMIZED_LOCATIONS, MSG_MISSED_OPTIMIZATION, MSG_NOTE, MSG_ALL, TDF_COMPARE_DEBUG, TDF_NONE): Convert from macros to... (enum dump_flag): ...this new enum. (dump_flags_t): Update to use enum. (operator|, operator&, operator~, operator|=, operator&=): Implement for dump_flags_t. (OPTGROUP_NONE, OPTGROUP_IPA, OPTGROUP_LOOP, OPTGROUP_INLINE, OPTGROUP_OMP, OPTGROUP_VEC, OPTGROUP_OTHER, OPTGROUP_ALL): Convert from macros to... (enum optgroup_flag): ...this new enum. (optgroup_flags_t): New typedef. (operator|, operator|=): Implement for optgroup_flags_t. (struct dump_file_info): Convert field "alt_flags" to dump_flags_t. Convert field "optgroup_flags" to optgroup_flags_t. (dump_basic_block): Use dump_flags_t rather than int for param. (dump_generic_expr_loc): Likewise. (dump_dec): Likewise. (dump_register): Convert param "optgroup_flags" to optgroup_flags_t. (opt_info_enable_passes): Likewise. * early-remat.c (early_remat::dump_edge_list): Use TDF_NONE rather than 0. * gimple-pretty-print.c (debug): Likewise. * gimple-ssa-store-merging.c (bswap_replace): Likewise. (merged_store_group::apply_stores): Likewise. * gimple-ssa-strength-reduction.c (insert_initializers): Likewise. * gimple.c (verify_gimple_pp): Likewise. * graphite-poly.c (print_pbb_body): Likewise. * passes.c (pass_manager::register_one_dump_file): Convert local "optgroup_flags" to optgroup_flags_t. * print-tree.c (print_node): Use TDF_NONE rather than 0. (debug): Likewise. (debug_body): Likewise. * tree-pass.h (struct pass_data): Convert field "optgroup_flags" to optgroup_flags_t. * tree-pretty-print.c (print_struct_decl): Use TDF_NONE rather than 0. * tree-ssa-math-opts.c (convert_mult_to_fma_1): Likewise. (convert_mult_to_fma): Likewise. * tree-ssa-reassoc.c (undistribute_ops_list): Likewise. * tree-ssa-sccvn.c (vn_eliminate): Likewise. * tree-vect-data-refs.c (dump_lower_bound): Convert param "dump_kind" to dump_flags_t. From-SVN: r261325
2018-06-08 14:50:19 +02:00
dump_flags = TDF_NONE;
alt_flags = TDF_NONE;
pflags = TDF_NONE;
}
/* Begin a tree dump for PHASE. Stores any user supplied flag in
*FLAG_PTR and returns a stream to write to. If the dump is not
enabled, returns NULL.
Multiple calls will reopen and append to the dump file. */
FILE *
Introduce dump_flags_t type and use it instead of int type. 2017-05-17 Martin Liska <mliska@suse.cz> * class.c (dump_class_hierarchy): Introduce dump_flags_t type and use it instead of int type. (dump_vtable): Likewise. (dump_vtt): Likewise. * decl2.c (dump_tu): Likewise. 2017-05-17 Martin Liska <mliska@suse.cz> * c-common.h: Introduce dump_flags_t type and use it instead of int type. * c-gimplify.c (c_genericize): Likewise. * c-opts.c: Likewise. 2017-05-17 Martin Liska <mliska@suse.cz> * c-decl.c (c_parse_final_cleanups): Introduce dump_flags_t type and use it instead of int type. 2017-05-17 Martin Liska <mliska@suse.cz> * cfg.c: Introduce dump_flags_t type and use it instead of int type. * cfg.h: Likewise. * cfghooks.c: Likewise. * cfghooks.h (struct cfg_hooks): Likewise. * cfgrtl.c: Likewise. * cfgrtl.h: Likewise. * cgraph.c (cgraph_node::get_body): Likewise. * coretypes.h: Likewise. * domwalk.c: Likewise. * domwalk.h: Likewise. * dumpfile.c (struct dump_option_value_info): Likewise. (dump_enable_all): Likewise. (dump_switch_p_1): Likewise. (opt_info_switch_p): Likewise. * dumpfile.h (enum tree_dump_index): Likewise. (struct dump_file_info): Likewise. * genemit.c: Likewise. * generic-match-head.c: Likewise. * gengtype.c (open_base_files): Likewise. * gimple-pretty-print.c: Likewise. * gimple-pretty-print.h: Likewise. * graph.c (print_graph_cfg): Likewise. * graphite-scop-detection.c (dot_all_sese): Likewise. * ipa-devirt.c (build_type_inheritance_graph): Likewise. * loop-unroll.c (report_unroll): Likewise. * passes.c (pass_manager::register_one_dump_file): Likewise. * print-tree.c: Likewise. * statistics.c: Likewise. * tree-cfg.c: Likewise. * tree-cfg.h: Likewise. * tree-dfa.c: Likewise. * tree-dfa.h: Likewise. * tree-dump.c (dump_function): Likewise. * tree-dump.h (struct dump_info): Likewise. * tree-pretty-print.c: Likewise. * tree-pretty-print.h: Likewise. * tree-ssa-live.c: Likewise. * tree-ssa-live.h: Likewise. * tree-ssa-loop-ivcanon.c (try_unroll_loop_completely): Likewise. * tree-vect-loop.c: Likewise. * tree-vect-slp.c: Likewise. From-SVN: r248140
2017-05-17 11:01:36 +02:00
dump_begin (int phase, dump_flags_t *flag_ptr)
Introduce gcc::dump_manager class 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-10-14 18:15:38 +02:00
{
return g->get_dumps ()->dump_begin (phase, flag_ptr);
}
FILE *
gcc::dump_manager::
Introduce dump_flags_t type and use it instead of int type. 2017-05-17 Martin Liska <mliska@suse.cz> * class.c (dump_class_hierarchy): Introduce dump_flags_t type and use it instead of int type. (dump_vtable): Likewise. (dump_vtt): Likewise. * decl2.c (dump_tu): Likewise. 2017-05-17 Martin Liska <mliska@suse.cz> * c-common.h: Introduce dump_flags_t type and use it instead of int type. * c-gimplify.c (c_genericize): Likewise. * c-opts.c: Likewise. 2017-05-17 Martin Liska <mliska@suse.cz> * c-decl.c (c_parse_final_cleanups): Introduce dump_flags_t type and use it instead of int type. 2017-05-17 Martin Liska <mliska@suse.cz> * cfg.c: Introduce dump_flags_t type and use it instead of int type. * cfg.h: Likewise. * cfghooks.c: Likewise. * cfghooks.h (struct cfg_hooks): Likewise. * cfgrtl.c: Likewise. * cfgrtl.h: Likewise. * cgraph.c (cgraph_node::get_body): Likewise. * coretypes.h: Likewise. * domwalk.c: Likewise. * domwalk.h: Likewise. * dumpfile.c (struct dump_option_value_info): Likewise. (dump_enable_all): Likewise. (dump_switch_p_1): Likewise. (opt_info_switch_p): Likewise. * dumpfile.h (enum tree_dump_index): Likewise. (struct dump_file_info): Likewise. * genemit.c: Likewise. * generic-match-head.c: Likewise. * gengtype.c (open_base_files): Likewise. * gimple-pretty-print.c: Likewise. * gimple-pretty-print.h: Likewise. * graph.c (print_graph_cfg): Likewise. * graphite-scop-detection.c (dot_all_sese): Likewise. * ipa-devirt.c (build_type_inheritance_graph): Likewise. * loop-unroll.c (report_unroll): Likewise. * passes.c (pass_manager::register_one_dump_file): Likewise. * print-tree.c: Likewise. * statistics.c: Likewise. * tree-cfg.c: Likewise. * tree-cfg.h: Likewise. * tree-dfa.c: Likewise. * tree-dfa.h: Likewise. * tree-dump.c (dump_function): Likewise. * tree-dump.h (struct dump_info): Likewise. * tree-pretty-print.c: Likewise. * tree-pretty-print.h: Likewise. * tree-ssa-live.c: Likewise. * tree-ssa-live.h: Likewise. * tree-ssa-loop-ivcanon.c (try_unroll_loop_completely): Likewise. * tree-vect-loop.c: Likewise. * tree-vect-slp.c: Likewise. From-SVN: r248140
2017-05-17 11:01:36 +02:00
dump_begin (int phase, dump_flags_t *flag_ptr)
{
char *name;
struct dump_file_info *dfi;
FILE *stream;
if (phase == TDI_none || !dump_phase_enabled_p (phase))
return NULL;
name = get_dump_file_name (phase);
if (!name)
return NULL;
dfi = get_dump_file_info (phase);
stream = dump_open (name, dfi->pstate < 0);
if (stream)
dfi->pstate = 1;
free (name);
if (flag_ptr)
*flag_ptr = dfi->pflags;
/* Initialize current flags */
pflags = dfi->pflags;
return stream;
}
/* Returns nonzero if dump PHASE is enabled for at least one stream.
If PHASE is TDI_tree_all, return nonzero if any dump is enabled for
any phase. */
Introduce gcc::dump_manager class 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-10-14 18:15:38 +02:00
int
gcc::dump_manager::
dump_phase_enabled_p (int phase) const
{
if (phase == TDI_tree_all)
{
size_t i;
for (i = TDI_none + 1; i < (size_t) TDI_end; i++)
if (dump_files[i].pstate || dump_files[i].alt_state)
return 1;
Introduce gcc::dump_manager class 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-10-14 18:15:38 +02:00
for (i = 0; i < m_extra_dump_files_in_use; i++)
if (m_extra_dump_files[i].pstate || m_extra_dump_files[i].alt_state)
return 1;
return 0;
}
else
{
struct dump_file_info *dfi = get_dump_file_info (phase);
return dfi->pstate || dfi->alt_state;
}
}
/* Returns nonzero if tree dump PHASE has been initialized. */
int
Introduce gcc::dump_manager class 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-10-14 18:15:38 +02:00
gcc::dump_manager::
dump_initialized_p (int phase) const
{
struct dump_file_info *dfi = get_dump_file_info (phase);
return dfi->pstate > 0 || dfi->alt_state > 0;
}
/* Returns the switch name of PHASE. */
const char *
dump_flag_name (int phase)
Introduce gcc::dump_manager class 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-10-14 18:15:38 +02:00
{
return g->get_dumps ()->dump_flag_name (phase);
}
const char *
gcc::dump_manager::
dump_flag_name (int phase) const
{
struct dump_file_info *dfi = get_dump_file_info (phase);
return dfi->swtch;
}
/* Finish a tree dump for PHASE. STREAM is the stream created by
dump_begin. */
void
dump_end (int phase ATTRIBUTE_UNUSED, FILE *stream)
{
if (stream != stderr && stream != stdout)
fclose (stream);
}
/* Enable all tree dumps with FLAGS on FILENAME. Return number of
enabled tree dumps. */
Introduce gcc::dump_manager class 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-10-14 18:15:38 +02:00
int
gcc::dump_manager::
dump_enable_all (dump_kind dkind, dump_flags_t flags, const char *filename)
{
int n = 0;
size_t i;
for (i = TDI_none + 1; i < (size_t) TDI_end; i++)
{
if ((dump_files[i].dkind == dkind))
{
const char *old_filename = dump_files[i].pfilename;
dump_files[i].pstate = -1;
dump_files[i].pflags |= flags;
n++;
/* Override the existing filename. */
if (filename)
{
dump_files[i].pfilename = xstrdup (filename);
/* Since it is a command-line provided file, which is
common to all the phases, use it in append mode. */
dump_files[i].pstate = 1;
}
if (old_filename && filename != old_filename)
free (CONST_CAST (char *, old_filename));
}
}
Introduce gcc::dump_manager class 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-10-14 18:15:38 +02:00
for (i = 0; i < m_extra_dump_files_in_use; i++)
{
if ((m_extra_dump_files[i].dkind == dkind))
{
Introduce gcc::dump_manager class 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-10-14 18:15:38 +02:00
const char *old_filename = m_extra_dump_files[i].pfilename;
m_extra_dump_files[i].pstate = -1;
m_extra_dump_files[i].pflags |= flags;
n++;
/* Override the existing filename. */
if (filename)
{
Introduce gcc::dump_manager class 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-10-14 18:15:38 +02:00
m_extra_dump_files[i].pfilename = xstrdup (filename);
/* Since it is a command-line provided file, which is
common to all the phases, use it in append mode. */
Introduce gcc::dump_manager class 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-10-14 18:15:38 +02:00
m_extra_dump_files[i].pstate = 1;
}
if (old_filename && filename != old_filename)
free (CONST_CAST (char *, old_filename));
}
}
return n;
}
invoke.texi: Update -fopt-info documentation. 2012-11-01 Sharad Singhai <singhai@google.com> * doc/invoke.texi: Update -fopt-info documentation. * dumpfile.c: Move dump_flags here from passes.c. Rename opt_info_options to optinfo_verbosity_options. Add optgroup_options. (dump_files): Add field for optinfo_flags in the static initializer. (dump_register): Handle additional parameter for optgroup_flags. (opt_info_enable_passes): Renamed opt_info_enable_all. Handle optgroup_flags. Fix documentation. (opt_info_switch_p_1): Handle optgroup options. (opt_info_switch_p): Handle optgroup_flags. Warn on multiple files. * dumpfile.h (dump_register): Additional argument for optgroup_flags. All callers updated. (struct dump_file_info): Add field for optgroup_flags. Define OPTGROUP_* flags. * tree-pass.h (struct opt_pass): Add addtional field for optinfo_flags. All opt_pass static initializers updated. * opts-global.c (dump_remap_tree_vectorizer_verbose): Use 'all' instead of 'optall'. (handle_common_deferred_options): Fix typo in error message. * passes.c (register_one_dump_file): Add argument for optgroup_flags. Turn on OPTGROUP_IPA for IPA passes. Move dump_flags from here to dumpfile.c. * statistics.c (statistics_early_init): Use OPTGROUP_NONE in call to dump_register. testsuite/ChangeLog * testsuite/gcc.dg/plugin/selfassign.c: Add opgtroup_flags initializer. * testsuite/gcc.dg/plugin/one_time_plugin.c: Likewise. * testsuite/g++.dg/plugin/selfassign.c: Likewise. * testsuite/g++.dg/plugin/dumb_plugin.c: Likewise. From-SVN: r193061
2012-11-01 08:34:44 +01:00
/* Enable -fopt-info dumps on all dump files matching OPTGROUP_FLAGS.
Enable dumps with FLAGS on FILENAME. Return the number of enabled
dumps. */
Introduce gcc::dump_manager class 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-10-14 18:15:38 +02:00
int
gcc::dump_manager::
Convert dump and optgroup flags to enums gcc/brig/ChangeLog: * brigfrontend/brig-to-generic.cc (brig_to_generic::write_globals): Use TDF_NONE rather than 0. (dump_function): Likewise. gcc/c-family/ChangeLog: * c-pretty-print.c (c_pretty_printer::statement): Use TDF_NONE rather than 0. gcc/ChangeLog: * cfg.c (debug): Use TDF_NONE rather than 0. * cfghooks.c (debug): Likewise. * dumpfile.c (DUMP_FILE_INFO): Likewise; also for OPTGROUP. (struct dump_option_value_info): Convert to... (struct kv_pair): ...this template type. (dump_options): Convert to kv_pair<dump_flags_t>; use TDF_NONE rather than 0. (optinfo_verbosity_options): Likewise. (optgroup_options): Convert to kv_pair<optgroup_flags_t>; use OPTGROUP_NONE. (gcc::dump_manager::dump_register): Use optgroup_flags_t rather than int for "optgroup_flags" param. (dump_generic_expr_loc): Use dump_flags_t rather than int for "dump_kind" param. (dump_dec): Likewise. (dump_finish): Use TDF_NONE rather than 0. (gcc::dump_manager::opt_info_enable_passes): Use optgroup_flags_t rather than int for "optgroup_flags" param. Use TDF_NONE rather than 0. Update for change to option_ptr. (opt_info_switch_p_1): Convert "optgroup_flags" param from int * to optgroup_flags_t *. Use TDF_NONE and OPTGROUP_NONE rather than 0. Update for changes to optinfo_verbosity_options and optgroup_options. (opt_info_switch_p): Convert optgroup_flags from int to optgroup_flags_t. (dump_basic_block): Use dump_flags_t rather than int for "dump_kind" param. * dumpfile.h (TDF_ADDRESS, TDF_SLIM, TDF_RAW, TDF_DETAILS, TDF_STATS, TDF_BLOCKS, TDF_VOPS, TDF_LINENO, TDF_UID) TDF_STMTADDR, TDF_GRAPH, TDF_MEMSYMS, TDF_RHS_ONLY, TDF_ASMNAME, TDF_EH, TDF_NOUID, TDF_ALIAS, TDF_ENUMERATE_LOCALS, TDF_CSELIB, TDF_SCEV, TDF_GIMPLE, TDF_FOLDING, MSG_OPTIMIZED_LOCATIONS, MSG_MISSED_OPTIMIZATION, MSG_NOTE, MSG_ALL, TDF_COMPARE_DEBUG, TDF_NONE): Convert from macros to... (enum dump_flag): ...this new enum. (dump_flags_t): Update to use enum. (operator|, operator&, operator~, operator|=, operator&=): Implement for dump_flags_t. (OPTGROUP_NONE, OPTGROUP_IPA, OPTGROUP_LOOP, OPTGROUP_INLINE, OPTGROUP_OMP, OPTGROUP_VEC, OPTGROUP_OTHER, OPTGROUP_ALL): Convert from macros to... (enum optgroup_flag): ...this new enum. (optgroup_flags_t): New typedef. (operator|, operator|=): Implement for optgroup_flags_t. (struct dump_file_info): Convert field "alt_flags" to dump_flags_t. Convert field "optgroup_flags" to optgroup_flags_t. (dump_basic_block): Use dump_flags_t rather than int for param. (dump_generic_expr_loc): Likewise. (dump_dec): Likewise. (dump_register): Convert param "optgroup_flags" to optgroup_flags_t. (opt_info_enable_passes): Likewise. * early-remat.c (early_remat::dump_edge_list): Use TDF_NONE rather than 0. * gimple-pretty-print.c (debug): Likewise. * gimple-ssa-store-merging.c (bswap_replace): Likewise. (merged_store_group::apply_stores): Likewise. * gimple-ssa-strength-reduction.c (insert_initializers): Likewise. * gimple.c (verify_gimple_pp): Likewise. * graphite-poly.c (print_pbb_body): Likewise. * passes.c (pass_manager::register_one_dump_file): Convert local "optgroup_flags" to optgroup_flags_t. * print-tree.c (print_node): Use TDF_NONE rather than 0. (debug): Likewise. (debug_body): Likewise. * tree-pass.h (struct pass_data): Convert field "optgroup_flags" to optgroup_flags_t. * tree-pretty-print.c (print_struct_decl): Use TDF_NONE rather than 0. * tree-ssa-math-opts.c (convert_mult_to_fma_1): Likewise. (convert_mult_to_fma): Likewise. * tree-ssa-reassoc.c (undistribute_ops_list): Likewise. * tree-ssa-sccvn.c (vn_eliminate): Likewise. * tree-vect-data-refs.c (dump_lower_bound): Convert param "dump_kind" to dump_flags_t. From-SVN: r261325
2018-06-08 14:50:19 +02:00
opt_info_enable_passes (optgroup_flags_t optgroup_flags, dump_flags_t flags,
Introduce dump_flags_t type and use it instead of int type. 2017-05-17 Martin Liska <mliska@suse.cz> * class.c (dump_class_hierarchy): Introduce dump_flags_t type and use it instead of int type. (dump_vtable): Likewise. (dump_vtt): Likewise. * decl2.c (dump_tu): Likewise. 2017-05-17 Martin Liska <mliska@suse.cz> * c-common.h: Introduce dump_flags_t type and use it instead of int type. * c-gimplify.c (c_genericize): Likewise. * c-opts.c: Likewise. 2017-05-17 Martin Liska <mliska@suse.cz> * c-decl.c (c_parse_final_cleanups): Introduce dump_flags_t type and use it instead of int type. 2017-05-17 Martin Liska <mliska@suse.cz> * cfg.c: Introduce dump_flags_t type and use it instead of int type. * cfg.h: Likewise. * cfghooks.c: Likewise. * cfghooks.h (struct cfg_hooks): Likewise. * cfgrtl.c: Likewise. * cfgrtl.h: Likewise. * cgraph.c (cgraph_node::get_body): Likewise. * coretypes.h: Likewise. * domwalk.c: Likewise. * domwalk.h: Likewise. * dumpfile.c (struct dump_option_value_info): Likewise. (dump_enable_all): Likewise. (dump_switch_p_1): Likewise. (opt_info_switch_p): Likewise. * dumpfile.h (enum tree_dump_index): Likewise. (struct dump_file_info): Likewise. * genemit.c: Likewise. * generic-match-head.c: Likewise. * gengtype.c (open_base_files): Likewise. * gimple-pretty-print.c: Likewise. * gimple-pretty-print.h: Likewise. * graph.c (print_graph_cfg): Likewise. * graphite-scop-detection.c (dot_all_sese): Likewise. * ipa-devirt.c (build_type_inheritance_graph): Likewise. * loop-unroll.c (report_unroll): Likewise. * passes.c (pass_manager::register_one_dump_file): Likewise. * print-tree.c: Likewise. * statistics.c: Likewise. * tree-cfg.c: Likewise. * tree-cfg.h: Likewise. * tree-dfa.c: Likewise. * tree-dfa.h: Likewise. * tree-dump.c (dump_function): Likewise. * tree-dump.h (struct dump_info): Likewise. * tree-pretty-print.c: Likewise. * tree-pretty-print.h: Likewise. * tree-ssa-live.c: Likewise. * tree-ssa-live.h: Likewise. * tree-ssa-loop-ivcanon.c (try_unroll_loop_completely): Likewise. * tree-vect-loop.c: Likewise. * tree-vect-slp.c: Likewise. From-SVN: r248140
2017-05-17 11:01:36 +02:00
const char *filename)
{
int n = 0;
size_t i;
for (i = TDI_none + 1; i < (size_t) TDI_end; i++)
{
invoke.texi: Update -fopt-info documentation. 2012-11-01 Sharad Singhai <singhai@google.com> * doc/invoke.texi: Update -fopt-info documentation. * dumpfile.c: Move dump_flags here from passes.c. Rename opt_info_options to optinfo_verbosity_options. Add optgroup_options. (dump_files): Add field for optinfo_flags in the static initializer. (dump_register): Handle additional parameter for optgroup_flags. (opt_info_enable_passes): Renamed opt_info_enable_all. Handle optgroup_flags. Fix documentation. (opt_info_switch_p_1): Handle optgroup options. (opt_info_switch_p): Handle optgroup_flags. Warn on multiple files. * dumpfile.h (dump_register): Additional argument for optgroup_flags. All callers updated. (struct dump_file_info): Add field for optgroup_flags. Define OPTGROUP_* flags. * tree-pass.h (struct opt_pass): Add addtional field for optinfo_flags. All opt_pass static initializers updated. * opts-global.c (dump_remap_tree_vectorizer_verbose): Use 'all' instead of 'optall'. (handle_common_deferred_options): Fix typo in error message. * passes.c (register_one_dump_file): Add argument for optgroup_flags. Turn on OPTGROUP_IPA for IPA passes. Move dump_flags from here to dumpfile.c. * statistics.c (statistics_early_init): Use OPTGROUP_NONE in call to dump_register. testsuite/ChangeLog * testsuite/gcc.dg/plugin/selfassign.c: Add opgtroup_flags initializer. * testsuite/gcc.dg/plugin/one_time_plugin.c: Likewise. * testsuite/g++.dg/plugin/selfassign.c: Likewise. * testsuite/g++.dg/plugin/dumb_plugin.c: Likewise. From-SVN: r193061
2012-11-01 08:34:44 +01:00
if ((dump_files[i].optgroup_flags & optgroup_flags))
{
const char *old_filename = dump_files[i].alt_filename;
/* Since this file is shared among different passes, it
should be opened in append mode. */
dump_files[i].alt_state = 1;
dump_files[i].alt_flags |= flags;
n++;
/* Override the existing filename. */
if (filename)
dump_files[i].alt_filename = xstrdup (filename);
if (old_filename && filename != old_filename)
free (CONST_CAST (char *, old_filename));
}
}
Introduce gcc::dump_manager class 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-10-14 18:15:38 +02:00
for (i = 0; i < m_extra_dump_files_in_use; i++)
{
Introduce gcc::dump_manager class 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-10-14 18:15:38 +02:00
if ((m_extra_dump_files[i].optgroup_flags & optgroup_flags))
{
Introduce gcc::dump_manager class 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-10-14 18:15:38 +02:00
const char *old_filename = m_extra_dump_files[i].alt_filename;
/* Since this file is shared among different passes, it
should be opened in append mode. */
Introduce gcc::dump_manager class 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-10-14 18:15:38 +02:00
m_extra_dump_files[i].alt_state = 1;
m_extra_dump_files[i].alt_flags |= flags;
n++;
/* Override the existing filename. */
if (filename)
Introduce gcc::dump_manager class 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-10-14 18:15:38 +02:00
m_extra_dump_files[i].alt_filename = xstrdup (filename);
if (old_filename && filename != old_filename)
free (CONST_CAST (char *, old_filename));
}
}
return n;
}
/* Parse ARG as a dump switch. Return nonzero if it is, and store the
relevant details in the dump_files array. */
Introduce gcc::dump_manager class 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-10-14 18:15:38 +02:00
int
gcc::dump_manager::
dump_switch_p_1 (const char *arg, struct dump_file_info *dfi, bool doglob)
{
const char *option_value;
const char *ptr;
Introduce dump_flags_t type and use it instead of int type. 2017-05-17 Martin Liska <mliska@suse.cz> * class.c (dump_class_hierarchy): Introduce dump_flags_t type and use it instead of int type. (dump_vtable): Likewise. (dump_vtt): Likewise. * decl2.c (dump_tu): Likewise. 2017-05-17 Martin Liska <mliska@suse.cz> * c-common.h: Introduce dump_flags_t type and use it instead of int type. * c-gimplify.c (c_genericize): Likewise. * c-opts.c: Likewise. 2017-05-17 Martin Liska <mliska@suse.cz> * c-decl.c (c_parse_final_cleanups): Introduce dump_flags_t type and use it instead of int type. 2017-05-17 Martin Liska <mliska@suse.cz> * cfg.c: Introduce dump_flags_t type and use it instead of int type. * cfg.h: Likewise. * cfghooks.c: Likewise. * cfghooks.h (struct cfg_hooks): Likewise. * cfgrtl.c: Likewise. * cfgrtl.h: Likewise. * cgraph.c (cgraph_node::get_body): Likewise. * coretypes.h: Likewise. * domwalk.c: Likewise. * domwalk.h: Likewise. * dumpfile.c (struct dump_option_value_info): Likewise. (dump_enable_all): Likewise. (dump_switch_p_1): Likewise. (opt_info_switch_p): Likewise. * dumpfile.h (enum tree_dump_index): Likewise. (struct dump_file_info): Likewise. * genemit.c: Likewise. * generic-match-head.c: Likewise. * gengtype.c (open_base_files): Likewise. * gimple-pretty-print.c: Likewise. * gimple-pretty-print.h: Likewise. * graph.c (print_graph_cfg): Likewise. * graphite-scop-detection.c (dot_all_sese): Likewise. * ipa-devirt.c (build_type_inheritance_graph): Likewise. * loop-unroll.c (report_unroll): Likewise. * passes.c (pass_manager::register_one_dump_file): Likewise. * print-tree.c: Likewise. * statistics.c: Likewise. * tree-cfg.c: Likewise. * tree-cfg.h: Likewise. * tree-dfa.c: Likewise. * tree-dfa.h: Likewise. * tree-dump.c (dump_function): Likewise. * tree-dump.h (struct dump_info): Likewise. * tree-pretty-print.c: Likewise. * tree-pretty-print.h: Likewise. * tree-ssa-live.c: Likewise. * tree-ssa-live.h: Likewise. * tree-ssa-loop-ivcanon.c (try_unroll_loop_completely): Likewise. * tree-vect-loop.c: Likewise. * tree-vect-slp.c: Likewise. From-SVN: r248140
2017-05-17 11:01:36 +02:00
dump_flags_t flags;
if (doglob && !dfi->glob)
return 0;
option_value = skip_leading_substring (arg, doglob ? dfi->glob : dfi->swtch);
if (!option_value)
return 0;
if (*option_value && *option_value != '-' && *option_value != '=')
return 0;
ptr = option_value;
Convert dump and optgroup flags to enums gcc/brig/ChangeLog: * brigfrontend/brig-to-generic.cc (brig_to_generic::write_globals): Use TDF_NONE rather than 0. (dump_function): Likewise. gcc/c-family/ChangeLog: * c-pretty-print.c (c_pretty_printer::statement): Use TDF_NONE rather than 0. gcc/ChangeLog: * cfg.c (debug): Use TDF_NONE rather than 0. * cfghooks.c (debug): Likewise. * dumpfile.c (DUMP_FILE_INFO): Likewise; also for OPTGROUP. (struct dump_option_value_info): Convert to... (struct kv_pair): ...this template type. (dump_options): Convert to kv_pair<dump_flags_t>; use TDF_NONE rather than 0. (optinfo_verbosity_options): Likewise. (optgroup_options): Convert to kv_pair<optgroup_flags_t>; use OPTGROUP_NONE. (gcc::dump_manager::dump_register): Use optgroup_flags_t rather than int for "optgroup_flags" param. (dump_generic_expr_loc): Use dump_flags_t rather than int for "dump_kind" param. (dump_dec): Likewise. (dump_finish): Use TDF_NONE rather than 0. (gcc::dump_manager::opt_info_enable_passes): Use optgroup_flags_t rather than int for "optgroup_flags" param. Use TDF_NONE rather than 0. Update for change to option_ptr. (opt_info_switch_p_1): Convert "optgroup_flags" param from int * to optgroup_flags_t *. Use TDF_NONE and OPTGROUP_NONE rather than 0. Update for changes to optinfo_verbosity_options and optgroup_options. (opt_info_switch_p): Convert optgroup_flags from int to optgroup_flags_t. (dump_basic_block): Use dump_flags_t rather than int for "dump_kind" param. * dumpfile.h (TDF_ADDRESS, TDF_SLIM, TDF_RAW, TDF_DETAILS, TDF_STATS, TDF_BLOCKS, TDF_VOPS, TDF_LINENO, TDF_UID) TDF_STMTADDR, TDF_GRAPH, TDF_MEMSYMS, TDF_RHS_ONLY, TDF_ASMNAME, TDF_EH, TDF_NOUID, TDF_ALIAS, TDF_ENUMERATE_LOCALS, TDF_CSELIB, TDF_SCEV, TDF_GIMPLE, TDF_FOLDING, MSG_OPTIMIZED_LOCATIONS, MSG_MISSED_OPTIMIZATION, MSG_NOTE, MSG_ALL, TDF_COMPARE_DEBUG, TDF_NONE): Convert from macros to... (enum dump_flag): ...this new enum. (dump_flags_t): Update to use enum. (operator|, operator&, operator~, operator|=, operator&=): Implement for dump_flags_t. (OPTGROUP_NONE, OPTGROUP_IPA, OPTGROUP_LOOP, OPTGROUP_INLINE, OPTGROUP_OMP, OPTGROUP_VEC, OPTGROUP_OTHER, OPTGROUP_ALL): Convert from macros to... (enum optgroup_flag): ...this new enum. (optgroup_flags_t): New typedef. (operator|, operator|=): Implement for optgroup_flags_t. (struct dump_file_info): Convert field "alt_flags" to dump_flags_t. Convert field "optgroup_flags" to optgroup_flags_t. (dump_basic_block): Use dump_flags_t rather than int for param. (dump_generic_expr_loc): Likewise. (dump_dec): Likewise. (dump_register): Convert param "optgroup_flags" to optgroup_flags_t. (opt_info_enable_passes): Likewise. * early-remat.c (early_remat::dump_edge_list): Use TDF_NONE rather than 0. * gimple-pretty-print.c (debug): Likewise. * gimple-ssa-store-merging.c (bswap_replace): Likewise. (merged_store_group::apply_stores): Likewise. * gimple-ssa-strength-reduction.c (insert_initializers): Likewise. * gimple.c (verify_gimple_pp): Likewise. * graphite-poly.c (print_pbb_body): Likewise. * passes.c (pass_manager::register_one_dump_file): Convert local "optgroup_flags" to optgroup_flags_t. * print-tree.c (print_node): Use TDF_NONE rather than 0. (debug): Likewise. (debug_body): Likewise. * tree-pass.h (struct pass_data): Convert field "optgroup_flags" to optgroup_flags_t. * tree-pretty-print.c (print_struct_decl): Use TDF_NONE rather than 0. * tree-ssa-math-opts.c (convert_mult_to_fma_1): Likewise. (convert_mult_to_fma): Likewise. * tree-ssa-reassoc.c (undistribute_ops_list): Likewise. * tree-ssa-sccvn.c (vn_eliminate): Likewise. * tree-vect-data-refs.c (dump_lower_bound): Convert param "dump_kind" to dump_flags_t. From-SVN: r261325
2018-06-08 14:50:19 +02:00
flags = TDF_NONE;
while (*ptr)
{
Convert dump and optgroup flags to enums gcc/brig/ChangeLog: * brigfrontend/brig-to-generic.cc (brig_to_generic::write_globals): Use TDF_NONE rather than 0. (dump_function): Likewise. gcc/c-family/ChangeLog: * c-pretty-print.c (c_pretty_printer::statement): Use TDF_NONE rather than 0. gcc/ChangeLog: * cfg.c (debug): Use TDF_NONE rather than 0. * cfghooks.c (debug): Likewise. * dumpfile.c (DUMP_FILE_INFO): Likewise; also for OPTGROUP. (struct dump_option_value_info): Convert to... (struct kv_pair): ...this template type. (dump_options): Convert to kv_pair<dump_flags_t>; use TDF_NONE rather than 0. (optinfo_verbosity_options): Likewise. (optgroup_options): Convert to kv_pair<optgroup_flags_t>; use OPTGROUP_NONE. (gcc::dump_manager::dump_register): Use optgroup_flags_t rather than int for "optgroup_flags" param. (dump_generic_expr_loc): Use dump_flags_t rather than int for "dump_kind" param. (dump_dec): Likewise. (dump_finish): Use TDF_NONE rather than 0. (gcc::dump_manager::opt_info_enable_passes): Use optgroup_flags_t rather than int for "optgroup_flags" param. Use TDF_NONE rather than 0. Update for change to option_ptr. (opt_info_switch_p_1): Convert "optgroup_flags" param from int * to optgroup_flags_t *. Use TDF_NONE and OPTGROUP_NONE rather than 0. Update for changes to optinfo_verbosity_options and optgroup_options. (opt_info_switch_p): Convert optgroup_flags from int to optgroup_flags_t. (dump_basic_block): Use dump_flags_t rather than int for "dump_kind" param. * dumpfile.h (TDF_ADDRESS, TDF_SLIM, TDF_RAW, TDF_DETAILS, TDF_STATS, TDF_BLOCKS, TDF_VOPS, TDF_LINENO, TDF_UID) TDF_STMTADDR, TDF_GRAPH, TDF_MEMSYMS, TDF_RHS_ONLY, TDF_ASMNAME, TDF_EH, TDF_NOUID, TDF_ALIAS, TDF_ENUMERATE_LOCALS, TDF_CSELIB, TDF_SCEV, TDF_GIMPLE, TDF_FOLDING, MSG_OPTIMIZED_LOCATIONS, MSG_MISSED_OPTIMIZATION, MSG_NOTE, MSG_ALL, TDF_COMPARE_DEBUG, TDF_NONE): Convert from macros to... (enum dump_flag): ...this new enum. (dump_flags_t): Update to use enum. (operator|, operator&, operator~, operator|=, operator&=): Implement for dump_flags_t. (OPTGROUP_NONE, OPTGROUP_IPA, OPTGROUP_LOOP, OPTGROUP_INLINE, OPTGROUP_OMP, OPTGROUP_VEC, OPTGROUP_OTHER, OPTGROUP_ALL): Convert from macros to... (enum optgroup_flag): ...this new enum. (optgroup_flags_t): New typedef. (operator|, operator|=): Implement for optgroup_flags_t. (struct dump_file_info): Convert field "alt_flags" to dump_flags_t. Convert field "optgroup_flags" to optgroup_flags_t. (dump_basic_block): Use dump_flags_t rather than int for param. (dump_generic_expr_loc): Likewise. (dump_dec): Likewise. (dump_register): Convert param "optgroup_flags" to optgroup_flags_t. (opt_info_enable_passes): Likewise. * early-remat.c (early_remat::dump_edge_list): Use TDF_NONE rather than 0. * gimple-pretty-print.c (debug): Likewise. * gimple-ssa-store-merging.c (bswap_replace): Likewise. (merged_store_group::apply_stores): Likewise. * gimple-ssa-strength-reduction.c (insert_initializers): Likewise. * gimple.c (verify_gimple_pp): Likewise. * graphite-poly.c (print_pbb_body): Likewise. * passes.c (pass_manager::register_one_dump_file): Convert local "optgroup_flags" to optgroup_flags_t. * print-tree.c (print_node): Use TDF_NONE rather than 0. (debug): Likewise. (debug_body): Likewise. * tree-pass.h (struct pass_data): Convert field "optgroup_flags" to optgroup_flags_t. * tree-pretty-print.c (print_struct_decl): Use TDF_NONE rather than 0. * tree-ssa-math-opts.c (convert_mult_to_fma_1): Likewise. (convert_mult_to_fma): Likewise. * tree-ssa-reassoc.c (undistribute_ops_list): Likewise. * tree-ssa-sccvn.c (vn_eliminate): Likewise. * tree-vect-data-refs.c (dump_lower_bound): Convert param "dump_kind" to dump_flags_t. From-SVN: r261325
2018-06-08 14:50:19 +02:00
const struct kv_pair<dump_flags_t> *option_ptr;
const char *end_ptr;
const char *eq_ptr;
unsigned length;
while (*ptr == '-')
ptr++;
end_ptr = strchr (ptr, '-');
eq_ptr = strchr (ptr, '=');
if (eq_ptr && !end_ptr)
end_ptr = eq_ptr;
if (!end_ptr)
end_ptr = ptr + strlen (ptr);
length = end_ptr - ptr;
for (option_ptr = dump_options; option_ptr->name; option_ptr++)
if (strlen (option_ptr->name) == length
&& !memcmp (option_ptr->name, ptr, length))
{
flags |= option_ptr->value;
goto found;
}
if (*ptr == '=')
{
/* Interpret rest of the argument as a dump filename. This
filename overrides other command line filenames. */
if (dfi->pfilename)
free (CONST_CAST (char *, dfi->pfilename));
dfi->pfilename = xstrdup (ptr + 1);
break;
}
else
warning (0, "ignoring unknown option %q.*s in %<-fdump-%s%>",
length, ptr, dfi->swtch);
found:;
ptr = end_ptr;
}
dfi->pstate = -1;
dfi->pflags |= flags;
/* Process -fdump-tree-all and -fdump-rtl-all, by enabling all the
known dumps. */
if (dfi->suffix == NULL)
dump_enable_all (dfi->dkind, dfi->pflags, dfi->pfilename);
return 1;
}
int
Introduce gcc::dump_manager class 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-10-14 18:15:38 +02:00
gcc::dump_manager::
dump_switch_p (const char *arg)
{
size_t i;
int any = 0;
for (i = TDI_none + 1; i != TDI_end; i++)
any |= dump_switch_p_1 (arg, &dump_files[i], false);
/* Don't glob if we got a hit already */
if (!any)
for (i = TDI_none + 1; i != TDI_end; i++)
any |= dump_switch_p_1 (arg, &dump_files[i], true);
Introduce gcc::dump_manager class 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-10-14 18:15:38 +02:00
for (i = 0; i < m_extra_dump_files_in_use; i++)
any |= dump_switch_p_1 (arg, &m_extra_dump_files[i], false);
if (!any)
Introduce gcc::dump_manager class 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-10-14 18:15:38 +02:00
for (i = 0; i < m_extra_dump_files_in_use; i++)
any |= dump_switch_p_1 (arg, &m_extra_dump_files[i], true);
return any;
}
invoke.texi: Update -fopt-info documentation. 2012-11-01 Sharad Singhai <singhai@google.com> * doc/invoke.texi: Update -fopt-info documentation. * dumpfile.c: Move dump_flags here from passes.c. Rename opt_info_options to optinfo_verbosity_options. Add optgroup_options. (dump_files): Add field for optinfo_flags in the static initializer. (dump_register): Handle additional parameter for optgroup_flags. (opt_info_enable_passes): Renamed opt_info_enable_all. Handle optgroup_flags. Fix documentation. (opt_info_switch_p_1): Handle optgroup options. (opt_info_switch_p): Handle optgroup_flags. Warn on multiple files. * dumpfile.h (dump_register): Additional argument for optgroup_flags. All callers updated. (struct dump_file_info): Add field for optgroup_flags. Define OPTGROUP_* flags. * tree-pass.h (struct opt_pass): Add addtional field for optinfo_flags. All opt_pass static initializers updated. * opts-global.c (dump_remap_tree_vectorizer_verbose): Use 'all' instead of 'optall'. (handle_common_deferred_options): Fix typo in error message. * passes.c (register_one_dump_file): Add argument for optgroup_flags. Turn on OPTGROUP_IPA for IPA passes. Move dump_flags from here to dumpfile.c. * statistics.c (statistics_early_init): Use OPTGROUP_NONE in call to dump_register. testsuite/ChangeLog * testsuite/gcc.dg/plugin/selfassign.c: Add opgtroup_flags initializer. * testsuite/gcc.dg/plugin/one_time_plugin.c: Likewise. * testsuite/g++.dg/plugin/selfassign.c: Likewise. * testsuite/g++.dg/plugin/dumb_plugin.c: Likewise. From-SVN: r193061
2012-11-01 08:34:44 +01:00
/* Parse ARG as a -fopt-info switch and store flags, optgroup_flags
and filename. Return non-zero if it is a recognized switch. */
static int
Convert dump and optgroup flags to enums gcc/brig/ChangeLog: * brigfrontend/brig-to-generic.cc (brig_to_generic::write_globals): Use TDF_NONE rather than 0. (dump_function): Likewise. gcc/c-family/ChangeLog: * c-pretty-print.c (c_pretty_printer::statement): Use TDF_NONE rather than 0. gcc/ChangeLog: * cfg.c (debug): Use TDF_NONE rather than 0. * cfghooks.c (debug): Likewise. * dumpfile.c (DUMP_FILE_INFO): Likewise; also for OPTGROUP. (struct dump_option_value_info): Convert to... (struct kv_pair): ...this template type. (dump_options): Convert to kv_pair<dump_flags_t>; use TDF_NONE rather than 0. (optinfo_verbosity_options): Likewise. (optgroup_options): Convert to kv_pair<optgroup_flags_t>; use OPTGROUP_NONE. (gcc::dump_manager::dump_register): Use optgroup_flags_t rather than int for "optgroup_flags" param. (dump_generic_expr_loc): Use dump_flags_t rather than int for "dump_kind" param. (dump_dec): Likewise. (dump_finish): Use TDF_NONE rather than 0. (gcc::dump_manager::opt_info_enable_passes): Use optgroup_flags_t rather than int for "optgroup_flags" param. Use TDF_NONE rather than 0. Update for change to option_ptr. (opt_info_switch_p_1): Convert "optgroup_flags" param from int * to optgroup_flags_t *. Use TDF_NONE and OPTGROUP_NONE rather than 0. Update for changes to optinfo_verbosity_options and optgroup_options. (opt_info_switch_p): Convert optgroup_flags from int to optgroup_flags_t. (dump_basic_block): Use dump_flags_t rather than int for "dump_kind" param. * dumpfile.h (TDF_ADDRESS, TDF_SLIM, TDF_RAW, TDF_DETAILS, TDF_STATS, TDF_BLOCKS, TDF_VOPS, TDF_LINENO, TDF_UID) TDF_STMTADDR, TDF_GRAPH, TDF_MEMSYMS, TDF_RHS_ONLY, TDF_ASMNAME, TDF_EH, TDF_NOUID, TDF_ALIAS, TDF_ENUMERATE_LOCALS, TDF_CSELIB, TDF_SCEV, TDF_GIMPLE, TDF_FOLDING, MSG_OPTIMIZED_LOCATIONS, MSG_MISSED_OPTIMIZATION, MSG_NOTE, MSG_ALL, TDF_COMPARE_DEBUG, TDF_NONE): Convert from macros to... (enum dump_flag): ...this new enum. (dump_flags_t): Update to use enum. (operator|, operator&, operator~, operator|=, operator&=): Implement for dump_flags_t. (OPTGROUP_NONE, OPTGROUP_IPA, OPTGROUP_LOOP, OPTGROUP_INLINE, OPTGROUP_OMP, OPTGROUP_VEC, OPTGROUP_OTHER, OPTGROUP_ALL): Convert from macros to... (enum optgroup_flag): ...this new enum. (optgroup_flags_t): New typedef. (operator|, operator|=): Implement for optgroup_flags_t. (struct dump_file_info): Convert field "alt_flags" to dump_flags_t. Convert field "optgroup_flags" to optgroup_flags_t. (dump_basic_block): Use dump_flags_t rather than int for param. (dump_generic_expr_loc): Likewise. (dump_dec): Likewise. (dump_register): Convert param "optgroup_flags" to optgroup_flags_t. (opt_info_enable_passes): Likewise. * early-remat.c (early_remat::dump_edge_list): Use TDF_NONE rather than 0. * gimple-pretty-print.c (debug): Likewise. * gimple-ssa-store-merging.c (bswap_replace): Likewise. (merged_store_group::apply_stores): Likewise. * gimple-ssa-strength-reduction.c (insert_initializers): Likewise. * gimple.c (verify_gimple_pp): Likewise. * graphite-poly.c (print_pbb_body): Likewise. * passes.c (pass_manager::register_one_dump_file): Convert local "optgroup_flags" to optgroup_flags_t. * print-tree.c (print_node): Use TDF_NONE rather than 0. (debug): Likewise. (debug_body): Likewise. * tree-pass.h (struct pass_data): Convert field "optgroup_flags" to optgroup_flags_t. * tree-pretty-print.c (print_struct_decl): Use TDF_NONE rather than 0. * tree-ssa-math-opts.c (convert_mult_to_fma_1): Likewise. (convert_mult_to_fma): Likewise. * tree-ssa-reassoc.c (undistribute_ops_list): Likewise. * tree-ssa-sccvn.c (vn_eliminate): Likewise. * tree-vect-data-refs.c (dump_lower_bound): Convert param "dump_kind" to dump_flags_t. From-SVN: r261325
2018-06-08 14:50:19 +02:00
opt_info_switch_p_1 (const char *arg, dump_flags_t *flags,
optgroup_flags_t *optgroup_flags, char **filename)
{
const char *option_value;
const char *ptr;
option_value = arg;
ptr = option_value;
*filename = NULL;
Convert dump and optgroup flags to enums gcc/brig/ChangeLog: * brigfrontend/brig-to-generic.cc (brig_to_generic::write_globals): Use TDF_NONE rather than 0. (dump_function): Likewise. gcc/c-family/ChangeLog: * c-pretty-print.c (c_pretty_printer::statement): Use TDF_NONE rather than 0. gcc/ChangeLog: * cfg.c (debug): Use TDF_NONE rather than 0. * cfghooks.c (debug): Likewise. * dumpfile.c (DUMP_FILE_INFO): Likewise; also for OPTGROUP. (struct dump_option_value_info): Convert to... (struct kv_pair): ...this template type. (dump_options): Convert to kv_pair<dump_flags_t>; use TDF_NONE rather than 0. (optinfo_verbosity_options): Likewise. (optgroup_options): Convert to kv_pair<optgroup_flags_t>; use OPTGROUP_NONE. (gcc::dump_manager::dump_register): Use optgroup_flags_t rather than int for "optgroup_flags" param. (dump_generic_expr_loc): Use dump_flags_t rather than int for "dump_kind" param. (dump_dec): Likewise. (dump_finish): Use TDF_NONE rather than 0. (gcc::dump_manager::opt_info_enable_passes): Use optgroup_flags_t rather than int for "optgroup_flags" param. Use TDF_NONE rather than 0. Update for change to option_ptr. (opt_info_switch_p_1): Convert "optgroup_flags" param from int * to optgroup_flags_t *. Use TDF_NONE and OPTGROUP_NONE rather than 0. Update for changes to optinfo_verbosity_options and optgroup_options. (opt_info_switch_p): Convert optgroup_flags from int to optgroup_flags_t. (dump_basic_block): Use dump_flags_t rather than int for "dump_kind" param. * dumpfile.h (TDF_ADDRESS, TDF_SLIM, TDF_RAW, TDF_DETAILS, TDF_STATS, TDF_BLOCKS, TDF_VOPS, TDF_LINENO, TDF_UID) TDF_STMTADDR, TDF_GRAPH, TDF_MEMSYMS, TDF_RHS_ONLY, TDF_ASMNAME, TDF_EH, TDF_NOUID, TDF_ALIAS, TDF_ENUMERATE_LOCALS, TDF_CSELIB, TDF_SCEV, TDF_GIMPLE, TDF_FOLDING, MSG_OPTIMIZED_LOCATIONS, MSG_MISSED_OPTIMIZATION, MSG_NOTE, MSG_ALL, TDF_COMPARE_DEBUG, TDF_NONE): Convert from macros to... (enum dump_flag): ...this new enum. (dump_flags_t): Update to use enum. (operator|, operator&, operator~, operator|=, operator&=): Implement for dump_flags_t. (OPTGROUP_NONE, OPTGROUP_IPA, OPTGROUP_LOOP, OPTGROUP_INLINE, OPTGROUP_OMP, OPTGROUP_VEC, OPTGROUP_OTHER, OPTGROUP_ALL): Convert from macros to... (enum optgroup_flag): ...this new enum. (optgroup_flags_t): New typedef. (operator|, operator|=): Implement for optgroup_flags_t. (struct dump_file_info): Convert field "alt_flags" to dump_flags_t. Convert field "optgroup_flags" to optgroup_flags_t. (dump_basic_block): Use dump_flags_t rather than int for param. (dump_generic_expr_loc): Likewise. (dump_dec): Likewise. (dump_register): Convert param "optgroup_flags" to optgroup_flags_t. (opt_info_enable_passes): Likewise. * early-remat.c (early_remat::dump_edge_list): Use TDF_NONE rather than 0. * gimple-pretty-print.c (debug): Likewise. * gimple-ssa-store-merging.c (bswap_replace): Likewise. (merged_store_group::apply_stores): Likewise. * gimple-ssa-strength-reduction.c (insert_initializers): Likewise. * gimple.c (verify_gimple_pp): Likewise. * graphite-poly.c (print_pbb_body): Likewise. * passes.c (pass_manager::register_one_dump_file): Convert local "optgroup_flags" to optgroup_flags_t. * print-tree.c (print_node): Use TDF_NONE rather than 0. (debug): Likewise. (debug_body): Likewise. * tree-pass.h (struct pass_data): Convert field "optgroup_flags" to optgroup_flags_t. * tree-pretty-print.c (print_struct_decl): Use TDF_NONE rather than 0. * tree-ssa-math-opts.c (convert_mult_to_fma_1): Likewise. (convert_mult_to_fma): Likewise. * tree-ssa-reassoc.c (undistribute_ops_list): Likewise. * tree-ssa-sccvn.c (vn_eliminate): Likewise. * tree-vect-data-refs.c (dump_lower_bound): Convert param "dump_kind" to dump_flags_t. From-SVN: r261325
2018-06-08 14:50:19 +02:00
*flags = TDF_NONE;
*optgroup_flags = OPTGROUP_NONE;
if (!ptr)
invoke.texi: Update -fopt-info documentation. 2012-11-01 Sharad Singhai <singhai@google.com> * doc/invoke.texi: Update -fopt-info documentation. * dumpfile.c: Move dump_flags here from passes.c. Rename opt_info_options to optinfo_verbosity_options. Add optgroup_options. (dump_files): Add field for optinfo_flags in the static initializer. (dump_register): Handle additional parameter for optgroup_flags. (opt_info_enable_passes): Renamed opt_info_enable_all. Handle optgroup_flags. Fix documentation. (opt_info_switch_p_1): Handle optgroup options. (opt_info_switch_p): Handle optgroup_flags. Warn on multiple files. * dumpfile.h (dump_register): Additional argument for optgroup_flags. All callers updated. (struct dump_file_info): Add field for optgroup_flags. Define OPTGROUP_* flags. * tree-pass.h (struct opt_pass): Add addtional field for optinfo_flags. All opt_pass static initializers updated. * opts-global.c (dump_remap_tree_vectorizer_verbose): Use 'all' instead of 'optall'. (handle_common_deferred_options): Fix typo in error message. * passes.c (register_one_dump_file): Add argument for optgroup_flags. Turn on OPTGROUP_IPA for IPA passes. Move dump_flags from here to dumpfile.c. * statistics.c (statistics_early_init): Use OPTGROUP_NONE in call to dump_register. testsuite/ChangeLog * testsuite/gcc.dg/plugin/selfassign.c: Add opgtroup_flags initializer. * testsuite/gcc.dg/plugin/one_time_plugin.c: Likewise. * testsuite/g++.dg/plugin/selfassign.c: Likewise. * testsuite/g++.dg/plugin/dumb_plugin.c: Likewise. From-SVN: r193061
2012-11-01 08:34:44 +01:00
return 1; /* Handle '-fopt-info' without any additional options. */
while (*ptr)
{
const char *end_ptr;
const char *eq_ptr;
unsigned length;
while (*ptr == '-')
ptr++;
end_ptr = strchr (ptr, '-');
eq_ptr = strchr (ptr, '=');
if (eq_ptr && !end_ptr)
end_ptr = eq_ptr;
if (!end_ptr)
end_ptr = ptr + strlen (ptr);
length = end_ptr - ptr;
Convert dump and optgroup flags to enums gcc/brig/ChangeLog: * brigfrontend/brig-to-generic.cc (brig_to_generic::write_globals): Use TDF_NONE rather than 0. (dump_function): Likewise. gcc/c-family/ChangeLog: * c-pretty-print.c (c_pretty_printer::statement): Use TDF_NONE rather than 0. gcc/ChangeLog: * cfg.c (debug): Use TDF_NONE rather than 0. * cfghooks.c (debug): Likewise. * dumpfile.c (DUMP_FILE_INFO): Likewise; also for OPTGROUP. (struct dump_option_value_info): Convert to... (struct kv_pair): ...this template type. (dump_options): Convert to kv_pair<dump_flags_t>; use TDF_NONE rather than 0. (optinfo_verbosity_options): Likewise. (optgroup_options): Convert to kv_pair<optgroup_flags_t>; use OPTGROUP_NONE. (gcc::dump_manager::dump_register): Use optgroup_flags_t rather than int for "optgroup_flags" param. (dump_generic_expr_loc): Use dump_flags_t rather than int for "dump_kind" param. (dump_dec): Likewise. (dump_finish): Use TDF_NONE rather than 0. (gcc::dump_manager::opt_info_enable_passes): Use optgroup_flags_t rather than int for "optgroup_flags" param. Use TDF_NONE rather than 0. Update for change to option_ptr. (opt_info_switch_p_1): Convert "optgroup_flags" param from int * to optgroup_flags_t *. Use TDF_NONE and OPTGROUP_NONE rather than 0. Update for changes to optinfo_verbosity_options and optgroup_options. (opt_info_switch_p): Convert optgroup_flags from int to optgroup_flags_t. (dump_basic_block): Use dump_flags_t rather than int for "dump_kind" param. * dumpfile.h (TDF_ADDRESS, TDF_SLIM, TDF_RAW, TDF_DETAILS, TDF_STATS, TDF_BLOCKS, TDF_VOPS, TDF_LINENO, TDF_UID) TDF_STMTADDR, TDF_GRAPH, TDF_MEMSYMS, TDF_RHS_ONLY, TDF_ASMNAME, TDF_EH, TDF_NOUID, TDF_ALIAS, TDF_ENUMERATE_LOCALS, TDF_CSELIB, TDF_SCEV, TDF_GIMPLE, TDF_FOLDING, MSG_OPTIMIZED_LOCATIONS, MSG_MISSED_OPTIMIZATION, MSG_NOTE, MSG_ALL, TDF_COMPARE_DEBUG, TDF_NONE): Convert from macros to... (enum dump_flag): ...this new enum. (dump_flags_t): Update to use enum. (operator|, operator&, operator~, operator|=, operator&=): Implement for dump_flags_t. (OPTGROUP_NONE, OPTGROUP_IPA, OPTGROUP_LOOP, OPTGROUP_INLINE, OPTGROUP_OMP, OPTGROUP_VEC, OPTGROUP_OTHER, OPTGROUP_ALL): Convert from macros to... (enum optgroup_flag): ...this new enum. (optgroup_flags_t): New typedef. (operator|, operator|=): Implement for optgroup_flags_t. (struct dump_file_info): Convert field "alt_flags" to dump_flags_t. Convert field "optgroup_flags" to optgroup_flags_t. (dump_basic_block): Use dump_flags_t rather than int for param. (dump_generic_expr_loc): Likewise. (dump_dec): Likewise. (dump_register): Convert param "optgroup_flags" to optgroup_flags_t. (opt_info_enable_passes): Likewise. * early-remat.c (early_remat::dump_edge_list): Use TDF_NONE rather than 0. * gimple-pretty-print.c (debug): Likewise. * gimple-ssa-store-merging.c (bswap_replace): Likewise. (merged_store_group::apply_stores): Likewise. * gimple-ssa-strength-reduction.c (insert_initializers): Likewise. * gimple.c (verify_gimple_pp): Likewise. * graphite-poly.c (print_pbb_body): Likewise. * passes.c (pass_manager::register_one_dump_file): Convert local "optgroup_flags" to optgroup_flags_t. * print-tree.c (print_node): Use TDF_NONE rather than 0. (debug): Likewise. (debug_body): Likewise. * tree-pass.h (struct pass_data): Convert field "optgroup_flags" to optgroup_flags_t. * tree-pretty-print.c (print_struct_decl): Use TDF_NONE rather than 0. * tree-ssa-math-opts.c (convert_mult_to_fma_1): Likewise. (convert_mult_to_fma): Likewise. * tree-ssa-reassoc.c (undistribute_ops_list): Likewise. * tree-ssa-sccvn.c (vn_eliminate): Likewise. * tree-vect-data-refs.c (dump_lower_bound): Convert param "dump_kind" to dump_flags_t. From-SVN: r261325
2018-06-08 14:50:19 +02:00
for (const kv_pair<dump_flags_t> *option_ptr = optinfo_verbosity_options;
option_ptr->name; option_ptr++)
if (strlen (option_ptr->name) == length
&& !memcmp (option_ptr->name, ptr, length))
{
*flags |= option_ptr->value;
goto found;
}
Convert dump and optgroup flags to enums gcc/brig/ChangeLog: * brigfrontend/brig-to-generic.cc (brig_to_generic::write_globals): Use TDF_NONE rather than 0. (dump_function): Likewise. gcc/c-family/ChangeLog: * c-pretty-print.c (c_pretty_printer::statement): Use TDF_NONE rather than 0. gcc/ChangeLog: * cfg.c (debug): Use TDF_NONE rather than 0. * cfghooks.c (debug): Likewise. * dumpfile.c (DUMP_FILE_INFO): Likewise; also for OPTGROUP. (struct dump_option_value_info): Convert to... (struct kv_pair): ...this template type. (dump_options): Convert to kv_pair<dump_flags_t>; use TDF_NONE rather than 0. (optinfo_verbosity_options): Likewise. (optgroup_options): Convert to kv_pair<optgroup_flags_t>; use OPTGROUP_NONE. (gcc::dump_manager::dump_register): Use optgroup_flags_t rather than int for "optgroup_flags" param. (dump_generic_expr_loc): Use dump_flags_t rather than int for "dump_kind" param. (dump_dec): Likewise. (dump_finish): Use TDF_NONE rather than 0. (gcc::dump_manager::opt_info_enable_passes): Use optgroup_flags_t rather than int for "optgroup_flags" param. Use TDF_NONE rather than 0. Update for change to option_ptr. (opt_info_switch_p_1): Convert "optgroup_flags" param from int * to optgroup_flags_t *. Use TDF_NONE and OPTGROUP_NONE rather than 0. Update for changes to optinfo_verbosity_options and optgroup_options. (opt_info_switch_p): Convert optgroup_flags from int to optgroup_flags_t. (dump_basic_block): Use dump_flags_t rather than int for "dump_kind" param. * dumpfile.h (TDF_ADDRESS, TDF_SLIM, TDF_RAW, TDF_DETAILS, TDF_STATS, TDF_BLOCKS, TDF_VOPS, TDF_LINENO, TDF_UID) TDF_STMTADDR, TDF_GRAPH, TDF_MEMSYMS, TDF_RHS_ONLY, TDF_ASMNAME, TDF_EH, TDF_NOUID, TDF_ALIAS, TDF_ENUMERATE_LOCALS, TDF_CSELIB, TDF_SCEV, TDF_GIMPLE, TDF_FOLDING, MSG_OPTIMIZED_LOCATIONS, MSG_MISSED_OPTIMIZATION, MSG_NOTE, MSG_ALL, TDF_COMPARE_DEBUG, TDF_NONE): Convert from macros to... (enum dump_flag): ...this new enum. (dump_flags_t): Update to use enum. (operator|, operator&, operator~, operator|=, operator&=): Implement for dump_flags_t. (OPTGROUP_NONE, OPTGROUP_IPA, OPTGROUP_LOOP, OPTGROUP_INLINE, OPTGROUP_OMP, OPTGROUP_VEC, OPTGROUP_OTHER, OPTGROUP_ALL): Convert from macros to... (enum optgroup_flag): ...this new enum. (optgroup_flags_t): New typedef. (operator|, operator|=): Implement for optgroup_flags_t. (struct dump_file_info): Convert field "alt_flags" to dump_flags_t. Convert field "optgroup_flags" to optgroup_flags_t. (dump_basic_block): Use dump_flags_t rather than int for param. (dump_generic_expr_loc): Likewise. (dump_dec): Likewise. (dump_register): Convert param "optgroup_flags" to optgroup_flags_t. (opt_info_enable_passes): Likewise. * early-remat.c (early_remat::dump_edge_list): Use TDF_NONE rather than 0. * gimple-pretty-print.c (debug): Likewise. * gimple-ssa-store-merging.c (bswap_replace): Likewise. (merged_store_group::apply_stores): Likewise. * gimple-ssa-strength-reduction.c (insert_initializers): Likewise. * gimple.c (verify_gimple_pp): Likewise. * graphite-poly.c (print_pbb_body): Likewise. * passes.c (pass_manager::register_one_dump_file): Convert local "optgroup_flags" to optgroup_flags_t. * print-tree.c (print_node): Use TDF_NONE rather than 0. (debug): Likewise. (debug_body): Likewise. * tree-pass.h (struct pass_data): Convert field "optgroup_flags" to optgroup_flags_t. * tree-pretty-print.c (print_struct_decl): Use TDF_NONE rather than 0. * tree-ssa-math-opts.c (convert_mult_to_fma_1): Likewise. (convert_mult_to_fma): Likewise. * tree-ssa-reassoc.c (undistribute_ops_list): Likewise. * tree-ssa-sccvn.c (vn_eliminate): Likewise. * tree-vect-data-refs.c (dump_lower_bound): Convert param "dump_kind" to dump_flags_t. From-SVN: r261325
2018-06-08 14:50:19 +02:00
for (const kv_pair<optgroup_flags_t> *option_ptr = optgroup_options;
option_ptr->name; option_ptr++)
invoke.texi: Update -fopt-info documentation. 2012-11-01 Sharad Singhai <singhai@google.com> * doc/invoke.texi: Update -fopt-info documentation. * dumpfile.c: Move dump_flags here from passes.c. Rename opt_info_options to optinfo_verbosity_options. Add optgroup_options. (dump_files): Add field for optinfo_flags in the static initializer. (dump_register): Handle additional parameter for optgroup_flags. (opt_info_enable_passes): Renamed opt_info_enable_all. Handle optgroup_flags. Fix documentation. (opt_info_switch_p_1): Handle optgroup options. (opt_info_switch_p): Handle optgroup_flags. Warn on multiple files. * dumpfile.h (dump_register): Additional argument for optgroup_flags. All callers updated. (struct dump_file_info): Add field for optgroup_flags. Define OPTGROUP_* flags. * tree-pass.h (struct opt_pass): Add addtional field for optinfo_flags. All opt_pass static initializers updated. * opts-global.c (dump_remap_tree_vectorizer_verbose): Use 'all' instead of 'optall'. (handle_common_deferred_options): Fix typo in error message. * passes.c (register_one_dump_file): Add argument for optgroup_flags. Turn on OPTGROUP_IPA for IPA passes. Move dump_flags from here to dumpfile.c. * statistics.c (statistics_early_init): Use OPTGROUP_NONE in call to dump_register. testsuite/ChangeLog * testsuite/gcc.dg/plugin/selfassign.c: Add opgtroup_flags initializer. * testsuite/gcc.dg/plugin/one_time_plugin.c: Likewise. * testsuite/g++.dg/plugin/selfassign.c: Likewise. * testsuite/g++.dg/plugin/dumb_plugin.c: Likewise. From-SVN: r193061
2012-11-01 08:34:44 +01:00
if (strlen (option_ptr->name) == length
&& !memcmp (option_ptr->name, ptr, length))
{
*optgroup_flags |= option_ptr->value;
goto found;
}
if (*ptr == '=')
{
/* Interpret rest of the argument as a dump filename. This
filename overrides other command line filenames. */
*filename = xstrdup (ptr + 1);
break;
}
else
invoke.texi: Update -fopt-info documentation. 2012-11-01 Sharad Singhai <singhai@google.com> * doc/invoke.texi: Update -fopt-info documentation. * dumpfile.c: Move dump_flags here from passes.c. Rename opt_info_options to optinfo_verbosity_options. Add optgroup_options. (dump_files): Add field for optinfo_flags in the static initializer. (dump_register): Handle additional parameter for optgroup_flags. (opt_info_enable_passes): Renamed opt_info_enable_all. Handle optgroup_flags. Fix documentation. (opt_info_switch_p_1): Handle optgroup options. (opt_info_switch_p): Handle optgroup_flags. Warn on multiple files. * dumpfile.h (dump_register): Additional argument for optgroup_flags. All callers updated. (struct dump_file_info): Add field for optgroup_flags. Define OPTGROUP_* flags. * tree-pass.h (struct opt_pass): Add addtional field for optinfo_flags. All opt_pass static initializers updated. * opts-global.c (dump_remap_tree_vectorizer_verbose): Use 'all' instead of 'optall'. (handle_common_deferred_options): Fix typo in error message. * passes.c (register_one_dump_file): Add argument for optgroup_flags. Turn on OPTGROUP_IPA for IPA passes. Move dump_flags from here to dumpfile.c. * statistics.c (statistics_early_init): Use OPTGROUP_NONE in call to dump_register. testsuite/ChangeLog * testsuite/gcc.dg/plugin/selfassign.c: Add opgtroup_flags initializer. * testsuite/gcc.dg/plugin/one_time_plugin.c: Likewise. * testsuite/g++.dg/plugin/selfassign.c: Likewise. * testsuite/g++.dg/plugin/dumb_plugin.c: Likewise. From-SVN: r193061
2012-11-01 08:34:44 +01:00
{
warning (0, "unknown option %q.*s in %<-fopt-info-%s%>",
length, ptr, arg);
return 0;
}
found:;
ptr = end_ptr;
}
return 1;
}
/* Return non-zero if ARG is a recognized switch for
-fopt-info. Return zero otherwise. */
int
opt_info_switch_p (const char *arg)
{
Introduce dump_flags_t type and use it instead of int type. 2017-05-17 Martin Liska <mliska@suse.cz> * class.c (dump_class_hierarchy): Introduce dump_flags_t type and use it instead of int type. (dump_vtable): Likewise. (dump_vtt): Likewise. * decl2.c (dump_tu): Likewise. 2017-05-17 Martin Liska <mliska@suse.cz> * c-common.h: Introduce dump_flags_t type and use it instead of int type. * c-gimplify.c (c_genericize): Likewise. * c-opts.c: Likewise. 2017-05-17 Martin Liska <mliska@suse.cz> * c-decl.c (c_parse_final_cleanups): Introduce dump_flags_t type and use it instead of int type. 2017-05-17 Martin Liska <mliska@suse.cz> * cfg.c: Introduce dump_flags_t type and use it instead of int type. * cfg.h: Likewise. * cfghooks.c: Likewise. * cfghooks.h (struct cfg_hooks): Likewise. * cfgrtl.c: Likewise. * cfgrtl.h: Likewise. * cgraph.c (cgraph_node::get_body): Likewise. * coretypes.h: Likewise. * domwalk.c: Likewise. * domwalk.h: Likewise. * dumpfile.c (struct dump_option_value_info): Likewise. (dump_enable_all): Likewise. (dump_switch_p_1): Likewise. (opt_info_switch_p): Likewise. * dumpfile.h (enum tree_dump_index): Likewise. (struct dump_file_info): Likewise. * genemit.c: Likewise. * generic-match-head.c: Likewise. * gengtype.c (open_base_files): Likewise. * gimple-pretty-print.c: Likewise. * gimple-pretty-print.h: Likewise. * graph.c (print_graph_cfg): Likewise. * graphite-scop-detection.c (dot_all_sese): Likewise. * ipa-devirt.c (build_type_inheritance_graph): Likewise. * loop-unroll.c (report_unroll): Likewise. * passes.c (pass_manager::register_one_dump_file): Likewise. * print-tree.c: Likewise. * statistics.c: Likewise. * tree-cfg.c: Likewise. * tree-cfg.h: Likewise. * tree-dfa.c: Likewise. * tree-dfa.h: Likewise. * tree-dump.c (dump_function): Likewise. * tree-dump.h (struct dump_info): Likewise. * tree-pretty-print.c: Likewise. * tree-pretty-print.h: Likewise. * tree-ssa-live.c: Likewise. * tree-ssa-live.h: Likewise. * tree-ssa-loop-ivcanon.c (try_unroll_loop_completely): Likewise. * tree-vect-loop.c: Likewise. * tree-vect-slp.c: Likewise. From-SVN: r248140
2017-05-17 11:01:36 +02:00
dump_flags_t flags;
Convert dump and optgroup flags to enums gcc/brig/ChangeLog: * brigfrontend/brig-to-generic.cc (brig_to_generic::write_globals): Use TDF_NONE rather than 0. (dump_function): Likewise. gcc/c-family/ChangeLog: * c-pretty-print.c (c_pretty_printer::statement): Use TDF_NONE rather than 0. gcc/ChangeLog: * cfg.c (debug): Use TDF_NONE rather than 0. * cfghooks.c (debug): Likewise. * dumpfile.c (DUMP_FILE_INFO): Likewise; also for OPTGROUP. (struct dump_option_value_info): Convert to... (struct kv_pair): ...this template type. (dump_options): Convert to kv_pair<dump_flags_t>; use TDF_NONE rather than 0. (optinfo_verbosity_options): Likewise. (optgroup_options): Convert to kv_pair<optgroup_flags_t>; use OPTGROUP_NONE. (gcc::dump_manager::dump_register): Use optgroup_flags_t rather than int for "optgroup_flags" param. (dump_generic_expr_loc): Use dump_flags_t rather than int for "dump_kind" param. (dump_dec): Likewise. (dump_finish): Use TDF_NONE rather than 0. (gcc::dump_manager::opt_info_enable_passes): Use optgroup_flags_t rather than int for "optgroup_flags" param. Use TDF_NONE rather than 0. Update for change to option_ptr. (opt_info_switch_p_1): Convert "optgroup_flags" param from int * to optgroup_flags_t *. Use TDF_NONE and OPTGROUP_NONE rather than 0. Update for changes to optinfo_verbosity_options and optgroup_options. (opt_info_switch_p): Convert optgroup_flags from int to optgroup_flags_t. (dump_basic_block): Use dump_flags_t rather than int for "dump_kind" param. * dumpfile.h (TDF_ADDRESS, TDF_SLIM, TDF_RAW, TDF_DETAILS, TDF_STATS, TDF_BLOCKS, TDF_VOPS, TDF_LINENO, TDF_UID) TDF_STMTADDR, TDF_GRAPH, TDF_MEMSYMS, TDF_RHS_ONLY, TDF_ASMNAME, TDF_EH, TDF_NOUID, TDF_ALIAS, TDF_ENUMERATE_LOCALS, TDF_CSELIB, TDF_SCEV, TDF_GIMPLE, TDF_FOLDING, MSG_OPTIMIZED_LOCATIONS, MSG_MISSED_OPTIMIZATION, MSG_NOTE, MSG_ALL, TDF_COMPARE_DEBUG, TDF_NONE): Convert from macros to... (enum dump_flag): ...this new enum. (dump_flags_t): Update to use enum. (operator|, operator&, operator~, operator|=, operator&=): Implement for dump_flags_t. (OPTGROUP_NONE, OPTGROUP_IPA, OPTGROUP_LOOP, OPTGROUP_INLINE, OPTGROUP_OMP, OPTGROUP_VEC, OPTGROUP_OTHER, OPTGROUP_ALL): Convert from macros to... (enum optgroup_flag): ...this new enum. (optgroup_flags_t): New typedef. (operator|, operator|=): Implement for optgroup_flags_t. (struct dump_file_info): Convert field "alt_flags" to dump_flags_t. Convert field "optgroup_flags" to optgroup_flags_t. (dump_basic_block): Use dump_flags_t rather than int for param. (dump_generic_expr_loc): Likewise. (dump_dec): Likewise. (dump_register): Convert param "optgroup_flags" to optgroup_flags_t. (opt_info_enable_passes): Likewise. * early-remat.c (early_remat::dump_edge_list): Use TDF_NONE rather than 0. * gimple-pretty-print.c (debug): Likewise. * gimple-ssa-store-merging.c (bswap_replace): Likewise. (merged_store_group::apply_stores): Likewise. * gimple-ssa-strength-reduction.c (insert_initializers): Likewise. * gimple.c (verify_gimple_pp): Likewise. * graphite-poly.c (print_pbb_body): Likewise. * passes.c (pass_manager::register_one_dump_file): Convert local "optgroup_flags" to optgroup_flags_t. * print-tree.c (print_node): Use TDF_NONE rather than 0. (debug): Likewise. (debug_body): Likewise. * tree-pass.h (struct pass_data): Convert field "optgroup_flags" to optgroup_flags_t. * tree-pretty-print.c (print_struct_decl): Use TDF_NONE rather than 0. * tree-ssa-math-opts.c (convert_mult_to_fma_1): Likewise. (convert_mult_to_fma): Likewise. * tree-ssa-reassoc.c (undistribute_ops_list): Likewise. * tree-ssa-sccvn.c (vn_eliminate): Likewise. * tree-vect-data-refs.c (dump_lower_bound): Convert param "dump_kind" to dump_flags_t. From-SVN: r261325
2018-06-08 14:50:19 +02:00
optgroup_flags_t optgroup_flags;
char *filename;
invoke.texi: Update -fopt-info documentation. 2012-11-01 Sharad Singhai <singhai@google.com> * doc/invoke.texi: Update -fopt-info documentation. * dumpfile.c: Move dump_flags here from passes.c. Rename opt_info_options to optinfo_verbosity_options. Add optgroup_options. (dump_files): Add field for optinfo_flags in the static initializer. (dump_register): Handle additional parameter for optgroup_flags. (opt_info_enable_passes): Renamed opt_info_enable_all. Handle optgroup_flags. Fix documentation. (opt_info_switch_p_1): Handle optgroup options. (opt_info_switch_p): Handle optgroup_flags. Warn on multiple files. * dumpfile.h (dump_register): Additional argument for optgroup_flags. All callers updated. (struct dump_file_info): Add field for optgroup_flags. Define OPTGROUP_* flags. * tree-pass.h (struct opt_pass): Add addtional field for optinfo_flags. All opt_pass static initializers updated. * opts-global.c (dump_remap_tree_vectorizer_verbose): Use 'all' instead of 'optall'. (handle_common_deferred_options): Fix typo in error message. * passes.c (register_one_dump_file): Add argument for optgroup_flags. Turn on OPTGROUP_IPA for IPA passes. Move dump_flags from here to dumpfile.c. * statistics.c (statistics_early_init): Use OPTGROUP_NONE in call to dump_register. testsuite/ChangeLog * testsuite/gcc.dg/plugin/selfassign.c: Add opgtroup_flags initializer. * testsuite/gcc.dg/plugin/one_time_plugin.c: Likewise. * testsuite/g++.dg/plugin/selfassign.c: Likewise. * testsuite/g++.dg/plugin/dumb_plugin.c: Likewise. From-SVN: r193061
2012-11-01 08:34:44 +01:00
static char *file_seen = NULL;
Introduce gcc::dump_manager class 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-10-14 18:15:38 +02:00
gcc::dump_manager *dumps = g->get_dumps ();
invoke.texi: Update -fopt-info documentation. 2012-11-01 Sharad Singhai <singhai@google.com> * doc/invoke.texi: Update -fopt-info documentation. * dumpfile.c: Move dump_flags here from passes.c. Rename opt_info_options to optinfo_verbosity_options. Add optgroup_options. (dump_files): Add field for optinfo_flags in the static initializer. (dump_register): Handle additional parameter for optgroup_flags. (opt_info_enable_passes): Renamed opt_info_enable_all. Handle optgroup_flags. Fix documentation. (opt_info_switch_p_1): Handle optgroup options. (opt_info_switch_p): Handle optgroup_flags. Warn on multiple files. * dumpfile.h (dump_register): Additional argument for optgroup_flags. All callers updated. (struct dump_file_info): Add field for optgroup_flags. Define OPTGROUP_* flags. * tree-pass.h (struct opt_pass): Add addtional field for optinfo_flags. All opt_pass static initializers updated. * opts-global.c (dump_remap_tree_vectorizer_verbose): Use 'all' instead of 'optall'. (handle_common_deferred_options): Fix typo in error message. * passes.c (register_one_dump_file): Add argument for optgroup_flags. Turn on OPTGROUP_IPA for IPA passes. Move dump_flags from here to dumpfile.c. * statistics.c (statistics_early_init): Use OPTGROUP_NONE in call to dump_register. testsuite/ChangeLog * testsuite/gcc.dg/plugin/selfassign.c: Add opgtroup_flags initializer. * testsuite/gcc.dg/plugin/one_time_plugin.c: Likewise. * testsuite/g++.dg/plugin/selfassign.c: Likewise. * testsuite/g++.dg/plugin/dumb_plugin.c: Likewise. From-SVN: r193061
2012-11-01 08:34:44 +01:00
if (!opt_info_switch_p_1 (arg, &flags, &optgroup_flags, &filename))
return 0;
if (!filename)
filename = xstrdup ("stderr");
invoke.texi: Update -fopt-info documentation. 2012-11-01 Sharad Singhai <singhai@google.com> * doc/invoke.texi: Update -fopt-info documentation. * dumpfile.c: Move dump_flags here from passes.c. Rename opt_info_options to optinfo_verbosity_options. Add optgroup_options. (dump_files): Add field for optinfo_flags in the static initializer. (dump_register): Handle additional parameter for optgroup_flags. (opt_info_enable_passes): Renamed opt_info_enable_all. Handle optgroup_flags. Fix documentation. (opt_info_switch_p_1): Handle optgroup options. (opt_info_switch_p): Handle optgroup_flags. Warn on multiple files. * dumpfile.h (dump_register): Additional argument for optgroup_flags. All callers updated. (struct dump_file_info): Add field for optgroup_flags. Define OPTGROUP_* flags. * tree-pass.h (struct opt_pass): Add addtional field for optinfo_flags. All opt_pass static initializers updated. * opts-global.c (dump_remap_tree_vectorizer_verbose): Use 'all' instead of 'optall'. (handle_common_deferred_options): Fix typo in error message. * passes.c (register_one_dump_file): Add argument for optgroup_flags. Turn on OPTGROUP_IPA for IPA passes. Move dump_flags from here to dumpfile.c. * statistics.c (statistics_early_init): Use OPTGROUP_NONE in call to dump_register. testsuite/ChangeLog * testsuite/gcc.dg/plugin/selfassign.c: Add opgtroup_flags initializer. * testsuite/gcc.dg/plugin/one_time_plugin.c: Likewise. * testsuite/g++.dg/plugin/selfassign.c: Likewise. * testsuite/g++.dg/plugin/dumb_plugin.c: Likewise. From-SVN: r193061
2012-11-01 08:34:44 +01:00
/* Bail out if a different filename has been specified. */
if (file_seen && strcmp (file_seen, filename))
{
warning (0, "ignoring possibly conflicting option %<-fopt-info-%s%>",
arg);
return 1;
}
file_seen = xstrdup (filename);
if (!flags)
dumpfile.c (opt_info_switch_p): Change -fopt-info default to -fopt-info=optimized instead of all. 2013-06-03 Teresa Johnson <tejohnson@google.com> * dumpfile.c (opt_info_switch_p): Change -fopt-info default to -fopt-info=optimized instead of all. * doc/invoke.texi: Ditto. * tree-vectorizer.c (vectorize_loops): Emit loop vectorization success under MSG_OPTIMIZED_LOCATIONS, and use dump_printf_loc. (execute_vect_slp): Emit BB vectorization success under MSG_OPTIMIZED_LOCATIONS. * tree-vect-slp.c (vect_slp_transform_bb): Change MSG_OPTIMIZED_LOCATIONS to MSG_NOTE. * tree-vect-loop.c (vect_transform_loop): Ditto. * testsuite/gcc.dg/vect/bb-slp-31.c: Update vect dump message. * testsuite/gcc.dg/vect/bb-slp-14.c: Ditto. * testsuite/gcc.dg/vect/fast-math-bb-slp-call-1.c: Ditto. * testsuite/gcc.dg/vect/bb-slp-23.c: Ditto. * testsuite/gcc.dg/vect/bb-slp-15.c: Ditto. * testsuite/gcc.dg/vect/fast-math-bb-slp-call-2.c: Ditto. * testsuite/gcc.dg/vect/bb-slp-24.c: Ditto. * testsuite/gcc.dg/vect/bb-slp-16.c: Ditto. * testsuite/gcc.dg/vect/bb-slp-25.c: Ditto. * testsuite/gcc.dg/vect/bb-slp-pattern-2.c: Ditto. * testsuite/gcc.dg/vect/bb-slp-17.c: Ditto. * testsuite/gcc.dg/vect/bb-slp-1.c: Ditto. * testsuite/gcc.dg/vect/bb-slp-26.c: Ditto. * testsuite/gcc.dg/vect/bb-slp-18.c: Ditto. * testsuite/gcc.dg/vect/bb-slp-2.c: Ditto. * testsuite/gcc.dg/vect/no-tree-reassoc-bb-slp-12.c: Ditto. * testsuite/gcc.dg/vect/bb-slp-27.c: Ditto. * testsuite/gcc.dg/vect/bb-slp-19.c: Ditto. * testsuite/gcc.dg/vect/bb-slp-3.c: Ditto. * testsuite/gcc.dg/vect/bb-slp-28.c: Ditto. * testsuite/gcc.dg/vect/bb-slp-4.c: Ditto. * testsuite/gcc.dg/vect/bb-slp-29.c: Ditto. * testsuite/gcc.dg/vect/bb-slp-5.c: Ditto. * testsuite/gcc.dg/vect/bb-slp-6.c: Ditto. * testsuite/gcc.dg/vect/bb-slp-8a.c: Ditto. * testsuite/gcc.dg/vect/bb-slp-7.c: Ditto. * testsuite/gcc.dg/vect/bb-slp-8b.c: Ditto. * testsuite/gcc.dg/vect/bb-slp-8.c: Ditto. * testsuite/gcc.dg/vect/bb-slp-9.c: Ditto. * testsuite/gcc.dg/vect/bb-slp-10.c: Ditto. * testsuite/gcc.dg/vect/bb-slp-11.c: Ditto. * testsuite/gcc.dg/vect/bb-slp-20.c: Ditto. * testsuite/gcc.dg/vect/bb-slp-cond-1.c: Ditto. * testsuite/gcc.dg/vect/bb-slp-21.c: Ditto. * testsuite/gcc.dg/vect/bb-slp-30.c: Ditto. * testsuite/gcc.dg/vect/bb-slp-13.c: Ditto. * testsuite/gcc.dg/vect/bb-slp-22.c: Ditto. * testsuite/g++.dg/vect/slp-pr50413.cc: Ditto. * testsuite/g++.dg/vect/slp-pr56812.cc: Ditto. * testsuite/g++.dg/vect/slp-pr50819.cc: Ditto. From-SVN: r199620
2013-06-03 20:39:04 +02:00
flags = MSG_OPTIMIZED_LOCATIONS;
invoke.texi: Update -fopt-info documentation. 2012-11-01 Sharad Singhai <singhai@google.com> * doc/invoke.texi: Update -fopt-info documentation. * dumpfile.c: Move dump_flags here from passes.c. Rename opt_info_options to optinfo_verbosity_options. Add optgroup_options. (dump_files): Add field for optinfo_flags in the static initializer. (dump_register): Handle additional parameter for optgroup_flags. (opt_info_enable_passes): Renamed opt_info_enable_all. Handle optgroup_flags. Fix documentation. (opt_info_switch_p_1): Handle optgroup options. (opt_info_switch_p): Handle optgroup_flags. Warn on multiple files. * dumpfile.h (dump_register): Additional argument for optgroup_flags. All callers updated. (struct dump_file_info): Add field for optgroup_flags. Define OPTGROUP_* flags. * tree-pass.h (struct opt_pass): Add addtional field for optinfo_flags. All opt_pass static initializers updated. * opts-global.c (dump_remap_tree_vectorizer_verbose): Use 'all' instead of 'optall'. (handle_common_deferred_options): Fix typo in error message. * passes.c (register_one_dump_file): Add argument for optgroup_flags. Turn on OPTGROUP_IPA for IPA passes. Move dump_flags from here to dumpfile.c. * statistics.c (statistics_early_init): Use OPTGROUP_NONE in call to dump_register. testsuite/ChangeLog * testsuite/gcc.dg/plugin/selfassign.c: Add opgtroup_flags initializer. * testsuite/gcc.dg/plugin/one_time_plugin.c: Likewise. * testsuite/g++.dg/plugin/selfassign.c: Likewise. * testsuite/g++.dg/plugin/dumb_plugin.c: Likewise. From-SVN: r193061
2012-11-01 08:34:44 +01:00
if (!optgroup_flags)
optgroup_flags = OPTGROUP_ALL;
Introduce gcc::dump_manager class 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-10-14 18:15:38 +02:00
return dumps->opt_info_enable_passes (optgroup_flags, flags, filename);
}
/* Print basic block on the dump streams. */
void
Convert dump and optgroup flags to enums gcc/brig/ChangeLog: * brigfrontend/brig-to-generic.cc (brig_to_generic::write_globals): Use TDF_NONE rather than 0. (dump_function): Likewise. gcc/c-family/ChangeLog: * c-pretty-print.c (c_pretty_printer::statement): Use TDF_NONE rather than 0. gcc/ChangeLog: * cfg.c (debug): Use TDF_NONE rather than 0. * cfghooks.c (debug): Likewise. * dumpfile.c (DUMP_FILE_INFO): Likewise; also for OPTGROUP. (struct dump_option_value_info): Convert to... (struct kv_pair): ...this template type. (dump_options): Convert to kv_pair<dump_flags_t>; use TDF_NONE rather than 0. (optinfo_verbosity_options): Likewise. (optgroup_options): Convert to kv_pair<optgroup_flags_t>; use OPTGROUP_NONE. (gcc::dump_manager::dump_register): Use optgroup_flags_t rather than int for "optgroup_flags" param. (dump_generic_expr_loc): Use dump_flags_t rather than int for "dump_kind" param. (dump_dec): Likewise. (dump_finish): Use TDF_NONE rather than 0. (gcc::dump_manager::opt_info_enable_passes): Use optgroup_flags_t rather than int for "optgroup_flags" param. Use TDF_NONE rather than 0. Update for change to option_ptr. (opt_info_switch_p_1): Convert "optgroup_flags" param from int * to optgroup_flags_t *. Use TDF_NONE and OPTGROUP_NONE rather than 0. Update for changes to optinfo_verbosity_options and optgroup_options. (opt_info_switch_p): Convert optgroup_flags from int to optgroup_flags_t. (dump_basic_block): Use dump_flags_t rather than int for "dump_kind" param. * dumpfile.h (TDF_ADDRESS, TDF_SLIM, TDF_RAW, TDF_DETAILS, TDF_STATS, TDF_BLOCKS, TDF_VOPS, TDF_LINENO, TDF_UID) TDF_STMTADDR, TDF_GRAPH, TDF_MEMSYMS, TDF_RHS_ONLY, TDF_ASMNAME, TDF_EH, TDF_NOUID, TDF_ALIAS, TDF_ENUMERATE_LOCALS, TDF_CSELIB, TDF_SCEV, TDF_GIMPLE, TDF_FOLDING, MSG_OPTIMIZED_LOCATIONS, MSG_MISSED_OPTIMIZATION, MSG_NOTE, MSG_ALL, TDF_COMPARE_DEBUG, TDF_NONE): Convert from macros to... (enum dump_flag): ...this new enum. (dump_flags_t): Update to use enum. (operator|, operator&, operator~, operator|=, operator&=): Implement for dump_flags_t. (OPTGROUP_NONE, OPTGROUP_IPA, OPTGROUP_LOOP, OPTGROUP_INLINE, OPTGROUP_OMP, OPTGROUP_VEC, OPTGROUP_OTHER, OPTGROUP_ALL): Convert from macros to... (enum optgroup_flag): ...this new enum. (optgroup_flags_t): New typedef. (operator|, operator|=): Implement for optgroup_flags_t. (struct dump_file_info): Convert field "alt_flags" to dump_flags_t. Convert field "optgroup_flags" to optgroup_flags_t. (dump_basic_block): Use dump_flags_t rather than int for param. (dump_generic_expr_loc): Likewise. (dump_dec): Likewise. (dump_register): Convert param "optgroup_flags" to optgroup_flags_t. (opt_info_enable_passes): Likewise. * early-remat.c (early_remat::dump_edge_list): Use TDF_NONE rather than 0. * gimple-pretty-print.c (debug): Likewise. * gimple-ssa-store-merging.c (bswap_replace): Likewise. (merged_store_group::apply_stores): Likewise. * gimple-ssa-strength-reduction.c (insert_initializers): Likewise. * gimple.c (verify_gimple_pp): Likewise. * graphite-poly.c (print_pbb_body): Likewise. * passes.c (pass_manager::register_one_dump_file): Convert local "optgroup_flags" to optgroup_flags_t. * print-tree.c (print_node): Use TDF_NONE rather than 0. (debug): Likewise. (debug_body): Likewise. * tree-pass.h (struct pass_data): Convert field "optgroup_flags" to optgroup_flags_t. * tree-pretty-print.c (print_struct_decl): Use TDF_NONE rather than 0. * tree-ssa-math-opts.c (convert_mult_to_fma_1): Likewise. (convert_mult_to_fma): Likewise. * tree-ssa-reassoc.c (undistribute_ops_list): Likewise. * tree-ssa-sccvn.c (vn_eliminate): Likewise. * tree-vect-data-refs.c (dump_lower_bound): Convert param "dump_kind" to dump_flags_t. From-SVN: r261325
2018-06-08 14:50:19 +02:00
dump_basic_block (dump_flags_t dump_kind, basic_block bb, int indent)
{
if (dump_file && (dump_kind & pflags))
dump_bb (dump_file, bb, indent, TDF_DETAILS);
if (alt_dump_file && (dump_kind & alt_flags))
dump_bb (alt_dump_file, bb, indent, TDF_DETAILS);
}
/* Dump FUNCTION_DECL FN as tree dump PHASE. */
void
dump_function (int phase, tree fn)
{
FILE *stream;
Introduce dump_flags_t type and use it instead of int type. 2017-05-17 Martin Liska <mliska@suse.cz> * class.c (dump_class_hierarchy): Introduce dump_flags_t type and use it instead of int type. (dump_vtable): Likewise. (dump_vtt): Likewise. * decl2.c (dump_tu): Likewise. 2017-05-17 Martin Liska <mliska@suse.cz> * c-common.h: Introduce dump_flags_t type and use it instead of int type. * c-gimplify.c (c_genericize): Likewise. * c-opts.c: Likewise. 2017-05-17 Martin Liska <mliska@suse.cz> * c-decl.c (c_parse_final_cleanups): Introduce dump_flags_t type and use it instead of int type. 2017-05-17 Martin Liska <mliska@suse.cz> * cfg.c: Introduce dump_flags_t type and use it instead of int type. * cfg.h: Likewise. * cfghooks.c: Likewise. * cfghooks.h (struct cfg_hooks): Likewise. * cfgrtl.c: Likewise. * cfgrtl.h: Likewise. * cgraph.c (cgraph_node::get_body): Likewise. * coretypes.h: Likewise. * domwalk.c: Likewise. * domwalk.h: Likewise. * dumpfile.c (struct dump_option_value_info): Likewise. (dump_enable_all): Likewise. (dump_switch_p_1): Likewise. (opt_info_switch_p): Likewise. * dumpfile.h (enum tree_dump_index): Likewise. (struct dump_file_info): Likewise. * genemit.c: Likewise. * generic-match-head.c: Likewise. * gengtype.c (open_base_files): Likewise. * gimple-pretty-print.c: Likewise. * gimple-pretty-print.h: Likewise. * graph.c (print_graph_cfg): Likewise. * graphite-scop-detection.c (dot_all_sese): Likewise. * ipa-devirt.c (build_type_inheritance_graph): Likewise. * loop-unroll.c (report_unroll): Likewise. * passes.c (pass_manager::register_one_dump_file): Likewise. * print-tree.c: Likewise. * statistics.c: Likewise. * tree-cfg.c: Likewise. * tree-cfg.h: Likewise. * tree-dfa.c: Likewise. * tree-dfa.h: Likewise. * tree-dump.c (dump_function): Likewise. * tree-dump.h (struct dump_info): Likewise. * tree-pretty-print.c: Likewise. * tree-pretty-print.h: Likewise. * tree-ssa-live.c: Likewise. * tree-ssa-live.h: Likewise. * tree-ssa-loop-ivcanon.c (try_unroll_loop_completely): Likewise. * tree-vect-loop.c: Likewise. * tree-vect-slp.c: Likewise. From-SVN: r248140
2017-05-17 11:01:36 +02:00
dump_flags_t flags;
stream = dump_begin (phase, &flags);
if (stream)
{
dump_function_to_file (fn, stream, flags);
dump_end (phase, stream);
}
}
/* Print information from the combine pass on dump_file. */
void
print_combine_total_stats (void)
{
if (dump_file)
dump_combine_total_stats (dump_file);
}
/* Enable RTL dump for all the RTL passes. */
bool
enable_rtl_dump_file (void)
{
Introduce gcc::dump_manager class 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-10-14 18:15:38 +02:00
gcc::dump_manager *dumps = g->get_dumps ();
int num_enabled =
dumps->dump_enable_all (DK_rtl, dump_flags_t (TDF_DETAILS) | TDF_BLOCKS,
NULL);
Introduce gcc::dump_manager class 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-10-14 18:15:38 +02:00
return num_enabled > 0;
}
Introduce dump_location_t gcc/ChangeLog: * cfgloop.c (get_loop_location): Convert return type from location_t to dump_user_location_t, replacing INSN_LOCATION lookups by implicit construction from rtx_insn *, and using dump_user_location_t::from_function_decl for the fallback case. * cfgloop.h (get_loop_location): Convert return type from location_t to dump_user_location_t. * cgraphunit.c (walk_polymorphic_call_targets): Update call to dump_printf_loc to pass in a dump_location_t rather than a location_t, via the gimple stmt. * coverage.c (get_coverage_counts): Update calls to dump_printf_loc to pass in dump_location_t rather than a location_t. * doc/optinfo.texi (Dump types): Convert example of dump_printf_loc from taking "locus" to taking "insn". Update description of the "_loc" calls to cover dump_location_t. * dumpfile.c: Include "backend.h", "gimple.h", "rtl.h", and "selftest.h". (dump_user_location_t::dump_user_location_t): New constructors, from gimple *stmt and rtx_insn *. (dump_user_location_t::from_function_decl): New function. (dump_loc): Make static. (dump_gimple_stmt_loc): Convert param "loc" from location_t to const dump_location_t &. (dump_generic_expr_loc): Delete. (dump_printf_loc): Convert param "loc" from location_t to const dump_location_t &. (selftest::test_impl_location): New function. (selftest::dumpfile_c_tests): New function. * dumpfile.h: Include "profile-count.h". (class dump_user_location_t): New class. (struct dump_impl_location_t): New struct. (class dump_location_t): New class. (dump_printf_loc): Convert 2nd param from source_location to const dump_location_t &. (dump_generic_expr_loc): Delete. (dump_gimple_stmt_loc): Convert 2nd param from source_location to const dump_location_t &. * gimple-fold.c (fold_gimple_assign): Update call to dump_printf_loc to pass in a dump_location_t rather than a location_t, via the gimple stmt. (gimple_fold_call): Likewise. * gimple-loop-interchange.cc (loop_cand::analyze_iloop_reduction_var): Update for change to check_reduction_path. (tree_loop_interchange::interchange): Update for change to find_loop_location. * graphite-isl-ast-to-gimple.c (scop_to_isl_ast): Update for change in return-type of find_loop_location. (graphite_regenerate_ast_isl): Likewise. * graphite-optimize-isl.c (optimize_isl): Likewise. * graphite.c (graphite_transform_loops): Likewise. * ipa-devirt.c (ipa_devirt): Update call to dump_printf_loc to pass in a dump_location_t rather than a location_t, via the gimple stmt. * ipa-prop.c (ipa_make_edge_direct_to_target): Likewise. * ipa.c (walk_polymorphic_call_targets): Likewise. * loop-unroll.c (report_unroll): Convert "locus" param from location_t to dump_location_t. (decide_unrolling): Update for change to get_loop_location's return type. * omp-grid.c (struct grid_prop): Convert field "target_loc" from location_t to dump_user_location_t. (grid_find_single_omp_among_assignments_1): Updates calls to dump_printf_loc to pass in a dump_location_t rather than a location_t, via the gimple stmt. (grid_parallel_clauses_gridifiable): Convert "tloc" from location_t to dump_location_t. Updates calls to dump_printf_loc to pass in a dump_location_t rather than a location_t, via the gimple stmt. (grid_inner_loop_gridifiable_p): Likewise. (grid_dist_follows_simple_pattern): Likewise. (grid_gfor_follows_tiling_pattern): Likewise. (grid_target_follows_gridifiable_pattern): Likewise. (grid_attempt_target_gridification): Convert initialization of local "grid" from memset to zero-initialization; FIXME: does this require C++11? Update call to dump_printf_loc to pass in a optinfo_location rather than a location_t, via the gimple stmt. * profile.c (read_profile_edge_counts): Updates call to dump_printf_loc to pass in a dump_location_t rather than a location_t (compute_branch_probabilities): Likewise. * selftest-run-tests.c (selftest::run_tests): Call dumpfile_c_tests. * selftest.h (dumpfile_c_tests): New decl. * tree-loop-distribution.c (pass_loop_distribution::execute): Update for change in return type of find_loop_location. * tree-parloops.c (parallelize_loops): Likewise. * tree-ssa-loop-ivcanon.c (try_unroll_loop_completely): Convert "locus" from location_t to dump_user_location_t. (canonicalize_loop_induction_variables): Likewise. * tree-ssa-loop-ivopts.c (tree_ssa_iv_optimize_loop): Update for change in return type of find_loop_location. * tree-ssa-loop-niter.c (number_of_iterations_exit): Update call to dump_printf_loc to pass in a dump_location_t rather than a location_t, via the stmt. * tree-ssa-sccvn.c (eliminate_dom_walker::before_dom_children): Likewise. * tree-vect-loop-manip.c (find_loop_location): Convert return type from source_location to dump_user_location_t. (vect_do_peeling): Update for above change. (vect_loop_versioning): Update for change in type of vect_location. * tree-vect-loop.c (check_reduction_path): Convert "loc" param from location_t to dump_user_location_t. (vect_estimate_min_profitable_iters): Update for change in type of vect_location. * tree-vect-slp.c (vect_print_slp_tree): Convert param "loc" from location_t to dump_location_t. (vect_slp_bb): Update for change in type of vect_location. * tree-vectorizer.c (vect_location): Convert from source_location to dump_user_location_t. (try_vectorize_loop_1): Update for change in vect_location's type. (vectorize_loops): Likewise. (increase_alignment): Likewise. * tree-vectorizer.h (vect_location): Convert from source_location to dump_user_location_t. (find_loop_location): Convert return type from source_location to dump_user_location_t. (check_reduction_path): Convert 1st param from location_t to dump_user_location_t. * value-prof.c (check_counter): Update call to dump_printf_loc to pass in a dump_user_location_t rather than a location_t; update call to error_at for change in type of "locus". (check_ic_target): Update call to dump_printf_loc to pass in a dump_user_location_t rather than a location_t, via the call_stmt. From-SVN: r262149
2018-06-26 15:34:59 +02:00
#if CHECKING_P
namespace selftest {
/* Verify that the dump_location_t constructors capture the source location
at which they were called (provided that the build compiler is sufficiently
recent). */
static void
test_impl_location ()
{
#if __GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 8)
/* Default ctor. */
{
dump_location_t loc;
const int expected_line = __LINE__ - 1;
ASSERT_STR_CONTAINS (loc.get_impl_location ().m_file, "dumpfile.c");
ASSERT_EQ (loc.get_impl_location ().m_line, expected_line);
}
/* Constructing from a gimple. */
{
dump_location_t loc ((gimple *)NULL);
const int expected_line = __LINE__ - 1;
ASSERT_STR_CONTAINS (loc.get_impl_location ().m_file, "dumpfile.c");
ASSERT_EQ (loc.get_impl_location ().m_line, expected_line);
}
/* Constructing from an rtx_insn. */
{
dump_location_t loc ((rtx_insn *)NULL);
const int expected_line = __LINE__ - 1;
ASSERT_STR_CONTAINS (loc.get_impl_location ().m_file, "dumpfile.c");
ASSERT_EQ (loc.get_impl_location ().m_line, expected_line);
}
#endif
}
/* Run all of the selftests within this file. */
void
dumpfile_c_tests ()
{
test_impl_location ();
}
} // namespace selftest
#endif /* CHECKING_P */