gcc/gcc/ipa-inline-transform.c

676 lines
23 KiB
C
Raw Normal View History

/* Callgraph transformations to handle inlining
Copyright (C) 2003-2017 Free Software Foundation, Inc.
Contributed by Jan Hubicka
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/>. */
/* The inline decisions are stored in callgraph in "inline plan" and
applied later.
To mark given call inline, use inline_call function.
The function marks the edge inlinable and, if necessary, produces
virtual clone in the callgraph representing the new copy of callee's
function body.
The inline plan is applied on given function body by inline_transform. */
#include "config.h"
#include "system.h"
#include "coretypes.h"
#include "tm.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 "function.h"
#include "tree.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 "alloc-pool.h"
#include "tree-pass.h"
#include "cgraph.h"
tree-ssa.h: Remove all #include's * tree-ssa.h: Remove all #include's * gengtype.c (open_base_files): Adjust include list for gtype-desc.c. * alias.c: Move required includes from tree-ssa.h. * asan.c: Likewise. * builtins.c: Likewise. * calls.c: Likewise. * cfgexpand.c: Likewise. * cfghooks.c: Likewise. * cfgloop.c: Likewise. * cfgloopmanip.c: Likewise. * cgraph.c: Likewise. * cgraphbuild.c: Likewise. * cgraphclones.c: Likewise. * cgraphunit.c: Likewise. * dse.c: Likewise. * except.c: Likewise. * expr.c: Likewise. * final.c: Likewise. * fold-const.c: Likewise. * ggc-page.c: Likewise. * gimple-builder.c: Likewise. * gimple-fold.c: Likewise. * gimple-iterator.c: Likewise. * gimple-low.c: Likewise. * gimple-pretty-print.c: Likewise. * gimple-ssa-strength-reduction.c: Likewise. * gimple-streamer-in.c: Likewise. * gimple-streamer-out.c: Likewise. * gimplify.c: Likewise. * graphite-blocking.c: Likewise. * graphite-clast-to-gimple.c: Likewise. * graphite-dependences.c: Likewise. * graphite-interchange.c: Likewise. * graphite-optimize-isl.c: Likewise. * graphite-poly.c: Likewise. * graphite-scop-detection.c: Likewise. * graphite-sese-to-poly.c: Likewise. * graphite.c: Likewise. * ipa-cp.c: Likewise. * ipa-inline-analysis.c: Likewise. * ipa-inline-transform.c: Likewise. * ipa-inline.c: Likewise. * ipa-prop.c: Likewise. * ipa-pure-const.c: Likewise. * ipa-reference.c: Likewise. * ipa-split.c: Likewise. * ipa-utils.c: Likewise. * loop-init.c: Likewise. * lto-cgraph.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. * omp-low.c: Likewise. * passes.c: Likewise. * predict.c: Likewise. * print-tree.c: Likewise. * profile.c: Likewise. * sese.c: Likewise. * targhooks.c: Likewise. * tracer.c: Likewise. * trans-mem.c: Likewise. * tree-call-cdce.c: Likewise. * tree-cfg.c: Likewise. * tree-cfgcleanup.c: Likewise. * tree-chrec.c: Likewise. * tree-complex.c: Likewise. * tree-data-ref.c: Likewise. * tree-dfa.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-loop-distribution.c: Likewise. * tree-mudflap.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-copyrename.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-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-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. * value-prof.c: Likewise. * var-tracking.c: Likewise. * varpool.c: Likewise. * vtable-verify.c: Likewise. From-SVN: r203967
2013-10-23 14:16:58 +02:00
#include "tree-cfg.h"
ipa-prop uses symbol_summary class. * lto-partition.c: Include of symbol-summary.h is added. * lto-symtab.c: Likewise. * lto.c: Likewise. * auto-profile.c: Include of symbol-summary.h is added. * cgraph.c: Likewise. * cgraphbuild.c: Likewise. * cgraphclones.c: Likewise. * cgraphunit.c: Likewise. * ipa-cp.c: Likewise. * ipa-devirt.c: Likewise. * ipa-icf.c: Likewise. * ipa-inline-analysis.c (evaluate_properties_for_edge): New ipa_node_params_sum data structure is used. (inline_node_duplication_hook): Likewise. (estimate_function_body_sizes): Likewise. (remap_edge_change_prob): Likewise. (inline_merge_summary): Likewise. * ipa-inline-transform.c: Include of symbol-summary.h is added. * ipa-inline.c (early_inliner): New ipa_node_params_sum data structure is used. * ipa-polymorphic-call.c: Include of symbol-summary.h is added. * ipa-profile.c: Include of symbol-summary.h is added. * ipa-prop.c (ipa_propagate_indirect_call_infos): New ipa_node_params_sum data structure is used. (ipa_node_params::~ipa_node_params): New function. (ipa_free_all_node_params): Destruction is simplified. (ipa_node_removal_hook): Removed. (ipa_add_new_function): Renamed from ipa_node_duplication_hook. (ipa_node_params_t::duplicate): New function. (ipa_register_cgraph_hooks): Few hooks are removed. (ipa_unregister_cgraph_hooks): Likewise. (ipa_prop_write_jump_functions): New ipa_node_params_sum is used. * ipa-prop.h (struct ipa_node_params): Destructor introduced for the structure. (ipa_check_create_node_params): Vector for ipa_node_params is replaced with function_summary. * ipa-split.c: Include of symbol-summary.h is added. * ipa-utils.c: Include of symbol-summary.h is added. * ipa.c: Include of symbol-summary.h is added. * omp-low.c: Include of symbol-summary.h is added. * tree-inline.c: Include of symbol-summary.h is added. * tree-sra.c: Include of symbol-summary.h is added. * tree-ssa-pre.c: Include of symbol-summary.h is added. From-SVN: r219005
2014-12-22 10:19:09 +01:00
#include "symbol-summary.h"
Add IPA VRP gcc/lto/ChangeLog: 2016-09-21 Kugan Vivekanandarajah <kuganv@linaro.org> * lto-partition.c: Include tree-vrp.h. * lto.c: Likewise. gcc/testsuite/ChangeLog: 2016-09-21 Kugan Vivekanandarajah <kuganv@linaro.org> * g++.dg/ipa/pure-const-3.C: Add -fno-ipa-vrp. Else constant arguments will be optimized away. * gcc.dg/ipa/vrp1.c: New test. * gcc.dg/ipa/vrp2.c: New test. * gcc.dg/ipa/vrp3.c: New test. gcc/ChangeLog: 2016-09-21 Kugan Vivekanandarajah <kuganv@linaro.org> * common.opt: New option -fipa-vrp. * ipa-cp.c (ipa_get_vr_lat): New. (ipcp_vr_lattice::print): Likewise. (print_all_lattices): Call ipcp_vr_lattice::print. (ipcp_vr_lattice::meet_with): New. (ipcp_vr_lattice::meet_with_1): Likewise. (ipcp_vr_lattice::top_p): Likewise. (ipcp_vr_lattice::bottom_p): Likewsie. (ipcp_vr_lattice::set_to_bottom): Likewise. (set_all_contains_variable): Call VR set_to_bottom. (initialize_node_lattices): Init VR lattices. (propagate_vr_accross_jump_function): New. (propagate_constants_accross_call): Call propagate_vr_accross_jump_function. (ipcp_store_vr_results): New. (ipcp_driver): Handle VR. * ipa-prop.c (ipa_print_node_jump_functions_for_edge): Handle VR. (ipa_set_jf_unknown): Likewise. (ipa_compute_jump_functions_for_edge): Likewise. (ipa_node_params_t::duplicate): Likewise. (ipa_write_jump_function): Likewise. (ipa_read_jump_function): Likewise. (write_ipcp_transformation_info): Likewise. (read_ipcp_transformation_info): Likewise. (ipcp_update_vr): New. (ipcp_transform_function): Handle VR. * ipa-prop.h (struct ipa_vr): New. * cgraph.c: Include tree-vrp.h. * cgraphunit.c: Likewise. * ipa-utils.c: Likewise. * ipa.c: Likewise. From-SVN: r240292
2016-09-21 01:29:05 +02:00
#include "tree-vrp.h"
#include "ipa-prop.h"
#include "ipa-inline.h"
#include "tree-inline.h"
int ncalls_inlined;
int nfunctions_inlined;
cgraphbuild.c (build_cgraph_edges): Update call of cgraph_create_edge and cgraph_create_indirect_edge. * cgraphbuild.c (build_cgraph_edges): Update call of cgraph_create_edge and cgraph_create_indirect_edge. * cgraph.c (cgraph_create_edge_including_clones, cgraph_create_edge_1, cgraph_allocate_init_indirect_info, cgraph_update_edges_for_call_stmt_node): Do not take nest argument; do not initialize call_stmt_size/time. (dump_cgraph_node): Do not dump nest. (cgraph_clone_edge): Do not take loop_nest argument; do not propagate it; do not clone call_stmt_size/time. (cgraph_clone_node): Likewise. (cgraph_create_virtual_clone): Update. * cgraph.h (struct cgraph_edge): Remove call_stmt_size/call_stmt_time/loop_nest. (cgraph_create_edge, cgraph_create_indirect_edge, cgraph_create_edge_including_clones, cgraph_clone_node): Update prototype. * tree-emutls.c (gen_emutls_addr): Update. * ipa-inline-transform.c (update_noncloned_frequencies): Do not handle loop_nest; handle indirect calls, too. (clone_inlined_nodes): Do not care about updating inline summaries. * cgraphunit.c (cgraph_copy_node_for_versioning): Update. * lto-cgraph.c (lto_output_edge, input_node, input_edge): Do not stream call_stmt_size/call_stmt_time/loop_nest. * ipa-inline.c (edge_badness): Update. (ipa_inline): dump summaries after inlining. * ipa-inline.h (struct inline_edge_summary, inline_edge_summary_t): new. (inline_edge_summary): New function. * ipa-inline-analysis.c (edge_duplication_hook_holder): New holder. (inline_edge_removal_hook): Handle edge summaries. (inline_edge_duplication_hook): New hook. (inline_summary_alloc): Alloc hooks. (initialize_growth_caches): Do not register removal hooks. (free_growth_caches); Do not free removal hook. (dump_inline_edge_summary): New function. (dump_inline_summary): Use it. (estimate_function_body_sizes, estimate_edge_size_and_time): Update. (inline_update_callee_summaries): New function. (inline_merge_summary): Use it. (do_estimate_edge_time, do_estimate_edge_growth): Update. (read_inline_edge_summary): New function. (inline_read_section): Use it. (write_inline_edge_summary): New function. (inline_write_summary): Use it. (inline_free_summary): Free edge new holders. * tree-inline.c (copy_bb): Update. From-SVN: r172989
2011-04-27 00:05:50 +02:00
/* Scale frequency of NODE edges by FREQ_SCALE. */
static void
update_noncloned_frequencies (struct cgraph_node *node,
cgraphbuild.c (build_cgraph_edges): Update call of cgraph_create_edge and cgraph_create_indirect_edge. * cgraphbuild.c (build_cgraph_edges): Update call of cgraph_create_edge and cgraph_create_indirect_edge. * cgraph.c (cgraph_create_edge_including_clones, cgraph_create_edge_1, cgraph_allocate_init_indirect_info, cgraph_update_edges_for_call_stmt_node): Do not take nest argument; do not initialize call_stmt_size/time. (dump_cgraph_node): Do not dump nest. (cgraph_clone_edge): Do not take loop_nest argument; do not propagate it; do not clone call_stmt_size/time. (cgraph_clone_node): Likewise. (cgraph_create_virtual_clone): Update. * cgraph.h (struct cgraph_edge): Remove call_stmt_size/call_stmt_time/loop_nest. (cgraph_create_edge, cgraph_create_indirect_edge, cgraph_create_edge_including_clones, cgraph_clone_node): Update prototype. * tree-emutls.c (gen_emutls_addr): Update. * ipa-inline-transform.c (update_noncloned_frequencies): Do not handle loop_nest; handle indirect calls, too. (clone_inlined_nodes): Do not care about updating inline summaries. * cgraphunit.c (cgraph_copy_node_for_versioning): Update. * lto-cgraph.c (lto_output_edge, input_node, input_edge): Do not stream call_stmt_size/call_stmt_time/loop_nest. * ipa-inline.c (edge_badness): Update. (ipa_inline): dump summaries after inlining. * ipa-inline.h (struct inline_edge_summary, inline_edge_summary_t): new. (inline_edge_summary): New function. * ipa-inline-analysis.c (edge_duplication_hook_holder): New holder. (inline_edge_removal_hook): Handle edge summaries. (inline_edge_duplication_hook): New hook. (inline_summary_alloc): Alloc hooks. (initialize_growth_caches): Do not register removal hooks. (free_growth_caches); Do not free removal hook. (dump_inline_edge_summary): New function. (dump_inline_summary): Use it. (estimate_function_body_sizes, estimate_edge_size_and_time): Update. (inline_update_callee_summaries): New function. (inline_merge_summary): Use it. (do_estimate_edge_time, do_estimate_edge_growth): Update. (read_inline_edge_summary): New function. (inline_read_section): Use it. (write_inline_edge_summary): New function. (inline_write_summary): Use it. (inline_free_summary): Free edge new holders. * tree-inline.c (copy_bb): Update. From-SVN: r172989
2011-04-27 00:05:50 +02:00
int freq_scale)
{
struct cgraph_edge *e;
/* We do not want to ignore high loop nest after freq drops to 0. */
if (!freq_scale)
freq_scale = 1;
for (e = node->callees; e; e = e->next_callee)
{
e->frequency = e->frequency * (gcov_type) freq_scale / CGRAPH_FREQ_BASE;
if (e->frequency > CGRAPH_FREQ_MAX)
e->frequency = CGRAPH_FREQ_MAX;
if (!e->inline_failed)
cgraphbuild.c (build_cgraph_edges): Update call of cgraph_create_edge and cgraph_create_indirect_edge. * cgraphbuild.c (build_cgraph_edges): Update call of cgraph_create_edge and cgraph_create_indirect_edge. * cgraph.c (cgraph_create_edge_including_clones, cgraph_create_edge_1, cgraph_allocate_init_indirect_info, cgraph_update_edges_for_call_stmt_node): Do not take nest argument; do not initialize call_stmt_size/time. (dump_cgraph_node): Do not dump nest. (cgraph_clone_edge): Do not take loop_nest argument; do not propagate it; do not clone call_stmt_size/time. (cgraph_clone_node): Likewise. (cgraph_create_virtual_clone): Update. * cgraph.h (struct cgraph_edge): Remove call_stmt_size/call_stmt_time/loop_nest. (cgraph_create_edge, cgraph_create_indirect_edge, cgraph_create_edge_including_clones, cgraph_clone_node): Update prototype. * tree-emutls.c (gen_emutls_addr): Update. * ipa-inline-transform.c (update_noncloned_frequencies): Do not handle loop_nest; handle indirect calls, too. (clone_inlined_nodes): Do not care about updating inline summaries. * cgraphunit.c (cgraph_copy_node_for_versioning): Update. * lto-cgraph.c (lto_output_edge, input_node, input_edge): Do not stream call_stmt_size/call_stmt_time/loop_nest. * ipa-inline.c (edge_badness): Update. (ipa_inline): dump summaries after inlining. * ipa-inline.h (struct inline_edge_summary, inline_edge_summary_t): new. (inline_edge_summary): New function. * ipa-inline-analysis.c (edge_duplication_hook_holder): New holder. (inline_edge_removal_hook): Handle edge summaries. (inline_edge_duplication_hook): New hook. (inline_summary_alloc): Alloc hooks. (initialize_growth_caches): Do not register removal hooks. (free_growth_caches); Do not free removal hook. (dump_inline_edge_summary): New function. (dump_inline_summary): Use it. (estimate_function_body_sizes, estimate_edge_size_and_time): Update. (inline_update_callee_summaries): New function. (inline_merge_summary): Use it. (do_estimate_edge_time, do_estimate_edge_growth): Update. (read_inline_edge_summary): New function. (inline_read_section): Use it. (write_inline_edge_summary): New function. (inline_write_summary): Use it. (inline_free_summary): Free edge new holders. * tree-inline.c (copy_bb): Update. From-SVN: r172989
2011-04-27 00:05:50 +02:00
update_noncloned_frequencies (e->callee, freq_scale);
}
for (e = node->indirect_calls; e; e = e->next_callee)
{
e->frequency = e->frequency * (gcov_type) freq_scale / CGRAPH_FREQ_BASE;
if (e->frequency > CGRAPH_FREQ_MAX)
e->frequency = CGRAPH_FREQ_MAX;
}
}
/* We removed or are going to remove the last call to NODE.
Return true if we can and want proactively remove the NODE now.
This is important to do, since we want inliner to know when offline
copy of function was removed. */
static bool
can_remove_node_now_p_1 (struct cgraph_node *node, struct cgraph_edge *e)
{
ipa_ref *ref;
FOR_EACH_ALIAS (node, ref)
{
cgraph_node *alias = dyn_cast <cgraph_node *> (ref->referring);
if ((alias->callers && alias->callers != e)
|| !can_remove_node_now_p_1 (alias, e))
return false;
}
/* FIXME: When address is taken of DECL_EXTERNAL function we still
can remove its offline copy, but we would need to keep unanalyzed node in
the callgraph so references can point to it.
Also for comdat group we can ignore references inside a group as we
want to prove the group as a whole to be dead. */
Autogenerated fixes of "->symbol." to "->" This is the autogenerated part of the conversion of the symtable types to a C++ class hierarchy. gcc/ Patch autogenerated by refactor_symtab.py from https://github.com/davidmalcolm/gcc-refactoring-scripts revision 58bb219cc090b2f4516a9297d868c245495ee622 * asan.c (asan_finish_file): Update for conversion of symtab types to a true class hierarchy. * cfgexpand.c (estimated_stack_frame_size): Likewise. * cgraph.c (cgraph_get_body): Likewise. (cgraph_get_create_real_symbol_node): Likewise. (verify_cgraph_node): Likewise. (verify_edge_corresponds_to_fndecl): Likewise. (verify_edge_count_and_frequency): Likewise. (cgraph_will_be_removed_from_program_if_no_direct_calls): Likewise. (cgraph_can_remove_if_no_direct_calls_p): Likewise. (cgraph_can_remove_if_no_direct_calls_and_refs_p): Likewise. (cgraph_node_cannot_return): Likewise. (cgraph_set_pure_flag_1): Likewise. (cgraph_set_const_flag_1): Likewise. (cgraph_set_nothrow_flag_1): Likewise. (cgraph_make_node_local_1): Likewise. (cgraph_for_node_and_aliases): Likewise. (cgraph_for_node_thunks_and_aliases): Likewise. (cgraph_node_can_be_local_p): Likewise. (cgraph_node_cannot_be_local_p_1): Likewise. (cgraph_function_body_availability): Likewise. (dump_cgraph_node): Likewise. (cgraph_rtl_info): Likewise. (cgraph_mark_address_taken_node): Likewise. (cgraph_remove_node): Likewise. (cgraph_release_function_body): Likewise. (cgraph_update_edges_for_call_stmt_node): Likewise. (cgraph_redirect_edge_call_stmt_to_callee): Likewise. (cgraph_make_edge_direct): Likewise. (cgraph_resolve_speculation): Likewise. (cgraph_speculative_call_info): Likewise. (cgraph_turn_edge_to_speculative): Likewise. (cgraph_create_edge_1): Likewise. (cgraph_set_call_stmt): Likewise. (cgraph_node_for_asm): Likewise. (cgraph_add_thunk): Likewise. (cgraph_same_body_alias): Likewise. (cgraph_create_function_alias): Likewise. (cgraph_create_node): Likewise. (cgraph_create_empty_node): Likewise. (record_function_versions): Likewise. (used_from_object_file_p): Likewise. * cgraph.h (symtab_can_be_discarded): Likewise. (symtab_real_symbol_p): Likewise. (cgraph_mark_force_output_node): Likewise. (cgraph_edge_recursive_p): Likewise. (symtab_alias_target): Likewise. (varpool_all_refs_explicit_p): Likewise. (varpool_can_remove_if_no_refs): Likewise. (cgraph_only_called_directly_or_aliased_p): Likewise. (cgraph_next_function_with_gimple_body): Likewise. (cgraph_first_function_with_gimple_body): Likewise. (cgraph_function_with_gimple_body_p): Likewise. (cgraph_next_function): Likewise. (cgraph_first_function): Likewise. (cgraph_next_defined_function): Likewise. (cgraph_first_defined_function): Likewise. (varpool_next_defined_variable): Likewise. (varpool_first_defined_variable): Likewise. (varpool_next_static_initializer): Likewise. (varpool_first_static_initializer): Likewise. (varpool_next_variable): Likewise. (varpool_first_variable): Likewise. (varpool_node_name): Likewise. (varpool): Likewise. (cgraph): Likewise. (is_a_helper <varpool_node>::test): Likewise. (is_a_helper <cgraph_node>::test): Likewise. (varpool_variable_node): Likewise. (cgraph_function_or_thunk_node): Likewise. (varpool_alias_target): Likewise. (cgraph_alias_target): Likewise. (cgraph_node_name): Likewise. (varpool_node_asm_name): Likewise. (cgraph_node_asm_name): Likewise. * cgraphbuild.c (remove_cgraph_callee_edges): Likewise. (cgraph_rebuild_references): Likewise. (rebuild_cgraph_edges): Likewise. (record_eh_tables): Likewise. (build_cgraph_edges): Likewise. (mark_store): Likewise. (mark_load): Likewise. (mark_address): Likewise. (record_type_list): Likewise. (record_reference): Likewise. * cgraphclones.c (cgraph_materialize_all_clones): Likewise. (cgraph_materialize_clone): Likewise. (cgraph_function_versioning): Likewise. (cgraph_copy_node_for_versioning): Likewise. (update_call_expr): Likewise. (cgraph_find_replacement_node): Likewise. (cgraph_create_virtual_clone): Likewise. (cgraph_clone_node): Likewise. * cgraphunit.c (compile): Likewise. (output_weakrefs): Likewise. (output_in_order): Likewise. (expand_function): Likewise. (assemble_thunks_and_aliases): Likewise. (expand_thunk): Likewise. (mark_functions_to_output): Likewise. (handle_alias_pairs): Likewise. (analyze_functions): Likewise. (walk_polymorphic_call_targets): Likewise. (varpool_finalize_decl): Likewise. (process_function_and_variable_attributes): Likewise. (cgraph_process_same_body_aliases): Likewise. (analyze_function): Likewise. (cgraph_add_new_function): Likewise. (cgraph_finalize_function): Likewise. (referred_to_p): Likewise. (cgraph_reset_node): Likewise. (cgraph_process_new_functions): Likewise. (enqueue_node): Likewise. (decide_is_symbol_needed): Likewise. * coverage.c (coverage_compute_profile_id): Likewise. * dbxout.c (dbxout_expand_expr): Likewise. * dwarf2out.c (premark_types_used_by_global_vars_helper): Likewise. (reference_to_unused): Likewise. * gimple-fold.c (can_refer_decl_in_current_unit_p): Likewise. * gimplify.c (unvisit_body): Likewise. (unshare_body): Likewise. * ipa-cp.c (ipcp_generate_summary): Likewise. (ipcp_decision_stage): Likewise. (identify_dead_nodes): Likewise. (decide_whether_version_node): Likewise. (decide_about_value): Likewise. (perhaps_add_new_callers): Likewise. (create_specialized_node): Likewise. (update_profiling_info): Likewise. (ipcp_propagate_stage): Likewise. (estimate_local_effects): Likewise. (good_cloning_opportunity_p): Likewise. (devirtualization_time_bonus): Likewise. (propagate_constants_accross_call): Likewise. (initialize_node_lattices): Likewise. (ipcp_cloning_candidate_p): Likewise. (determine_versionability): Likewise. (print_all_lattices): Likewise. (print_lattice): Likewise. (ipcp_discover_new_direct_edges): Likewise. * ipa-devirt.c (ipa_devirt): Likewise. (likely_target_p): Likewise. (update_type_inheritance_graph): Likewise. (possible_polymorphic_call_target_p): Likewise. (dump_possible_polymorphic_call_targets): Likewise. (devirt_variable_node_removal_hook): Likewise. (record_binfo): Likewise. (maybe_record_node): Likewise. (build_type_inheritance_graph): Likewise. * ipa-inline-analysis.c (inline_write_summary): Likewise. (inline_generate_summary): Likewise. (inline_analyze_function): Likewise. (do_estimate_growth): Likewise. (simple_edge_hints): Likewise. (estimate_node_size_and_time): Likewise. (estimate_edge_devirt_benefit): Likewise. (compute_inline_parameters): Likewise. (estimate_function_body_sizes): Likewise. (compute_bb_predicates): Likewise. (initialize_inline_failed): Likewise. (dump_inline_summary): Likewise. (dump_inline_edge_summary): Likewise. * ipa-inline-transform.c (inline_transform): Likewise. (preserve_function_body_p): Likewise. (save_inline_function_body): Likewise. (inline_call): Likewise. (clone_inlined_nodes): Likewise. (can_remove_node_now_p): Likewise. (can_remove_node_now_p_1): Likewise. * ipa-inline.c (early_inliner): Likewise. (early_inline_small_functions): Likewise. (inline_always_inline_functions): Likewise. (ipa_inline): Likewise. (flatten_function): Likewise. (inline_small_functions): Likewise. (speculation_useful_p): Likewise. (recursive_inlining): Likewise. (update_caller_keys): Likewise. (reset_edge_caches): Likewise. (update_edge_key): Likewise. (edge_badness): Likewise. (relative_time_benefit): Likewise. (want_inline_self_recursive_call_p): Likewise. (want_inline_small_function_p): Likewise. (want_early_inline_function_p): Likewise. (num_calls): Likewise. (can_early_inline_edge_p): Likewise. (can_inline_edge_p): Likewise. (report_inline_failed_reason): Likewise. * ipa-profile.c (ipa_profile): Likewise. (ipa_propagate_frequency): Likewise. (ipa_propagate_frequency_1): Likewise. (ipa_profile_generate_summary): Likewise. * ipa-prop.c (ipcp_transform_function): Likewise. (read_replacements_section): Likewise. (ipa_prop_read_section): Likewise. (ipa_modify_call_arguments): Likewise. (ipa_print_node_params): Likewise. (propagate_controlled_uses): Likewise. (update_indirect_edges_after_inlining): Likewise. (remove_described_reference): Likewise. (ipa_make_edge_direct_to_target): Likewise. (ipa_analyze_node): Likewise. (ipa_analyze_params_uses): Likewise. (ipa_compute_jump_functions): Likewise. (ipa_get_callee_param_type): Likewise. (ipa_print_node_jump_functions): Likewise. (ipa_initialize_node_params): Likewise. (ipa_populate_param_decls): Likewise. (ipa_func_spec_opts_forbid_analysis_p): Likewise. (write_agg_replacement_chain): Likewise. (ipa_write_node_info): Likewise. (ipa_edge_duplication_hook): Likewise. (try_decrement_rdesc_refcount): Likewise. * ipa-pure-const.c (propagate_nothrow): Likewise. (propagate_pure_const): Likewise. (pure_const_read_summary): Likewise. (pure_const_write_summary): Likewise. (analyze_function): Likewise. * ipa-ref-inline.h (ipa_ref_referred_ref_list): Likewise. (ipa_ref_referring_ref_list): Likewise. * ipa-ref.c (ipa_clear_stmts_in_references): Likewise. (ipa_remove_stmt_references): Likewise. (ipa_find_reference): Likewise. (ipa_dump_referring): Likewise. (ipa_dump_references): Likewise. (ipa_record_reference): Likewise. * ipa-reference.c (ipa_reference_read_optimization_summary): Likewise. (ipa_reference_write_optimization_summary): Likewise. (write_node_summary_p): Likewise. (propagate): Likewise. (read_write_all_from_decl): Likewise. (generate_summary): Likewise. (analyze_function): Likewise. (propagate_bits): Likewise. (ipa_reference_get_not_written_global): Likewise. (ipa_reference_get_not_read_global): Likewise. * ipa-split.c (execute_split_functions): Likewise. (split_function): Likewise. * ipa-utils.c (ipa_merge_profiles): Likewise. (dump_cgraph_node_set): Likewise. (ipa_reverse_postorder): Likewise. (ipa_edge_within_scc): Likewise. (ipa_get_nodes_in_cycle): Likewise. (ipa_free_postorder_info): Likewise. (ipa_reduced_postorder): Likewise. (searchc): Likewise. (recursive_call_p): Likewise. * ipa.c (ipa_cdtor_merge): Likewise. (record_cdtor_fn): Likewise. (function_and_variable_visibility): Likewise. (varpool_externally_visible_p): Likewise. (cgraph_externally_visible_p): Likewise. (comdat_can_be_unshared_p): Likewise. (comdat_can_be_unshared_p_1): Likewise. (address_taken_from_non_vtable_p): Likewise. (ipa_discover_readonly_nonaddressable_vars): Likewise. (symtab_remove_unreachable_nodes): Likewise. (walk_polymorphic_call_targets): Likewise. (process_references): Likewise. (enqueue_node): Likewise. (has_addr_references_p): Likewise. (cgraph_non_local_node_p_1): Likewise. * is-a.h (varpool_analyze_node): Likewise. * lto-cgraph.c (input_symtab): Likewise. (merge_profile_summaries): Likewise. (input_cgraph_1): Likewise. (input_edge): Likewise. (input_varpool_node): Likewise. (input_node): Likewise. (input_overwrite_node): Likewise. (compute_ltrans_boundary): Likewise. (output_refs): Likewise. (lto_output_varpool_node): Likewise. (lto_output_node): Likewise. (reachable_from_other_partition_p): Likewise. (referenced_from_other_partition_p): Likewise. (lto_output_edge): Likewise. (output_node_opt_summary): Likewise. (add_node_to): Likewise. (reachable_from_this_partition_p): Likewise. (lto_set_symtab_encoder_in_partition): Likewise. (lto_symtab_encoder_in_partition_p): Likewise. (lto_set_symtab_encoder_encode_initializer): Likewise. (lto_symtab_encoder_encode_initializer_p): Likewise. (lto_set_symtab_encoder_encode_body): Likewise. (lto_symtab_encoder_encode_body_p): Likewise. * lto-section-in.c (lto_free_function_in_decl_state_for_node): Likewise. * lto-streamer-in.c (lto_read_body): Likewise. (fixup_call_stmt_edges): Likewise. (fixup_call_stmt_edges_1): Likewise. * lto-streamer-out.c (produce_symtab): Likewise. (output_symbol_p): Likewise. (write_symbol): Likewise. (lto_output): Likewise. (copy_function): Likewise. (output_function): Likewise. * passes.c (function_called_by_processed_nodes_p): Likewise. (ipa_write_optimization_summaries): Likewise. (ipa_write_summaries): Likewise. (do_per_function_toporder): Likewise. (do_per_function): Likewise. (dump_passes): Likewise. * symtab.c (symtab_semantically_equivalent_p): Likewise. (symtab_nonoverwritable_alias): Likewise. (symtab_nonoverwritable_alias_1): Likewise. (symtab_for_node_and_aliases): Likewise. (symtab_resolve_alias): Likewise. (fixup_same_cpp_alias_visibility): Likewise. (symtab_alias_ultimate_target): Likewise. (symtab_used_from_object_file_p): Likewise. (verify_symtab_base): Likewise. (dump_symtab_base): Likewise. (symtab_node_name): Likewise. (symtab_node_asm_name): Likewise. (symtab_dissolve_same_comdat_group_list): Likewise. (symtab_add_to_same_comdat_group): Likewise. (symtab_unregister_node): Likewise. (symtab_insert_node_to_hashtable): Likewise. (symtab_register_node): Likewise. (unlink_from_assembler_name_hash): Likewise. (insert_to_assembler_name_hash): Likewise. (eq_assembler_name): Likewise. (hash_node_by_assembler_name): Likewise. (eq_node): Likewise. (hash_node): Likewise. * toplev.c (wrapup_global_declaration_2): Likewise. * trans-mem.c (ipa_tm_execute): Likewise. (ipa_tm_transform_clone): Likewise. (ipa_tm_transform_transaction): Likewise. (ipa_tm_transform_calls_redirect): Likewise. (ipa_tm_insert_gettmclone_call): Likewise. (ipa_tm_insert_irr_call): Likewise. (ipa_tm_create_version): Likewise. (ipa_tm_create_version_alias): Likewise. (ipa_tm_mark_forced_by_abi_node): Likewise. (ipa_tm_mark_force_output_node): Likewise. (ipa_tm_diagnose_tm_safe): Likewise. (ipa_tm_mayenterirr_function): Likewise. (ipa_tm_scan_irr_function): Likewise. (ipa_tm_note_irrevocable): Likewise. (ipa_tm_scan_calls_clone): Likewise. (get_cg_data): Likewise. * tree-eh.c (tree_could_trap_p): Likewise. * tree-emutls.c (ipa_lower_emutls): Likewise. (create_emultls_var): Likewise. (lower_emutls_function_body): Likewise. (gen_emutls_addr): Likewise. (emutls_decl): Likewise. (new_emutls_decl): Likewise. * tree-inline.c (tree_function_versioning): Likewise. (optimize_inline_calls): Likewise. (expand_call_inline): Likewise. (estimate_num_insns): Likewise. (copy_bb): Likewise. (delete_unreachable_blocks_update_callgraph): Likewise. * tree-nested.c (gimplify_all_functions): Likewise. (create_nesting_tree): Likewise. (check_for_nested_with_variably_modified): Likewise. * tree-pretty-print.c (dump_function_header): Likewise. * tree-profile.c (tree_profiling): Likewise. * tree-sra.c (ipa_sra_preliminary_function_checks): Likewise. (modify_function): Likewise. (convert_callers): Likewise. (convert_callers_for_node): Likewise. * tree-ssa-structalias.c (ipa_pta_execute): Likewise. (associate_varinfo_to_alias): Likewise. (create_variable_info_for): Likewise. (get_constraint_for_ssa_var): Likewise. * tree-vectorizer.c (increase_alignment): Likewise. * tree.c (find_decls_types_in_var): Likewise. (find_decls_types_in_node): Likewise. (free_lang_data_in_decl): Likewise. * value-prof.c (gimple_ic_transform): Likewise. (gimple_ic): Likewise. (check_ic_target): Likewise. (init_node_map): Likewise. * varasm.c (decl_binds_to_current_def_p): Likewise. (default_binds_local_p_1): Likewise. (dump_tm_clone_pairs): Likewise. (assemble_alias): Likewise. (find_decl): Likewise. (mark_decl_referenced): Likewise. * varpool.c (varpool_for_node_and_aliases): Likewise. (varpool_extra_name_alias): Likewise. (varpool_create_variable_alias): Likewise. (add_new_static_var): Likewise. (varpool_finalize_named_section_flags): Likewise. (varpool_remove_unreferenced_decls): Likewise. (enqueue_node): Likewise. (varpool_assemble_decl): Likewise. (assemble_aliases): Likewise. (varpool_analyze_node): Likewise. (cgraph_variable_initializer_availability): Likewise. (varpool_add_new_variable): Likewise. (ctor_for_folding): Likewise. (dump_varpool_node): Likewise. (varpool_remove_initializer): Likewise. (varpool_remove_node): Likewise. (varpool_node_for_decl): Likewise. (varpool_create_empty_node): Likewise. * config/i386/i386.c (ix86_generate_version_dispatcher_body): Likewise. (ix86_get_function_versions_dispatcher): Likewise. gcc/ada/ Patch autogenerated by refactor_symtab.py from https://github.com/davidmalcolm/gcc-refactoring-scripts revision 58bb219cc090b2f4516a9297d868c245495ee622 * gcc-interface/trans.c (finalize_nrv): Update for conversion of symtab types to a true class hierarchy. * gcc-interface/utils.c (gnat_write_global_declarations): Likewise. gcc/c-family/ Patch autogenerated by refactor_symtab.py from https://github.com/davidmalcolm/gcc-refactoring-scripts revision 58bb219cc090b2f4516a9297d868c245495ee622 * c-gimplify.c (c_genericize): Update for conversion of symtab types to a true class hierarchy. * c-pragma.c (maybe_apply_pending_pragma_weaks): Likewise. gcc/cp/ Patch autogenerated by refactor_symtab.py from https://github.com/davidmalcolm/gcc-refactoring-scripts revision 58bb219cc090b2f4516a9297d868c245495ee622 * call.c (mark_versions_used): Update for conversion of symtab types to a true class hierarchy. * decl2.c (cp_write_global_declarations): Likewise. (clear_decl_external): Likewise. (build_java_method_aliases): Likewise. (collect_candidates_for_java_method_aliases): Likewise. (mark_needed): Likewise. (var_finalized_p): Likewise. (maybe_make_one_only): Likewise. (maybe_emit_vtables): Likewise. * lambda.c (maybe_add_lambda_conv_op): Likewise. * method.c (use_thunk): Likewise. * optimize.c (maybe_clone_body): Likewise. * tree.c (cp_fix_function_decl_p): Likewise. gcc/java/ Patch autogenerated by refactor_symtab.py from https://github.com/davidmalcolm/gcc-refactoring-scripts revision 58bb219cc090b2f4516a9297d868c245495ee622 * decl.c (java_mark_decl_local): Update for conversion of symtab types to a true class hierarchy. gcc/lto/ Patch autogenerated by refactor_symtab.py from https://github.com/davidmalcolm/gcc-refactoring-scripts revision 58bb219cc090b2f4516a9297d868c245495ee622 * lto-partition.c (lto_promote_cross_file_statics): Update for conversion of symtab types to a true class hierarchy. (rename_statics): Likewise. (promote_symbol): Likewise. (privatize_symbol_name): Likewise. (lto_balanced_map): Likewise. (varpool_node_cmp): Likewise. (node_cmp): Likewise. (lto_1_to_1_map): Likewise. (undo_partition): Likewise. (add_symbol_to_partition): Likewise. (contained_in_symbol): Likewise. (add_symbol_to_partition_1): Likewise. (add_references_to_partition): Likewise. (symbol_partitioned_p): Likewise. (get_symbol_class): Likewise. (lto_max_map): Likewise. * lto-symtab.c (lto_symtab_prevailing_decl): Likewise. (lto_symtab_merge_symbols): Likewise. (lto_symtab_merge_symbols_1): Likewise. (lto_symtab_merge_decls): Likewise. (lto_symtab_merge_decls_1): Likewise. (lto_symtab_merge_decls_2): Likewise. (lto_symtab_resolve_symbols): Likewise. (lto_symtab_resolve_can_prevail_p): Likewise. (lto_symtab_symbol_p): Likewise. (lto_symtab_resolve_replaceable_p): Likewise. (lto_symtab_merge): Likewise. (lto_varpool_replace_node): Likewise. (lto_cgraph_replace_node): Likewise. * lto.c (lto_main): Likewise. (do_whole_program_analysis): Likewise. (materialize_cgraph): Likewise. (read_cgraph_and_symbols): Likewise. (cmp_partitions_order): Likewise. (lto_materialize_function): Likewise. (has_analyzed_clone_p): Likewise. From-SVN: r204171
2013-10-29 19:30:00 +01:00
return (!node->address_taken
&& node->can_remove_if_no_direct_calls_and_refs_p ()
/* Inlining might enable more devirtualizing, so we want to remove
those only after all devirtualizable virtual calls are processed.
Lacking may edges in callgraph we just preserve them post
inlining. */
&& (!DECL_VIRTUAL_P (node->decl)
|| !opt_for_fn (node->decl, flag_devirtualize))
/* During early inlining some unanalyzed cgraph nodes might be in the
callgraph and they might reffer the function in question. */
&& !cgraph_new_nodes.exists ());
}
/* We are going to eliminate last direct call to NODE (or alias of it) via edge E.
Verify that the NODE can be removed from unit and if it is contained in comdat
group that the whole comdat group is removable. */
static bool
can_remove_node_now_p (struct cgraph_node *node, struct cgraph_edge *e)
{
struct cgraph_node *next;
if (!can_remove_node_now_p_1 (node, e))
return false;
/* When we see same comdat group, we need to be sure that all
items can be removed. */
if (!node->same_comdat_group || !node->externally_visible)
return true;
IPA C++ refactoring 1/N * cgraph.h (symtab_node): (void register_symbol (void)): created from symtab_register_node (void remove (void)): created from symtab_remove_node (void dump (FILE *f)): created from dump_symtab_node (void DEBUG_FUNCTION debug (void)): created from debug_symtab_node (void DEBUG_FUNCTION verify (void)): created from verify_symtab_node (struct ipa_ref *add_reference (symtab_node *referred_node, enum ipa_ref_use use_type)): created from add_reference (struct ipa_ref *add_reference (symtab_node *referred_node, enum ipa_ref_use use_type, gimple stmt)): created from add_reference (struct ipa_ref *maybe_add_reference (tree val, enum ipa_ref_use use_type, gimple stmt)): created from maybe_add_reference (bool semantically_equivalent_p (symtab_node *target)): created from symtab_semantically_equivalent_p (void remove_from_same_comdat_group (void)): created from remove_from_same_comdat_group (void add_to_same_comdat_group (symtab_node *old_node)): created from symtab_add_to_same_comdat_group (void dissolve_same_comdat_group_list (void)): created from symtab_dissolve_same_comdat_group_list (bool used_from_object_file_p (void)): created from symtab_used_from_object_file_p (symtab_node *ultimate_alias_target (enum availability *avail = NULL)): created from symtab_alias_ultimate_target (inline symtab_node *next_defined_symbol (void)): created from symtab_next_defined_symbol (bool resolve_alias (symtab_node *target)): created from symtab_resolve_alias (bool call_for_symbol_and_aliases (bool (*callback) (symtab_node *, void *), void *data, bool include_overwrite)): created from symtab_for_node_and_aliases (symtab_node *noninterposable_alias (void)): created from symtab_nonoverwritable_alias (inline symtab_node *get_alias_target (void)): created from symtab_alias_target (void set_section (const char *section)): created from set_section_1 (enum availability get_availability (void)): created from symtab_node_availability (void make_decl_local (void)): created from symtab_make_decl_local (bool real_symbol_p (void)): created from symtab_read_node (can_be_discarded_p (void)): created from symtab_can_be_discarded (inline bool comdat_local_p (void)): created from symtab_comdat_local_p (inline bool in_same_comdat_group_p (symtab_node *target)): created from symtab_in_same_comdat_p; (bool address_taken_from_non_vtable_p (void)): created from address_taken_from_non_vtable_p (static inline symtab_node *get (const_tree decl)): created from symtab_get_node (static void dump_table (FILE *)): created from dump_symtab (static inline DEBUG_FUNCTION void debug_symtab (void)): created from debug_symtab (static DEBUG_FUNCTION void verify_symtab_nodes (void)): created from verify_symtab (static bool used_from_object_file_p_worker (symtab_node *node)): created from symtab_used_from_object_file_p (void dump_base (FILE *)): created from dump_symtab_base (bool DEBUG_FUNCTION verify_base (void)): created from verify_symtab_base (void unregister (void)): created from symtab_unregister_node (struct symbol_priority_map *priority_info (void)): created from symtab_priority_info (static bool set_implicit_section (symtab_node *n, void *)): created from set_implicit_section (static bool noninterposable_alias (symtab_node *node, void *data)): created from symtab_nonoverwritable_alias_1 * cgraph.h (cgraph_node): (bool remove_symbol_and_inline_clones (cgraph_node *forbidden_node = NULL)): created from cgraph_remove_node_and_inline_clones (void record_stmt_references (gimple stmt)): created from ipa_record_stmt_references (void set_call_stmt_including_clones (gimple old_stmt, gimple new_stmt, bool update_speculative = true)): created from cgraph_set_call_stmt_including_clones (cgraph_node *function_symbol (enum availability *avail = NULL)): created from cgraph_function_node (cgraph_node *create_clone (tree decl, gcov_type count, int freq, bool update_original, vec<cgraph_edge *> redirect_callers, bool call_duplication_hook, struct cgraph_node *new_inlined_to, bitmap args_to_skip)): created from cgraph_create_clone (cgraph_node *create_virtual_clone (vec<cgraph_edge *> redirect_callers, vec<ipa_replace_map *, va_gc> *tree_map, bitmap args_to_skip, const char * suffix)): created from cgraph_create_virtual_clone (cgraph_node *find_replacement (void)): created from cgraph_find_replacement_node (cgraph_node *create_version_clone (tree new_decl, vec<cgraph_edge *> redirect_callers, bitmap bbs_to_copy)): created from cgraph_copy_node_for_versioning (cgraph_node *create_version_clone_with_body (vec<cgraph_edge *> redirect_callers, vec<ipa_replace_map *, va_gc> *tree_map, bitmap args_to_skip, bool skip_return, bitmap bbs_to_copy, basic_block new_entry_block, const char *clone_name)): created from cgraph_function_version_info (struct cgraph_function_version_info *insert_new_function_version (void)): created from insert_new_cgraph_node_version (struct cgraph_function_version_info *function_version (void)): created from get_cgraph_node_version (void analyze (void)): created from analyze_function (cgraph_node * create_thunk (tree alias, tree, bool this_adjusting, HOST_WIDE_INT fixed_offset, HOST_WIDE_INT virtual_value, tree virtual_offset, tree real_alias) cgraph_add_thunk (inline cgraph_node *get_alias_target (void)): created from cgraph_alias_target (cgraph_node *ultimate_alias_target (availability *availability = NULL)): created from cgraph_function_or_thunk_node (bool expand_thunk (bool output_asm_thunks, bool force_gimple_thunk)): created from expand_thunk (void reset (void)): created from cgraph_reset_node (void create_wrapper (cgraph_node *target)): created from cgraph_make_wrapper (void DEBUG_FUNCTION verify_node (void)): created from verify_cgraph_node (void remove (void)): created from cgraph_remove_node (void dump (FILE *f)): created from dump_cgraph_node (void DEBUG_FUNCTION debug (void)): created from debug_cgraph_node (bool get_body (void)): created from cgraph_get_body (void release_body (void)): created from cgraph_release_function_body (void unnest (void)): created from cgraph_unnest_node (void make_local (void)): created from cgraph_make_node_local (void mark_address_taken (void)): created from cgraph_mark_address_taken_node (struct cgraph_edge *create_edge (cgraph_node *callee, gimple call_stmt, gcov_type count, int freq)): created from cgraph_create_edge (struct cgraph_edge *create_indirect_edge (gimple call_stmt, int ecf_flags, gcov_type count, int freq)): created from cgraph_create_indirect_edge (void create_edge_including_clones (struct cgraph_node *callee, gimple old_stmt, gimple stmt, gcov_type count, int freq, cgraph_inline_failed_t reason)): created from cgraph_create_edge_including_clones (cgraph_edge *get_edge (gimple call_stmt)): created from cgraph_edge (vec<cgraph_edge *> collect_callers (void)): created from collect_callers_of_node (void remove_callers (void)): created from cgraph_node_remove_callers (void remove_callees (void)): created from cgraph_node_remove_callees (enum availability get_availability (void)): created from cgraph_function_body_availability (void set_nothrow_flag (bool nothrow)): created from cgraph_set_nothrow_flag (void set_const_flag (bool readonly, bool looping)): created from cgraph_set_const_flag (void set_pure_flag (bool pure, bool looping)): created from cgraph_set_pure_flag (void call_duplication_hooks (cgraph_node *node2)): created from cgraph_call_node_duplication_hooks (bool call_for_symbol_and_aliases (bool (*callback) (cgraph_node *, void *), void *data, bool include_overwritable)): created from cgraph_for_node_and_aliases (bool call_for_symbol_thunks_and_aliases (bool (*callback) (cgraph_node *node, void *data), void *data, bool include_overwritable)): created from cgraph_for_node_thunks_and_aliases (void call_function_insertion_hooks (void)): created from cgraph_call_function_insertion_hooks (inline void mark_force_output (void)): created from cgraph_mark_force_output_node (bool local_p (void)): created from cgraph_local_node (bool can_be_local_p (void)): created from cgraph_node_can_be_local_p (bool cannot_return_p (void)): created from cgraph_node_cannot_return (bool only_called_directly_p (void)): created from cgraph_only_called_directly_p (inline bool only_called_directly_or_aliased_p (void)): created from cgraph_only_called_directly_or_aliased_p (bool will_be_removed_from_program_if_no_direct_calls_p (void)): created from cgraph_will_be_removed_from_program_if_no_direct_calls (bool can_remove_if_no_direct_calls_and_refs_p (void)): created from cgraph_can_remove_if_no_direct_calls_and_refs_p (bool can_remove_if_no_direct_calls_p (void)): created from cgraph_can_remove_if_no_direct_calls_p (inline bool has_gimple_body_p (void)): created from cgraph_function_with_gimple_body_p (bool optimize_for_size_p (void)): created from cgraph_optimize_for_size_p (static void dump_cgraph (FILE *f)): created from dump_cgraph (static inline void debug_cgraph (void)): created from debug_cgraph (static void record_function_versions (tree decl1, tree decl2)): created from record_function_versions (static void delete_function_version (tree decl)): created from delete_function_version (static void add_new_function (tree fndecl, bool lowered)): created from cgraph_add_new_function (static inline cgraph_node *get (const_tree decl)): created from cgraph_get_node (static cgraph_node * create (tree decl)): created from cgraph_create_node (static cgraph_node * create_empty (void)): created from cgraph_create_empty_node (static cgraph_node * get_create (tree)): created from cgraph_get_create_node (static cgraph_node *get_for_asmname (tree asmname)): created from cgraph_node_for_asm (static cgraph_node * create_same_body_alias (tree alias, tree decl)): created from cgraph_same_body_alias (static bool used_from_object_file_p_worker (cgraph_node *node, void *): new function (static bool non_local_p (cgraph_node *node, void *)): created from cgraph_non_local_node_p_1 (static void DEBUG_FUNCTION verify_cgraph_nodes (void)): created from verify_cgraph (static bool make_local (cgraph_node *node, void *)): created from cgraph_make_node_local (static cgraph_node *create_alias (tree alias, tree target)): created from cgraph_create_function_alias (static cgraph_edge * create_edge (cgraph_node *caller, cgraph_node *callee, gimple call_stmt, gcov_type count, int freq, bool indir_unknown_callee)): created from cgraph_create_edge_1 * cgraph.h (varpool_node): (void remove (void)): created from varpool_remove_node (void dump (FILE *f)): created from dump_varpool_node From-SVN: r212982
2014-07-24 14:07:13 +02:00
for (next = dyn_cast<cgraph_node *> (node->same_comdat_group);
next != node; next = dyn_cast<cgraph_node *> (next->same_comdat_group))
{
if (next->alias)
continue;
if ((next->callers && next->callers != e)
|| !can_remove_node_now_p_1 (next, e))
return false;
}
return true;
}
/* Return true if NODE is a master clone with non-inline clones. */
static bool
master_clone_with_noninline_clones_p (struct cgraph_node *node)
{
if (node->clone_of)
return false;
for (struct cgraph_node *n = node->clones; n; n = n->next_sibling_clone)
if (n->decl != node->decl)
return true;
return false;
}
/* E is expected to be an edge being inlined. Clone destination node of
the edge and redirect it to the new clone.
DUPLICATE is used for bookkeeping on whether we are actually creating new
clones or re-using node originally representing out-of-line function call.
By default the offline copy is removed, when it appears dead after inlining.
UPDATE_ORIGINAL prevents this transformation.
If OVERALL_SIZE is non-NULL, the size is updated to reflect the
transformation.
FREQ_SCALE specify the scaling of frequencies of call sites. */
void
clone_inlined_nodes (struct cgraph_edge *e, bool duplicate,
bool update_original, int *overall_size, int freq_scale)
{
struct cgraph_node *inlining_into;
struct cgraph_edge *next;
if (e->caller->global.inlined_to)
inlining_into = e->caller->global.inlined_to;
else
inlining_into = e->caller;
if (duplicate)
{
/* We may eliminate the need for out-of-line copy to be output.
In that case just go ahead and re-use it. This is not just an
memory optimization. Making offline copy of fuction disappear
from the program will improve future decisions on inlining. */
if (!e->callee->callers->next_caller
/* Recursive inlining never wants the master clone to
be overwritten. */
&& update_original
&& can_remove_node_now_p (e->callee, e)
/* We cannot overwrite a master clone with non-inline clones
until after these clones are materialized. */
&& !master_clone_with_noninline_clones_p (e->callee))
{
/* TODO: When callee is in a comdat group, we could remove all of it,
including all inline clones inlined into it. That would however
need small function inlining to register edge removal hook to
maintain the priority queue.
For now we keep the ohter functions in the group in program until
cgraph_remove_unreachable_functions gets rid of them. */
gcc_assert (!e->callee->global.inlined_to);
e->callee->remove_from_same_comdat_group ();
if (e->callee->definition
&& inline_account_function_p (e->callee))
{
gcc_assert (!e->callee->alias);
if (overall_size)
symbol_summary is used for inline_summary. * lto-partition.c (add_symbol_to_partition_1): New inline_summaries is used. (undo_partition): Likewise. (lto_balanced_map): Likewise. * cgraphunit.c (symbol_table::process_new_functions): New inline_summaries is used. * ipa-cp.c (ipcp_cloning_candidate_p): Likewise. (devirtualization_time_bonus): Likewise. (estimate_local_effects): Likewise. (ipcp_propagate_stage): Likewise. * ipa-inline-analysis.c (evaluate_conditions_for_known_args): Likewise. (evaluate_properties_for_edge): Likewise. (inline_summary_alloc): Likewise. (reset_inline_summary): New inline_summary argument is introduced. (inline_summary_t::remove): New function. (inline_summary_t::duplicate): Likewise. (dump_inline_edge_summary): New inline_summaries is used. (dump_inline_summary): Likewise. (estimate_function_body_sizes): Likewise. (compute_inline_parameters): Likewise. (estimate_edge_devirt_benefit): Likewise. (estimate_node_size_and_time): Likewise. (inline_update_callee_summaries): Likewise. (inline_merge_summary): Likewise. (inline_update_overall_summary): Likewise. (simple_edge_hints): Likewise. (do_estimate_edge_time): Likewise. (estimate_time_after_inlining): Likewise. (estimate_size_after_inlining): Likewise. (do_estimate_growth): Likewise. (growth_likely_positive): Likewise. (inline_generate_summary): Likewise. (inline_read_section): Likewise. (inline_read_summary): Likewise. (inline_write_summary): Likewise. (inline_free_summary): Likewise. * ipa-inline-transform.c (clone_inlined_nodes): Likewise. (inline_call): Likewise. * ipa-inline.c (caller_growth_limits): Likewise. (can_inline_edge_p): Likewise. (want_early_inline_function_p): Likewise. (compute_uninlined_call_time): Likewise. (compute_inlined_call_time): Likewise. (big_speedup_p): Likewise. (want_inline_small_function_p): Likewise. (edge_badness): Likewise. (update_caller_keys): Likewise. (update_callee_keys): Likewise. (recursive_inlining): Likewise. (inline_small_functions): Likewise. (inline_to_all_callers): Likewise. (dump_overall_stats): Likewise. (early_inline_small_functions): Likewise. * ipa-inline.h: New class inline_summary_t replaces vec<inline_summary_t>. * ipa-split.c (execute_split_functions): New inline_summaries is used. * ipa.c (walk_polymorphic_call_targets): Likewise. * tree-sra.c (ipa_sra_preliminary_function_checks): Likewise. From-SVN: r219006
2014-12-22 10:33:05 +01:00
*overall_size -= inline_summaries->get (e->callee)->size;
nfunctions_inlined++;
}
duplicate = false;
Autogenerated fixes of "->symbol." to "->" This is the autogenerated part of the conversion of the symtable types to a C++ class hierarchy. gcc/ Patch autogenerated by refactor_symtab.py from https://github.com/davidmalcolm/gcc-refactoring-scripts revision 58bb219cc090b2f4516a9297d868c245495ee622 * asan.c (asan_finish_file): Update for conversion of symtab types to a true class hierarchy. * cfgexpand.c (estimated_stack_frame_size): Likewise. * cgraph.c (cgraph_get_body): Likewise. (cgraph_get_create_real_symbol_node): Likewise. (verify_cgraph_node): Likewise. (verify_edge_corresponds_to_fndecl): Likewise. (verify_edge_count_and_frequency): Likewise. (cgraph_will_be_removed_from_program_if_no_direct_calls): Likewise. (cgraph_can_remove_if_no_direct_calls_p): Likewise. (cgraph_can_remove_if_no_direct_calls_and_refs_p): Likewise. (cgraph_node_cannot_return): Likewise. (cgraph_set_pure_flag_1): Likewise. (cgraph_set_const_flag_1): Likewise. (cgraph_set_nothrow_flag_1): Likewise. (cgraph_make_node_local_1): Likewise. (cgraph_for_node_and_aliases): Likewise. (cgraph_for_node_thunks_and_aliases): Likewise. (cgraph_node_can_be_local_p): Likewise. (cgraph_node_cannot_be_local_p_1): Likewise. (cgraph_function_body_availability): Likewise. (dump_cgraph_node): Likewise. (cgraph_rtl_info): Likewise. (cgraph_mark_address_taken_node): Likewise. (cgraph_remove_node): Likewise. (cgraph_release_function_body): Likewise. (cgraph_update_edges_for_call_stmt_node): Likewise. (cgraph_redirect_edge_call_stmt_to_callee): Likewise. (cgraph_make_edge_direct): Likewise. (cgraph_resolve_speculation): Likewise. (cgraph_speculative_call_info): Likewise. (cgraph_turn_edge_to_speculative): Likewise. (cgraph_create_edge_1): Likewise. (cgraph_set_call_stmt): Likewise. (cgraph_node_for_asm): Likewise. (cgraph_add_thunk): Likewise. (cgraph_same_body_alias): Likewise. (cgraph_create_function_alias): Likewise. (cgraph_create_node): Likewise. (cgraph_create_empty_node): Likewise. (record_function_versions): Likewise. (used_from_object_file_p): Likewise. * cgraph.h (symtab_can_be_discarded): Likewise. (symtab_real_symbol_p): Likewise. (cgraph_mark_force_output_node): Likewise. (cgraph_edge_recursive_p): Likewise. (symtab_alias_target): Likewise. (varpool_all_refs_explicit_p): Likewise. (varpool_can_remove_if_no_refs): Likewise. (cgraph_only_called_directly_or_aliased_p): Likewise. (cgraph_next_function_with_gimple_body): Likewise. (cgraph_first_function_with_gimple_body): Likewise. (cgraph_function_with_gimple_body_p): Likewise. (cgraph_next_function): Likewise. (cgraph_first_function): Likewise. (cgraph_next_defined_function): Likewise. (cgraph_first_defined_function): Likewise. (varpool_next_defined_variable): Likewise. (varpool_first_defined_variable): Likewise. (varpool_next_static_initializer): Likewise. (varpool_first_static_initializer): Likewise. (varpool_next_variable): Likewise. (varpool_first_variable): Likewise. (varpool_node_name): Likewise. (varpool): Likewise. (cgraph): Likewise. (is_a_helper <varpool_node>::test): Likewise. (is_a_helper <cgraph_node>::test): Likewise. (varpool_variable_node): Likewise. (cgraph_function_or_thunk_node): Likewise. (varpool_alias_target): Likewise. (cgraph_alias_target): Likewise. (cgraph_node_name): Likewise. (varpool_node_asm_name): Likewise. (cgraph_node_asm_name): Likewise. * cgraphbuild.c (remove_cgraph_callee_edges): Likewise. (cgraph_rebuild_references): Likewise. (rebuild_cgraph_edges): Likewise. (record_eh_tables): Likewise. (build_cgraph_edges): Likewise. (mark_store): Likewise. (mark_load): Likewise. (mark_address): Likewise. (record_type_list): Likewise. (record_reference): Likewise. * cgraphclones.c (cgraph_materialize_all_clones): Likewise. (cgraph_materialize_clone): Likewise. (cgraph_function_versioning): Likewise. (cgraph_copy_node_for_versioning): Likewise. (update_call_expr): Likewise. (cgraph_find_replacement_node): Likewise. (cgraph_create_virtual_clone): Likewise. (cgraph_clone_node): Likewise. * cgraphunit.c (compile): Likewise. (output_weakrefs): Likewise. (output_in_order): Likewise. (expand_function): Likewise. (assemble_thunks_and_aliases): Likewise. (expand_thunk): Likewise. (mark_functions_to_output): Likewise. (handle_alias_pairs): Likewise. (analyze_functions): Likewise. (walk_polymorphic_call_targets): Likewise. (varpool_finalize_decl): Likewise. (process_function_and_variable_attributes): Likewise. (cgraph_process_same_body_aliases): Likewise. (analyze_function): Likewise. (cgraph_add_new_function): Likewise. (cgraph_finalize_function): Likewise. (referred_to_p): Likewise. (cgraph_reset_node): Likewise. (cgraph_process_new_functions): Likewise. (enqueue_node): Likewise. (decide_is_symbol_needed): Likewise. * coverage.c (coverage_compute_profile_id): Likewise. * dbxout.c (dbxout_expand_expr): Likewise. * dwarf2out.c (premark_types_used_by_global_vars_helper): Likewise. (reference_to_unused): Likewise. * gimple-fold.c (can_refer_decl_in_current_unit_p): Likewise. * gimplify.c (unvisit_body): Likewise. (unshare_body): Likewise. * ipa-cp.c (ipcp_generate_summary): Likewise. (ipcp_decision_stage): Likewise. (identify_dead_nodes): Likewise. (decide_whether_version_node): Likewise. (decide_about_value): Likewise. (perhaps_add_new_callers): Likewise. (create_specialized_node): Likewise. (update_profiling_info): Likewise. (ipcp_propagate_stage): Likewise. (estimate_local_effects): Likewise. (good_cloning_opportunity_p): Likewise. (devirtualization_time_bonus): Likewise. (propagate_constants_accross_call): Likewise. (initialize_node_lattices): Likewise. (ipcp_cloning_candidate_p): Likewise. (determine_versionability): Likewise. (print_all_lattices): Likewise. (print_lattice): Likewise. (ipcp_discover_new_direct_edges): Likewise. * ipa-devirt.c (ipa_devirt): Likewise. (likely_target_p): Likewise. (update_type_inheritance_graph): Likewise. (possible_polymorphic_call_target_p): Likewise. (dump_possible_polymorphic_call_targets): Likewise. (devirt_variable_node_removal_hook): Likewise. (record_binfo): Likewise. (maybe_record_node): Likewise. (build_type_inheritance_graph): Likewise. * ipa-inline-analysis.c (inline_write_summary): Likewise. (inline_generate_summary): Likewise. (inline_analyze_function): Likewise. (do_estimate_growth): Likewise. (simple_edge_hints): Likewise. (estimate_node_size_and_time): Likewise. (estimate_edge_devirt_benefit): Likewise. (compute_inline_parameters): Likewise. (estimate_function_body_sizes): Likewise. (compute_bb_predicates): Likewise. (initialize_inline_failed): Likewise. (dump_inline_summary): Likewise. (dump_inline_edge_summary): Likewise. * ipa-inline-transform.c (inline_transform): Likewise. (preserve_function_body_p): Likewise. (save_inline_function_body): Likewise. (inline_call): Likewise. (clone_inlined_nodes): Likewise. (can_remove_node_now_p): Likewise. (can_remove_node_now_p_1): Likewise. * ipa-inline.c (early_inliner): Likewise. (early_inline_small_functions): Likewise. (inline_always_inline_functions): Likewise. (ipa_inline): Likewise. (flatten_function): Likewise. (inline_small_functions): Likewise. (speculation_useful_p): Likewise. (recursive_inlining): Likewise. (update_caller_keys): Likewise. (reset_edge_caches): Likewise. (update_edge_key): Likewise. (edge_badness): Likewise. (relative_time_benefit): Likewise. (want_inline_self_recursive_call_p): Likewise. (want_inline_small_function_p): Likewise. (want_early_inline_function_p): Likewise. (num_calls): Likewise. (can_early_inline_edge_p): Likewise. (can_inline_edge_p): Likewise. (report_inline_failed_reason): Likewise. * ipa-profile.c (ipa_profile): Likewise. (ipa_propagate_frequency): Likewise. (ipa_propagate_frequency_1): Likewise. (ipa_profile_generate_summary): Likewise. * ipa-prop.c (ipcp_transform_function): Likewise. (read_replacements_section): Likewise. (ipa_prop_read_section): Likewise. (ipa_modify_call_arguments): Likewise. (ipa_print_node_params): Likewise. (propagate_controlled_uses): Likewise. (update_indirect_edges_after_inlining): Likewise. (remove_described_reference): Likewise. (ipa_make_edge_direct_to_target): Likewise. (ipa_analyze_node): Likewise. (ipa_analyze_params_uses): Likewise. (ipa_compute_jump_functions): Likewise. (ipa_get_callee_param_type): Likewise. (ipa_print_node_jump_functions): Likewise. (ipa_initialize_node_params): Likewise. (ipa_populate_param_decls): Likewise. (ipa_func_spec_opts_forbid_analysis_p): Likewise. (write_agg_replacement_chain): Likewise. (ipa_write_node_info): Likewise. (ipa_edge_duplication_hook): Likewise. (try_decrement_rdesc_refcount): Likewise. * ipa-pure-const.c (propagate_nothrow): Likewise. (propagate_pure_const): Likewise. (pure_const_read_summary): Likewise. (pure_const_write_summary): Likewise. (analyze_function): Likewise. * ipa-ref-inline.h (ipa_ref_referred_ref_list): Likewise. (ipa_ref_referring_ref_list): Likewise. * ipa-ref.c (ipa_clear_stmts_in_references): Likewise. (ipa_remove_stmt_references): Likewise. (ipa_find_reference): Likewise. (ipa_dump_referring): Likewise. (ipa_dump_references): Likewise. (ipa_record_reference): Likewise. * ipa-reference.c (ipa_reference_read_optimization_summary): Likewise. (ipa_reference_write_optimization_summary): Likewise. (write_node_summary_p): Likewise. (propagate): Likewise. (read_write_all_from_decl): Likewise. (generate_summary): Likewise. (analyze_function): Likewise. (propagate_bits): Likewise. (ipa_reference_get_not_written_global): Likewise. (ipa_reference_get_not_read_global): Likewise. * ipa-split.c (execute_split_functions): Likewise. (split_function): Likewise. * ipa-utils.c (ipa_merge_profiles): Likewise. (dump_cgraph_node_set): Likewise. (ipa_reverse_postorder): Likewise. (ipa_edge_within_scc): Likewise. (ipa_get_nodes_in_cycle): Likewise. (ipa_free_postorder_info): Likewise. (ipa_reduced_postorder): Likewise. (searchc): Likewise. (recursive_call_p): Likewise. * ipa.c (ipa_cdtor_merge): Likewise. (record_cdtor_fn): Likewise. (function_and_variable_visibility): Likewise. (varpool_externally_visible_p): Likewise. (cgraph_externally_visible_p): Likewise. (comdat_can_be_unshared_p): Likewise. (comdat_can_be_unshared_p_1): Likewise. (address_taken_from_non_vtable_p): Likewise. (ipa_discover_readonly_nonaddressable_vars): Likewise. (symtab_remove_unreachable_nodes): Likewise. (walk_polymorphic_call_targets): Likewise. (process_references): Likewise. (enqueue_node): Likewise. (has_addr_references_p): Likewise. (cgraph_non_local_node_p_1): Likewise. * is-a.h (varpool_analyze_node): Likewise. * lto-cgraph.c (input_symtab): Likewise. (merge_profile_summaries): Likewise. (input_cgraph_1): Likewise. (input_edge): Likewise. (input_varpool_node): Likewise. (input_node): Likewise. (input_overwrite_node): Likewise. (compute_ltrans_boundary): Likewise. (output_refs): Likewise. (lto_output_varpool_node): Likewise. (lto_output_node): Likewise. (reachable_from_other_partition_p): Likewise. (referenced_from_other_partition_p): Likewise. (lto_output_edge): Likewise. (output_node_opt_summary): Likewise. (add_node_to): Likewise. (reachable_from_this_partition_p): Likewise. (lto_set_symtab_encoder_in_partition): Likewise. (lto_symtab_encoder_in_partition_p): Likewise. (lto_set_symtab_encoder_encode_initializer): Likewise. (lto_symtab_encoder_encode_initializer_p): Likewise. (lto_set_symtab_encoder_encode_body): Likewise. (lto_symtab_encoder_encode_body_p): Likewise. * lto-section-in.c (lto_free_function_in_decl_state_for_node): Likewise. * lto-streamer-in.c (lto_read_body): Likewise. (fixup_call_stmt_edges): Likewise. (fixup_call_stmt_edges_1): Likewise. * lto-streamer-out.c (produce_symtab): Likewise. (output_symbol_p): Likewise. (write_symbol): Likewise. (lto_output): Likewise. (copy_function): Likewise. (output_function): Likewise. * passes.c (function_called_by_processed_nodes_p): Likewise. (ipa_write_optimization_summaries): Likewise. (ipa_write_summaries): Likewise. (do_per_function_toporder): Likewise. (do_per_function): Likewise. (dump_passes): Likewise. * symtab.c (symtab_semantically_equivalent_p): Likewise. (symtab_nonoverwritable_alias): Likewise. (symtab_nonoverwritable_alias_1): Likewise. (symtab_for_node_and_aliases): Likewise. (symtab_resolve_alias): Likewise. (fixup_same_cpp_alias_visibility): Likewise. (symtab_alias_ultimate_target): Likewise. (symtab_used_from_object_file_p): Likewise. (verify_symtab_base): Likewise. (dump_symtab_base): Likewise. (symtab_node_name): Likewise. (symtab_node_asm_name): Likewise. (symtab_dissolve_same_comdat_group_list): Likewise. (symtab_add_to_same_comdat_group): Likewise. (symtab_unregister_node): Likewise. (symtab_insert_node_to_hashtable): Likewise. (symtab_register_node): Likewise. (unlink_from_assembler_name_hash): Likewise. (insert_to_assembler_name_hash): Likewise. (eq_assembler_name): Likewise. (hash_node_by_assembler_name): Likewise. (eq_node): Likewise. (hash_node): Likewise. * toplev.c (wrapup_global_declaration_2): Likewise. * trans-mem.c (ipa_tm_execute): Likewise. (ipa_tm_transform_clone): Likewise. (ipa_tm_transform_transaction): Likewise. (ipa_tm_transform_calls_redirect): Likewise. (ipa_tm_insert_gettmclone_call): Likewise. (ipa_tm_insert_irr_call): Likewise. (ipa_tm_create_version): Likewise. (ipa_tm_create_version_alias): Likewise. (ipa_tm_mark_forced_by_abi_node): Likewise. (ipa_tm_mark_force_output_node): Likewise. (ipa_tm_diagnose_tm_safe): Likewise. (ipa_tm_mayenterirr_function): Likewise. (ipa_tm_scan_irr_function): Likewise. (ipa_tm_note_irrevocable): Likewise. (ipa_tm_scan_calls_clone): Likewise. (get_cg_data): Likewise. * tree-eh.c (tree_could_trap_p): Likewise. * tree-emutls.c (ipa_lower_emutls): Likewise. (create_emultls_var): Likewise. (lower_emutls_function_body): Likewise. (gen_emutls_addr): Likewise. (emutls_decl): Likewise. (new_emutls_decl): Likewise. * tree-inline.c (tree_function_versioning): Likewise. (optimize_inline_calls): Likewise. (expand_call_inline): Likewise. (estimate_num_insns): Likewise. (copy_bb): Likewise. (delete_unreachable_blocks_update_callgraph): Likewise. * tree-nested.c (gimplify_all_functions): Likewise. (create_nesting_tree): Likewise. (check_for_nested_with_variably_modified): Likewise. * tree-pretty-print.c (dump_function_header): Likewise. * tree-profile.c (tree_profiling): Likewise. * tree-sra.c (ipa_sra_preliminary_function_checks): Likewise. (modify_function): Likewise. (convert_callers): Likewise. (convert_callers_for_node): Likewise. * tree-ssa-structalias.c (ipa_pta_execute): Likewise. (associate_varinfo_to_alias): Likewise. (create_variable_info_for): Likewise. (get_constraint_for_ssa_var): Likewise. * tree-vectorizer.c (increase_alignment): Likewise. * tree.c (find_decls_types_in_var): Likewise. (find_decls_types_in_node): Likewise. (free_lang_data_in_decl): Likewise. * value-prof.c (gimple_ic_transform): Likewise. (gimple_ic): Likewise. (check_ic_target): Likewise. (init_node_map): Likewise. * varasm.c (decl_binds_to_current_def_p): Likewise. (default_binds_local_p_1): Likewise. (dump_tm_clone_pairs): Likewise. (assemble_alias): Likewise. (find_decl): Likewise. (mark_decl_referenced): Likewise. * varpool.c (varpool_for_node_and_aliases): Likewise. (varpool_extra_name_alias): Likewise. (varpool_create_variable_alias): Likewise. (add_new_static_var): Likewise. (varpool_finalize_named_section_flags): Likewise. (varpool_remove_unreferenced_decls): Likewise. (enqueue_node): Likewise. (varpool_assemble_decl): Likewise. (assemble_aliases): Likewise. (varpool_analyze_node): Likewise. (cgraph_variable_initializer_availability): Likewise. (varpool_add_new_variable): Likewise. (ctor_for_folding): Likewise. (dump_varpool_node): Likewise. (varpool_remove_initializer): Likewise. (varpool_remove_node): Likewise. (varpool_node_for_decl): Likewise. (varpool_create_empty_node): Likewise. * config/i386/i386.c (ix86_generate_version_dispatcher_body): Likewise. (ix86_get_function_versions_dispatcher): Likewise. gcc/ada/ Patch autogenerated by refactor_symtab.py from https://github.com/davidmalcolm/gcc-refactoring-scripts revision 58bb219cc090b2f4516a9297d868c245495ee622 * gcc-interface/trans.c (finalize_nrv): Update for conversion of symtab types to a true class hierarchy. * gcc-interface/utils.c (gnat_write_global_declarations): Likewise. gcc/c-family/ Patch autogenerated by refactor_symtab.py from https://github.com/davidmalcolm/gcc-refactoring-scripts revision 58bb219cc090b2f4516a9297d868c245495ee622 * c-gimplify.c (c_genericize): Update for conversion of symtab types to a true class hierarchy. * c-pragma.c (maybe_apply_pending_pragma_weaks): Likewise. gcc/cp/ Patch autogenerated by refactor_symtab.py from https://github.com/davidmalcolm/gcc-refactoring-scripts revision 58bb219cc090b2f4516a9297d868c245495ee622 * call.c (mark_versions_used): Update for conversion of symtab types to a true class hierarchy. * decl2.c (cp_write_global_declarations): Likewise. (clear_decl_external): Likewise. (build_java_method_aliases): Likewise. (collect_candidates_for_java_method_aliases): Likewise. (mark_needed): Likewise. (var_finalized_p): Likewise. (maybe_make_one_only): Likewise. (maybe_emit_vtables): Likewise. * lambda.c (maybe_add_lambda_conv_op): Likewise. * method.c (use_thunk): Likewise. * optimize.c (maybe_clone_body): Likewise. * tree.c (cp_fix_function_decl_p): Likewise. gcc/java/ Patch autogenerated by refactor_symtab.py from https://github.com/davidmalcolm/gcc-refactoring-scripts revision 58bb219cc090b2f4516a9297d868c245495ee622 * decl.c (java_mark_decl_local): Update for conversion of symtab types to a true class hierarchy. gcc/lto/ Patch autogenerated by refactor_symtab.py from https://github.com/davidmalcolm/gcc-refactoring-scripts revision 58bb219cc090b2f4516a9297d868c245495ee622 * lto-partition.c (lto_promote_cross_file_statics): Update for conversion of symtab types to a true class hierarchy. (rename_statics): Likewise. (promote_symbol): Likewise. (privatize_symbol_name): Likewise. (lto_balanced_map): Likewise. (varpool_node_cmp): Likewise. (node_cmp): Likewise. (lto_1_to_1_map): Likewise. (undo_partition): Likewise. (add_symbol_to_partition): Likewise. (contained_in_symbol): Likewise. (add_symbol_to_partition_1): Likewise. (add_references_to_partition): Likewise. (symbol_partitioned_p): Likewise. (get_symbol_class): Likewise. (lto_max_map): Likewise. * lto-symtab.c (lto_symtab_prevailing_decl): Likewise. (lto_symtab_merge_symbols): Likewise. (lto_symtab_merge_symbols_1): Likewise. (lto_symtab_merge_decls): Likewise. (lto_symtab_merge_decls_1): Likewise. (lto_symtab_merge_decls_2): Likewise. (lto_symtab_resolve_symbols): Likewise. (lto_symtab_resolve_can_prevail_p): Likewise. (lto_symtab_symbol_p): Likewise. (lto_symtab_resolve_replaceable_p): Likewise. (lto_symtab_merge): Likewise. (lto_varpool_replace_node): Likewise. (lto_cgraph_replace_node): Likewise. * lto.c (lto_main): Likewise. (do_whole_program_analysis): Likewise. (materialize_cgraph): Likewise. (read_cgraph_and_symbols): Likewise. (cmp_partitions_order): Likewise. (lto_materialize_function): Likewise. (has_analyzed_clone_p): Likewise. From-SVN: r204171
2013-10-29 19:30:00 +01:00
e->callee->externally_visible = false;
cgraphbuild.c (build_cgraph_edges): Update call of cgraph_create_edge and cgraph_create_indirect_edge. * cgraphbuild.c (build_cgraph_edges): Update call of cgraph_create_edge and cgraph_create_indirect_edge. * cgraph.c (cgraph_create_edge_including_clones, cgraph_create_edge_1, cgraph_allocate_init_indirect_info, cgraph_update_edges_for_call_stmt_node): Do not take nest argument; do not initialize call_stmt_size/time. (dump_cgraph_node): Do not dump nest. (cgraph_clone_edge): Do not take loop_nest argument; do not propagate it; do not clone call_stmt_size/time. (cgraph_clone_node): Likewise. (cgraph_create_virtual_clone): Update. * cgraph.h (struct cgraph_edge): Remove call_stmt_size/call_stmt_time/loop_nest. (cgraph_create_edge, cgraph_create_indirect_edge, cgraph_create_edge_including_clones, cgraph_clone_node): Update prototype. * tree-emutls.c (gen_emutls_addr): Update. * ipa-inline-transform.c (update_noncloned_frequencies): Do not handle loop_nest; handle indirect calls, too. (clone_inlined_nodes): Do not care about updating inline summaries. * cgraphunit.c (cgraph_copy_node_for_versioning): Update. * lto-cgraph.c (lto_output_edge, input_node, input_edge): Do not stream call_stmt_size/call_stmt_time/loop_nest. * ipa-inline.c (edge_badness): Update. (ipa_inline): dump summaries after inlining. * ipa-inline.h (struct inline_edge_summary, inline_edge_summary_t): new. (inline_edge_summary): New function. * ipa-inline-analysis.c (edge_duplication_hook_holder): New holder. (inline_edge_removal_hook): Handle edge summaries. (inline_edge_duplication_hook): New hook. (inline_summary_alloc): Alloc hooks. (initialize_growth_caches): Do not register removal hooks. (free_growth_caches); Do not free removal hook. (dump_inline_edge_summary): New function. (dump_inline_summary): Use it. (estimate_function_body_sizes, estimate_edge_size_and_time): Update. (inline_update_callee_summaries): New function. (inline_merge_summary): Use it. (do_estimate_edge_time, do_estimate_edge_growth): Update. (read_inline_edge_summary): New function. (inline_read_section): Use it. (write_inline_edge_summary): New function. (inline_write_summary): Use it. (inline_free_summary): Free edge new holders. * tree-inline.c (copy_bb): Update. From-SVN: r172989
2011-04-27 00:05:50 +02:00
update_noncloned_frequencies (e->callee, e->frequency);
dump_callgraph_transformation (e->callee, inlining_into,
"inlining to");
}
else
{
struct cgraph_node *n;
if (freq_scale == -1)
freq_scale = e->frequency;
IPA C++ refactoring 1/N * cgraph.h (symtab_node): (void register_symbol (void)): created from symtab_register_node (void remove (void)): created from symtab_remove_node (void dump (FILE *f)): created from dump_symtab_node (void DEBUG_FUNCTION debug (void)): created from debug_symtab_node (void DEBUG_FUNCTION verify (void)): created from verify_symtab_node (struct ipa_ref *add_reference (symtab_node *referred_node, enum ipa_ref_use use_type)): created from add_reference (struct ipa_ref *add_reference (symtab_node *referred_node, enum ipa_ref_use use_type, gimple stmt)): created from add_reference (struct ipa_ref *maybe_add_reference (tree val, enum ipa_ref_use use_type, gimple stmt)): created from maybe_add_reference (bool semantically_equivalent_p (symtab_node *target)): created from symtab_semantically_equivalent_p (void remove_from_same_comdat_group (void)): created from remove_from_same_comdat_group (void add_to_same_comdat_group (symtab_node *old_node)): created from symtab_add_to_same_comdat_group (void dissolve_same_comdat_group_list (void)): created from symtab_dissolve_same_comdat_group_list (bool used_from_object_file_p (void)): created from symtab_used_from_object_file_p (symtab_node *ultimate_alias_target (enum availability *avail = NULL)): created from symtab_alias_ultimate_target (inline symtab_node *next_defined_symbol (void)): created from symtab_next_defined_symbol (bool resolve_alias (symtab_node *target)): created from symtab_resolve_alias (bool call_for_symbol_and_aliases (bool (*callback) (symtab_node *, void *), void *data, bool include_overwrite)): created from symtab_for_node_and_aliases (symtab_node *noninterposable_alias (void)): created from symtab_nonoverwritable_alias (inline symtab_node *get_alias_target (void)): created from symtab_alias_target (void set_section (const char *section)): created from set_section_1 (enum availability get_availability (void)): created from symtab_node_availability (void make_decl_local (void)): created from symtab_make_decl_local (bool real_symbol_p (void)): created from symtab_read_node (can_be_discarded_p (void)): created from symtab_can_be_discarded (inline bool comdat_local_p (void)): created from symtab_comdat_local_p (inline bool in_same_comdat_group_p (symtab_node *target)): created from symtab_in_same_comdat_p; (bool address_taken_from_non_vtable_p (void)): created from address_taken_from_non_vtable_p (static inline symtab_node *get (const_tree decl)): created from symtab_get_node (static void dump_table (FILE *)): created from dump_symtab (static inline DEBUG_FUNCTION void debug_symtab (void)): created from debug_symtab (static DEBUG_FUNCTION void verify_symtab_nodes (void)): created from verify_symtab (static bool used_from_object_file_p_worker (symtab_node *node)): created from symtab_used_from_object_file_p (void dump_base (FILE *)): created from dump_symtab_base (bool DEBUG_FUNCTION verify_base (void)): created from verify_symtab_base (void unregister (void)): created from symtab_unregister_node (struct symbol_priority_map *priority_info (void)): created from symtab_priority_info (static bool set_implicit_section (symtab_node *n, void *)): created from set_implicit_section (static bool noninterposable_alias (symtab_node *node, void *data)): created from symtab_nonoverwritable_alias_1 * cgraph.h (cgraph_node): (bool remove_symbol_and_inline_clones (cgraph_node *forbidden_node = NULL)): created from cgraph_remove_node_and_inline_clones (void record_stmt_references (gimple stmt)): created from ipa_record_stmt_references (void set_call_stmt_including_clones (gimple old_stmt, gimple new_stmt, bool update_speculative = true)): created from cgraph_set_call_stmt_including_clones (cgraph_node *function_symbol (enum availability *avail = NULL)): created from cgraph_function_node (cgraph_node *create_clone (tree decl, gcov_type count, int freq, bool update_original, vec<cgraph_edge *> redirect_callers, bool call_duplication_hook, struct cgraph_node *new_inlined_to, bitmap args_to_skip)): created from cgraph_create_clone (cgraph_node *create_virtual_clone (vec<cgraph_edge *> redirect_callers, vec<ipa_replace_map *, va_gc> *tree_map, bitmap args_to_skip, const char * suffix)): created from cgraph_create_virtual_clone (cgraph_node *find_replacement (void)): created from cgraph_find_replacement_node (cgraph_node *create_version_clone (tree new_decl, vec<cgraph_edge *> redirect_callers, bitmap bbs_to_copy)): created from cgraph_copy_node_for_versioning (cgraph_node *create_version_clone_with_body (vec<cgraph_edge *> redirect_callers, vec<ipa_replace_map *, va_gc> *tree_map, bitmap args_to_skip, bool skip_return, bitmap bbs_to_copy, basic_block new_entry_block, const char *clone_name)): created from cgraph_function_version_info (struct cgraph_function_version_info *insert_new_function_version (void)): created from insert_new_cgraph_node_version (struct cgraph_function_version_info *function_version (void)): created from get_cgraph_node_version (void analyze (void)): created from analyze_function (cgraph_node * create_thunk (tree alias, tree, bool this_adjusting, HOST_WIDE_INT fixed_offset, HOST_WIDE_INT virtual_value, tree virtual_offset, tree real_alias) cgraph_add_thunk (inline cgraph_node *get_alias_target (void)): created from cgraph_alias_target (cgraph_node *ultimate_alias_target (availability *availability = NULL)): created from cgraph_function_or_thunk_node (bool expand_thunk (bool output_asm_thunks, bool force_gimple_thunk)): created from expand_thunk (void reset (void)): created from cgraph_reset_node (void create_wrapper (cgraph_node *target)): created from cgraph_make_wrapper (void DEBUG_FUNCTION verify_node (void)): created from verify_cgraph_node (void remove (void)): created from cgraph_remove_node (void dump (FILE *f)): created from dump_cgraph_node (void DEBUG_FUNCTION debug (void)): created from debug_cgraph_node (bool get_body (void)): created from cgraph_get_body (void release_body (void)): created from cgraph_release_function_body (void unnest (void)): created from cgraph_unnest_node (void make_local (void)): created from cgraph_make_node_local (void mark_address_taken (void)): created from cgraph_mark_address_taken_node (struct cgraph_edge *create_edge (cgraph_node *callee, gimple call_stmt, gcov_type count, int freq)): created from cgraph_create_edge (struct cgraph_edge *create_indirect_edge (gimple call_stmt, int ecf_flags, gcov_type count, int freq)): created from cgraph_create_indirect_edge (void create_edge_including_clones (struct cgraph_node *callee, gimple old_stmt, gimple stmt, gcov_type count, int freq, cgraph_inline_failed_t reason)): created from cgraph_create_edge_including_clones (cgraph_edge *get_edge (gimple call_stmt)): created from cgraph_edge (vec<cgraph_edge *> collect_callers (void)): created from collect_callers_of_node (void remove_callers (void)): created from cgraph_node_remove_callers (void remove_callees (void)): created from cgraph_node_remove_callees (enum availability get_availability (void)): created from cgraph_function_body_availability (void set_nothrow_flag (bool nothrow)): created from cgraph_set_nothrow_flag (void set_const_flag (bool readonly, bool looping)): created from cgraph_set_const_flag (void set_pure_flag (bool pure, bool looping)): created from cgraph_set_pure_flag (void call_duplication_hooks (cgraph_node *node2)): created from cgraph_call_node_duplication_hooks (bool call_for_symbol_and_aliases (bool (*callback) (cgraph_node *, void *), void *data, bool include_overwritable)): created from cgraph_for_node_and_aliases (bool call_for_symbol_thunks_and_aliases (bool (*callback) (cgraph_node *node, void *data), void *data, bool include_overwritable)): created from cgraph_for_node_thunks_and_aliases (void call_function_insertion_hooks (void)): created from cgraph_call_function_insertion_hooks (inline void mark_force_output (void)): created from cgraph_mark_force_output_node (bool local_p (void)): created from cgraph_local_node (bool can_be_local_p (void)): created from cgraph_node_can_be_local_p (bool cannot_return_p (void)): created from cgraph_node_cannot_return (bool only_called_directly_p (void)): created from cgraph_only_called_directly_p (inline bool only_called_directly_or_aliased_p (void)): created from cgraph_only_called_directly_or_aliased_p (bool will_be_removed_from_program_if_no_direct_calls_p (void)): created from cgraph_will_be_removed_from_program_if_no_direct_calls (bool can_remove_if_no_direct_calls_and_refs_p (void)): created from cgraph_can_remove_if_no_direct_calls_and_refs_p (bool can_remove_if_no_direct_calls_p (void)): created from cgraph_can_remove_if_no_direct_calls_p (inline bool has_gimple_body_p (void)): created from cgraph_function_with_gimple_body_p (bool optimize_for_size_p (void)): created from cgraph_optimize_for_size_p (static void dump_cgraph (FILE *f)): created from dump_cgraph (static inline void debug_cgraph (void)): created from debug_cgraph (static void record_function_versions (tree decl1, tree decl2)): created from record_function_versions (static void delete_function_version (tree decl)): created from delete_function_version (static void add_new_function (tree fndecl, bool lowered)): created from cgraph_add_new_function (static inline cgraph_node *get (const_tree decl)): created from cgraph_get_node (static cgraph_node * create (tree decl)): created from cgraph_create_node (static cgraph_node * create_empty (void)): created from cgraph_create_empty_node (static cgraph_node * get_create (tree)): created from cgraph_get_create_node (static cgraph_node *get_for_asmname (tree asmname)): created from cgraph_node_for_asm (static cgraph_node * create_same_body_alias (tree alias, tree decl)): created from cgraph_same_body_alias (static bool used_from_object_file_p_worker (cgraph_node *node, void *): new function (static bool non_local_p (cgraph_node *node, void *)): created from cgraph_non_local_node_p_1 (static void DEBUG_FUNCTION verify_cgraph_nodes (void)): created from verify_cgraph (static bool make_local (cgraph_node *node, void *)): created from cgraph_make_node_local (static cgraph_node *create_alias (tree alias, tree target)): created from cgraph_create_function_alias (static cgraph_edge * create_edge (cgraph_node *caller, cgraph_node *callee, gimple call_stmt, gcov_type count, int freq, bool indir_unknown_callee)): created from cgraph_create_edge_1 * cgraph.h (varpool_node): (void remove (void)): created from varpool_remove_node (void dump (FILE *f)): created from dump_varpool_node From-SVN: r212982
2014-07-24 14:07:13 +02:00
n = e->callee->create_clone (e->callee->decl,
MIN (e->count, e->callee->count),
freq_scale,
update_original, vNULL, true,
inlining_into,
NULL);
n->used_as_abstract_origin = e->callee->used_as_abstract_origin;
IPA C++ refactoring 4/N * cgraph.h (symtab_node): (bool needed_p (void)): created from decide_is_symbol_needed (bool referred_to_p (void)): created from referred_to_p (static cgraph_node *get_for_asmname (tree asmname)): created from symtab_node_for_asm * cgraph.h (cgraph_node): (void assemble_thunks_and_aliases (void)): created from assemble_thunks_and_aliases (void expand (void)): created from expand_function (static void finalize_function (tree, bool)): created from cgraph_finalize_function (static cgraph_local_info *local_info (tree decl)): created from cgraph_local_info (static cgraph_global_info *global_info (tree)): created from cgraph_global_info (static cgraph_rtl_info *rtl_info (tree)): created from cgraph_rtl_info * cgraph.h (varpool_node): (static void add (tree decl): created from varpool_add_new_variable * cgraph.h (cgraph_edge): void remove (void); (void remove_caller (void)): created from cgraph_edge_remove_caller (void remove_callee (void)): created from cgraph_edge_remove_callee (void set_call_stmt (gimple new_stmt, bool update_speculative = true)): created from cgraph_set_call_stmt (void redirect_callee (cgraph_node *n)): created from cgraph_redirect_edge_callee (cgraph_edge *make_direct (cgraph_node *callee)): created from cgraph_make_edge_direct (cgraph_edge *make_speculative (cgraph_node *n2, gcov_type direct_count, gimple redirect_call_stmt_to_callee (void)): created from cgraph_turn_edge_to_speculative (void speculative_call_info (cgraph_edge *&direct, cgraph_edge *&indirect, ipa_ref *&reference)): created from cgraph_speculative_call_info (cgraph_edge * clone (cgraph_node *n, gimple call_stmt, unsigned stmt_uid, gcov_type count_scale, int freq_scale, bool update_original)): created from cgraph_clone_edge (cgraph_edge *resolve_speculation (tree callee_decl)): created from cgraph_resolve_speculation (bool cannot_lead_to_return_p (void)): created from cannot_lead_to_return_p (bool recursive_p (void)): created from cgraph_edge_recursive_p (bool maybe_hot_p (void)): created from cgraph_maybe_hot_edge_p (static unsigned int rebuild_edges (void)): created from rebuild_cgraph_edges (static void rebuild_references (void)): created from cgraph_rebuild_references * cgraph.h (symbol_table): (create_reference): renamed from add_reference (maybe_create_reference): renamed from maybe_add_reference (void register_symbol (symtab_node *node)): new function (void clear_asm_symbols (void)): new function (void unregister (symtab_node *node)): new function (void release_symbol (cgraph_node *node, int uid)): new function (cgraph_node * allocate_cgraph_symbol (void)): new function (void initialize (void)): created from cgraph_init (symtab_node *first_symbol (void)):new function (asm_node *first_asm_symbol (void)):new function (symtab_node *first_defined_symbol (void)):new function (varpool_node *first_variable (void)):new function (varpool_node *next_variable (varpool_node *node)):new function (varpool_node *first_static_initializer (void)):new function (varpool_node *next_static_initializer (varpool_node *node)):new function (varpool_node *first_defined_variable (void)):new function (varpool_node *next_defined_variable (varpool_node *node)):new function (cgraph_node *first_defined_function (void)):new function (cgraph_node *next_defined_function (cgraph_node *node)):new function (cgraph_node *first_function (void)):new function (cgraph_node *next_function (cgraph_node *node)):new function (cgraph_node *first_function_with_gimple_body (void)):new function (asm_node *finalize_toplevel_asm (tree asm_str)): created from add_asm_node (bool remove_unreachable_nodes (bool before_inlining_p, FILE *file)): created from symtab_remove_unreachable_nodes (void remove_unreferenced_decls (void)): created from varpool_remove_unreferenced_decls (void process_new_functions (void)): created from cgraph_process_new_functions (void process_same_body_aliases (void)): created from cgraph_process_same_body_aliases (bool output_variables (void)): created from varpool_node::output_variables (void output_asm_statements (void)): created from output_asm_statements (void finalize_compilation_unit (void)): created from finalize_compilation_unit (void compile (void)): created from compile (void output_weakrefs (void)): created from output_weakrefs (cgraph_node *create_empty (void)): created from cgraph_node::create_empty (cgraph_edge *create_edge (cgraph_node *caller, cgraph_node *callee, gimple call_stmt, gcov_type count, int freq, bool indir_unknown_callee)): created from cgraph_node::create_edge (void free_edge (cgraph_edge *e)): created from cgraph_free_edge (cgraph_node *next_function_with_gimple_body (cgraph_node *node)): created from cgraph_next_function_with_gimple_body (void remove_edge_removal_hook (cgraph_edge_hook_list *)): created from cgraph_remove_edge_removal_hook (cgraph_node_hook_list *add_cgraph_removal_hook (cgraph_node_hook, void *)): created from cgraph_add_node_removal_hook (void remove_cgraph_removal_hook (cgraph_node_hook_list *)): created from cgraph_remove_node_removal_hook (varpool_node_hook_list *add_varpool_removal_hook (varpool_node_hook, void *)): created from varpool_add_node_removal_hook (void remove_varpool_removal_hook (varpool_node_hook_list *)): created from varpool_remove_node_removal_hook (cgraph_node_hook_list *add_cgraph_insertion_hook (cgraph_node_hook, void *)): created from cgraph_add_function_insertion_hook (void remove_cgraph_insertion_hook (cgraph_node_hook_list *)): created from cgraph_remove_function_insertion_hook (varpool_node_hook_list *add_varpool_insertion_hook (varpool_node_hook, void *)): created from varpool_add_variable_insertion_hook (void remove_varpool_insertion_hook (varpool_node_hook_list *)): created from varpool_remove_variable_insertion_hook (cgraph_2edge_hook_list *add_edge_duplication_hook (cgraph_2edge_hook, void *)): created from cgraph_add_edge_duplication_hook (void remove_edge_duplication_hook (cgraph_2edge_hook_list *)): created from cgraph_remove_edge_duplication_hook (cgraph_2node_hook_list *add_cgraph_duplication_hook (cgraph_2node_hook, void *)): created from cgraph_add_node_duplication_hook (void remove_cgraph_duplication_hook (cgraph_2node_hook_list *)): created from cgraph_remove_node_duplication_hook (void call_edge_removal_hooks (cgraph_edge *e)): created from cgraph_call_edge_removal_hooks (void call_cgraph_insertion_hooks (cgraph_node *node)): created from call_function_insertion_hooks (void call_cgraph_removal_hooks (cgraph_node *node)): created from cgraph_call_node_removal_hooks (void call_cgraph_duplication_hooks (cgraph_node *node, cgraph_node *node2)): created from cgraph_node::call_duplication_hooks (void call_edge_duplication_hooks (cgraph_edge *cs1, cgraph_edge *cs2)): created from cgraph_call_edge_duplication_hooks (void call_varpool_removal_hooks (varpool_node *node)): created from varpool_call_node_removal_hooks (void call_varpool_insertion_hooks (varpool_node *node)): created from varpool_call_variable_insertion_hooks (void insert_to_assembler_name_hash (symtab_node *node, bool with_clones)): created from insert_to_assembler_name_hash (void unlink_from_assembler_name_hash (symtab_node *node, bool with_clones)): created from unlink_from_assembler_name_hash (void symtab_prevail_in_asm_name_hash (symtab_node *node)): created from symtab_prevail_in_asm_name_hash (void symtab_initialize_asm_name_hash (void)): created from symtab_initialize_asm_name_hash (void change_decl_assembler_name (tree decl, tree name)): created from change_decl_assembler_name (void materialize_all_clones (void)): created from cgraph_materialize_all_clones (static hashval_t decl_assembler_name_hash (const_tree asmname)): created from decl_assembler_name_hash (static bool decl_assembler_name_equal (tree decl, const_tree asmname)): created from decl_assembler_name_equal (static hashval_t hash_node_by_assembler_name (const void *p)): created from hash_node_by_assembler_name (static int eq_assembler_name (const void *p1, const void *p2)): created from eq_assembler_name From-SVN: r214422
2014-08-25 15:01:47 +02:00
e->redirect_callee (n);
}
}
cgraph.c (ld_plugin_symbol_resolution_names): Move to symtab.c * cgraph.c (ld_plugin_symbol_resolution_names): Move to symtab.c (cgraph_asm_nodes, cgraph_asm_last_node): Move to cgraphunit.c (cgraph_add_to_same_comdat_group): Remove. (cgraph_add_asm_node): Move to cgraphunit.c. (cgraph_make_decl_local): Move to symtab.c (cgraph_make_node_local_1): Update. (cgraph_can_remove_if_no_direct_calls_and): Update. (used_from_object_file_p): Update. (resolution_used_from_other_file_p): Move to symtab.c (cgraph_used_from_object_file_p): move to symtab.c (verify_cgraph_node): Verify same comdat groups. * cgraph.h (cgraph_asm_node): Rename to ... (asm_node): ... this one. (cgraph_asm_nodes): Rename to ... (asm_nodes): ... this one. (symtab_add_to_same_comdat_group): New function. (symtab_dissolve_same_comdat_group_list): New function. (symtab_used_from_object_file_p): Declare. (symtab_make_decl_local): Declare. (cgraph_add_to_same_comdat_group): Remove. (cgraph_add_asm_node): Remove. (cgraph_used_from_object_file_p, varpool_used_from_object_file_p): Remove. (cgraph_finalize_compilation_unit): Rename to ... (finalize_compilation_unit): ... this one. (cgraph_optimize): Rename to .... (compile): ... this one. (add_asm_node): Declare. (fixup_same_cpp_alias_visibility): Declare. (cgraph_make_decl_local): Remove. (varpool_assemble_pending_decls): Rename to ... (varpool_output_variables): ... this one. (varpool_remove_unreferenced_decls): Remove. * ipa-inline-transform.c (clone_inlined_nodes): Dissolve comdat groups. (preserve_function_body_p): Make static. * toplev.c (compile_file): Update comments; update. * cgraphunit.c: Update comments. (cgraph_expand_all_functions): Rename to ... (expand_all_functions): ... this one; update. (cgraph_mark_functions_to_output): Rename to ... (mark_functions_to_output): ... this one; cleanup. (cgraph_output_pending_asms): Remove prototype. (asm_nodes, asm_last_node): New static vars. (cgraph_process_new_functions): Update. (cgraph_reset_node): Cleanup; add comment. (cgraph_add_new_function): Update. (cgraph_output_pending_asms): Rename to ... (output_asm_statements): ... this one. (add_asm_node): New function. (fixup_same_cpp_alias_visibility): New function based on code in cgraph_analyze_function. (cgraph_analyze_function): Use it. (cgraph_order_sort): Update. (cgraph_output_in_order): Update. (cgraph_function_versioning): Update. (cgraph_optimize): Rename to ... (compile): ... this one; initialize streamer hooks here. (cgraph_finalize_compilation_unit): Rename to ... (finalize_compilation_unit): ... this one; do not initialize streamer hook here. * lto-streamer-out.c (lto_output_toplevel_asms): Update. * dwarf2out.c: Update ocmment. * optimize.c (maybe_clone_body): Use symtab_add_to_same_comdat_group. * method.c (use_thunk): Likewise. * semantics.c (maybe_add_lambda_conv_op): Likewise. * decl2.c (maybe_emit_vtables): Likewise. (cp_write_global_declarations): Use finalize_compilation_unit. * parser.c (cp_parser_asm_definition): Use add_asm_node. * lto-streamer-in.c (lto_input_toplevel_asms): Use add_asm_node * c-decl.c (c_write_global_declarations): Use finalize_compilation_unit. * langhooks.c (write_global_declarations): Update. * ipa.c (cgraph_externally_visible_p): Update. (dissolve_same_comdat_group_list): Remove. (function_and_variable_visibility): Update. * symtab.c: Inlcude lto-streamer.h and rtl.h (ld_plugin_symbol_resolution_names): New. (symtab_add_to_same_comdat_group): New. (symtab_dissolve_same_comdat_group_list): New. (resolution_used_from_other_file_p): Move here from cgraph.c (symtab_used_from_object_file_p): New. (symtab_make_decl_local): New. * passes.c (register_pass): Update comments. * c-parser.c (c_parser_asm_definition): Update. * varpool.c (varpool_analyze_node): Use fixup_same_cpp_alias_visibility. (varpool_remove_unreferenced_decls): Make static. (varpool_assemble_pending_decls): Rename to ... (varpool_output_variables): ... this one; call varpool_remove_unreferenced_decls. (varpool_used_from_object_file_p): Remove. * gogo-tree.cc (Gogo::write_globals): Use finalize_compilation_unit. * gcc-interface/utils.c (rest_of_subprog_body_compilation): Update comment. (gnat_write_global_declarations): Use finalize_compilation_unit. * f95-lang.c (gfc_finish): Update comments. * lto.c (lto_main): Use compile (). * lto-partition.c (partition_cgraph_node_p): Use symtab_used_from_object_file_p. (partition_varpool_node_p): Likewise. From-SVN: r186998
2012-04-30 19:55:29 +02:00
else
e->callee->remove_from_same_comdat_group ();
e->callee->global.inlined_to = inlining_into;
/* Recursively clone all bodies. */
for (e = e->callee->callees; e; e = next)
{
next = e->next_callee;
if (!e->inline_failed)
clone_inlined_nodes (e, duplicate, update_original, overall_size, freq_scale);
}
}
/* Check all speculations in N and resolve them if they seems useless. */
static bool
check_speculations (cgraph_node *n)
{
bool speculation_removed = false;
cgraph_edge *next;
for (cgraph_edge *e = n->callees; e; e = next)
{
next = e->next_callee;
if (e->speculative && !speculation_useful_p (e, true))
{
IPA C++ refactoring 4/N * cgraph.h (symtab_node): (bool needed_p (void)): created from decide_is_symbol_needed (bool referred_to_p (void)): created from referred_to_p (static cgraph_node *get_for_asmname (tree asmname)): created from symtab_node_for_asm * cgraph.h (cgraph_node): (void assemble_thunks_and_aliases (void)): created from assemble_thunks_and_aliases (void expand (void)): created from expand_function (static void finalize_function (tree, bool)): created from cgraph_finalize_function (static cgraph_local_info *local_info (tree decl)): created from cgraph_local_info (static cgraph_global_info *global_info (tree)): created from cgraph_global_info (static cgraph_rtl_info *rtl_info (tree)): created from cgraph_rtl_info * cgraph.h (varpool_node): (static void add (tree decl): created from varpool_add_new_variable * cgraph.h (cgraph_edge): void remove (void); (void remove_caller (void)): created from cgraph_edge_remove_caller (void remove_callee (void)): created from cgraph_edge_remove_callee (void set_call_stmt (gimple new_stmt, bool update_speculative = true)): created from cgraph_set_call_stmt (void redirect_callee (cgraph_node *n)): created from cgraph_redirect_edge_callee (cgraph_edge *make_direct (cgraph_node *callee)): created from cgraph_make_edge_direct (cgraph_edge *make_speculative (cgraph_node *n2, gcov_type direct_count, gimple redirect_call_stmt_to_callee (void)): created from cgraph_turn_edge_to_speculative (void speculative_call_info (cgraph_edge *&direct, cgraph_edge *&indirect, ipa_ref *&reference)): created from cgraph_speculative_call_info (cgraph_edge * clone (cgraph_node *n, gimple call_stmt, unsigned stmt_uid, gcov_type count_scale, int freq_scale, bool update_original)): created from cgraph_clone_edge (cgraph_edge *resolve_speculation (tree callee_decl)): created from cgraph_resolve_speculation (bool cannot_lead_to_return_p (void)): created from cannot_lead_to_return_p (bool recursive_p (void)): created from cgraph_edge_recursive_p (bool maybe_hot_p (void)): created from cgraph_maybe_hot_edge_p (static unsigned int rebuild_edges (void)): created from rebuild_cgraph_edges (static void rebuild_references (void)): created from cgraph_rebuild_references * cgraph.h (symbol_table): (create_reference): renamed from add_reference (maybe_create_reference): renamed from maybe_add_reference (void register_symbol (symtab_node *node)): new function (void clear_asm_symbols (void)): new function (void unregister (symtab_node *node)): new function (void release_symbol (cgraph_node *node, int uid)): new function (cgraph_node * allocate_cgraph_symbol (void)): new function (void initialize (void)): created from cgraph_init (symtab_node *first_symbol (void)):new function (asm_node *first_asm_symbol (void)):new function (symtab_node *first_defined_symbol (void)):new function (varpool_node *first_variable (void)):new function (varpool_node *next_variable (varpool_node *node)):new function (varpool_node *first_static_initializer (void)):new function (varpool_node *next_static_initializer (varpool_node *node)):new function (varpool_node *first_defined_variable (void)):new function (varpool_node *next_defined_variable (varpool_node *node)):new function (cgraph_node *first_defined_function (void)):new function (cgraph_node *next_defined_function (cgraph_node *node)):new function (cgraph_node *first_function (void)):new function (cgraph_node *next_function (cgraph_node *node)):new function (cgraph_node *first_function_with_gimple_body (void)):new function (asm_node *finalize_toplevel_asm (tree asm_str)): created from add_asm_node (bool remove_unreachable_nodes (bool before_inlining_p, FILE *file)): created from symtab_remove_unreachable_nodes (void remove_unreferenced_decls (void)): created from varpool_remove_unreferenced_decls (void process_new_functions (void)): created from cgraph_process_new_functions (void process_same_body_aliases (void)): created from cgraph_process_same_body_aliases (bool output_variables (void)): created from varpool_node::output_variables (void output_asm_statements (void)): created from output_asm_statements (void finalize_compilation_unit (void)): created from finalize_compilation_unit (void compile (void)): created from compile (void output_weakrefs (void)): created from output_weakrefs (cgraph_node *create_empty (void)): created from cgraph_node::create_empty (cgraph_edge *create_edge (cgraph_node *caller, cgraph_node *callee, gimple call_stmt, gcov_type count, int freq, bool indir_unknown_callee)): created from cgraph_node::create_edge (void free_edge (cgraph_edge *e)): created from cgraph_free_edge (cgraph_node *next_function_with_gimple_body (cgraph_node *node)): created from cgraph_next_function_with_gimple_body (void remove_edge_removal_hook (cgraph_edge_hook_list *)): created from cgraph_remove_edge_removal_hook (cgraph_node_hook_list *add_cgraph_removal_hook (cgraph_node_hook, void *)): created from cgraph_add_node_removal_hook (void remove_cgraph_removal_hook (cgraph_node_hook_list *)): created from cgraph_remove_node_removal_hook (varpool_node_hook_list *add_varpool_removal_hook (varpool_node_hook, void *)): created from varpool_add_node_removal_hook (void remove_varpool_removal_hook (varpool_node_hook_list *)): created from varpool_remove_node_removal_hook (cgraph_node_hook_list *add_cgraph_insertion_hook (cgraph_node_hook, void *)): created from cgraph_add_function_insertion_hook (void remove_cgraph_insertion_hook (cgraph_node_hook_list *)): created from cgraph_remove_function_insertion_hook (varpool_node_hook_list *add_varpool_insertion_hook (varpool_node_hook, void *)): created from varpool_add_variable_insertion_hook (void remove_varpool_insertion_hook (varpool_node_hook_list *)): created from varpool_remove_variable_insertion_hook (cgraph_2edge_hook_list *add_edge_duplication_hook (cgraph_2edge_hook, void *)): created from cgraph_add_edge_duplication_hook (void remove_edge_duplication_hook (cgraph_2edge_hook_list *)): created from cgraph_remove_edge_duplication_hook (cgraph_2node_hook_list *add_cgraph_duplication_hook (cgraph_2node_hook, void *)): created from cgraph_add_node_duplication_hook (void remove_cgraph_duplication_hook (cgraph_2node_hook_list *)): created from cgraph_remove_node_duplication_hook (void call_edge_removal_hooks (cgraph_edge *e)): created from cgraph_call_edge_removal_hooks (void call_cgraph_insertion_hooks (cgraph_node *node)): created from call_function_insertion_hooks (void call_cgraph_removal_hooks (cgraph_node *node)): created from cgraph_call_node_removal_hooks (void call_cgraph_duplication_hooks (cgraph_node *node, cgraph_node *node2)): created from cgraph_node::call_duplication_hooks (void call_edge_duplication_hooks (cgraph_edge *cs1, cgraph_edge *cs2)): created from cgraph_call_edge_duplication_hooks (void call_varpool_removal_hooks (varpool_node *node)): created from varpool_call_node_removal_hooks (void call_varpool_insertion_hooks (varpool_node *node)): created from varpool_call_variable_insertion_hooks (void insert_to_assembler_name_hash (symtab_node *node, bool with_clones)): created from insert_to_assembler_name_hash (void unlink_from_assembler_name_hash (symtab_node *node, bool with_clones)): created from unlink_from_assembler_name_hash (void symtab_prevail_in_asm_name_hash (symtab_node *node)): created from symtab_prevail_in_asm_name_hash (void symtab_initialize_asm_name_hash (void)): created from symtab_initialize_asm_name_hash (void change_decl_assembler_name (tree decl, tree name)): created from change_decl_assembler_name (void materialize_all_clones (void)): created from cgraph_materialize_all_clones (static hashval_t decl_assembler_name_hash (const_tree asmname)): created from decl_assembler_name_hash (static bool decl_assembler_name_equal (tree decl, const_tree asmname)): created from decl_assembler_name_equal (static hashval_t hash_node_by_assembler_name (const void *p)): created from hash_node_by_assembler_name (static int eq_assembler_name (const void *p1, const void *p2)): created from eq_assembler_name From-SVN: r214422
2014-08-25 15:01:47 +02:00
e->resolve_speculation (NULL);
speculation_removed = true;
}
else if (!e->inline_failed)
speculation_removed |= check_speculations (e->callee);
}
return speculation_removed;
}
/* Mark all call graph edges coming out of NODE and all nodes that have been
inlined to it as in_polymorphic_cdtor. */
static void
mark_all_inlined_calls_cdtor (cgraph_node *node)
{
for (cgraph_edge *cs = node->callees; cs; cs = cs->next_callee)
{
cs->in_polymorphic_cdtor = true;
if (!cs->inline_failed)
mark_all_inlined_calls_cdtor (cs->callee);
}
for (cgraph_edge *cs = node->indirect_calls; cs; cs = cs->next_callee)
cs->in_polymorphic_cdtor = true;
}
/* Mark edge E as inlined and update callgraph accordingly. UPDATE_ORIGINAL
specify whether profile of original function should be updated. If any new
indirect edges are discovered in the process, add them to NEW_EDGES, unless
it is NULL. If UPDATE_OVERALL_SUMMARY is false, do not bother to recompute overall
size of caller after inlining. Caller is required to eventually do it via
inline_update_overall_summary.
If callee_removed is non-NULL, set it to true if we removed callee node.
Return true iff any new callgraph edges were discovered as a
result of inlining. */
bool
inline_call (struct cgraph_edge *e, bool update_original,
IPA C++ refactoring 1/N * cgraph.h (symtab_node): (void register_symbol (void)): created from symtab_register_node (void remove (void)): created from symtab_remove_node (void dump (FILE *f)): created from dump_symtab_node (void DEBUG_FUNCTION debug (void)): created from debug_symtab_node (void DEBUG_FUNCTION verify (void)): created from verify_symtab_node (struct ipa_ref *add_reference (symtab_node *referred_node, enum ipa_ref_use use_type)): created from add_reference (struct ipa_ref *add_reference (symtab_node *referred_node, enum ipa_ref_use use_type, gimple stmt)): created from add_reference (struct ipa_ref *maybe_add_reference (tree val, enum ipa_ref_use use_type, gimple stmt)): created from maybe_add_reference (bool semantically_equivalent_p (symtab_node *target)): created from symtab_semantically_equivalent_p (void remove_from_same_comdat_group (void)): created from remove_from_same_comdat_group (void add_to_same_comdat_group (symtab_node *old_node)): created from symtab_add_to_same_comdat_group (void dissolve_same_comdat_group_list (void)): created from symtab_dissolve_same_comdat_group_list (bool used_from_object_file_p (void)): created from symtab_used_from_object_file_p (symtab_node *ultimate_alias_target (enum availability *avail = NULL)): created from symtab_alias_ultimate_target (inline symtab_node *next_defined_symbol (void)): created from symtab_next_defined_symbol (bool resolve_alias (symtab_node *target)): created from symtab_resolve_alias (bool call_for_symbol_and_aliases (bool (*callback) (symtab_node *, void *), void *data, bool include_overwrite)): created from symtab_for_node_and_aliases (symtab_node *noninterposable_alias (void)): created from symtab_nonoverwritable_alias (inline symtab_node *get_alias_target (void)): created from symtab_alias_target (void set_section (const char *section)): created from set_section_1 (enum availability get_availability (void)): created from symtab_node_availability (void make_decl_local (void)): created from symtab_make_decl_local (bool real_symbol_p (void)): created from symtab_read_node (can_be_discarded_p (void)): created from symtab_can_be_discarded (inline bool comdat_local_p (void)): created from symtab_comdat_local_p (inline bool in_same_comdat_group_p (symtab_node *target)): created from symtab_in_same_comdat_p; (bool address_taken_from_non_vtable_p (void)): created from address_taken_from_non_vtable_p (static inline symtab_node *get (const_tree decl)): created from symtab_get_node (static void dump_table (FILE *)): created from dump_symtab (static inline DEBUG_FUNCTION void debug_symtab (void)): created from debug_symtab (static DEBUG_FUNCTION void verify_symtab_nodes (void)): created from verify_symtab (static bool used_from_object_file_p_worker (symtab_node *node)): created from symtab_used_from_object_file_p (void dump_base (FILE *)): created from dump_symtab_base (bool DEBUG_FUNCTION verify_base (void)): created from verify_symtab_base (void unregister (void)): created from symtab_unregister_node (struct symbol_priority_map *priority_info (void)): created from symtab_priority_info (static bool set_implicit_section (symtab_node *n, void *)): created from set_implicit_section (static bool noninterposable_alias (symtab_node *node, void *data)): created from symtab_nonoverwritable_alias_1 * cgraph.h (cgraph_node): (bool remove_symbol_and_inline_clones (cgraph_node *forbidden_node = NULL)): created from cgraph_remove_node_and_inline_clones (void record_stmt_references (gimple stmt)): created from ipa_record_stmt_references (void set_call_stmt_including_clones (gimple old_stmt, gimple new_stmt, bool update_speculative = true)): created from cgraph_set_call_stmt_including_clones (cgraph_node *function_symbol (enum availability *avail = NULL)): created from cgraph_function_node (cgraph_node *create_clone (tree decl, gcov_type count, int freq, bool update_original, vec<cgraph_edge *> redirect_callers, bool call_duplication_hook, struct cgraph_node *new_inlined_to, bitmap args_to_skip)): created from cgraph_create_clone (cgraph_node *create_virtual_clone (vec<cgraph_edge *> redirect_callers, vec<ipa_replace_map *, va_gc> *tree_map, bitmap args_to_skip, const char * suffix)): created from cgraph_create_virtual_clone (cgraph_node *find_replacement (void)): created from cgraph_find_replacement_node (cgraph_node *create_version_clone (tree new_decl, vec<cgraph_edge *> redirect_callers, bitmap bbs_to_copy)): created from cgraph_copy_node_for_versioning (cgraph_node *create_version_clone_with_body (vec<cgraph_edge *> redirect_callers, vec<ipa_replace_map *, va_gc> *tree_map, bitmap args_to_skip, bool skip_return, bitmap bbs_to_copy, basic_block new_entry_block, const char *clone_name)): created from cgraph_function_version_info (struct cgraph_function_version_info *insert_new_function_version (void)): created from insert_new_cgraph_node_version (struct cgraph_function_version_info *function_version (void)): created from get_cgraph_node_version (void analyze (void)): created from analyze_function (cgraph_node * create_thunk (tree alias, tree, bool this_adjusting, HOST_WIDE_INT fixed_offset, HOST_WIDE_INT virtual_value, tree virtual_offset, tree real_alias) cgraph_add_thunk (inline cgraph_node *get_alias_target (void)): created from cgraph_alias_target (cgraph_node *ultimate_alias_target (availability *availability = NULL)): created from cgraph_function_or_thunk_node (bool expand_thunk (bool output_asm_thunks, bool force_gimple_thunk)): created from expand_thunk (void reset (void)): created from cgraph_reset_node (void create_wrapper (cgraph_node *target)): created from cgraph_make_wrapper (void DEBUG_FUNCTION verify_node (void)): created from verify_cgraph_node (void remove (void)): created from cgraph_remove_node (void dump (FILE *f)): created from dump_cgraph_node (void DEBUG_FUNCTION debug (void)): created from debug_cgraph_node (bool get_body (void)): created from cgraph_get_body (void release_body (void)): created from cgraph_release_function_body (void unnest (void)): created from cgraph_unnest_node (void make_local (void)): created from cgraph_make_node_local (void mark_address_taken (void)): created from cgraph_mark_address_taken_node (struct cgraph_edge *create_edge (cgraph_node *callee, gimple call_stmt, gcov_type count, int freq)): created from cgraph_create_edge (struct cgraph_edge *create_indirect_edge (gimple call_stmt, int ecf_flags, gcov_type count, int freq)): created from cgraph_create_indirect_edge (void create_edge_including_clones (struct cgraph_node *callee, gimple old_stmt, gimple stmt, gcov_type count, int freq, cgraph_inline_failed_t reason)): created from cgraph_create_edge_including_clones (cgraph_edge *get_edge (gimple call_stmt)): created from cgraph_edge (vec<cgraph_edge *> collect_callers (void)): created from collect_callers_of_node (void remove_callers (void)): created from cgraph_node_remove_callers (void remove_callees (void)): created from cgraph_node_remove_callees (enum availability get_availability (void)): created from cgraph_function_body_availability (void set_nothrow_flag (bool nothrow)): created from cgraph_set_nothrow_flag (void set_const_flag (bool readonly, bool looping)): created from cgraph_set_const_flag (void set_pure_flag (bool pure, bool looping)): created from cgraph_set_pure_flag (void call_duplication_hooks (cgraph_node *node2)): created from cgraph_call_node_duplication_hooks (bool call_for_symbol_and_aliases (bool (*callback) (cgraph_node *, void *), void *data, bool include_overwritable)): created from cgraph_for_node_and_aliases (bool call_for_symbol_thunks_and_aliases (bool (*callback) (cgraph_node *node, void *data), void *data, bool include_overwritable)): created from cgraph_for_node_thunks_and_aliases (void call_function_insertion_hooks (void)): created from cgraph_call_function_insertion_hooks (inline void mark_force_output (void)): created from cgraph_mark_force_output_node (bool local_p (void)): created from cgraph_local_node (bool can_be_local_p (void)): created from cgraph_node_can_be_local_p (bool cannot_return_p (void)): created from cgraph_node_cannot_return (bool only_called_directly_p (void)): created from cgraph_only_called_directly_p (inline bool only_called_directly_or_aliased_p (void)): created from cgraph_only_called_directly_or_aliased_p (bool will_be_removed_from_program_if_no_direct_calls_p (void)): created from cgraph_will_be_removed_from_program_if_no_direct_calls (bool can_remove_if_no_direct_calls_and_refs_p (void)): created from cgraph_can_remove_if_no_direct_calls_and_refs_p (bool can_remove_if_no_direct_calls_p (void)): created from cgraph_can_remove_if_no_direct_calls_p (inline bool has_gimple_body_p (void)): created from cgraph_function_with_gimple_body_p (bool optimize_for_size_p (void)): created from cgraph_optimize_for_size_p (static void dump_cgraph (FILE *f)): created from dump_cgraph (static inline void debug_cgraph (void)): created from debug_cgraph (static void record_function_versions (tree decl1, tree decl2)): created from record_function_versions (static void delete_function_version (tree decl)): created from delete_function_version (static void add_new_function (tree fndecl, bool lowered)): created from cgraph_add_new_function (static inline cgraph_node *get (const_tree decl)): created from cgraph_get_node (static cgraph_node * create (tree decl)): created from cgraph_create_node (static cgraph_node * create_empty (void)): created from cgraph_create_empty_node (static cgraph_node * get_create (tree)): created from cgraph_get_create_node (static cgraph_node *get_for_asmname (tree asmname)): created from cgraph_node_for_asm (static cgraph_node * create_same_body_alias (tree alias, tree decl)): created from cgraph_same_body_alias (static bool used_from_object_file_p_worker (cgraph_node *node, void *): new function (static bool non_local_p (cgraph_node *node, void *)): created from cgraph_non_local_node_p_1 (static void DEBUG_FUNCTION verify_cgraph_nodes (void)): created from verify_cgraph (static bool make_local (cgraph_node *node, void *)): created from cgraph_make_node_local (static cgraph_node *create_alias (tree alias, tree target)): created from cgraph_create_function_alias (static cgraph_edge * create_edge (cgraph_node *caller, cgraph_node *callee, gimple call_stmt, gcov_type count, int freq, bool indir_unknown_callee)): created from cgraph_create_edge_1 * cgraph.h (varpool_node): (void remove (void)): created from varpool_remove_node (void dump (FILE *f)): created from dump_varpool_node From-SVN: r212982
2014-07-24 14:07:13 +02:00
vec<cgraph_edge *> *new_edges,
int *overall_size, bool update_overall_summary,
bool *callee_removed)
{
int old_size = 0, new_size = 0;
struct cgraph_node *to = NULL;
struct cgraph_edge *curr = e;
IPA C++ refactoring 1/N * cgraph.h (symtab_node): (void register_symbol (void)): created from symtab_register_node (void remove (void)): created from symtab_remove_node (void dump (FILE *f)): created from dump_symtab_node (void DEBUG_FUNCTION debug (void)): created from debug_symtab_node (void DEBUG_FUNCTION verify (void)): created from verify_symtab_node (struct ipa_ref *add_reference (symtab_node *referred_node, enum ipa_ref_use use_type)): created from add_reference (struct ipa_ref *add_reference (symtab_node *referred_node, enum ipa_ref_use use_type, gimple stmt)): created from add_reference (struct ipa_ref *maybe_add_reference (tree val, enum ipa_ref_use use_type, gimple stmt)): created from maybe_add_reference (bool semantically_equivalent_p (symtab_node *target)): created from symtab_semantically_equivalent_p (void remove_from_same_comdat_group (void)): created from remove_from_same_comdat_group (void add_to_same_comdat_group (symtab_node *old_node)): created from symtab_add_to_same_comdat_group (void dissolve_same_comdat_group_list (void)): created from symtab_dissolve_same_comdat_group_list (bool used_from_object_file_p (void)): created from symtab_used_from_object_file_p (symtab_node *ultimate_alias_target (enum availability *avail = NULL)): created from symtab_alias_ultimate_target (inline symtab_node *next_defined_symbol (void)): created from symtab_next_defined_symbol (bool resolve_alias (symtab_node *target)): created from symtab_resolve_alias (bool call_for_symbol_and_aliases (bool (*callback) (symtab_node *, void *), void *data, bool include_overwrite)): created from symtab_for_node_and_aliases (symtab_node *noninterposable_alias (void)): created from symtab_nonoverwritable_alias (inline symtab_node *get_alias_target (void)): created from symtab_alias_target (void set_section (const char *section)): created from set_section_1 (enum availability get_availability (void)): created from symtab_node_availability (void make_decl_local (void)): created from symtab_make_decl_local (bool real_symbol_p (void)): created from symtab_read_node (can_be_discarded_p (void)): created from symtab_can_be_discarded (inline bool comdat_local_p (void)): created from symtab_comdat_local_p (inline bool in_same_comdat_group_p (symtab_node *target)): created from symtab_in_same_comdat_p; (bool address_taken_from_non_vtable_p (void)): created from address_taken_from_non_vtable_p (static inline symtab_node *get (const_tree decl)): created from symtab_get_node (static void dump_table (FILE *)): created from dump_symtab (static inline DEBUG_FUNCTION void debug_symtab (void)): created from debug_symtab (static DEBUG_FUNCTION void verify_symtab_nodes (void)): created from verify_symtab (static bool used_from_object_file_p_worker (symtab_node *node)): created from symtab_used_from_object_file_p (void dump_base (FILE *)): created from dump_symtab_base (bool DEBUG_FUNCTION verify_base (void)): created from verify_symtab_base (void unregister (void)): created from symtab_unregister_node (struct symbol_priority_map *priority_info (void)): created from symtab_priority_info (static bool set_implicit_section (symtab_node *n, void *)): created from set_implicit_section (static bool noninterposable_alias (symtab_node *node, void *data)): created from symtab_nonoverwritable_alias_1 * cgraph.h (cgraph_node): (bool remove_symbol_and_inline_clones (cgraph_node *forbidden_node = NULL)): created from cgraph_remove_node_and_inline_clones (void record_stmt_references (gimple stmt)): created from ipa_record_stmt_references (void set_call_stmt_including_clones (gimple old_stmt, gimple new_stmt, bool update_speculative = true)): created from cgraph_set_call_stmt_including_clones (cgraph_node *function_symbol (enum availability *avail = NULL)): created from cgraph_function_node (cgraph_node *create_clone (tree decl, gcov_type count, int freq, bool update_original, vec<cgraph_edge *> redirect_callers, bool call_duplication_hook, struct cgraph_node *new_inlined_to, bitmap args_to_skip)): created from cgraph_create_clone (cgraph_node *create_virtual_clone (vec<cgraph_edge *> redirect_callers, vec<ipa_replace_map *, va_gc> *tree_map, bitmap args_to_skip, const char * suffix)): created from cgraph_create_virtual_clone (cgraph_node *find_replacement (void)): created from cgraph_find_replacement_node (cgraph_node *create_version_clone (tree new_decl, vec<cgraph_edge *> redirect_callers, bitmap bbs_to_copy)): created from cgraph_copy_node_for_versioning (cgraph_node *create_version_clone_with_body (vec<cgraph_edge *> redirect_callers, vec<ipa_replace_map *, va_gc> *tree_map, bitmap args_to_skip, bool skip_return, bitmap bbs_to_copy, basic_block new_entry_block, const char *clone_name)): created from cgraph_function_version_info (struct cgraph_function_version_info *insert_new_function_version (void)): created from insert_new_cgraph_node_version (struct cgraph_function_version_info *function_version (void)): created from get_cgraph_node_version (void analyze (void)): created from analyze_function (cgraph_node * create_thunk (tree alias, tree, bool this_adjusting, HOST_WIDE_INT fixed_offset, HOST_WIDE_INT virtual_value, tree virtual_offset, tree real_alias) cgraph_add_thunk (inline cgraph_node *get_alias_target (void)): created from cgraph_alias_target (cgraph_node *ultimate_alias_target (availability *availability = NULL)): created from cgraph_function_or_thunk_node (bool expand_thunk (bool output_asm_thunks, bool force_gimple_thunk)): created from expand_thunk (void reset (void)): created from cgraph_reset_node (void create_wrapper (cgraph_node *target)): created from cgraph_make_wrapper (void DEBUG_FUNCTION verify_node (void)): created from verify_cgraph_node (void remove (void)): created from cgraph_remove_node (void dump (FILE *f)): created from dump_cgraph_node (void DEBUG_FUNCTION debug (void)): created from debug_cgraph_node (bool get_body (void)): created from cgraph_get_body (void release_body (void)): created from cgraph_release_function_body (void unnest (void)): created from cgraph_unnest_node (void make_local (void)): created from cgraph_make_node_local (void mark_address_taken (void)): created from cgraph_mark_address_taken_node (struct cgraph_edge *create_edge (cgraph_node *callee, gimple call_stmt, gcov_type count, int freq)): created from cgraph_create_edge (struct cgraph_edge *create_indirect_edge (gimple call_stmt, int ecf_flags, gcov_type count, int freq)): created from cgraph_create_indirect_edge (void create_edge_including_clones (struct cgraph_node *callee, gimple old_stmt, gimple stmt, gcov_type count, int freq, cgraph_inline_failed_t reason)): created from cgraph_create_edge_including_clones (cgraph_edge *get_edge (gimple call_stmt)): created from cgraph_edge (vec<cgraph_edge *> collect_callers (void)): created from collect_callers_of_node (void remove_callers (void)): created from cgraph_node_remove_callers (void remove_callees (void)): created from cgraph_node_remove_callees (enum availability get_availability (void)): created from cgraph_function_body_availability (void set_nothrow_flag (bool nothrow)): created from cgraph_set_nothrow_flag (void set_const_flag (bool readonly, bool looping)): created from cgraph_set_const_flag (void set_pure_flag (bool pure, bool looping)): created from cgraph_set_pure_flag (void call_duplication_hooks (cgraph_node *node2)): created from cgraph_call_node_duplication_hooks (bool call_for_symbol_and_aliases (bool (*callback) (cgraph_node *, void *), void *data, bool include_overwritable)): created from cgraph_for_node_and_aliases (bool call_for_symbol_thunks_and_aliases (bool (*callback) (cgraph_node *node, void *data), void *data, bool include_overwritable)): created from cgraph_for_node_thunks_and_aliases (void call_function_insertion_hooks (void)): created from cgraph_call_function_insertion_hooks (inline void mark_force_output (void)): created from cgraph_mark_force_output_node (bool local_p (void)): created from cgraph_local_node (bool can_be_local_p (void)): created from cgraph_node_can_be_local_p (bool cannot_return_p (void)): created from cgraph_node_cannot_return (bool only_called_directly_p (void)): created from cgraph_only_called_directly_p (inline bool only_called_directly_or_aliased_p (void)): created from cgraph_only_called_directly_or_aliased_p (bool will_be_removed_from_program_if_no_direct_calls_p (void)): created from cgraph_will_be_removed_from_program_if_no_direct_calls (bool can_remove_if_no_direct_calls_and_refs_p (void)): created from cgraph_can_remove_if_no_direct_calls_and_refs_p (bool can_remove_if_no_direct_calls_p (void)): created from cgraph_can_remove_if_no_direct_calls_p (inline bool has_gimple_body_p (void)): created from cgraph_function_with_gimple_body_p (bool optimize_for_size_p (void)): created from cgraph_optimize_for_size_p (static void dump_cgraph (FILE *f)): created from dump_cgraph (static inline void debug_cgraph (void)): created from debug_cgraph (static void record_function_versions (tree decl1, tree decl2)): created from record_function_versions (static void delete_function_version (tree decl)): created from delete_function_version (static void add_new_function (tree fndecl, bool lowered)): created from cgraph_add_new_function (static inline cgraph_node *get (const_tree decl)): created from cgraph_get_node (static cgraph_node * create (tree decl)): created from cgraph_create_node (static cgraph_node * create_empty (void)): created from cgraph_create_empty_node (static cgraph_node * get_create (tree)): created from cgraph_get_create_node (static cgraph_node *get_for_asmname (tree asmname)): created from cgraph_node_for_asm (static cgraph_node * create_same_body_alias (tree alias, tree decl)): created from cgraph_same_body_alias (static bool used_from_object_file_p_worker (cgraph_node *node, void *): new function (static bool non_local_p (cgraph_node *node, void *)): created from cgraph_non_local_node_p_1 (static void DEBUG_FUNCTION verify_cgraph_nodes (void)): created from verify_cgraph (static bool make_local (cgraph_node *node, void *)): created from cgraph_make_node_local (static cgraph_node *create_alias (tree alias, tree target)): created from cgraph_create_function_alias (static cgraph_edge * create_edge (cgraph_node *caller, cgraph_node *callee, gimple call_stmt, gcov_type count, int freq, bool indir_unknown_callee)): created from cgraph_create_edge_1 * cgraph.h (varpool_node): (void remove (void)): created from varpool_remove_node (void dump (FILE *f)): created from dump_varpool_node From-SVN: r212982
2014-07-24 14:07:13 +02:00
struct cgraph_node *callee = e->callee->ultimate_alias_target ();
bool new_edges_found = false;
int estimated_growth = 0;
if (! update_overall_summary)
estimated_growth = estimate_edge_growth (e);
/* This is used only for assert bellow. */
#if 0
bool predicated = inline_edge_summary (e)->predicate != NULL;
#endif
/* Don't inline inlined edges. */
gcc_assert (e->inline_failed);
/* Don't even think of inlining inline clone. */
gcc_assert (!callee->global.inlined_to);
gengtype.c (open_base_files): Add ipa-inline.h include. * gengtype.c (open_base_files): Add ipa-inline.h include. * ipa-cp.c (ipcp_get_lattice, ipcp_lattice_from_jfunc): Move to ipa-prop.c update all uses. * ipa-prop.c: (ipa_get_lattice, ipa_lattice_from_jfunc): ... here. * ipa-inline-transform.c (inline_call): Use inline_merge_summary to merge summary of inlined function into former caller. * ipa-inline.c (max_benefit): Remove. (edge_badness): Compensate for removal of benefits. (update_caller_keys): Use reset_node_growth_cache/reset_edge_growth_cache. (update_callee_keys): Likewise. (update_all_callee_keys): Likewise. (inline_small_functions): Do not collect max_benefit; do not reset stimated_growth; call free_growth_caches and initialize_growth_caches. * ipa-inline.h (struct condition, type clause_t, struct predicate, struct size_time_entry): New structures. (INLINE_SIZE_SCALE, INLINE_TIME_SCALE, MAX_CLAUSES): New constants. (inline_summary): Remove size_inlining_benefit, time_inlining_benefit and estimated_growth. (edge_growth_cache_entry): New structure. (node_growth_cache, edge_growth_cache): New global vars. (estimate_growth): Turn into inline. (inline_merge_summary, do_estimate_edge_growth, do_estimate_edge_time, initialize_growth_caches, free_growth_caches): Declare. (estimate_edge_growth): Rewrite. (estimate_edge_time): Implement as inline cache lookup. (reset_node_growth_cache, reset_edge_growth_cache): New inline functions. (MAX_TIME): Reduce to allow multiplicatoin by INLINE_SIZE_SCALE. (NUM_CONDITIONS): New constant. (predicate_conditions): New enum. (IS_NOT_CONSTANT): New constant. (edge_removal_hook_holder): New var. (node_growth_cache, edge_growth_cache): New global vars. (true_predicate, single_cond_predicate, false_predicate, not_inlined_predicate, add_condition, add_clause, and_predicates, or_predicates, predicates_equal_p, evaulate_predicate, dump_condition, dump_clause, dump_predicate, account_size_time, evaulate_conditions_for_edge): New functions. (inline_summary_alloc): Move to heap. (inline_node_removal_hook): Clear condition and entry vectors. (inline_edge_removal_hook): New function. (initialize_growth_caches, free_growth_caches): New function. (dump_inline_summary): Update. (edge_execution_predicate): New function. (will_be_nonconstant_predicate): New function. (estimate_function_body_sizes): Compute BB and constantness predicates. (compute_inline_parameters): Do not clear estimated_growth. (estimate_edge_size_and_time): New function. (estimate_calls_size_and_time): New function. (estimate_callee_size_and_time): New function. (remap_predicate): New function. (inline_merge_summary): New function. (do_estimate_edge_time): New function based on... (estimate_edge_time): ... this one. (do_estimate_edge_growth): New function. (do_estimate_growth): New function based on.... (estimate_growth): ... this one. (inline_analyze_function): Analyze after deciding on jump functions. (inline_read_section): New function. (inline_read_summary): Use it. (inline_write_summary): Write all the new data. * ipa-prop.c (ipa_get_param_decl_index): Export. (ipa_lattice_from_jfunc): Move here from ipa-cp.c * ipa-prop.h (ipa_get_param_decl_index, ipa_lattice_from_jfunc): Declare. (ipa_get_lattice): Move hre from ipa-cp.c * Makefile.in (GTFILES): Add ipa-inline.h and ipa-inline-analysis.c * params.def (PARAM_EARLY_INLINING_INSNS): Set to 11. * cgraph.h (cgraph_clone_inlined_nodes, compute_inline_parameters, cgraph_edge_inlinable_p): Remove. * cgraphunit.c: Include ipainline.h (cgraph_process_new_functions): Update call of compute_inline_parameters. * gcc.dg/tree-ssa/pr38699.c: Fix testcase. From-SVN: r172873
2011-04-22 22:04:42 +02:00
to = e->caller;
if (to->global.inlined_to)
to = to->global.inlined_to;
if (to->thunk.thunk_p)
{
struct cgraph_node *target = to->callees->callee;
if (in_lto_p)
to->get_untransformed_body ();
to->expand_thunk (false, true);
/* When thunk is instrumented we may have multiple callees. */
for (e = to->callees; e && e->callee != target; e = e->next_callee)
;
gcc_assert (e);
}
e->inline_failed = CIF_OK;
DECL_POSSIBLY_INLINED (callee->decl) = true;
gengtype.c (open_base_files): Add ipa-inline.h include. * gengtype.c (open_base_files): Add ipa-inline.h include. * ipa-cp.c (ipcp_get_lattice, ipcp_lattice_from_jfunc): Move to ipa-prop.c update all uses. * ipa-prop.c: (ipa_get_lattice, ipa_lattice_from_jfunc): ... here. * ipa-inline-transform.c (inline_call): Use inline_merge_summary to merge summary of inlined function into former caller. * ipa-inline.c (max_benefit): Remove. (edge_badness): Compensate for removal of benefits. (update_caller_keys): Use reset_node_growth_cache/reset_edge_growth_cache. (update_callee_keys): Likewise. (update_all_callee_keys): Likewise. (inline_small_functions): Do not collect max_benefit; do not reset stimated_growth; call free_growth_caches and initialize_growth_caches. * ipa-inline.h (struct condition, type clause_t, struct predicate, struct size_time_entry): New structures. (INLINE_SIZE_SCALE, INLINE_TIME_SCALE, MAX_CLAUSES): New constants. (inline_summary): Remove size_inlining_benefit, time_inlining_benefit and estimated_growth. (edge_growth_cache_entry): New structure. (node_growth_cache, edge_growth_cache): New global vars. (estimate_growth): Turn into inline. (inline_merge_summary, do_estimate_edge_growth, do_estimate_edge_time, initialize_growth_caches, free_growth_caches): Declare. (estimate_edge_growth): Rewrite. (estimate_edge_time): Implement as inline cache lookup. (reset_node_growth_cache, reset_edge_growth_cache): New inline functions. (MAX_TIME): Reduce to allow multiplicatoin by INLINE_SIZE_SCALE. (NUM_CONDITIONS): New constant. (predicate_conditions): New enum. (IS_NOT_CONSTANT): New constant. (edge_removal_hook_holder): New var. (node_growth_cache, edge_growth_cache): New global vars. (true_predicate, single_cond_predicate, false_predicate, not_inlined_predicate, add_condition, add_clause, and_predicates, or_predicates, predicates_equal_p, evaulate_predicate, dump_condition, dump_clause, dump_predicate, account_size_time, evaulate_conditions_for_edge): New functions. (inline_summary_alloc): Move to heap. (inline_node_removal_hook): Clear condition and entry vectors. (inline_edge_removal_hook): New function. (initialize_growth_caches, free_growth_caches): New function. (dump_inline_summary): Update. (edge_execution_predicate): New function. (will_be_nonconstant_predicate): New function. (estimate_function_body_sizes): Compute BB and constantness predicates. (compute_inline_parameters): Do not clear estimated_growth. (estimate_edge_size_and_time): New function. (estimate_calls_size_and_time): New function. (estimate_callee_size_and_time): New function. (remap_predicate): New function. (inline_merge_summary): New function. (do_estimate_edge_time): New function based on... (estimate_edge_time): ... this one. (do_estimate_edge_growth): New function. (do_estimate_growth): New function based on.... (estimate_growth): ... this one. (inline_analyze_function): Analyze after deciding on jump functions. (inline_read_section): New function. (inline_read_summary): Use it. (inline_write_summary): Write all the new data. * ipa-prop.c (ipa_get_param_decl_index): Export. (ipa_lattice_from_jfunc): Move here from ipa-cp.c * ipa-prop.h (ipa_get_param_decl_index, ipa_lattice_from_jfunc): Declare. (ipa_get_lattice): Move hre from ipa-cp.c * Makefile.in (GTFILES): Add ipa-inline.h and ipa-inline-analysis.c * params.def (PARAM_EARLY_INLINING_INSNS): Set to 11. * cgraph.h (cgraph_clone_inlined_nodes, compute_inline_parameters, cgraph_edge_inlinable_p): Remove. * cgraphunit.c: Include ipainline.h (cgraph_process_new_functions): Update call of compute_inline_parameters. * gcc.dg/tree-ssa/pr38699.c: Fix testcase. From-SVN: r172873
2011-04-22 22:04:42 +02:00
if (DECL_FUNCTION_PERSONALITY (callee->decl))
DECL_FUNCTION_PERSONALITY (to->decl)
= DECL_FUNCTION_PERSONALITY (callee->decl);
bool reload_optimization_node = false;
if (!opt_for_fn (callee->decl, flag_strict_aliasing)
&& opt_for_fn (to->decl, flag_strict_aliasing))
{
struct gcc_options opts = global_options;
cl_optimization_restore (&opts, opts_for_fn (to->decl));
opts.x_flag_strict_aliasing = false;
if (dump_file)
fprintf (dump_file, "Dropping flag_strict_aliasing on %s:%i\n",
to->name (), to->order);
DECL_FUNCTION_SPECIFIC_OPTIMIZATION (to->decl)
= build_optimization_node (&opts);
reload_optimization_node = true;
}
inline_summary *caller_info = inline_summaries->get (to);
inline_summary *callee_info = inline_summaries->get (callee);
if (!caller_info->fp_expressions && callee_info->fp_expressions)
{
caller_info->fp_expressions = true;
if (opt_for_fn (callee->decl, flag_rounding_math)
!= opt_for_fn (to->decl, flag_rounding_math)
|| opt_for_fn (callee->decl, flag_trapping_math)
!= opt_for_fn (to->decl, flag_trapping_math)
|| opt_for_fn (callee->decl, flag_unsafe_math_optimizations)
!= opt_for_fn (to->decl, flag_unsafe_math_optimizations)
|| opt_for_fn (callee->decl, flag_finite_math_only)
!= opt_for_fn (to->decl, flag_finite_math_only)
|| opt_for_fn (callee->decl, flag_signaling_nans)
!= opt_for_fn (to->decl, flag_signaling_nans)
|| opt_for_fn (callee->decl, flag_cx_limited_range)
!= opt_for_fn (to->decl, flag_cx_limited_range)
|| opt_for_fn (callee->decl, flag_signed_zeros)
!= opt_for_fn (to->decl, flag_signed_zeros)
|| opt_for_fn (callee->decl, flag_associative_math)
!= opt_for_fn (to->decl, flag_associative_math)
|| opt_for_fn (callee->decl, flag_reciprocal_math)
!= opt_for_fn (to->decl, flag_reciprocal_math)
Add option for whether ceil etc. can raise "inexact", adjust x86 conditions. In ISO C99/C11, the ceil, floor, round and trunc functions may or may not raise the "inexact" exception for noninteger arguments. Under TS 18661-1:2014, the C bindings for IEEE 754-2008, these functions are prohibited from raising "inexact", in line with the general rule that "inexact" is only when the mathematical infinite precision result of a function differs from the result after rounding to the target type. GCC has no option to select TS 18661 requirements for not raising "inexact" when expanding built-in versions of these functions inline. Furthermore, even given such requirements, the conditions on the x86 insn patterns for these functions are unnecessarily restrictive. I'd like to make the out-of-line glibc versions follow the TS 18661 requirements; in the cases where this slows them down (the cases using x87 floating point), that makes it more important for inline versions to be used when the user does not care about "inexact". This patch fixes these issues. A new option -fno-fp-int-builtin-inexact is added to request TS 18661 rules for these functions; the default -ffp-int-builtin-inexact reflects that such exceptions are allowed by C99 and C11. (The intention is that if C2x incorporates TS 18661-1, then the default would change in C2x mode.) The x86 built-ins for rint (x87, SSE2 and SSE4.1) are made unconditionally available (no longer depending on -funsafe-math-optimizations or -fno-trapping-math); "inexact" is correct for noninteger arguments to rint. For floor, ceil and trunc, the x87 and SSE2 built-ins are OK if -ffp-int-builtin-inexact or -fno-trapping-math (they may raise "inexact" for noninteger arguments); the SSE4.1 built-ins are made to use ROUND_NO_EXC so that they do not raise "inexact" and so are OK unconditionally. Now, while there was no semantic reason for depending on -funsafe-math-optimizations, the insn patterns had such a dependence because of use of gen_truncxf<mode>2_i387_noop to truncate back to SFmode or DFmode after using frndint in XFmode. In this case a no-op truncation is safe because rounding to integer always produces an exactly representable value (the same reason why IEEE semantics say it shouldn't produce "inexact") - but of course that insn pattern isn't safe because it would also match cases where the truncation is not in fact a no-op. To allow frndint to be used for SFmode and DFmode without that unsafe pattern, the relevant frndint patterns are extended to SFmode and DFmode or new SFmode and DFmode patterns added, so that the frndint operation can be represented in RTL as an operation acting directly on SFmode or DFmode without the extension and the problematic truncation. A generic test of the new option is added, as well as x86-specific tests, both execution tests including the generic test with different x86 options and scan-assembler tests verifying that functions that should be inlined with different options are indeed inlined. I think other architectures are OK for TS 18661-1 semantics already. Considering those defining "ceil" patterns: aarch64, arm, rs6000, s390 use instructions that do not raise "inexact"; nvptx does not support floating-point exceptions. (This does mean the -f option in fact only affects one architecture, but I think it should still be a -f option; it's logically architecture-independent and is expected to be affected by future -std options, so is similar to e.g. -fexcess-precision=, which also does nothing on most architectures but is implied by -std options.) Bootstrapped with no regressions on x86_64-pc-linux-gnu. OK to commit? PR target/71276 PR target/71277 gcc: * common.opt (ffp-int-builtin-inexact): New option. * doc/invoke.texi (-fno-fp-int-builtin-inexact): Document. * doc/md.texi (floor@var{m}2, btrunc@var{m}2, round@var{m}2) (ceil@var{m}2): Document dependence on this option. * ipa-inline-transform.c (inline_call): Handle flag_fp_int_builtin_inexact. * ipa-inline.c (can_inline_edge_p): Likewise. * config/i386/i386.md (rintxf2): Do not test flag_unsafe_math_optimizations. (rint<mode>2_frndint): New define_insn. (rint<mode>2): Do not test flag_unsafe_math_optimizations for 387 or !flag_trapping_math for SSE. Just use gen_rint<mode>2_frndint for 387 instead of extending and truncating. (frndintxf2_<rounding>): Test flag_fp_int_builtin_inexact || !flag_trapping_math instead of flag_unsafe_math_optimizations. Change to frndint<mode>2_<rounding>. (frndintxf2_<rounding>_i387): Likewise. Change to frndint<mode>2_<rounding>_i387. (<rounding_insn>xf2): Likewise. (<rounding_insn><mode>2): Test flag_fp_int_builtin_inexact || !flag_trapping_math instead of flag_unsafe_math_optimizations for x87. Test TARGET_ROUND || !flag_trapping_math || flag_fp_int_builtin_inexact instead of !flag_trapping_math for SSE. Use ROUND_NO_EXC in constant operand of gen_sse4_1_round<mode>2. Just use gen_frndint<mode>2_<rounding> for 387 instead of extending and truncating. gcc/testsuite: * gcc.dg/torture/builtin-fp-int-inexact.c, gcc.target/i386/387-builtin-fp-int-inexact.c, gcc.target/i386/387-rint-inline-1.c, gcc.target/i386/387-rint-inline-2.c, gcc.target/i386/sse2-builtin-fp-int-inexact.c, gcc.target/i386/sse2-rint-inline-1.c, gcc.target/i386/sse2-rint-inline-2.c, gcc.target/i386/sse4_1-builtin-fp-int-inexact.c, gcc.target/i386/sse4_1-rint-inline.c: New tests. From-SVN: r237074
2016-06-03 17:49:04 +02:00
|| opt_for_fn (callee->decl, flag_fp_int_builtin_inexact)
!= opt_for_fn (to->decl, flag_fp_int_builtin_inexact)
|| opt_for_fn (callee->decl, flag_errno_math)
!= opt_for_fn (to->decl, flag_errno_math))
{
struct gcc_options opts = global_options;
cl_optimization_restore (&opts, opts_for_fn (to->decl));
opts.x_flag_rounding_math
= opt_for_fn (callee->decl, flag_rounding_math);
opts.x_flag_trapping_math
= opt_for_fn (callee->decl, flag_trapping_math);
opts.x_flag_unsafe_math_optimizations
= opt_for_fn (callee->decl, flag_unsafe_math_optimizations);
opts.x_flag_finite_math_only
= opt_for_fn (callee->decl, flag_finite_math_only);
opts.x_flag_signaling_nans
= opt_for_fn (callee->decl, flag_signaling_nans);
opts.x_flag_cx_limited_range
= opt_for_fn (callee->decl, flag_cx_limited_range);
opts.x_flag_signed_zeros
= opt_for_fn (callee->decl, flag_signed_zeros);
opts.x_flag_associative_math
= opt_for_fn (callee->decl, flag_associative_math);
opts.x_flag_reciprocal_math
= opt_for_fn (callee->decl, flag_reciprocal_math);
Add option for whether ceil etc. can raise "inexact", adjust x86 conditions. In ISO C99/C11, the ceil, floor, round and trunc functions may or may not raise the "inexact" exception for noninteger arguments. Under TS 18661-1:2014, the C bindings for IEEE 754-2008, these functions are prohibited from raising "inexact", in line with the general rule that "inexact" is only when the mathematical infinite precision result of a function differs from the result after rounding to the target type. GCC has no option to select TS 18661 requirements for not raising "inexact" when expanding built-in versions of these functions inline. Furthermore, even given such requirements, the conditions on the x86 insn patterns for these functions are unnecessarily restrictive. I'd like to make the out-of-line glibc versions follow the TS 18661 requirements; in the cases where this slows them down (the cases using x87 floating point), that makes it more important for inline versions to be used when the user does not care about "inexact". This patch fixes these issues. A new option -fno-fp-int-builtin-inexact is added to request TS 18661 rules for these functions; the default -ffp-int-builtin-inexact reflects that such exceptions are allowed by C99 and C11. (The intention is that if C2x incorporates TS 18661-1, then the default would change in C2x mode.) The x86 built-ins for rint (x87, SSE2 and SSE4.1) are made unconditionally available (no longer depending on -funsafe-math-optimizations or -fno-trapping-math); "inexact" is correct for noninteger arguments to rint. For floor, ceil and trunc, the x87 and SSE2 built-ins are OK if -ffp-int-builtin-inexact or -fno-trapping-math (they may raise "inexact" for noninteger arguments); the SSE4.1 built-ins are made to use ROUND_NO_EXC so that they do not raise "inexact" and so are OK unconditionally. Now, while there was no semantic reason for depending on -funsafe-math-optimizations, the insn patterns had such a dependence because of use of gen_truncxf<mode>2_i387_noop to truncate back to SFmode or DFmode after using frndint in XFmode. In this case a no-op truncation is safe because rounding to integer always produces an exactly representable value (the same reason why IEEE semantics say it shouldn't produce "inexact") - but of course that insn pattern isn't safe because it would also match cases where the truncation is not in fact a no-op. To allow frndint to be used for SFmode and DFmode without that unsafe pattern, the relevant frndint patterns are extended to SFmode and DFmode or new SFmode and DFmode patterns added, so that the frndint operation can be represented in RTL as an operation acting directly on SFmode or DFmode without the extension and the problematic truncation. A generic test of the new option is added, as well as x86-specific tests, both execution tests including the generic test with different x86 options and scan-assembler tests verifying that functions that should be inlined with different options are indeed inlined. I think other architectures are OK for TS 18661-1 semantics already. Considering those defining "ceil" patterns: aarch64, arm, rs6000, s390 use instructions that do not raise "inexact"; nvptx does not support floating-point exceptions. (This does mean the -f option in fact only affects one architecture, but I think it should still be a -f option; it's logically architecture-independent and is expected to be affected by future -std options, so is similar to e.g. -fexcess-precision=, which also does nothing on most architectures but is implied by -std options.) Bootstrapped with no regressions on x86_64-pc-linux-gnu. OK to commit? PR target/71276 PR target/71277 gcc: * common.opt (ffp-int-builtin-inexact): New option. * doc/invoke.texi (-fno-fp-int-builtin-inexact): Document. * doc/md.texi (floor@var{m}2, btrunc@var{m}2, round@var{m}2) (ceil@var{m}2): Document dependence on this option. * ipa-inline-transform.c (inline_call): Handle flag_fp_int_builtin_inexact. * ipa-inline.c (can_inline_edge_p): Likewise. * config/i386/i386.md (rintxf2): Do not test flag_unsafe_math_optimizations. (rint<mode>2_frndint): New define_insn. (rint<mode>2): Do not test flag_unsafe_math_optimizations for 387 or !flag_trapping_math for SSE. Just use gen_rint<mode>2_frndint for 387 instead of extending and truncating. (frndintxf2_<rounding>): Test flag_fp_int_builtin_inexact || !flag_trapping_math instead of flag_unsafe_math_optimizations. Change to frndint<mode>2_<rounding>. (frndintxf2_<rounding>_i387): Likewise. Change to frndint<mode>2_<rounding>_i387. (<rounding_insn>xf2): Likewise. (<rounding_insn><mode>2): Test flag_fp_int_builtin_inexact || !flag_trapping_math instead of flag_unsafe_math_optimizations for x87. Test TARGET_ROUND || !flag_trapping_math || flag_fp_int_builtin_inexact instead of !flag_trapping_math for SSE. Use ROUND_NO_EXC in constant operand of gen_sse4_1_round<mode>2. Just use gen_frndint<mode>2_<rounding> for 387 instead of extending and truncating. gcc/testsuite: * gcc.dg/torture/builtin-fp-int-inexact.c, gcc.target/i386/387-builtin-fp-int-inexact.c, gcc.target/i386/387-rint-inline-1.c, gcc.target/i386/387-rint-inline-2.c, gcc.target/i386/sse2-builtin-fp-int-inexact.c, gcc.target/i386/sse2-rint-inline-1.c, gcc.target/i386/sse2-rint-inline-2.c, gcc.target/i386/sse4_1-builtin-fp-int-inexact.c, gcc.target/i386/sse4_1-rint-inline.c: New tests. From-SVN: r237074
2016-06-03 17:49:04 +02:00
opts.x_flag_fp_int_builtin_inexact
= opt_for_fn (callee->decl, flag_fp_int_builtin_inexact);
opts.x_flag_errno_math
= opt_for_fn (callee->decl, flag_errno_math);
if (dump_file)
fprintf (dump_file, "Copying FP flags from %s:%i to %s:%i\n",
callee->name (), callee->order, to->name (), to->order);
DECL_FUNCTION_SPECIFIC_OPTIMIZATION (to->decl)
= build_optimization_node (&opts);
reload_optimization_node = true;
}
}
/* Reload global optimization flags. */
if (reload_optimization_node && DECL_STRUCT_FUNCTION (to->decl) == cfun)
set_cfun (cfun, true);
/* If aliases are involved, redirect edge to the actual destination and
possibly remove the aliases. */
if (e->callee != callee)
lto-symtab.c (lto_cgraph_replace_node): Kill same body alias code. * lto-symtab.c (lto_cgraph_replace_node): Kill same body alias code. (lto_symtab_resolve_can_prevail_p): Likewise. (lto_symtab_merge_cgraph_nodes): Update merging of aliases. * cgraph.c (same_body_aliases_done): New global var. (cgraph_same_body_alias_1): Rename to ... (cgraph_create_function_alias): ... this one; reorg to new representation. (cgraph_same_body_alias): Use cgraph_create_function_alias; record references when asked to. (cgraph_add_thunk): Fix formating. (cgraph_get_node): Kill same body alias code. (cgraph_node_for_asm): Likewise. (cgraph_remove_same_body_alias): Remove. (cgraph_remove_node): Kill same body alias code. (cgraph_mark_address_taken_node): Mark also the aliased function as having address taken. (dump_cgraph_node): Dump same body aliases. (cgraph_for_node_thunks_and_aliases): Update for new alias representation. (cgraph_for_node_and_aliases): Likewise. * cgraph.h (same_body): Kll pointer. (same_body_alias): Update comment. (same_body_aliases_done): Declare. (cgraph_remove_same_body_alias): Remove declaration. (cgraph_create_function_alias): Declare. (cgraph_process_same_body_aliases): Declare. (cgraph_function_with_gimple_body_p): Check for alias. (cgraph_can_remove_if_no_direct_calls_p): Look for aliases. (cgraph_alias_aliased_node): New function. (cgraph_function_node): Update for new aliases. (cgraph_function_or_thunk_node): Likewise. * ipa-inline-transform.c (can_remove_node_now_p): Look for aliases. (inline_call): Remove dead aliases. * cgraphunit.c (cgraph_decide_is_function_needed): Disable assembler name hack for same body aliases. (clone_of_p): Look through aliases. (verify_cgraph_node): Verify aliases. (cgraph_analyze_function): Analyze aliases; fixup C++ bugs. (cgraph_process_same_body_aliases): New function. (process_function_and_variable_attributes): Disable weakref warning on alias. (cgraph_analyze_functions): Handle aliases. (cgraph_mark_functions_to_output): Handle aliases same way as thunks. (assemble_thunks): Rename to ... (assemble_thunks_and_aliases): ... this one; handle aliases, too. (cgraph_expand_function): Remove alias output code. (cgraph_output_in_order): Skip aliases. (cgraph_preserve_function_body_p): Aliases don't need preserving. * ipa-ref.c (ipa_ref_use_name): Add alias reference. (ipa_record_reference): Do not assert on alias references. (ipa_ref_has_aliases_p): New function. * ipa-ref.h (enum ipa_ref_use): Add IPA_REF_ALIAS. (ipa_ref_has_aliases_p): Declare. * lto-cgraph.c (lto_output_node): Handle aliases. (input_node): Likewise. * lto-streamer-out.c (lto_output): Skip aliases. (produce_symtab): Kill same_body_alias code. * ipa-utils.c (ipa_reverse_postorder): Add FIXME. (ipa_reverse_postorder): Use cgraph_only_called_directly_or_aliased_p. * ipa-inline.c (update_caller_keys): Walk aliases. (inline_small_functions): Fix thinko in previous patch. * ipa.c (cgraph_externally_visible_p): Do not walk aliases. (function_and_variable_visibility): Do not walk same body aliases. * tree-ssa-structalias.c (associate_varinfo_to_alias): New function. (ipa_pta_execute): Use it. * lto.c (add_cgraph_node_to_partition_1): Break out from ... (add_cgraph_node_to_partition) ... here; walk aliases. (lto_1_to_1_map): Remove same body alias code. (promote_fn): Likewise. (lto_promote_cross_file_statics): Update comment. * decl2.c (cp_write_global_declarations): Process aliases; look trhough same body aliases. From-SVN: r174952
2011-06-11 15:01:53 +02:00
{
struct cgraph_node *alias = e->callee, *next_alias;
IPA C++ refactoring 4/N * cgraph.h (symtab_node): (bool needed_p (void)): created from decide_is_symbol_needed (bool referred_to_p (void)): created from referred_to_p (static cgraph_node *get_for_asmname (tree asmname)): created from symtab_node_for_asm * cgraph.h (cgraph_node): (void assemble_thunks_and_aliases (void)): created from assemble_thunks_and_aliases (void expand (void)): created from expand_function (static void finalize_function (tree, bool)): created from cgraph_finalize_function (static cgraph_local_info *local_info (tree decl)): created from cgraph_local_info (static cgraph_global_info *global_info (tree)): created from cgraph_global_info (static cgraph_rtl_info *rtl_info (tree)): created from cgraph_rtl_info * cgraph.h (varpool_node): (static void add (tree decl): created from varpool_add_new_variable * cgraph.h (cgraph_edge): void remove (void); (void remove_caller (void)): created from cgraph_edge_remove_caller (void remove_callee (void)): created from cgraph_edge_remove_callee (void set_call_stmt (gimple new_stmt, bool update_speculative = true)): created from cgraph_set_call_stmt (void redirect_callee (cgraph_node *n)): created from cgraph_redirect_edge_callee (cgraph_edge *make_direct (cgraph_node *callee)): created from cgraph_make_edge_direct (cgraph_edge *make_speculative (cgraph_node *n2, gcov_type direct_count, gimple redirect_call_stmt_to_callee (void)): created from cgraph_turn_edge_to_speculative (void speculative_call_info (cgraph_edge *&direct, cgraph_edge *&indirect, ipa_ref *&reference)): created from cgraph_speculative_call_info (cgraph_edge * clone (cgraph_node *n, gimple call_stmt, unsigned stmt_uid, gcov_type count_scale, int freq_scale, bool update_original)): created from cgraph_clone_edge (cgraph_edge *resolve_speculation (tree callee_decl)): created from cgraph_resolve_speculation (bool cannot_lead_to_return_p (void)): created from cannot_lead_to_return_p (bool recursive_p (void)): created from cgraph_edge_recursive_p (bool maybe_hot_p (void)): created from cgraph_maybe_hot_edge_p (static unsigned int rebuild_edges (void)): created from rebuild_cgraph_edges (static void rebuild_references (void)): created from cgraph_rebuild_references * cgraph.h (symbol_table): (create_reference): renamed from add_reference (maybe_create_reference): renamed from maybe_add_reference (void register_symbol (symtab_node *node)): new function (void clear_asm_symbols (void)): new function (void unregister (symtab_node *node)): new function (void release_symbol (cgraph_node *node, int uid)): new function (cgraph_node * allocate_cgraph_symbol (void)): new function (void initialize (void)): created from cgraph_init (symtab_node *first_symbol (void)):new function (asm_node *first_asm_symbol (void)):new function (symtab_node *first_defined_symbol (void)):new function (varpool_node *first_variable (void)):new function (varpool_node *next_variable (varpool_node *node)):new function (varpool_node *first_static_initializer (void)):new function (varpool_node *next_static_initializer (varpool_node *node)):new function (varpool_node *first_defined_variable (void)):new function (varpool_node *next_defined_variable (varpool_node *node)):new function (cgraph_node *first_defined_function (void)):new function (cgraph_node *next_defined_function (cgraph_node *node)):new function (cgraph_node *first_function (void)):new function (cgraph_node *next_function (cgraph_node *node)):new function (cgraph_node *first_function_with_gimple_body (void)):new function (asm_node *finalize_toplevel_asm (tree asm_str)): created from add_asm_node (bool remove_unreachable_nodes (bool before_inlining_p, FILE *file)): created from symtab_remove_unreachable_nodes (void remove_unreferenced_decls (void)): created from varpool_remove_unreferenced_decls (void process_new_functions (void)): created from cgraph_process_new_functions (void process_same_body_aliases (void)): created from cgraph_process_same_body_aliases (bool output_variables (void)): created from varpool_node::output_variables (void output_asm_statements (void)): created from output_asm_statements (void finalize_compilation_unit (void)): created from finalize_compilation_unit (void compile (void)): created from compile (void output_weakrefs (void)): created from output_weakrefs (cgraph_node *create_empty (void)): created from cgraph_node::create_empty (cgraph_edge *create_edge (cgraph_node *caller, cgraph_node *callee, gimple call_stmt, gcov_type count, int freq, bool indir_unknown_callee)): created from cgraph_node::create_edge (void free_edge (cgraph_edge *e)): created from cgraph_free_edge (cgraph_node *next_function_with_gimple_body (cgraph_node *node)): created from cgraph_next_function_with_gimple_body (void remove_edge_removal_hook (cgraph_edge_hook_list *)): created from cgraph_remove_edge_removal_hook (cgraph_node_hook_list *add_cgraph_removal_hook (cgraph_node_hook, void *)): created from cgraph_add_node_removal_hook (void remove_cgraph_removal_hook (cgraph_node_hook_list *)): created from cgraph_remove_node_removal_hook (varpool_node_hook_list *add_varpool_removal_hook (varpool_node_hook, void *)): created from varpool_add_node_removal_hook (void remove_varpool_removal_hook (varpool_node_hook_list *)): created from varpool_remove_node_removal_hook (cgraph_node_hook_list *add_cgraph_insertion_hook (cgraph_node_hook, void *)): created from cgraph_add_function_insertion_hook (void remove_cgraph_insertion_hook (cgraph_node_hook_list *)): created from cgraph_remove_function_insertion_hook (varpool_node_hook_list *add_varpool_insertion_hook (varpool_node_hook, void *)): created from varpool_add_variable_insertion_hook (void remove_varpool_insertion_hook (varpool_node_hook_list *)): created from varpool_remove_variable_insertion_hook (cgraph_2edge_hook_list *add_edge_duplication_hook (cgraph_2edge_hook, void *)): created from cgraph_add_edge_duplication_hook (void remove_edge_duplication_hook (cgraph_2edge_hook_list *)): created from cgraph_remove_edge_duplication_hook (cgraph_2node_hook_list *add_cgraph_duplication_hook (cgraph_2node_hook, void *)): created from cgraph_add_node_duplication_hook (void remove_cgraph_duplication_hook (cgraph_2node_hook_list *)): created from cgraph_remove_node_duplication_hook (void call_edge_removal_hooks (cgraph_edge *e)): created from cgraph_call_edge_removal_hooks (void call_cgraph_insertion_hooks (cgraph_node *node)): created from call_function_insertion_hooks (void call_cgraph_removal_hooks (cgraph_node *node)): created from cgraph_call_node_removal_hooks (void call_cgraph_duplication_hooks (cgraph_node *node, cgraph_node *node2)): created from cgraph_node::call_duplication_hooks (void call_edge_duplication_hooks (cgraph_edge *cs1, cgraph_edge *cs2)): created from cgraph_call_edge_duplication_hooks (void call_varpool_removal_hooks (varpool_node *node)): created from varpool_call_node_removal_hooks (void call_varpool_insertion_hooks (varpool_node *node)): created from varpool_call_variable_insertion_hooks (void insert_to_assembler_name_hash (symtab_node *node, bool with_clones)): created from insert_to_assembler_name_hash (void unlink_from_assembler_name_hash (symtab_node *node, bool with_clones)): created from unlink_from_assembler_name_hash (void symtab_prevail_in_asm_name_hash (symtab_node *node)): created from symtab_prevail_in_asm_name_hash (void symtab_initialize_asm_name_hash (void)): created from symtab_initialize_asm_name_hash (void change_decl_assembler_name (tree decl, tree name)): created from change_decl_assembler_name (void materialize_all_clones (void)): created from cgraph_materialize_all_clones (static hashval_t decl_assembler_name_hash (const_tree asmname)): created from decl_assembler_name_hash (static bool decl_assembler_name_equal (tree decl, const_tree asmname)): created from decl_assembler_name_equal (static hashval_t hash_node_by_assembler_name (const void *p)): created from hash_node_by_assembler_name (static int eq_assembler_name (const void *p1, const void *p2)): created from eq_assembler_name From-SVN: r214422
2014-08-25 15:01:47 +02:00
e->redirect_callee (callee);
lto-symtab.c (lto_cgraph_replace_node): Kill same body alias code. * lto-symtab.c (lto_cgraph_replace_node): Kill same body alias code. (lto_symtab_resolve_can_prevail_p): Likewise. (lto_symtab_merge_cgraph_nodes): Update merging of aliases. * cgraph.c (same_body_aliases_done): New global var. (cgraph_same_body_alias_1): Rename to ... (cgraph_create_function_alias): ... this one; reorg to new representation. (cgraph_same_body_alias): Use cgraph_create_function_alias; record references when asked to. (cgraph_add_thunk): Fix formating. (cgraph_get_node): Kill same body alias code. (cgraph_node_for_asm): Likewise. (cgraph_remove_same_body_alias): Remove. (cgraph_remove_node): Kill same body alias code. (cgraph_mark_address_taken_node): Mark also the aliased function as having address taken. (dump_cgraph_node): Dump same body aliases. (cgraph_for_node_thunks_and_aliases): Update for new alias representation. (cgraph_for_node_and_aliases): Likewise. * cgraph.h (same_body): Kll pointer. (same_body_alias): Update comment. (same_body_aliases_done): Declare. (cgraph_remove_same_body_alias): Remove declaration. (cgraph_create_function_alias): Declare. (cgraph_process_same_body_aliases): Declare. (cgraph_function_with_gimple_body_p): Check for alias. (cgraph_can_remove_if_no_direct_calls_p): Look for aliases. (cgraph_alias_aliased_node): New function. (cgraph_function_node): Update for new aliases. (cgraph_function_or_thunk_node): Likewise. * ipa-inline-transform.c (can_remove_node_now_p): Look for aliases. (inline_call): Remove dead aliases. * cgraphunit.c (cgraph_decide_is_function_needed): Disable assembler name hack for same body aliases. (clone_of_p): Look through aliases. (verify_cgraph_node): Verify aliases. (cgraph_analyze_function): Analyze aliases; fixup C++ bugs. (cgraph_process_same_body_aliases): New function. (process_function_and_variable_attributes): Disable weakref warning on alias. (cgraph_analyze_functions): Handle aliases. (cgraph_mark_functions_to_output): Handle aliases same way as thunks. (assemble_thunks): Rename to ... (assemble_thunks_and_aliases): ... this one; handle aliases, too. (cgraph_expand_function): Remove alias output code. (cgraph_output_in_order): Skip aliases. (cgraph_preserve_function_body_p): Aliases don't need preserving. * ipa-ref.c (ipa_ref_use_name): Add alias reference. (ipa_record_reference): Do not assert on alias references. (ipa_ref_has_aliases_p): New function. * ipa-ref.h (enum ipa_ref_use): Add IPA_REF_ALIAS. (ipa_ref_has_aliases_p): Declare. * lto-cgraph.c (lto_output_node): Handle aliases. (input_node): Likewise. * lto-streamer-out.c (lto_output): Skip aliases. (produce_symtab): Kill same_body_alias code. * ipa-utils.c (ipa_reverse_postorder): Add FIXME. (ipa_reverse_postorder): Use cgraph_only_called_directly_or_aliased_p. * ipa-inline.c (update_caller_keys): Walk aliases. (inline_small_functions): Fix thinko in previous patch. * ipa.c (cgraph_externally_visible_p): Do not walk aliases. (function_and_variable_visibility): Do not walk same body aliases. * tree-ssa-structalias.c (associate_varinfo_to_alias): New function. (ipa_pta_execute): Use it. * lto.c (add_cgraph_node_to_partition_1): Break out from ... (add_cgraph_node_to_partition) ... here; walk aliases. (lto_1_to_1_map): Remove same body alias code. (promote_fn): Likewise. (lto_promote_cross_file_statics): Update comment. * decl2.c (cp_write_global_declarations): Process aliases; look trhough same body aliases. From-SVN: r174952
2011-06-11 15:01:53 +02:00
while (alias && alias != callee)
{
if (!alias->callers
&& can_remove_node_now_p (alias,
!e->next_caller && !e->prev_caller ? e : NULL))
lto-symtab.c (lto_cgraph_replace_node): Kill same body alias code. * lto-symtab.c (lto_cgraph_replace_node): Kill same body alias code. (lto_symtab_resolve_can_prevail_p): Likewise. (lto_symtab_merge_cgraph_nodes): Update merging of aliases. * cgraph.c (same_body_aliases_done): New global var. (cgraph_same_body_alias_1): Rename to ... (cgraph_create_function_alias): ... this one; reorg to new representation. (cgraph_same_body_alias): Use cgraph_create_function_alias; record references when asked to. (cgraph_add_thunk): Fix formating. (cgraph_get_node): Kill same body alias code. (cgraph_node_for_asm): Likewise. (cgraph_remove_same_body_alias): Remove. (cgraph_remove_node): Kill same body alias code. (cgraph_mark_address_taken_node): Mark also the aliased function as having address taken. (dump_cgraph_node): Dump same body aliases. (cgraph_for_node_thunks_and_aliases): Update for new alias representation. (cgraph_for_node_and_aliases): Likewise. * cgraph.h (same_body): Kll pointer. (same_body_alias): Update comment. (same_body_aliases_done): Declare. (cgraph_remove_same_body_alias): Remove declaration. (cgraph_create_function_alias): Declare. (cgraph_process_same_body_aliases): Declare. (cgraph_function_with_gimple_body_p): Check for alias. (cgraph_can_remove_if_no_direct_calls_p): Look for aliases. (cgraph_alias_aliased_node): New function. (cgraph_function_node): Update for new aliases. (cgraph_function_or_thunk_node): Likewise. * ipa-inline-transform.c (can_remove_node_now_p): Look for aliases. (inline_call): Remove dead aliases. * cgraphunit.c (cgraph_decide_is_function_needed): Disable assembler name hack for same body aliases. (clone_of_p): Look through aliases. (verify_cgraph_node): Verify aliases. (cgraph_analyze_function): Analyze aliases; fixup C++ bugs. (cgraph_process_same_body_aliases): New function. (process_function_and_variable_attributes): Disable weakref warning on alias. (cgraph_analyze_functions): Handle aliases. (cgraph_mark_functions_to_output): Handle aliases same way as thunks. (assemble_thunks): Rename to ... (assemble_thunks_and_aliases): ... this one; handle aliases, too. (cgraph_expand_function): Remove alias output code. (cgraph_output_in_order): Skip aliases. (cgraph_preserve_function_body_p): Aliases don't need preserving. * ipa-ref.c (ipa_ref_use_name): Add alias reference. (ipa_record_reference): Do not assert on alias references. (ipa_ref_has_aliases_p): New function. * ipa-ref.h (enum ipa_ref_use): Add IPA_REF_ALIAS. (ipa_ref_has_aliases_p): Declare. * lto-cgraph.c (lto_output_node): Handle aliases. (input_node): Likewise. * lto-streamer-out.c (lto_output): Skip aliases. (produce_symtab): Kill same_body_alias code. * ipa-utils.c (ipa_reverse_postorder): Add FIXME. (ipa_reverse_postorder): Use cgraph_only_called_directly_or_aliased_p. * ipa-inline.c (update_caller_keys): Walk aliases. (inline_small_functions): Fix thinko in previous patch. * ipa.c (cgraph_externally_visible_p): Do not walk aliases. (function_and_variable_visibility): Do not walk same body aliases. * tree-ssa-structalias.c (associate_varinfo_to_alias): New function. (ipa_pta_execute): Use it. * lto.c (add_cgraph_node_to_partition_1): Break out from ... (add_cgraph_node_to_partition) ... here; walk aliases. (lto_1_to_1_map): Remove same body alias code. (promote_fn): Likewise. (lto_promote_cross_file_statics): Update comment. * decl2.c (cp_write_global_declarations): Process aliases; look trhough same body aliases. From-SVN: r174952
2011-06-11 15:01:53 +02:00
{
IPA C++ refactoring 1/N * cgraph.h (symtab_node): (void register_symbol (void)): created from symtab_register_node (void remove (void)): created from symtab_remove_node (void dump (FILE *f)): created from dump_symtab_node (void DEBUG_FUNCTION debug (void)): created from debug_symtab_node (void DEBUG_FUNCTION verify (void)): created from verify_symtab_node (struct ipa_ref *add_reference (symtab_node *referred_node, enum ipa_ref_use use_type)): created from add_reference (struct ipa_ref *add_reference (symtab_node *referred_node, enum ipa_ref_use use_type, gimple stmt)): created from add_reference (struct ipa_ref *maybe_add_reference (tree val, enum ipa_ref_use use_type, gimple stmt)): created from maybe_add_reference (bool semantically_equivalent_p (symtab_node *target)): created from symtab_semantically_equivalent_p (void remove_from_same_comdat_group (void)): created from remove_from_same_comdat_group (void add_to_same_comdat_group (symtab_node *old_node)): created from symtab_add_to_same_comdat_group (void dissolve_same_comdat_group_list (void)): created from symtab_dissolve_same_comdat_group_list (bool used_from_object_file_p (void)): created from symtab_used_from_object_file_p (symtab_node *ultimate_alias_target (enum availability *avail = NULL)): created from symtab_alias_ultimate_target (inline symtab_node *next_defined_symbol (void)): created from symtab_next_defined_symbol (bool resolve_alias (symtab_node *target)): created from symtab_resolve_alias (bool call_for_symbol_and_aliases (bool (*callback) (symtab_node *, void *), void *data, bool include_overwrite)): created from symtab_for_node_and_aliases (symtab_node *noninterposable_alias (void)): created from symtab_nonoverwritable_alias (inline symtab_node *get_alias_target (void)): created from symtab_alias_target (void set_section (const char *section)): created from set_section_1 (enum availability get_availability (void)): created from symtab_node_availability (void make_decl_local (void)): created from symtab_make_decl_local (bool real_symbol_p (void)): created from symtab_read_node (can_be_discarded_p (void)): created from symtab_can_be_discarded (inline bool comdat_local_p (void)): created from symtab_comdat_local_p (inline bool in_same_comdat_group_p (symtab_node *target)): created from symtab_in_same_comdat_p; (bool address_taken_from_non_vtable_p (void)): created from address_taken_from_non_vtable_p (static inline symtab_node *get (const_tree decl)): created from symtab_get_node (static void dump_table (FILE *)): created from dump_symtab (static inline DEBUG_FUNCTION void debug_symtab (void)): created from debug_symtab (static DEBUG_FUNCTION void verify_symtab_nodes (void)): created from verify_symtab (static bool used_from_object_file_p_worker (symtab_node *node)): created from symtab_used_from_object_file_p (void dump_base (FILE *)): created from dump_symtab_base (bool DEBUG_FUNCTION verify_base (void)): created from verify_symtab_base (void unregister (void)): created from symtab_unregister_node (struct symbol_priority_map *priority_info (void)): created from symtab_priority_info (static bool set_implicit_section (symtab_node *n, void *)): created from set_implicit_section (static bool noninterposable_alias (symtab_node *node, void *data)): created from symtab_nonoverwritable_alias_1 * cgraph.h (cgraph_node): (bool remove_symbol_and_inline_clones (cgraph_node *forbidden_node = NULL)): created from cgraph_remove_node_and_inline_clones (void record_stmt_references (gimple stmt)): created from ipa_record_stmt_references (void set_call_stmt_including_clones (gimple old_stmt, gimple new_stmt, bool update_speculative = true)): created from cgraph_set_call_stmt_including_clones (cgraph_node *function_symbol (enum availability *avail = NULL)): created from cgraph_function_node (cgraph_node *create_clone (tree decl, gcov_type count, int freq, bool update_original, vec<cgraph_edge *> redirect_callers, bool call_duplication_hook, struct cgraph_node *new_inlined_to, bitmap args_to_skip)): created from cgraph_create_clone (cgraph_node *create_virtual_clone (vec<cgraph_edge *> redirect_callers, vec<ipa_replace_map *, va_gc> *tree_map, bitmap args_to_skip, const char * suffix)): created from cgraph_create_virtual_clone (cgraph_node *find_replacement (void)): created from cgraph_find_replacement_node (cgraph_node *create_version_clone (tree new_decl, vec<cgraph_edge *> redirect_callers, bitmap bbs_to_copy)): created from cgraph_copy_node_for_versioning (cgraph_node *create_version_clone_with_body (vec<cgraph_edge *> redirect_callers, vec<ipa_replace_map *, va_gc> *tree_map, bitmap args_to_skip, bool skip_return, bitmap bbs_to_copy, basic_block new_entry_block, const char *clone_name)): created from cgraph_function_version_info (struct cgraph_function_version_info *insert_new_function_version (void)): created from insert_new_cgraph_node_version (struct cgraph_function_version_info *function_version (void)): created from get_cgraph_node_version (void analyze (void)): created from analyze_function (cgraph_node * create_thunk (tree alias, tree, bool this_adjusting, HOST_WIDE_INT fixed_offset, HOST_WIDE_INT virtual_value, tree virtual_offset, tree real_alias) cgraph_add_thunk (inline cgraph_node *get_alias_target (void)): created from cgraph_alias_target (cgraph_node *ultimate_alias_target (availability *availability = NULL)): created from cgraph_function_or_thunk_node (bool expand_thunk (bool output_asm_thunks, bool force_gimple_thunk)): created from expand_thunk (void reset (void)): created from cgraph_reset_node (void create_wrapper (cgraph_node *target)): created from cgraph_make_wrapper (void DEBUG_FUNCTION verify_node (void)): created from verify_cgraph_node (void remove (void)): created from cgraph_remove_node (void dump (FILE *f)): created from dump_cgraph_node (void DEBUG_FUNCTION debug (void)): created from debug_cgraph_node (bool get_body (void)): created from cgraph_get_body (void release_body (void)): created from cgraph_release_function_body (void unnest (void)): created from cgraph_unnest_node (void make_local (void)): created from cgraph_make_node_local (void mark_address_taken (void)): created from cgraph_mark_address_taken_node (struct cgraph_edge *create_edge (cgraph_node *callee, gimple call_stmt, gcov_type count, int freq)): created from cgraph_create_edge (struct cgraph_edge *create_indirect_edge (gimple call_stmt, int ecf_flags, gcov_type count, int freq)): created from cgraph_create_indirect_edge (void create_edge_including_clones (struct cgraph_node *callee, gimple old_stmt, gimple stmt, gcov_type count, int freq, cgraph_inline_failed_t reason)): created from cgraph_create_edge_including_clones (cgraph_edge *get_edge (gimple call_stmt)): created from cgraph_edge (vec<cgraph_edge *> collect_callers (void)): created from collect_callers_of_node (void remove_callers (void)): created from cgraph_node_remove_callers (void remove_callees (void)): created from cgraph_node_remove_callees (enum availability get_availability (void)): created from cgraph_function_body_availability (void set_nothrow_flag (bool nothrow)): created from cgraph_set_nothrow_flag (void set_const_flag (bool readonly, bool looping)): created from cgraph_set_const_flag (void set_pure_flag (bool pure, bool looping)): created from cgraph_set_pure_flag (void call_duplication_hooks (cgraph_node *node2)): created from cgraph_call_node_duplication_hooks (bool call_for_symbol_and_aliases (bool (*callback) (cgraph_node *, void *), void *data, bool include_overwritable)): created from cgraph_for_node_and_aliases (bool call_for_symbol_thunks_and_aliases (bool (*callback) (cgraph_node *node, void *data), void *data, bool include_overwritable)): created from cgraph_for_node_thunks_and_aliases (void call_function_insertion_hooks (void)): created from cgraph_call_function_insertion_hooks (inline void mark_force_output (void)): created from cgraph_mark_force_output_node (bool local_p (void)): created from cgraph_local_node (bool can_be_local_p (void)): created from cgraph_node_can_be_local_p (bool cannot_return_p (void)): created from cgraph_node_cannot_return (bool only_called_directly_p (void)): created from cgraph_only_called_directly_p (inline bool only_called_directly_or_aliased_p (void)): created from cgraph_only_called_directly_or_aliased_p (bool will_be_removed_from_program_if_no_direct_calls_p (void)): created from cgraph_will_be_removed_from_program_if_no_direct_calls (bool can_remove_if_no_direct_calls_and_refs_p (void)): created from cgraph_can_remove_if_no_direct_calls_and_refs_p (bool can_remove_if_no_direct_calls_p (void)): created from cgraph_can_remove_if_no_direct_calls_p (inline bool has_gimple_body_p (void)): created from cgraph_function_with_gimple_body_p (bool optimize_for_size_p (void)): created from cgraph_optimize_for_size_p (static void dump_cgraph (FILE *f)): created from dump_cgraph (static inline void debug_cgraph (void)): created from debug_cgraph (static void record_function_versions (tree decl1, tree decl2)): created from record_function_versions (static void delete_function_version (tree decl)): created from delete_function_version (static void add_new_function (tree fndecl, bool lowered)): created from cgraph_add_new_function (static inline cgraph_node *get (const_tree decl)): created from cgraph_get_node (static cgraph_node * create (tree decl)): created from cgraph_create_node (static cgraph_node * create_empty (void)): created from cgraph_create_empty_node (static cgraph_node * get_create (tree)): created from cgraph_get_create_node (static cgraph_node *get_for_asmname (tree asmname)): created from cgraph_node_for_asm (static cgraph_node * create_same_body_alias (tree alias, tree decl)): created from cgraph_same_body_alias (static bool used_from_object_file_p_worker (cgraph_node *node, void *): new function (static bool non_local_p (cgraph_node *node, void *)): created from cgraph_non_local_node_p_1 (static void DEBUG_FUNCTION verify_cgraph_nodes (void)): created from verify_cgraph (static bool make_local (cgraph_node *node, void *)): created from cgraph_make_node_local (static cgraph_node *create_alias (tree alias, tree target)): created from cgraph_create_function_alias (static cgraph_edge * create_edge (cgraph_node *caller, cgraph_node *callee, gimple call_stmt, gcov_type count, int freq, bool indir_unknown_callee)): created from cgraph_create_edge_1 * cgraph.h (varpool_node): (void remove (void)): created from varpool_remove_node (void dump (FILE *f)): created from dump_varpool_node From-SVN: r212982
2014-07-24 14:07:13 +02:00
next_alias = alias->get_alias_target ();
alias->remove ();
if (callee_removed)
*callee_removed = true;
lto-symtab.c (lto_cgraph_replace_node): Kill same body alias code. * lto-symtab.c (lto_cgraph_replace_node): Kill same body alias code. (lto_symtab_resolve_can_prevail_p): Likewise. (lto_symtab_merge_cgraph_nodes): Update merging of aliases. * cgraph.c (same_body_aliases_done): New global var. (cgraph_same_body_alias_1): Rename to ... (cgraph_create_function_alias): ... this one; reorg to new representation. (cgraph_same_body_alias): Use cgraph_create_function_alias; record references when asked to. (cgraph_add_thunk): Fix formating. (cgraph_get_node): Kill same body alias code. (cgraph_node_for_asm): Likewise. (cgraph_remove_same_body_alias): Remove. (cgraph_remove_node): Kill same body alias code. (cgraph_mark_address_taken_node): Mark also the aliased function as having address taken. (dump_cgraph_node): Dump same body aliases. (cgraph_for_node_thunks_and_aliases): Update for new alias representation. (cgraph_for_node_and_aliases): Likewise. * cgraph.h (same_body): Kll pointer. (same_body_alias): Update comment. (same_body_aliases_done): Declare. (cgraph_remove_same_body_alias): Remove declaration. (cgraph_create_function_alias): Declare. (cgraph_process_same_body_aliases): Declare. (cgraph_function_with_gimple_body_p): Check for alias. (cgraph_can_remove_if_no_direct_calls_p): Look for aliases. (cgraph_alias_aliased_node): New function. (cgraph_function_node): Update for new aliases. (cgraph_function_or_thunk_node): Likewise. * ipa-inline-transform.c (can_remove_node_now_p): Look for aliases. (inline_call): Remove dead aliases. * cgraphunit.c (cgraph_decide_is_function_needed): Disable assembler name hack for same body aliases. (clone_of_p): Look through aliases. (verify_cgraph_node): Verify aliases. (cgraph_analyze_function): Analyze aliases; fixup C++ bugs. (cgraph_process_same_body_aliases): New function. (process_function_and_variable_attributes): Disable weakref warning on alias. (cgraph_analyze_functions): Handle aliases. (cgraph_mark_functions_to_output): Handle aliases same way as thunks. (assemble_thunks): Rename to ... (assemble_thunks_and_aliases): ... this one; handle aliases, too. (cgraph_expand_function): Remove alias output code. (cgraph_output_in_order): Skip aliases. (cgraph_preserve_function_body_p): Aliases don't need preserving. * ipa-ref.c (ipa_ref_use_name): Add alias reference. (ipa_record_reference): Do not assert on alias references. (ipa_ref_has_aliases_p): New function. * ipa-ref.h (enum ipa_ref_use): Add IPA_REF_ALIAS. (ipa_ref_has_aliases_p): Declare. * lto-cgraph.c (lto_output_node): Handle aliases. (input_node): Likewise. * lto-streamer-out.c (lto_output): Skip aliases. (produce_symtab): Kill same_body_alias code. * ipa-utils.c (ipa_reverse_postorder): Add FIXME. (ipa_reverse_postorder): Use cgraph_only_called_directly_or_aliased_p. * ipa-inline.c (update_caller_keys): Walk aliases. (inline_small_functions): Fix thinko in previous patch. * ipa.c (cgraph_externally_visible_p): Do not walk aliases. (function_and_variable_visibility): Do not walk same body aliases. * tree-ssa-structalias.c (associate_varinfo_to_alias): New function. (ipa_pta_execute): Use it. * lto.c (add_cgraph_node_to_partition_1): Break out from ... (add_cgraph_node_to_partition) ... here; walk aliases. (lto_1_to_1_map): Remove same body alias code. (promote_fn): Likewise. (lto_promote_cross_file_statics): Update comment. * decl2.c (cp_write_global_declarations): Process aliases; look trhough same body aliases. From-SVN: r174952
2011-06-11 15:01:53 +02:00
alias = next_alias;
}
else
break;
}
}
clone_inlined_nodes (e, true, update_original, overall_size, e->frequency);
gcc_assert (curr->callee->global.inlined_to == to);
cgraphbuild.c (build_cgraph_edges): Update call of cgraph_create_edge and cgraph_create_indirect_edge. * cgraphbuild.c (build_cgraph_edges): Update call of cgraph_create_edge and cgraph_create_indirect_edge. * cgraph.c (cgraph_create_edge_including_clones, cgraph_create_edge_1, cgraph_allocate_init_indirect_info, cgraph_update_edges_for_call_stmt_node): Do not take nest argument; do not initialize call_stmt_size/time. (dump_cgraph_node): Do not dump nest. (cgraph_clone_edge): Do not take loop_nest argument; do not propagate it; do not clone call_stmt_size/time. (cgraph_clone_node): Likewise. (cgraph_create_virtual_clone): Update. * cgraph.h (struct cgraph_edge): Remove call_stmt_size/call_stmt_time/loop_nest. (cgraph_create_edge, cgraph_create_indirect_edge, cgraph_create_edge_including_clones, cgraph_clone_node): Update prototype. * tree-emutls.c (gen_emutls_addr): Update. * ipa-inline-transform.c (update_noncloned_frequencies): Do not handle loop_nest; handle indirect calls, too. (clone_inlined_nodes): Do not care about updating inline summaries. * cgraphunit.c (cgraph_copy_node_for_versioning): Update. * lto-cgraph.c (lto_output_edge, input_node, input_edge): Do not stream call_stmt_size/call_stmt_time/loop_nest. * ipa-inline.c (edge_badness): Update. (ipa_inline): dump summaries after inlining. * ipa-inline.h (struct inline_edge_summary, inline_edge_summary_t): new. (inline_edge_summary): New function. * ipa-inline-analysis.c (edge_duplication_hook_holder): New holder. (inline_edge_removal_hook): Handle edge summaries. (inline_edge_duplication_hook): New hook. (inline_summary_alloc): Alloc hooks. (initialize_growth_caches): Do not register removal hooks. (free_growth_caches); Do not free removal hook. (dump_inline_edge_summary): New function. (dump_inline_summary): Use it. (estimate_function_body_sizes, estimate_edge_size_and_time): Update. (inline_update_callee_summaries): New function. (inline_merge_summary): Use it. (do_estimate_edge_time, do_estimate_edge_growth): Update. (read_inline_edge_summary): New function. (inline_read_section): Use it. (write_inline_edge_summary): New function. (inline_write_summary): Use it. (inline_free_summary): Free edge new holders. * tree-inline.c (copy_bb): Update. From-SVN: r172989
2011-04-27 00:05:50 +02:00
symbol_summary is used for inline_summary. * lto-partition.c (add_symbol_to_partition_1): New inline_summaries is used. (undo_partition): Likewise. (lto_balanced_map): Likewise. * cgraphunit.c (symbol_table::process_new_functions): New inline_summaries is used. * ipa-cp.c (ipcp_cloning_candidate_p): Likewise. (devirtualization_time_bonus): Likewise. (estimate_local_effects): Likewise. (ipcp_propagate_stage): Likewise. * ipa-inline-analysis.c (evaluate_conditions_for_known_args): Likewise. (evaluate_properties_for_edge): Likewise. (inline_summary_alloc): Likewise. (reset_inline_summary): New inline_summary argument is introduced. (inline_summary_t::remove): New function. (inline_summary_t::duplicate): Likewise. (dump_inline_edge_summary): New inline_summaries is used. (dump_inline_summary): Likewise. (estimate_function_body_sizes): Likewise. (compute_inline_parameters): Likewise. (estimate_edge_devirt_benefit): Likewise. (estimate_node_size_and_time): Likewise. (inline_update_callee_summaries): Likewise. (inline_merge_summary): Likewise. (inline_update_overall_summary): Likewise. (simple_edge_hints): Likewise. (do_estimate_edge_time): Likewise. (estimate_time_after_inlining): Likewise. (estimate_size_after_inlining): Likewise. (do_estimate_growth): Likewise. (growth_likely_positive): Likewise. (inline_generate_summary): Likewise. (inline_read_section): Likewise. (inline_read_summary): Likewise. (inline_write_summary): Likewise. (inline_free_summary): Likewise. * ipa-inline-transform.c (clone_inlined_nodes): Likewise. (inline_call): Likewise. * ipa-inline.c (caller_growth_limits): Likewise. (can_inline_edge_p): Likewise. (want_early_inline_function_p): Likewise. (compute_uninlined_call_time): Likewise. (compute_inlined_call_time): Likewise. (big_speedup_p): Likewise. (want_inline_small_function_p): Likewise. (edge_badness): Likewise. (update_caller_keys): Likewise. (update_callee_keys): Likewise. (recursive_inlining): Likewise. (inline_small_functions): Likewise. (inline_to_all_callers): Likewise. (dump_overall_stats): Likewise. (early_inline_small_functions): Likewise. * ipa-inline.h: New class inline_summary_t replaces vec<inline_summary_t>. * ipa-split.c (execute_split_functions): New inline_summaries is used. * ipa.c (walk_polymorphic_call_targets): Likewise. * tree-sra.c (ipa_sra_preliminary_function_checks): Likewise. From-SVN: r219006
2014-12-22 10:33:05 +01:00
old_size = inline_summaries->get (to)->size;
cgraphbuild.c (build_cgraph_edges): Update call of cgraph_create_edge and cgraph_create_indirect_edge. * cgraphbuild.c (build_cgraph_edges): Update call of cgraph_create_edge and cgraph_create_indirect_edge. * cgraph.c (cgraph_create_edge_including_clones, cgraph_create_edge_1, cgraph_allocate_init_indirect_info, cgraph_update_edges_for_call_stmt_node): Do not take nest argument; do not initialize call_stmt_size/time. (dump_cgraph_node): Do not dump nest. (cgraph_clone_edge): Do not take loop_nest argument; do not propagate it; do not clone call_stmt_size/time. (cgraph_clone_node): Likewise. (cgraph_create_virtual_clone): Update. * cgraph.h (struct cgraph_edge): Remove call_stmt_size/call_stmt_time/loop_nest. (cgraph_create_edge, cgraph_create_indirect_edge, cgraph_create_edge_including_clones, cgraph_clone_node): Update prototype. * tree-emutls.c (gen_emutls_addr): Update. * ipa-inline-transform.c (update_noncloned_frequencies): Do not handle loop_nest; handle indirect calls, too. (clone_inlined_nodes): Do not care about updating inline summaries. * cgraphunit.c (cgraph_copy_node_for_versioning): Update. * lto-cgraph.c (lto_output_edge, input_node, input_edge): Do not stream call_stmt_size/call_stmt_time/loop_nest. * ipa-inline.c (edge_badness): Update. (ipa_inline): dump summaries after inlining. * ipa-inline.h (struct inline_edge_summary, inline_edge_summary_t): new. (inline_edge_summary): New function. * ipa-inline-analysis.c (edge_duplication_hook_holder): New holder. (inline_edge_removal_hook): Handle edge summaries. (inline_edge_duplication_hook): New hook. (inline_summary_alloc): Alloc hooks. (initialize_growth_caches): Do not register removal hooks. (free_growth_caches); Do not free removal hook. (dump_inline_edge_summary): New function. (dump_inline_summary): Use it. (estimate_function_body_sizes, estimate_edge_size_and_time): Update. (inline_update_callee_summaries): New function. (inline_merge_summary): Use it. (do_estimate_edge_time, do_estimate_edge_growth): Update. (read_inline_edge_summary): New function. (inline_read_section): Use it. (write_inline_edge_summary): New function. (inline_write_summary): Use it. (inline_free_summary): Free edge new holders. * tree-inline.c (copy_bb): Update. From-SVN: r172989
2011-04-27 00:05:50 +02:00
inline_merge_summary (e);
if (e->in_polymorphic_cdtor)
mark_all_inlined_calls_cdtor (e->callee);
if (opt_for_fn (e->caller->decl, optimize))
new_edges_found = ipa_propagate_indirect_call_infos (curr, new_edges);
check_speculations (e->callee);
if (update_overall_summary)
inline_update_overall_summary (to);
else
/* Update self size by the estimate so overall function growth limits
work for further inlining into this function. Before inlining
the function we inlined to again we expect the caller to update
the overall summary. */
inline_summaries->get (to)->size += estimated_growth;
symbol_summary is used for inline_summary. * lto-partition.c (add_symbol_to_partition_1): New inline_summaries is used. (undo_partition): Likewise. (lto_balanced_map): Likewise. * cgraphunit.c (symbol_table::process_new_functions): New inline_summaries is used. * ipa-cp.c (ipcp_cloning_candidate_p): Likewise. (devirtualization_time_bonus): Likewise. (estimate_local_effects): Likewise. (ipcp_propagate_stage): Likewise. * ipa-inline-analysis.c (evaluate_conditions_for_known_args): Likewise. (evaluate_properties_for_edge): Likewise. (inline_summary_alloc): Likewise. (reset_inline_summary): New inline_summary argument is introduced. (inline_summary_t::remove): New function. (inline_summary_t::duplicate): Likewise. (dump_inline_edge_summary): New inline_summaries is used. (dump_inline_summary): Likewise. (estimate_function_body_sizes): Likewise. (compute_inline_parameters): Likewise. (estimate_edge_devirt_benefit): Likewise. (estimate_node_size_and_time): Likewise. (inline_update_callee_summaries): Likewise. (inline_merge_summary): Likewise. (inline_update_overall_summary): Likewise. (simple_edge_hints): Likewise. (do_estimate_edge_time): Likewise. (estimate_time_after_inlining): Likewise. (estimate_size_after_inlining): Likewise. (do_estimate_growth): Likewise. (growth_likely_positive): Likewise. (inline_generate_summary): Likewise. (inline_read_section): Likewise. (inline_read_summary): Likewise. (inline_write_summary): Likewise. (inline_free_summary): Likewise. * ipa-inline-transform.c (clone_inlined_nodes): Likewise. (inline_call): Likewise. * ipa-inline.c (caller_growth_limits): Likewise. (can_inline_edge_p): Likewise. (want_early_inline_function_p): Likewise. (compute_uninlined_call_time): Likewise. (compute_inlined_call_time): Likewise. (big_speedup_p): Likewise. (want_inline_small_function_p): Likewise. (edge_badness): Likewise. (update_caller_keys): Likewise. (update_callee_keys): Likewise. (recursive_inlining): Likewise. (inline_small_functions): Likewise. (inline_to_all_callers): Likewise. (dump_overall_stats): Likewise. (early_inline_small_functions): Likewise. * ipa-inline.h: New class inline_summary_t replaces vec<inline_summary_t>. * ipa-split.c (execute_split_functions): New inline_summaries is used. * ipa.c (walk_polymorphic_call_targets): Likewise. * tree-sra.c (ipa_sra_preliminary_function_checks): Likewise. From-SVN: r219006
2014-12-22 10:33:05 +01:00
new_size = inline_summaries->get (to)->size;
re PR c++/41090 (Using static label reference in c++ class constructor produces wrong code) PR c++/41090 Add -fdeclone-ctor-dtor. gcc/cp/ * optimize.c (can_alias_cdtor, populate_clone_array): Split out from maybe_clone_body. (maybe_thunk_body): New function. (maybe_clone_body): Call it. * mangle.c (write_mangled_name): Remove code to suppress writing of mangled name for cloned constructor or destructor. (write_special_name_constructor): Handle decloned constructor. (write_special_name_destructor): Handle decloned destructor. * method.c (trivial_fn_p): Handle decloning. * semantics.c (expand_or_defer_fn_1): Clone after setting linkage. gcc/c-family/ * c.opt: Add -fdeclone-ctor-dtor. * c-opts.c (c_common_post_options): Default to on iff -Os. gcc/ * cgraph.h (struct cgraph_node): Add calls_comdat_local. (symtab_comdat_local_p, symtab_in_same_comdat_p): New. * cif-code.def: Add USES_COMDAT_LOCAL. * symtab.c (verify_symtab_base): Make sure we don't refer to a comdat-local symbol from outside its comdat. * cgraph.c (verify_cgraph_node): Likewise. * cgraphunit.c (mark_functions_to_output): Don't mark comdat-locals. * ipa.c (symtab_remove_unreachable_nodes): Likewise. (function_and_variable_visibility): Handle comdat-local fns. * ipa-cp.c (determine_versionability): Don't clone comdat-locals. * ipa-inline-analysis.c (compute_inline_parameters): Update calls_comdat_local. * ipa-inline-transform.c (inline_call): Likewise. (save_inline_function_body): Don't clear DECL_COMDAT_GROUP. * ipa-inline.c (can_inline_edge_p): Check calls_comdat_local. * lto-cgraph.c (input_overwrite_node): Read calls_comdat_local. (lto_output_node): Write it. * symtab.c (symtab_dissolve_same_comdat_group_list): Clear DECL_COMDAT_GROUP for comdat-locals. include/ * demangle.h (enum gnu_v3_ctor_kinds): Added literal gnu_v3_unified_ctor. (enum gnu_v3_ctor_kinds): Added literal gnu_v3_unified_dtor. libiberty/ * cp-demangle.c (cplus_demangle_fill_ctor,cplus_demangle_fill_dtor): Handle unified ctor/dtor. (d_ctor_dtor_name): Handle unified ctor/dtor. From-SVN: r206182
2013-12-23 18:49:47 +01:00
if (callee->calls_comdat_local)
to->calls_comdat_local = true;
IPA C++ refactoring 1/N * cgraph.h (symtab_node): (void register_symbol (void)): created from symtab_register_node (void remove (void)): created from symtab_remove_node (void dump (FILE *f)): created from dump_symtab_node (void DEBUG_FUNCTION debug (void)): created from debug_symtab_node (void DEBUG_FUNCTION verify (void)): created from verify_symtab_node (struct ipa_ref *add_reference (symtab_node *referred_node, enum ipa_ref_use use_type)): created from add_reference (struct ipa_ref *add_reference (symtab_node *referred_node, enum ipa_ref_use use_type, gimple stmt)): created from add_reference (struct ipa_ref *maybe_add_reference (tree val, enum ipa_ref_use use_type, gimple stmt)): created from maybe_add_reference (bool semantically_equivalent_p (symtab_node *target)): created from symtab_semantically_equivalent_p (void remove_from_same_comdat_group (void)): created from remove_from_same_comdat_group (void add_to_same_comdat_group (symtab_node *old_node)): created from symtab_add_to_same_comdat_group (void dissolve_same_comdat_group_list (void)): created from symtab_dissolve_same_comdat_group_list (bool used_from_object_file_p (void)): created from symtab_used_from_object_file_p (symtab_node *ultimate_alias_target (enum availability *avail = NULL)): created from symtab_alias_ultimate_target (inline symtab_node *next_defined_symbol (void)): created from symtab_next_defined_symbol (bool resolve_alias (symtab_node *target)): created from symtab_resolve_alias (bool call_for_symbol_and_aliases (bool (*callback) (symtab_node *, void *), void *data, bool include_overwrite)): created from symtab_for_node_and_aliases (symtab_node *noninterposable_alias (void)): created from symtab_nonoverwritable_alias (inline symtab_node *get_alias_target (void)): created from symtab_alias_target (void set_section (const char *section)): created from set_section_1 (enum availability get_availability (void)): created from symtab_node_availability (void make_decl_local (void)): created from symtab_make_decl_local (bool real_symbol_p (void)): created from symtab_read_node (can_be_discarded_p (void)): created from symtab_can_be_discarded (inline bool comdat_local_p (void)): created from symtab_comdat_local_p (inline bool in_same_comdat_group_p (symtab_node *target)): created from symtab_in_same_comdat_p; (bool address_taken_from_non_vtable_p (void)): created from address_taken_from_non_vtable_p (static inline symtab_node *get (const_tree decl)): created from symtab_get_node (static void dump_table (FILE *)): created from dump_symtab (static inline DEBUG_FUNCTION void debug_symtab (void)): created from debug_symtab (static DEBUG_FUNCTION void verify_symtab_nodes (void)): created from verify_symtab (static bool used_from_object_file_p_worker (symtab_node *node)): created from symtab_used_from_object_file_p (void dump_base (FILE *)): created from dump_symtab_base (bool DEBUG_FUNCTION verify_base (void)): created from verify_symtab_base (void unregister (void)): created from symtab_unregister_node (struct symbol_priority_map *priority_info (void)): created from symtab_priority_info (static bool set_implicit_section (symtab_node *n, void *)): created from set_implicit_section (static bool noninterposable_alias (symtab_node *node, void *data)): created from symtab_nonoverwritable_alias_1 * cgraph.h (cgraph_node): (bool remove_symbol_and_inline_clones (cgraph_node *forbidden_node = NULL)): created from cgraph_remove_node_and_inline_clones (void record_stmt_references (gimple stmt)): created from ipa_record_stmt_references (void set_call_stmt_including_clones (gimple old_stmt, gimple new_stmt, bool update_speculative = true)): created from cgraph_set_call_stmt_including_clones (cgraph_node *function_symbol (enum availability *avail = NULL)): created from cgraph_function_node (cgraph_node *create_clone (tree decl, gcov_type count, int freq, bool update_original, vec<cgraph_edge *> redirect_callers, bool call_duplication_hook, struct cgraph_node *new_inlined_to, bitmap args_to_skip)): created from cgraph_create_clone (cgraph_node *create_virtual_clone (vec<cgraph_edge *> redirect_callers, vec<ipa_replace_map *, va_gc> *tree_map, bitmap args_to_skip, const char * suffix)): created from cgraph_create_virtual_clone (cgraph_node *find_replacement (void)): created from cgraph_find_replacement_node (cgraph_node *create_version_clone (tree new_decl, vec<cgraph_edge *> redirect_callers, bitmap bbs_to_copy)): created from cgraph_copy_node_for_versioning (cgraph_node *create_version_clone_with_body (vec<cgraph_edge *> redirect_callers, vec<ipa_replace_map *, va_gc> *tree_map, bitmap args_to_skip, bool skip_return, bitmap bbs_to_copy, basic_block new_entry_block, const char *clone_name)): created from cgraph_function_version_info (struct cgraph_function_version_info *insert_new_function_version (void)): created from insert_new_cgraph_node_version (struct cgraph_function_version_info *function_version (void)): created from get_cgraph_node_version (void analyze (void)): created from analyze_function (cgraph_node * create_thunk (tree alias, tree, bool this_adjusting, HOST_WIDE_INT fixed_offset, HOST_WIDE_INT virtual_value, tree virtual_offset, tree real_alias) cgraph_add_thunk (inline cgraph_node *get_alias_target (void)): created from cgraph_alias_target (cgraph_node *ultimate_alias_target (availability *availability = NULL)): created from cgraph_function_or_thunk_node (bool expand_thunk (bool output_asm_thunks, bool force_gimple_thunk)): created from expand_thunk (void reset (void)): created from cgraph_reset_node (void create_wrapper (cgraph_node *target)): created from cgraph_make_wrapper (void DEBUG_FUNCTION verify_node (void)): created from verify_cgraph_node (void remove (void)): created from cgraph_remove_node (void dump (FILE *f)): created from dump_cgraph_node (void DEBUG_FUNCTION debug (void)): created from debug_cgraph_node (bool get_body (void)): created from cgraph_get_body (void release_body (void)): created from cgraph_release_function_body (void unnest (void)): created from cgraph_unnest_node (void make_local (void)): created from cgraph_make_node_local (void mark_address_taken (void)): created from cgraph_mark_address_taken_node (struct cgraph_edge *create_edge (cgraph_node *callee, gimple call_stmt, gcov_type count, int freq)): created from cgraph_create_edge (struct cgraph_edge *create_indirect_edge (gimple call_stmt, int ecf_flags, gcov_type count, int freq)): created from cgraph_create_indirect_edge (void create_edge_including_clones (struct cgraph_node *callee, gimple old_stmt, gimple stmt, gcov_type count, int freq, cgraph_inline_failed_t reason)): created from cgraph_create_edge_including_clones (cgraph_edge *get_edge (gimple call_stmt)): created from cgraph_edge (vec<cgraph_edge *> collect_callers (void)): created from collect_callers_of_node (void remove_callers (void)): created from cgraph_node_remove_callers (void remove_callees (void)): created from cgraph_node_remove_callees (enum availability get_availability (void)): created from cgraph_function_body_availability (void set_nothrow_flag (bool nothrow)): created from cgraph_set_nothrow_flag (void set_const_flag (bool readonly, bool looping)): created from cgraph_set_const_flag (void set_pure_flag (bool pure, bool looping)): created from cgraph_set_pure_flag (void call_duplication_hooks (cgraph_node *node2)): created from cgraph_call_node_duplication_hooks (bool call_for_symbol_and_aliases (bool (*callback) (cgraph_node *, void *), void *data, bool include_overwritable)): created from cgraph_for_node_and_aliases (bool call_for_symbol_thunks_and_aliases (bool (*callback) (cgraph_node *node, void *data), void *data, bool include_overwritable)): created from cgraph_for_node_thunks_and_aliases (void call_function_insertion_hooks (void)): created from cgraph_call_function_insertion_hooks (inline void mark_force_output (void)): created from cgraph_mark_force_output_node (bool local_p (void)): created from cgraph_local_node (bool can_be_local_p (void)): created from cgraph_node_can_be_local_p (bool cannot_return_p (void)): created from cgraph_node_cannot_return (bool only_called_directly_p (void)): created from cgraph_only_called_directly_p (inline bool only_called_directly_or_aliased_p (void)): created from cgraph_only_called_directly_or_aliased_p (bool will_be_removed_from_program_if_no_direct_calls_p (void)): created from cgraph_will_be_removed_from_program_if_no_direct_calls (bool can_remove_if_no_direct_calls_and_refs_p (void)): created from cgraph_can_remove_if_no_direct_calls_and_refs_p (bool can_remove_if_no_direct_calls_p (void)): created from cgraph_can_remove_if_no_direct_calls_p (inline bool has_gimple_body_p (void)): created from cgraph_function_with_gimple_body_p (bool optimize_for_size_p (void)): created from cgraph_optimize_for_size_p (static void dump_cgraph (FILE *f)): created from dump_cgraph (static inline void debug_cgraph (void)): created from debug_cgraph (static void record_function_versions (tree decl1, tree decl2)): created from record_function_versions (static void delete_function_version (tree decl)): created from delete_function_version (static void add_new_function (tree fndecl, bool lowered)): created from cgraph_add_new_function (static inline cgraph_node *get (const_tree decl)): created from cgraph_get_node (static cgraph_node * create (tree decl)): created from cgraph_create_node (static cgraph_node * create_empty (void)): created from cgraph_create_empty_node (static cgraph_node * get_create (tree)): created from cgraph_get_create_node (static cgraph_node *get_for_asmname (tree asmname)): created from cgraph_node_for_asm (static cgraph_node * create_same_body_alias (tree alias, tree decl)): created from cgraph_same_body_alias (static bool used_from_object_file_p_worker (cgraph_node *node, void *): new function (static bool non_local_p (cgraph_node *node, void *)): created from cgraph_non_local_node_p_1 (static void DEBUG_FUNCTION verify_cgraph_nodes (void)): created from verify_cgraph (static bool make_local (cgraph_node *node, void *)): created from cgraph_make_node_local (static cgraph_node *create_alias (tree alias, tree target)): created from cgraph_create_function_alias (static cgraph_edge * create_edge (cgraph_node *caller, cgraph_node *callee, gimple call_stmt, gcov_type count, int freq, bool indir_unknown_callee)): created from cgraph_create_edge_1 * cgraph.h (varpool_node): (void remove (void)): created from varpool_remove_node (void dump (FILE *f)): created from dump_varpool_node From-SVN: r212982
2014-07-24 14:07:13 +02:00
else if (to->calls_comdat_local && callee->comdat_local_p ())
re PR c++/41090 (Using static label reference in c++ class constructor produces wrong code) PR c++/41090 Add -fdeclone-ctor-dtor. gcc/cp/ * optimize.c (can_alias_cdtor, populate_clone_array): Split out from maybe_clone_body. (maybe_thunk_body): New function. (maybe_clone_body): Call it. * mangle.c (write_mangled_name): Remove code to suppress writing of mangled name for cloned constructor or destructor. (write_special_name_constructor): Handle decloned constructor. (write_special_name_destructor): Handle decloned destructor. * method.c (trivial_fn_p): Handle decloning. * semantics.c (expand_or_defer_fn_1): Clone after setting linkage. gcc/c-family/ * c.opt: Add -fdeclone-ctor-dtor. * c-opts.c (c_common_post_options): Default to on iff -Os. gcc/ * cgraph.h (struct cgraph_node): Add calls_comdat_local. (symtab_comdat_local_p, symtab_in_same_comdat_p): New. * cif-code.def: Add USES_COMDAT_LOCAL. * symtab.c (verify_symtab_base): Make sure we don't refer to a comdat-local symbol from outside its comdat. * cgraph.c (verify_cgraph_node): Likewise. * cgraphunit.c (mark_functions_to_output): Don't mark comdat-locals. * ipa.c (symtab_remove_unreachable_nodes): Likewise. (function_and_variable_visibility): Handle comdat-local fns. * ipa-cp.c (determine_versionability): Don't clone comdat-locals. * ipa-inline-analysis.c (compute_inline_parameters): Update calls_comdat_local. * ipa-inline-transform.c (inline_call): Likewise. (save_inline_function_body): Don't clear DECL_COMDAT_GROUP. * ipa-inline.c (can_inline_edge_p): Check calls_comdat_local. * lto-cgraph.c (input_overwrite_node): Read calls_comdat_local. (lto_output_node): Write it. * symtab.c (symtab_dissolve_same_comdat_group_list): Clear DECL_COMDAT_GROUP for comdat-locals. include/ * demangle.h (enum gnu_v3_ctor_kinds): Added literal gnu_v3_unified_ctor. (enum gnu_v3_ctor_kinds): Added literal gnu_v3_unified_dtor. libiberty/ * cp-demangle.c (cplus_demangle_fill_ctor,cplus_demangle_fill_dtor): Handle unified ctor/dtor. (d_ctor_dtor_name): Handle unified ctor/dtor. From-SVN: r206182
2013-12-23 18:49:47 +01:00
{
struct cgraph_edge *se = to->callees;
for (; se; se = se->next_callee)
IPA C++ refactoring 1/N * cgraph.h (symtab_node): (void register_symbol (void)): created from symtab_register_node (void remove (void)): created from symtab_remove_node (void dump (FILE *f)): created from dump_symtab_node (void DEBUG_FUNCTION debug (void)): created from debug_symtab_node (void DEBUG_FUNCTION verify (void)): created from verify_symtab_node (struct ipa_ref *add_reference (symtab_node *referred_node, enum ipa_ref_use use_type)): created from add_reference (struct ipa_ref *add_reference (symtab_node *referred_node, enum ipa_ref_use use_type, gimple stmt)): created from add_reference (struct ipa_ref *maybe_add_reference (tree val, enum ipa_ref_use use_type, gimple stmt)): created from maybe_add_reference (bool semantically_equivalent_p (symtab_node *target)): created from symtab_semantically_equivalent_p (void remove_from_same_comdat_group (void)): created from remove_from_same_comdat_group (void add_to_same_comdat_group (symtab_node *old_node)): created from symtab_add_to_same_comdat_group (void dissolve_same_comdat_group_list (void)): created from symtab_dissolve_same_comdat_group_list (bool used_from_object_file_p (void)): created from symtab_used_from_object_file_p (symtab_node *ultimate_alias_target (enum availability *avail = NULL)): created from symtab_alias_ultimate_target (inline symtab_node *next_defined_symbol (void)): created from symtab_next_defined_symbol (bool resolve_alias (symtab_node *target)): created from symtab_resolve_alias (bool call_for_symbol_and_aliases (bool (*callback) (symtab_node *, void *), void *data, bool include_overwrite)): created from symtab_for_node_and_aliases (symtab_node *noninterposable_alias (void)): created from symtab_nonoverwritable_alias (inline symtab_node *get_alias_target (void)): created from symtab_alias_target (void set_section (const char *section)): created from set_section_1 (enum availability get_availability (void)): created from symtab_node_availability (void make_decl_local (void)): created from symtab_make_decl_local (bool real_symbol_p (void)): created from symtab_read_node (can_be_discarded_p (void)): created from symtab_can_be_discarded (inline bool comdat_local_p (void)): created from symtab_comdat_local_p (inline bool in_same_comdat_group_p (symtab_node *target)): created from symtab_in_same_comdat_p; (bool address_taken_from_non_vtable_p (void)): created from address_taken_from_non_vtable_p (static inline symtab_node *get (const_tree decl)): created from symtab_get_node (static void dump_table (FILE *)): created from dump_symtab (static inline DEBUG_FUNCTION void debug_symtab (void)): created from debug_symtab (static DEBUG_FUNCTION void verify_symtab_nodes (void)): created from verify_symtab (static bool used_from_object_file_p_worker (symtab_node *node)): created from symtab_used_from_object_file_p (void dump_base (FILE *)): created from dump_symtab_base (bool DEBUG_FUNCTION verify_base (void)): created from verify_symtab_base (void unregister (void)): created from symtab_unregister_node (struct symbol_priority_map *priority_info (void)): created from symtab_priority_info (static bool set_implicit_section (symtab_node *n, void *)): created from set_implicit_section (static bool noninterposable_alias (symtab_node *node, void *data)): created from symtab_nonoverwritable_alias_1 * cgraph.h (cgraph_node): (bool remove_symbol_and_inline_clones (cgraph_node *forbidden_node = NULL)): created from cgraph_remove_node_and_inline_clones (void record_stmt_references (gimple stmt)): created from ipa_record_stmt_references (void set_call_stmt_including_clones (gimple old_stmt, gimple new_stmt, bool update_speculative = true)): created from cgraph_set_call_stmt_including_clones (cgraph_node *function_symbol (enum availability *avail = NULL)): created from cgraph_function_node (cgraph_node *create_clone (tree decl, gcov_type count, int freq, bool update_original, vec<cgraph_edge *> redirect_callers, bool call_duplication_hook, struct cgraph_node *new_inlined_to, bitmap args_to_skip)): created from cgraph_create_clone (cgraph_node *create_virtual_clone (vec<cgraph_edge *> redirect_callers, vec<ipa_replace_map *, va_gc> *tree_map, bitmap args_to_skip, const char * suffix)): created from cgraph_create_virtual_clone (cgraph_node *find_replacement (void)): created from cgraph_find_replacement_node (cgraph_node *create_version_clone (tree new_decl, vec<cgraph_edge *> redirect_callers, bitmap bbs_to_copy)): created from cgraph_copy_node_for_versioning (cgraph_node *create_version_clone_with_body (vec<cgraph_edge *> redirect_callers, vec<ipa_replace_map *, va_gc> *tree_map, bitmap args_to_skip, bool skip_return, bitmap bbs_to_copy, basic_block new_entry_block, const char *clone_name)): created from cgraph_function_version_info (struct cgraph_function_version_info *insert_new_function_version (void)): created from insert_new_cgraph_node_version (struct cgraph_function_version_info *function_version (void)): created from get_cgraph_node_version (void analyze (void)): created from analyze_function (cgraph_node * create_thunk (tree alias, tree, bool this_adjusting, HOST_WIDE_INT fixed_offset, HOST_WIDE_INT virtual_value, tree virtual_offset, tree real_alias) cgraph_add_thunk (inline cgraph_node *get_alias_target (void)): created from cgraph_alias_target (cgraph_node *ultimate_alias_target (availability *availability = NULL)): created from cgraph_function_or_thunk_node (bool expand_thunk (bool output_asm_thunks, bool force_gimple_thunk)): created from expand_thunk (void reset (void)): created from cgraph_reset_node (void create_wrapper (cgraph_node *target)): created from cgraph_make_wrapper (void DEBUG_FUNCTION verify_node (void)): created from verify_cgraph_node (void remove (void)): created from cgraph_remove_node (void dump (FILE *f)): created from dump_cgraph_node (void DEBUG_FUNCTION debug (void)): created from debug_cgraph_node (bool get_body (void)): created from cgraph_get_body (void release_body (void)): created from cgraph_release_function_body (void unnest (void)): created from cgraph_unnest_node (void make_local (void)): created from cgraph_make_node_local (void mark_address_taken (void)): created from cgraph_mark_address_taken_node (struct cgraph_edge *create_edge (cgraph_node *callee, gimple call_stmt, gcov_type count, int freq)): created from cgraph_create_edge (struct cgraph_edge *create_indirect_edge (gimple call_stmt, int ecf_flags, gcov_type count, int freq)): created from cgraph_create_indirect_edge (void create_edge_including_clones (struct cgraph_node *callee, gimple old_stmt, gimple stmt, gcov_type count, int freq, cgraph_inline_failed_t reason)): created from cgraph_create_edge_including_clones (cgraph_edge *get_edge (gimple call_stmt)): created from cgraph_edge (vec<cgraph_edge *> collect_callers (void)): created from collect_callers_of_node (void remove_callers (void)): created from cgraph_node_remove_callers (void remove_callees (void)): created from cgraph_node_remove_callees (enum availability get_availability (void)): created from cgraph_function_body_availability (void set_nothrow_flag (bool nothrow)): created from cgraph_set_nothrow_flag (void set_const_flag (bool readonly, bool looping)): created from cgraph_set_const_flag (void set_pure_flag (bool pure, bool looping)): created from cgraph_set_pure_flag (void call_duplication_hooks (cgraph_node *node2)): created from cgraph_call_node_duplication_hooks (bool call_for_symbol_and_aliases (bool (*callback) (cgraph_node *, void *), void *data, bool include_overwritable)): created from cgraph_for_node_and_aliases (bool call_for_symbol_thunks_and_aliases (bool (*callback) (cgraph_node *node, void *data), void *data, bool include_overwritable)): created from cgraph_for_node_thunks_and_aliases (void call_function_insertion_hooks (void)): created from cgraph_call_function_insertion_hooks (inline void mark_force_output (void)): created from cgraph_mark_force_output_node (bool local_p (void)): created from cgraph_local_node (bool can_be_local_p (void)): created from cgraph_node_can_be_local_p (bool cannot_return_p (void)): created from cgraph_node_cannot_return (bool only_called_directly_p (void)): created from cgraph_only_called_directly_p (inline bool only_called_directly_or_aliased_p (void)): created from cgraph_only_called_directly_or_aliased_p (bool will_be_removed_from_program_if_no_direct_calls_p (void)): created from cgraph_will_be_removed_from_program_if_no_direct_calls (bool can_remove_if_no_direct_calls_and_refs_p (void)): created from cgraph_can_remove_if_no_direct_calls_and_refs_p (bool can_remove_if_no_direct_calls_p (void)): created from cgraph_can_remove_if_no_direct_calls_p (inline bool has_gimple_body_p (void)): created from cgraph_function_with_gimple_body_p (bool optimize_for_size_p (void)): created from cgraph_optimize_for_size_p (static void dump_cgraph (FILE *f)): created from dump_cgraph (static inline void debug_cgraph (void)): created from debug_cgraph (static void record_function_versions (tree decl1, tree decl2)): created from record_function_versions (static void delete_function_version (tree decl)): created from delete_function_version (static void add_new_function (tree fndecl, bool lowered)): created from cgraph_add_new_function (static inline cgraph_node *get (const_tree decl)): created from cgraph_get_node (static cgraph_node * create (tree decl)): created from cgraph_create_node (static cgraph_node * create_empty (void)): created from cgraph_create_empty_node (static cgraph_node * get_create (tree)): created from cgraph_get_create_node (static cgraph_node *get_for_asmname (tree asmname)): created from cgraph_node_for_asm (static cgraph_node * create_same_body_alias (tree alias, tree decl)): created from cgraph_same_body_alias (static bool used_from_object_file_p_worker (cgraph_node *node, void *): new function (static bool non_local_p (cgraph_node *node, void *)): created from cgraph_non_local_node_p_1 (static void DEBUG_FUNCTION verify_cgraph_nodes (void)): created from verify_cgraph (static bool make_local (cgraph_node *node, void *)): created from cgraph_make_node_local (static cgraph_node *create_alias (tree alias, tree target)): created from cgraph_create_function_alias (static cgraph_edge * create_edge (cgraph_node *caller, cgraph_node *callee, gimple call_stmt, gcov_type count, int freq, bool indir_unknown_callee)): created from cgraph_create_edge_1 * cgraph.h (varpool_node): (void remove (void)): created from varpool_remove_node (void dump (FILE *f)): created from dump_varpool_node From-SVN: r212982
2014-07-24 14:07:13 +02:00
if (se->inline_failed && se->callee->comdat_local_p ())
re PR c++/41090 (Using static label reference in c++ class constructor produces wrong code) PR c++/41090 Add -fdeclone-ctor-dtor. gcc/cp/ * optimize.c (can_alias_cdtor, populate_clone_array): Split out from maybe_clone_body. (maybe_thunk_body): New function. (maybe_clone_body): Call it. * mangle.c (write_mangled_name): Remove code to suppress writing of mangled name for cloned constructor or destructor. (write_special_name_constructor): Handle decloned constructor. (write_special_name_destructor): Handle decloned destructor. * method.c (trivial_fn_p): Handle decloning. * semantics.c (expand_or_defer_fn_1): Clone after setting linkage. gcc/c-family/ * c.opt: Add -fdeclone-ctor-dtor. * c-opts.c (c_common_post_options): Default to on iff -Os. gcc/ * cgraph.h (struct cgraph_node): Add calls_comdat_local. (symtab_comdat_local_p, symtab_in_same_comdat_p): New. * cif-code.def: Add USES_COMDAT_LOCAL. * symtab.c (verify_symtab_base): Make sure we don't refer to a comdat-local symbol from outside its comdat. * cgraph.c (verify_cgraph_node): Likewise. * cgraphunit.c (mark_functions_to_output): Don't mark comdat-locals. * ipa.c (symtab_remove_unreachable_nodes): Likewise. (function_and_variable_visibility): Handle comdat-local fns. * ipa-cp.c (determine_versionability): Don't clone comdat-locals. * ipa-inline-analysis.c (compute_inline_parameters): Update calls_comdat_local. * ipa-inline-transform.c (inline_call): Likewise. (save_inline_function_body): Don't clear DECL_COMDAT_GROUP. * ipa-inline.c (can_inline_edge_p): Check calls_comdat_local. * lto-cgraph.c (input_overwrite_node): Read calls_comdat_local. (lto_output_node): Write it. * symtab.c (symtab_dissolve_same_comdat_group_list): Clear DECL_COMDAT_GROUP for comdat-locals. include/ * demangle.h (enum gnu_v3_ctor_kinds): Added literal gnu_v3_unified_ctor. (enum gnu_v3_ctor_kinds): Added literal gnu_v3_unified_dtor. libiberty/ * cp-demangle.c (cplus_demangle_fill_ctor,cplus_demangle_fill_dtor): Handle unified ctor/dtor. (d_ctor_dtor_name): Handle unified ctor/dtor. From-SVN: r206182
2013-12-23 18:49:47 +01:00
break;
if (se == NULL)
to->calls_comdat_local = false;
}
/* FIXME: This assert suffers from roundoff errors, disable it for GCC 5
and revisit it after conversion to sreals in GCC 6.
See PR 65654. */
#if 0
/* Verify that estimated growth match real growth. Allow off-by-one
error due to INLINE_SIZE_SCALE roudoff errors. */
gcc_assert (!update_overall_summary || !overall_size || new_edges_found
|| abs (estimated_growth - (new_size - old_size)) <= 1
|| speculation_removed
/* FIXME: a hack. Edges with false predicate are accounted
wrong, we should remove them from callgraph. */
|| predicated);
#endif
/* Account the change of overall unit size; external functions will be
removed and are thus not accounted. */
if (overall_size && inline_account_function_p (to))
*overall_size += new_size - old_size;
ncalls_inlined++;
inline-1.c: new testcase. * gcc.dg/ipa/inline-1.c: new testcase. * gcc.dg/ipa/inline-2.c: new testcase. * gcc.dg/ipa/inline-3.c: new testcase. * gcc.dg/ipa/inline-4.c: new testcase. * ipa-inline-transform.c (inline_call): Add comment. * ipa-inline.h (inline_param_summary): New structure and vector. (struct inline_edge_summary): Add param field. * ipa-inline-analysis.c (CHANGED): New constant. (add_clause): Handle CHANGED and NOT_CONSTANT. (predicate_probability): New function. (dump_condition): Dump CHANGED predicate. (evaluate_conditions_for_known_args): Handle ERROR_MARK as marker of unknown function wide invariant. (evaluate_conditions_for_edge): Handle change probabilities. (inline_edge_duplication_hook): Copy param summaries. (inline_edge_removal_hook): Free param summaries. (dump_inline_edge_summary): Fix dumping of indirect edges and callee sizes; dump param summaries. (will_be_nonconstant_predicate): Use CHANGED predicate. (record_modified_bb_info): New structure. (record_modified): New function. (param_change_prob): New function. (estimate_function_body_sizes): Compute param summaries. (estimate_edge_size_and_time): Add probability argument. (estimate_node_size_and_time): Add inline_param_summary argument; handle predicate probabilities. (remap_predicate): Fix formating. (remap_edge_change_prob): New function. (remap_edge_summaries): Rename from ...; use remap_edge_change_prob. (remap_edge_predicates): ... this one. (inline_merge_summary): Remap edge summaries; handle predicate probabilities; remove param summaries after we are done. (do_estimate_edge_time): Update. (do_estimate_edge_growth): Update. (read_inline_edge_summary): Read param info. (inline_read_summary): Fix formating. (write_inline_edge_summary): Write param summaries. From-SVN: r179126
2011-09-23 19:30:34 +02:00
/* This must happen after inline_merge_summary that rely on jump
functions of callee to not be updated. */
return new_edges_found;
}
/* Copy function body of NODE and redirect all inline clones to it.
This is done before inline plan is applied to NODE when there are
still some inline clones if it.
LANGUAGES: Fix typos. * LANGUAGES: Fix typos. * Makefile.in: Fix typos. * alias.c: Fix typos. * auto-inc-dec.c: Fix typos. * bb-reorder.c: Fix typos. * cfgcleanup.c: Fix typos. * cgraph.c: Fix typos. * cgraph.h: Fix typos. * cgraphunit.c: Fix typos. * collect2-aix.h: Fix typos. * collect2.c: Fix typos. * compare-elim.c: Fix typos. * config/alpha/vms.h: Fix typos. * config/arm/README-interworking: Fix typos. * config/arm/arm.c: Fix typos. * config/arm/iterators.md: Fix typos. * config/arm/vxworks.h: Fix typos. * config/avr/avr.c: Fix typos. * config/avr/avr.h: Fix typos. * config/avr/avr.md: Fix typos. * config/avr/builtins.def: Fix typos. * config/c6x/c6x.c: Fix typos. * config/cr16/cr16.c: Fix typos. * config/cr16/cr16.md: Fix typos. * config/cris/cris.md: Fix typos. * config/darwin.c: Fix typos. * config/darwin.opt: Fix typos. * config/i386/i386-c.c: Fix typos. * config/i386/i386.c: Fix typos. * config/ia64/ia64.c: Fix typos. * config/m68k/cf.md: Fix typos. * config/mep/mep.c: Fix typos. * config/microblaze/microblaze.c: Fix typos. * config/microblaze/microblaze.h: Fix typos. * config/mn10300/mn10300.c: Fix typos. * config/mn10300/mn10300.md: Fix typos. * config/pa/pa.c: Fix typos. * config/picochip/picochip.h: Fix typos. * config/rs6000/a2.md: Fix typos. * config/rs6000/rs6000.c: Fix typos. * config/rs6000/vector.md: Fix typos. * config/rx/rx.md: Fix typos. * config/rx/rx.opt: Fix typos. * config/s390/2097.md: Fix typos. * config/s390/s390.c: Fix typos. * config/s390/s390.h: Fix typos. * config/sh/sh.c: Fix typos. * config/sh/sh.md: Fix typos. * config/sparc/sync.md: Fix typos. * config/spu/spu.c: Fix typos. * config/spu/spu.md: Fix typos. * config/vms/vms.c: Fix typos. * config/vxworks-dummy.h: Fix typos. * config/vxworks.h: Fix typos. * cselib.c: Fix typos. * df-scan.c: Fix typos. * df.h: Fix typos. * doc/extend.texi: Fix typos. * doc/install.texi: Fix typos. * doc/invoke.texi: Fix typos. * doc/md.texi: Fix typos. * doc/plugins.texi: Fix typos. * doc/rtl.texi: Fix typos. * dse.c: Fix typos. * dwarf2asm.c: Fix typos. * dwarf2out.c: Fix typos. * except.h: Fix typos. * expr.c: Fix typos. * fold-const.c: Fix typos. * gcc.c: Fix typos. * gcse.c: Fix typos. * genautomata.c: Fix typos. * gengtype-state.c: Fix typos. * gengtype.c: Fix typos. * genhooks.c: Fix typos. * gimple-fold.c: Fix typos. * gimple-pretty-print.c: Fix typos. * gimple.c: Fix typos. * gimple.h: Fix typos. * gimplify.c: Fix typos. * graphite-interchange.c: Fix typos. * graphite-sese-to-poly.c: Fix typos. * ifcvt.c: Fix typos. * input.c: Fix typos. * ipa-cp.c: Fix typos. * ipa-inline-analysis.c: Fix typos. * ipa-inline-transform.c: Fix typos. * ipa-inline.c: Fix typos. * ipa-pure-const.c: Fix typos. * ipa-ref.h: Fix typos. * ipa-reference.c: Fix typos. * ipa-utils.c: Fix typos. * ipa.c: Fix typos. * ira-emit.c: Fix typos. * ira-lives.c: Fix typos. * lto-streamer.c: Fix typos. * lto-streamer.h: Fix typos. * lto-wrapper.c: Fix typos. * mcf.c: Fix typos. * mode-switching.c: Fix typos. * modulo-sched.c: Fix typos. * plugin.c: Fix typos. * postreload.c: Fix typos. * sched-deps.c: Fix typos. * sel-sched-ir.c: Fix typos. * sel-sched-ir.h: Fix typos. * sel-sched.c: Fix typos. * sese.c: Fix typos. * stor-layout.c: Fix typos. * target-hooks-macros.h: Fix typos. * target.def: Fix typos. * trans-mem.c: Fix typos. * tree-eh.c: Fix typos. * tree-predcom.c: Fix typos. * tree-sra.c: Fix typos. * tree-ssa-address.c: Fix typos. * tree-ssa-loop-ivopts.c: Fix typos. * tree-ssa-loop-niter.c: Fix typos. * tree-ssa-math-opts.c: Fix typos. * tree-ssa-pre.c: Fix typos. * tree-ssa-propagate.c: Fix typos. * tree-ssa-reassoc.c: Fix typos. * tree-ssa-sccvn.c: Fix typos. * tree-ssa-ter.c: Fix typos. * tree-ssa-uninit.c: Fix typos. * tree-ssanames.c: Fix typos. * tree-vect-generic.c: Fix typos. * tree-vect-slp.c: Fix typos. * tree.c: Fix typos. * tree.h: Fix typos. * varasm.c: Fix typos. * varpool.c: Fix typos. From-SVN: r187959
2012-05-29 16:14:06 +02:00
This is necessary because inline decisions are not really transitive
and the other inline clones may have different bodies. */
static struct cgraph_node *
save_inline_function_body (struct cgraph_node *node)
{
struct cgraph_node *first_clone, *n;
if (dump_file)
fprintf (dump_file, "\nSaving body of %s for later reuse\n",
node->name ());
IPA C++ refactoring 1/N * cgraph.h (symtab_node): (void register_symbol (void)): created from symtab_register_node (void remove (void)): created from symtab_remove_node (void dump (FILE *f)): created from dump_symtab_node (void DEBUG_FUNCTION debug (void)): created from debug_symtab_node (void DEBUG_FUNCTION verify (void)): created from verify_symtab_node (struct ipa_ref *add_reference (symtab_node *referred_node, enum ipa_ref_use use_type)): created from add_reference (struct ipa_ref *add_reference (symtab_node *referred_node, enum ipa_ref_use use_type, gimple stmt)): created from add_reference (struct ipa_ref *maybe_add_reference (tree val, enum ipa_ref_use use_type, gimple stmt)): created from maybe_add_reference (bool semantically_equivalent_p (symtab_node *target)): created from symtab_semantically_equivalent_p (void remove_from_same_comdat_group (void)): created from remove_from_same_comdat_group (void add_to_same_comdat_group (symtab_node *old_node)): created from symtab_add_to_same_comdat_group (void dissolve_same_comdat_group_list (void)): created from symtab_dissolve_same_comdat_group_list (bool used_from_object_file_p (void)): created from symtab_used_from_object_file_p (symtab_node *ultimate_alias_target (enum availability *avail = NULL)): created from symtab_alias_ultimate_target (inline symtab_node *next_defined_symbol (void)): created from symtab_next_defined_symbol (bool resolve_alias (symtab_node *target)): created from symtab_resolve_alias (bool call_for_symbol_and_aliases (bool (*callback) (symtab_node *, void *), void *data, bool include_overwrite)): created from symtab_for_node_and_aliases (symtab_node *noninterposable_alias (void)): created from symtab_nonoverwritable_alias (inline symtab_node *get_alias_target (void)): created from symtab_alias_target (void set_section (const char *section)): created from set_section_1 (enum availability get_availability (void)): created from symtab_node_availability (void make_decl_local (void)): created from symtab_make_decl_local (bool real_symbol_p (void)): created from symtab_read_node (can_be_discarded_p (void)): created from symtab_can_be_discarded (inline bool comdat_local_p (void)): created from symtab_comdat_local_p (inline bool in_same_comdat_group_p (symtab_node *target)): created from symtab_in_same_comdat_p; (bool address_taken_from_non_vtable_p (void)): created from address_taken_from_non_vtable_p (static inline symtab_node *get (const_tree decl)): created from symtab_get_node (static void dump_table (FILE *)): created from dump_symtab (static inline DEBUG_FUNCTION void debug_symtab (void)): created from debug_symtab (static DEBUG_FUNCTION void verify_symtab_nodes (void)): created from verify_symtab (static bool used_from_object_file_p_worker (symtab_node *node)): created from symtab_used_from_object_file_p (void dump_base (FILE *)): created from dump_symtab_base (bool DEBUG_FUNCTION verify_base (void)): created from verify_symtab_base (void unregister (void)): created from symtab_unregister_node (struct symbol_priority_map *priority_info (void)): created from symtab_priority_info (static bool set_implicit_section (symtab_node *n, void *)): created from set_implicit_section (static bool noninterposable_alias (symtab_node *node, void *data)): created from symtab_nonoverwritable_alias_1 * cgraph.h (cgraph_node): (bool remove_symbol_and_inline_clones (cgraph_node *forbidden_node = NULL)): created from cgraph_remove_node_and_inline_clones (void record_stmt_references (gimple stmt)): created from ipa_record_stmt_references (void set_call_stmt_including_clones (gimple old_stmt, gimple new_stmt, bool update_speculative = true)): created from cgraph_set_call_stmt_including_clones (cgraph_node *function_symbol (enum availability *avail = NULL)): created from cgraph_function_node (cgraph_node *create_clone (tree decl, gcov_type count, int freq, bool update_original, vec<cgraph_edge *> redirect_callers, bool call_duplication_hook, struct cgraph_node *new_inlined_to, bitmap args_to_skip)): created from cgraph_create_clone (cgraph_node *create_virtual_clone (vec<cgraph_edge *> redirect_callers, vec<ipa_replace_map *, va_gc> *tree_map, bitmap args_to_skip, const char * suffix)): created from cgraph_create_virtual_clone (cgraph_node *find_replacement (void)): created from cgraph_find_replacement_node (cgraph_node *create_version_clone (tree new_decl, vec<cgraph_edge *> redirect_callers, bitmap bbs_to_copy)): created from cgraph_copy_node_for_versioning (cgraph_node *create_version_clone_with_body (vec<cgraph_edge *> redirect_callers, vec<ipa_replace_map *, va_gc> *tree_map, bitmap args_to_skip, bool skip_return, bitmap bbs_to_copy, basic_block new_entry_block, const char *clone_name)): created from cgraph_function_version_info (struct cgraph_function_version_info *insert_new_function_version (void)): created from insert_new_cgraph_node_version (struct cgraph_function_version_info *function_version (void)): created from get_cgraph_node_version (void analyze (void)): created from analyze_function (cgraph_node * create_thunk (tree alias, tree, bool this_adjusting, HOST_WIDE_INT fixed_offset, HOST_WIDE_INT virtual_value, tree virtual_offset, tree real_alias) cgraph_add_thunk (inline cgraph_node *get_alias_target (void)): created from cgraph_alias_target (cgraph_node *ultimate_alias_target (availability *availability = NULL)): created from cgraph_function_or_thunk_node (bool expand_thunk (bool output_asm_thunks, bool force_gimple_thunk)): created from expand_thunk (void reset (void)): created from cgraph_reset_node (void create_wrapper (cgraph_node *target)): created from cgraph_make_wrapper (void DEBUG_FUNCTION verify_node (void)): created from verify_cgraph_node (void remove (void)): created from cgraph_remove_node (void dump (FILE *f)): created from dump_cgraph_node (void DEBUG_FUNCTION debug (void)): created from debug_cgraph_node (bool get_body (void)): created from cgraph_get_body (void release_body (void)): created from cgraph_release_function_body (void unnest (void)): created from cgraph_unnest_node (void make_local (void)): created from cgraph_make_node_local (void mark_address_taken (void)): created from cgraph_mark_address_taken_node (struct cgraph_edge *create_edge (cgraph_node *callee, gimple call_stmt, gcov_type count, int freq)): created from cgraph_create_edge (struct cgraph_edge *create_indirect_edge (gimple call_stmt, int ecf_flags, gcov_type count, int freq)): created from cgraph_create_indirect_edge (void create_edge_including_clones (struct cgraph_node *callee, gimple old_stmt, gimple stmt, gcov_type count, int freq, cgraph_inline_failed_t reason)): created from cgraph_create_edge_including_clones (cgraph_edge *get_edge (gimple call_stmt)): created from cgraph_edge (vec<cgraph_edge *> collect_callers (void)): created from collect_callers_of_node (void remove_callers (void)): created from cgraph_node_remove_callers (void remove_callees (void)): created from cgraph_node_remove_callees (enum availability get_availability (void)): created from cgraph_function_body_availability (void set_nothrow_flag (bool nothrow)): created from cgraph_set_nothrow_flag (void set_const_flag (bool readonly, bool looping)): created from cgraph_set_const_flag (void set_pure_flag (bool pure, bool looping)): created from cgraph_set_pure_flag (void call_duplication_hooks (cgraph_node *node2)): created from cgraph_call_node_duplication_hooks (bool call_for_symbol_and_aliases (bool (*callback) (cgraph_node *, void *), void *data, bool include_overwritable)): created from cgraph_for_node_and_aliases (bool call_for_symbol_thunks_and_aliases (bool (*callback) (cgraph_node *node, void *data), void *data, bool include_overwritable)): created from cgraph_for_node_thunks_and_aliases (void call_function_insertion_hooks (void)): created from cgraph_call_function_insertion_hooks (inline void mark_force_output (void)): created from cgraph_mark_force_output_node (bool local_p (void)): created from cgraph_local_node (bool can_be_local_p (void)): created from cgraph_node_can_be_local_p (bool cannot_return_p (void)): created from cgraph_node_cannot_return (bool only_called_directly_p (void)): created from cgraph_only_called_directly_p (inline bool only_called_directly_or_aliased_p (void)): created from cgraph_only_called_directly_or_aliased_p (bool will_be_removed_from_program_if_no_direct_calls_p (void)): created from cgraph_will_be_removed_from_program_if_no_direct_calls (bool can_remove_if_no_direct_calls_and_refs_p (void)): created from cgraph_can_remove_if_no_direct_calls_and_refs_p (bool can_remove_if_no_direct_calls_p (void)): created from cgraph_can_remove_if_no_direct_calls_p (inline bool has_gimple_body_p (void)): created from cgraph_function_with_gimple_body_p (bool optimize_for_size_p (void)): created from cgraph_optimize_for_size_p (static void dump_cgraph (FILE *f)): created from dump_cgraph (static inline void debug_cgraph (void)): created from debug_cgraph (static void record_function_versions (tree decl1, tree decl2)): created from record_function_versions (static void delete_function_version (tree decl)): created from delete_function_version (static void add_new_function (tree fndecl, bool lowered)): created from cgraph_add_new_function (static inline cgraph_node *get (const_tree decl)): created from cgraph_get_node (static cgraph_node * create (tree decl)): created from cgraph_create_node (static cgraph_node * create_empty (void)): created from cgraph_create_empty_node (static cgraph_node * get_create (tree)): created from cgraph_get_create_node (static cgraph_node *get_for_asmname (tree asmname)): created from cgraph_node_for_asm (static cgraph_node * create_same_body_alias (tree alias, tree decl)): created from cgraph_same_body_alias (static bool used_from_object_file_p_worker (cgraph_node *node, void *): new function (static bool non_local_p (cgraph_node *node, void *)): created from cgraph_non_local_node_p_1 (static void DEBUG_FUNCTION verify_cgraph_nodes (void)): created from verify_cgraph (static bool make_local (cgraph_node *node, void *)): created from cgraph_make_node_local (static cgraph_node *create_alias (tree alias, tree target)): created from cgraph_create_function_alias (static cgraph_edge * create_edge (cgraph_node *caller, cgraph_node *callee, gimple call_stmt, gcov_type count, int freq, bool indir_unknown_callee)): created from cgraph_create_edge_1 * cgraph.h (varpool_node): (void remove (void)): created from varpool_remove_node (void dump (FILE *f)): created from dump_varpool_node From-SVN: r212982
2014-07-24 14:07:13 +02:00
gcc_assert (node == cgraph_node::get (node->decl));
/* first_clone will be turned into real function. */
first_clone = node->clones;
/* Arrange first clone to not be thunk as those do not have bodies. */
if (first_clone->thunk.thunk_p)
{
while (first_clone->thunk.thunk_p)
first_clone = first_clone->next_sibling_clone;
first_clone->prev_sibling_clone->next_sibling_clone
= first_clone->next_sibling_clone;
if (first_clone->next_sibling_clone)
first_clone->next_sibling_clone->prev_sibling_clone
= first_clone->prev_sibling_clone;
first_clone->next_sibling_clone = node->clones;
first_clone->prev_sibling_clone = NULL;
node->clones->prev_sibling_clone = first_clone;
node->clones = first_clone;
}
Autogenerated fixes of "->symbol." to "->" This is the autogenerated part of the conversion of the symtable types to a C++ class hierarchy. gcc/ Patch autogenerated by refactor_symtab.py from https://github.com/davidmalcolm/gcc-refactoring-scripts revision 58bb219cc090b2f4516a9297d868c245495ee622 * asan.c (asan_finish_file): Update for conversion of symtab types to a true class hierarchy. * cfgexpand.c (estimated_stack_frame_size): Likewise. * cgraph.c (cgraph_get_body): Likewise. (cgraph_get_create_real_symbol_node): Likewise. (verify_cgraph_node): Likewise. (verify_edge_corresponds_to_fndecl): Likewise. (verify_edge_count_and_frequency): Likewise. (cgraph_will_be_removed_from_program_if_no_direct_calls): Likewise. (cgraph_can_remove_if_no_direct_calls_p): Likewise. (cgraph_can_remove_if_no_direct_calls_and_refs_p): Likewise. (cgraph_node_cannot_return): Likewise. (cgraph_set_pure_flag_1): Likewise. (cgraph_set_const_flag_1): Likewise. (cgraph_set_nothrow_flag_1): Likewise. (cgraph_make_node_local_1): Likewise. (cgraph_for_node_and_aliases): Likewise. (cgraph_for_node_thunks_and_aliases): Likewise. (cgraph_node_can_be_local_p): Likewise. (cgraph_node_cannot_be_local_p_1): Likewise. (cgraph_function_body_availability): Likewise. (dump_cgraph_node): Likewise. (cgraph_rtl_info): Likewise. (cgraph_mark_address_taken_node): Likewise. (cgraph_remove_node): Likewise. (cgraph_release_function_body): Likewise. (cgraph_update_edges_for_call_stmt_node): Likewise. (cgraph_redirect_edge_call_stmt_to_callee): Likewise. (cgraph_make_edge_direct): Likewise. (cgraph_resolve_speculation): Likewise. (cgraph_speculative_call_info): Likewise. (cgraph_turn_edge_to_speculative): Likewise. (cgraph_create_edge_1): Likewise. (cgraph_set_call_stmt): Likewise. (cgraph_node_for_asm): Likewise. (cgraph_add_thunk): Likewise. (cgraph_same_body_alias): Likewise. (cgraph_create_function_alias): Likewise. (cgraph_create_node): Likewise. (cgraph_create_empty_node): Likewise. (record_function_versions): Likewise. (used_from_object_file_p): Likewise. * cgraph.h (symtab_can_be_discarded): Likewise. (symtab_real_symbol_p): Likewise. (cgraph_mark_force_output_node): Likewise. (cgraph_edge_recursive_p): Likewise. (symtab_alias_target): Likewise. (varpool_all_refs_explicit_p): Likewise. (varpool_can_remove_if_no_refs): Likewise. (cgraph_only_called_directly_or_aliased_p): Likewise. (cgraph_next_function_with_gimple_body): Likewise. (cgraph_first_function_with_gimple_body): Likewise. (cgraph_function_with_gimple_body_p): Likewise. (cgraph_next_function): Likewise. (cgraph_first_function): Likewise. (cgraph_next_defined_function): Likewise. (cgraph_first_defined_function): Likewise. (varpool_next_defined_variable): Likewise. (varpool_first_defined_variable): Likewise. (varpool_next_static_initializer): Likewise. (varpool_first_static_initializer): Likewise. (varpool_next_variable): Likewise. (varpool_first_variable): Likewise. (varpool_node_name): Likewise. (varpool): Likewise. (cgraph): Likewise. (is_a_helper <varpool_node>::test): Likewise. (is_a_helper <cgraph_node>::test): Likewise. (varpool_variable_node): Likewise. (cgraph_function_or_thunk_node): Likewise. (varpool_alias_target): Likewise. (cgraph_alias_target): Likewise. (cgraph_node_name): Likewise. (varpool_node_asm_name): Likewise. (cgraph_node_asm_name): Likewise. * cgraphbuild.c (remove_cgraph_callee_edges): Likewise. (cgraph_rebuild_references): Likewise. (rebuild_cgraph_edges): Likewise. (record_eh_tables): Likewise. (build_cgraph_edges): Likewise. (mark_store): Likewise. (mark_load): Likewise. (mark_address): Likewise. (record_type_list): Likewise. (record_reference): Likewise. * cgraphclones.c (cgraph_materialize_all_clones): Likewise. (cgraph_materialize_clone): Likewise. (cgraph_function_versioning): Likewise. (cgraph_copy_node_for_versioning): Likewise. (update_call_expr): Likewise. (cgraph_find_replacement_node): Likewise. (cgraph_create_virtual_clone): Likewise. (cgraph_clone_node): Likewise. * cgraphunit.c (compile): Likewise. (output_weakrefs): Likewise. (output_in_order): Likewise. (expand_function): Likewise. (assemble_thunks_and_aliases): Likewise. (expand_thunk): Likewise. (mark_functions_to_output): Likewise. (handle_alias_pairs): Likewise. (analyze_functions): Likewise. (walk_polymorphic_call_targets): Likewise. (varpool_finalize_decl): Likewise. (process_function_and_variable_attributes): Likewise. (cgraph_process_same_body_aliases): Likewise. (analyze_function): Likewise. (cgraph_add_new_function): Likewise. (cgraph_finalize_function): Likewise. (referred_to_p): Likewise. (cgraph_reset_node): Likewise. (cgraph_process_new_functions): Likewise. (enqueue_node): Likewise. (decide_is_symbol_needed): Likewise. * coverage.c (coverage_compute_profile_id): Likewise. * dbxout.c (dbxout_expand_expr): Likewise. * dwarf2out.c (premark_types_used_by_global_vars_helper): Likewise. (reference_to_unused): Likewise. * gimple-fold.c (can_refer_decl_in_current_unit_p): Likewise. * gimplify.c (unvisit_body): Likewise. (unshare_body): Likewise. * ipa-cp.c (ipcp_generate_summary): Likewise. (ipcp_decision_stage): Likewise. (identify_dead_nodes): Likewise. (decide_whether_version_node): Likewise. (decide_about_value): Likewise. (perhaps_add_new_callers): Likewise. (create_specialized_node): Likewise. (update_profiling_info): Likewise. (ipcp_propagate_stage): Likewise. (estimate_local_effects): Likewise. (good_cloning_opportunity_p): Likewise. (devirtualization_time_bonus): Likewise. (propagate_constants_accross_call): Likewise. (initialize_node_lattices): Likewise. (ipcp_cloning_candidate_p): Likewise. (determine_versionability): Likewise. (print_all_lattices): Likewise. (print_lattice): Likewise. (ipcp_discover_new_direct_edges): Likewise. * ipa-devirt.c (ipa_devirt): Likewise. (likely_target_p): Likewise. (update_type_inheritance_graph): Likewise. (possible_polymorphic_call_target_p): Likewise. (dump_possible_polymorphic_call_targets): Likewise. (devirt_variable_node_removal_hook): Likewise. (record_binfo): Likewise. (maybe_record_node): Likewise. (build_type_inheritance_graph): Likewise. * ipa-inline-analysis.c (inline_write_summary): Likewise. (inline_generate_summary): Likewise. (inline_analyze_function): Likewise. (do_estimate_growth): Likewise. (simple_edge_hints): Likewise. (estimate_node_size_and_time): Likewise. (estimate_edge_devirt_benefit): Likewise. (compute_inline_parameters): Likewise. (estimate_function_body_sizes): Likewise. (compute_bb_predicates): Likewise. (initialize_inline_failed): Likewise. (dump_inline_summary): Likewise. (dump_inline_edge_summary): Likewise. * ipa-inline-transform.c (inline_transform): Likewise. (preserve_function_body_p): Likewise. (save_inline_function_body): Likewise. (inline_call): Likewise. (clone_inlined_nodes): Likewise. (can_remove_node_now_p): Likewise. (can_remove_node_now_p_1): Likewise. * ipa-inline.c (early_inliner): Likewise. (early_inline_small_functions): Likewise. (inline_always_inline_functions): Likewise. (ipa_inline): Likewise. (flatten_function): Likewise. (inline_small_functions): Likewise. (speculation_useful_p): Likewise. (recursive_inlining): Likewise. (update_caller_keys): Likewise. (reset_edge_caches): Likewise. (update_edge_key): Likewise. (edge_badness): Likewise. (relative_time_benefit): Likewise. (want_inline_self_recursive_call_p): Likewise. (want_inline_small_function_p): Likewise. (want_early_inline_function_p): Likewise. (num_calls): Likewise. (can_early_inline_edge_p): Likewise. (can_inline_edge_p): Likewise. (report_inline_failed_reason): Likewise. * ipa-profile.c (ipa_profile): Likewise. (ipa_propagate_frequency): Likewise. (ipa_propagate_frequency_1): Likewise. (ipa_profile_generate_summary): Likewise. * ipa-prop.c (ipcp_transform_function): Likewise. (read_replacements_section): Likewise. (ipa_prop_read_section): Likewise. (ipa_modify_call_arguments): Likewise. (ipa_print_node_params): Likewise. (propagate_controlled_uses): Likewise. (update_indirect_edges_after_inlining): Likewise. (remove_described_reference): Likewise. (ipa_make_edge_direct_to_target): Likewise. (ipa_analyze_node): Likewise. (ipa_analyze_params_uses): Likewise. (ipa_compute_jump_functions): Likewise. (ipa_get_callee_param_type): Likewise. (ipa_print_node_jump_functions): Likewise. (ipa_initialize_node_params): Likewise. (ipa_populate_param_decls): Likewise. (ipa_func_spec_opts_forbid_analysis_p): Likewise. (write_agg_replacement_chain): Likewise. (ipa_write_node_info): Likewise. (ipa_edge_duplication_hook): Likewise. (try_decrement_rdesc_refcount): Likewise. * ipa-pure-const.c (propagate_nothrow): Likewise. (propagate_pure_const): Likewise. (pure_const_read_summary): Likewise. (pure_const_write_summary): Likewise. (analyze_function): Likewise. * ipa-ref-inline.h (ipa_ref_referred_ref_list): Likewise. (ipa_ref_referring_ref_list): Likewise. * ipa-ref.c (ipa_clear_stmts_in_references): Likewise. (ipa_remove_stmt_references): Likewise. (ipa_find_reference): Likewise. (ipa_dump_referring): Likewise. (ipa_dump_references): Likewise. (ipa_record_reference): Likewise. * ipa-reference.c (ipa_reference_read_optimization_summary): Likewise. (ipa_reference_write_optimization_summary): Likewise. (write_node_summary_p): Likewise. (propagate): Likewise. (read_write_all_from_decl): Likewise. (generate_summary): Likewise. (analyze_function): Likewise. (propagate_bits): Likewise. (ipa_reference_get_not_written_global): Likewise. (ipa_reference_get_not_read_global): Likewise. * ipa-split.c (execute_split_functions): Likewise. (split_function): Likewise. * ipa-utils.c (ipa_merge_profiles): Likewise. (dump_cgraph_node_set): Likewise. (ipa_reverse_postorder): Likewise. (ipa_edge_within_scc): Likewise. (ipa_get_nodes_in_cycle): Likewise. (ipa_free_postorder_info): Likewise. (ipa_reduced_postorder): Likewise. (searchc): Likewise. (recursive_call_p): Likewise. * ipa.c (ipa_cdtor_merge): Likewise. (record_cdtor_fn): Likewise. (function_and_variable_visibility): Likewise. (varpool_externally_visible_p): Likewise. (cgraph_externally_visible_p): Likewise. (comdat_can_be_unshared_p): Likewise. (comdat_can_be_unshared_p_1): Likewise. (address_taken_from_non_vtable_p): Likewise. (ipa_discover_readonly_nonaddressable_vars): Likewise. (symtab_remove_unreachable_nodes): Likewise. (walk_polymorphic_call_targets): Likewise. (process_references): Likewise. (enqueue_node): Likewise. (has_addr_references_p): Likewise. (cgraph_non_local_node_p_1): Likewise. * is-a.h (varpool_analyze_node): Likewise. * lto-cgraph.c (input_symtab): Likewise. (merge_profile_summaries): Likewise. (input_cgraph_1): Likewise. (input_edge): Likewise. (input_varpool_node): Likewise. (input_node): Likewise. (input_overwrite_node): Likewise. (compute_ltrans_boundary): Likewise. (output_refs): Likewise. (lto_output_varpool_node): Likewise. (lto_output_node): Likewise. (reachable_from_other_partition_p): Likewise. (referenced_from_other_partition_p): Likewise. (lto_output_edge): Likewise. (output_node_opt_summary): Likewise. (add_node_to): Likewise. (reachable_from_this_partition_p): Likewise. (lto_set_symtab_encoder_in_partition): Likewise. (lto_symtab_encoder_in_partition_p): Likewise. (lto_set_symtab_encoder_encode_initializer): Likewise. (lto_symtab_encoder_encode_initializer_p): Likewise. (lto_set_symtab_encoder_encode_body): Likewise. (lto_symtab_encoder_encode_body_p): Likewise. * lto-section-in.c (lto_free_function_in_decl_state_for_node): Likewise. * lto-streamer-in.c (lto_read_body): Likewise. (fixup_call_stmt_edges): Likewise. (fixup_call_stmt_edges_1): Likewise. * lto-streamer-out.c (produce_symtab): Likewise. (output_symbol_p): Likewise. (write_symbol): Likewise. (lto_output): Likewise. (copy_function): Likewise. (output_function): Likewise. * passes.c (function_called_by_processed_nodes_p): Likewise. (ipa_write_optimization_summaries): Likewise. (ipa_write_summaries): Likewise. (do_per_function_toporder): Likewise. (do_per_function): Likewise. (dump_passes): Likewise. * symtab.c (symtab_semantically_equivalent_p): Likewise. (symtab_nonoverwritable_alias): Likewise. (symtab_nonoverwritable_alias_1): Likewise. (symtab_for_node_and_aliases): Likewise. (symtab_resolve_alias): Likewise. (fixup_same_cpp_alias_visibility): Likewise. (symtab_alias_ultimate_target): Likewise. (symtab_used_from_object_file_p): Likewise. (verify_symtab_base): Likewise. (dump_symtab_base): Likewise. (symtab_node_name): Likewise. (symtab_node_asm_name): Likewise. (symtab_dissolve_same_comdat_group_list): Likewise. (symtab_add_to_same_comdat_group): Likewise. (symtab_unregister_node): Likewise. (symtab_insert_node_to_hashtable): Likewise. (symtab_register_node): Likewise. (unlink_from_assembler_name_hash): Likewise. (insert_to_assembler_name_hash): Likewise. (eq_assembler_name): Likewise. (hash_node_by_assembler_name): Likewise. (eq_node): Likewise. (hash_node): Likewise. * toplev.c (wrapup_global_declaration_2): Likewise. * trans-mem.c (ipa_tm_execute): Likewise. (ipa_tm_transform_clone): Likewise. (ipa_tm_transform_transaction): Likewise. (ipa_tm_transform_calls_redirect): Likewise. (ipa_tm_insert_gettmclone_call): Likewise. (ipa_tm_insert_irr_call): Likewise. (ipa_tm_create_version): Likewise. (ipa_tm_create_version_alias): Likewise. (ipa_tm_mark_forced_by_abi_node): Likewise. (ipa_tm_mark_force_output_node): Likewise. (ipa_tm_diagnose_tm_safe): Likewise. (ipa_tm_mayenterirr_function): Likewise. (ipa_tm_scan_irr_function): Likewise. (ipa_tm_note_irrevocable): Likewise. (ipa_tm_scan_calls_clone): Likewise. (get_cg_data): Likewise. * tree-eh.c (tree_could_trap_p): Likewise. * tree-emutls.c (ipa_lower_emutls): Likewise. (create_emultls_var): Likewise. (lower_emutls_function_body): Likewise. (gen_emutls_addr): Likewise. (emutls_decl): Likewise. (new_emutls_decl): Likewise. * tree-inline.c (tree_function_versioning): Likewise. (optimize_inline_calls): Likewise. (expand_call_inline): Likewise. (estimate_num_insns): Likewise. (copy_bb): Likewise. (delete_unreachable_blocks_update_callgraph): Likewise. * tree-nested.c (gimplify_all_functions): Likewise. (create_nesting_tree): Likewise. (check_for_nested_with_variably_modified): Likewise. * tree-pretty-print.c (dump_function_header): Likewise. * tree-profile.c (tree_profiling): Likewise. * tree-sra.c (ipa_sra_preliminary_function_checks): Likewise. (modify_function): Likewise. (convert_callers): Likewise. (convert_callers_for_node): Likewise. * tree-ssa-structalias.c (ipa_pta_execute): Likewise. (associate_varinfo_to_alias): Likewise. (create_variable_info_for): Likewise. (get_constraint_for_ssa_var): Likewise. * tree-vectorizer.c (increase_alignment): Likewise. * tree.c (find_decls_types_in_var): Likewise. (find_decls_types_in_node): Likewise. (free_lang_data_in_decl): Likewise. * value-prof.c (gimple_ic_transform): Likewise. (gimple_ic): Likewise. (check_ic_target): Likewise. (init_node_map): Likewise. * varasm.c (decl_binds_to_current_def_p): Likewise. (default_binds_local_p_1): Likewise. (dump_tm_clone_pairs): Likewise. (assemble_alias): Likewise. (find_decl): Likewise. (mark_decl_referenced): Likewise. * varpool.c (varpool_for_node_and_aliases): Likewise. (varpool_extra_name_alias): Likewise. (varpool_create_variable_alias): Likewise. (add_new_static_var): Likewise. (varpool_finalize_named_section_flags): Likewise. (varpool_remove_unreferenced_decls): Likewise. (enqueue_node): Likewise. (varpool_assemble_decl): Likewise. (assemble_aliases): Likewise. (varpool_analyze_node): Likewise. (cgraph_variable_initializer_availability): Likewise. (varpool_add_new_variable): Likewise. (ctor_for_folding): Likewise. (dump_varpool_node): Likewise. (varpool_remove_initializer): Likewise. (varpool_remove_node): Likewise. (varpool_node_for_decl): Likewise. (varpool_create_empty_node): Likewise. * config/i386/i386.c (ix86_generate_version_dispatcher_body): Likewise. (ix86_get_function_versions_dispatcher): Likewise. gcc/ada/ Patch autogenerated by refactor_symtab.py from https://github.com/davidmalcolm/gcc-refactoring-scripts revision 58bb219cc090b2f4516a9297d868c245495ee622 * gcc-interface/trans.c (finalize_nrv): Update for conversion of symtab types to a true class hierarchy. * gcc-interface/utils.c (gnat_write_global_declarations): Likewise. gcc/c-family/ Patch autogenerated by refactor_symtab.py from https://github.com/davidmalcolm/gcc-refactoring-scripts revision 58bb219cc090b2f4516a9297d868c245495ee622 * c-gimplify.c (c_genericize): Update for conversion of symtab types to a true class hierarchy. * c-pragma.c (maybe_apply_pending_pragma_weaks): Likewise. gcc/cp/ Patch autogenerated by refactor_symtab.py from https://github.com/davidmalcolm/gcc-refactoring-scripts revision 58bb219cc090b2f4516a9297d868c245495ee622 * call.c (mark_versions_used): Update for conversion of symtab types to a true class hierarchy. * decl2.c (cp_write_global_declarations): Likewise. (clear_decl_external): Likewise. (build_java_method_aliases): Likewise. (collect_candidates_for_java_method_aliases): Likewise. (mark_needed): Likewise. (var_finalized_p): Likewise. (maybe_make_one_only): Likewise. (maybe_emit_vtables): Likewise. * lambda.c (maybe_add_lambda_conv_op): Likewise. * method.c (use_thunk): Likewise. * optimize.c (maybe_clone_body): Likewise. * tree.c (cp_fix_function_decl_p): Likewise. gcc/java/ Patch autogenerated by refactor_symtab.py from https://github.com/davidmalcolm/gcc-refactoring-scripts revision 58bb219cc090b2f4516a9297d868c245495ee622 * decl.c (java_mark_decl_local): Update for conversion of symtab types to a true class hierarchy. gcc/lto/ Patch autogenerated by refactor_symtab.py from https://github.com/davidmalcolm/gcc-refactoring-scripts revision 58bb219cc090b2f4516a9297d868c245495ee622 * lto-partition.c (lto_promote_cross_file_statics): Update for conversion of symtab types to a true class hierarchy. (rename_statics): Likewise. (promote_symbol): Likewise. (privatize_symbol_name): Likewise. (lto_balanced_map): Likewise. (varpool_node_cmp): Likewise. (node_cmp): Likewise. (lto_1_to_1_map): Likewise. (undo_partition): Likewise. (add_symbol_to_partition): Likewise. (contained_in_symbol): Likewise. (add_symbol_to_partition_1): Likewise. (add_references_to_partition): Likewise. (symbol_partitioned_p): Likewise. (get_symbol_class): Likewise. (lto_max_map): Likewise. * lto-symtab.c (lto_symtab_prevailing_decl): Likewise. (lto_symtab_merge_symbols): Likewise. (lto_symtab_merge_symbols_1): Likewise. (lto_symtab_merge_decls): Likewise. (lto_symtab_merge_decls_1): Likewise. (lto_symtab_merge_decls_2): Likewise. (lto_symtab_resolve_symbols): Likewise. (lto_symtab_resolve_can_prevail_p): Likewise. (lto_symtab_symbol_p): Likewise. (lto_symtab_resolve_replaceable_p): Likewise. (lto_symtab_merge): Likewise. (lto_varpool_replace_node): Likewise. (lto_cgraph_replace_node): Likewise. * lto.c (lto_main): Likewise. (do_whole_program_analysis): Likewise. (materialize_cgraph): Likewise. (read_cgraph_and_symbols): Likewise. (cmp_partitions_order): Likewise. (lto_materialize_function): Likewise. (has_analyzed_clone_p): Likewise. From-SVN: r204171
2013-10-29 19:30:00 +01:00
first_clone->decl = copy_node (node->decl);
tree-core.h (tree_decl_with_vis): Replace comdat_group by symtab_node pointer. * tree-core.h (tree_decl_with_vis): Replace comdat_group by symtab_node pointer. * tree.c (copy_node_stat): Be sure tonot copy symtab_node pointer. (find_decls_types_r): Do not walk COMDAT_GROUP. * tree.h (DECL_COMDAT_GROUP): Revamp to use decl_comdat_group. * varasm.c (make_decl_one_only): Use set_comdat_group; create node if needed. * ipa-inline-transform.c (save_inline_function_body): Update way we decl->symtab mapping. * symtab.c (symtab_hash, hash_node, eq_node symtab_insert_node_to_hashtable): Remove. (symtab_register_node): Update. (symtab_unregister_node): Update. (symtab_get_node): Reimplement as inline function. (symtab_add_to_same_comdat_group): Update. (symtab_dissolve_same_comdat_group_list): Update. (dump_symtab_base): Update. (verify_symtab_base): Update. (symtab_make_decl_local): Update. (fixup_same_cpp_alias_visibility): Update. (symtab_nonoverwritable_alias): Update. * cgraphclones.c (set_new_clone_decl_and_node_flags): Update. * ipa.c (update_visibility_by_resolution_info): UPdate. * bb-reorder.c: Include cgraph.h * lto-streamer-out.c (DFS_write_tree_body, hash_tree): Do not deal with comdat groups. * ipa-comdats.c (set_comdat_group, ipa_comdats): Update. * cgraph.c (cgraph_get_create_node): Update. * cgraph.h (struct symtab_node): Add get_comdat_group, set_comdat_group and comdat_group_. (symtab_get_node): Make inline. (symtab_insert_node_to_hashtable): Remove. (symtab_can_be_discarded): Update. (decl_comdat_group): New function. * tree-streamer-in.c (lto_input_ts_decl_with_vis_tree_pointers): Update. * lto-cgraph.c (lto_output_node, lto_output_varpool_node): Stream out comdat group name. (read_comdat_group): New function. (input_node, input_varpool_node): Use it. * trans-mem.c (ipa_tm_create_version_alias): Update code creating comdat groups. * mips.c (mips_start_unique_function): Likewise. (ix86_code_end): Likewise. (rs6000_code_end): Likweise. * tree-streamer-out.c (DECL_COMDAT_GROUP): Do not stream comdat group. * lto-symtab.c (lto_symtab_merge_symbols): Update code setting symtab pointer. * lto.c (compare_tree_sccs_1): Do not compare comdat groups. * optmize.c (maybe_thunk_body): Use set_comdat_group. (maybe_clone_body): Likewise. * decl.c (duplicate_decls): Update code duplicating comdat group; do not copy symtab pointer; before freeing newdecl remove it from symtab. * decl2.c (constrain_visibility): Use set_comdat_group. * c-decl.c (merge_decls): Preserve symtab node pointers. (duplicate_decls): Free new decl. From-SVN: r210901
2014-05-25 00:00:14 +02:00
first_clone->decl->decl_with_vis.symtab_node = first_clone;
IPA C++ refactoring 1/N * cgraph.h (symtab_node): (void register_symbol (void)): created from symtab_register_node (void remove (void)): created from symtab_remove_node (void dump (FILE *f)): created from dump_symtab_node (void DEBUG_FUNCTION debug (void)): created from debug_symtab_node (void DEBUG_FUNCTION verify (void)): created from verify_symtab_node (struct ipa_ref *add_reference (symtab_node *referred_node, enum ipa_ref_use use_type)): created from add_reference (struct ipa_ref *add_reference (symtab_node *referred_node, enum ipa_ref_use use_type, gimple stmt)): created from add_reference (struct ipa_ref *maybe_add_reference (tree val, enum ipa_ref_use use_type, gimple stmt)): created from maybe_add_reference (bool semantically_equivalent_p (symtab_node *target)): created from symtab_semantically_equivalent_p (void remove_from_same_comdat_group (void)): created from remove_from_same_comdat_group (void add_to_same_comdat_group (symtab_node *old_node)): created from symtab_add_to_same_comdat_group (void dissolve_same_comdat_group_list (void)): created from symtab_dissolve_same_comdat_group_list (bool used_from_object_file_p (void)): created from symtab_used_from_object_file_p (symtab_node *ultimate_alias_target (enum availability *avail = NULL)): created from symtab_alias_ultimate_target (inline symtab_node *next_defined_symbol (void)): created from symtab_next_defined_symbol (bool resolve_alias (symtab_node *target)): created from symtab_resolve_alias (bool call_for_symbol_and_aliases (bool (*callback) (symtab_node *, void *), void *data, bool include_overwrite)): created from symtab_for_node_and_aliases (symtab_node *noninterposable_alias (void)): created from symtab_nonoverwritable_alias (inline symtab_node *get_alias_target (void)): created from symtab_alias_target (void set_section (const char *section)): created from set_section_1 (enum availability get_availability (void)): created from symtab_node_availability (void make_decl_local (void)): created from symtab_make_decl_local (bool real_symbol_p (void)): created from symtab_read_node (can_be_discarded_p (void)): created from symtab_can_be_discarded (inline bool comdat_local_p (void)): created from symtab_comdat_local_p (inline bool in_same_comdat_group_p (symtab_node *target)): created from symtab_in_same_comdat_p; (bool address_taken_from_non_vtable_p (void)): created from address_taken_from_non_vtable_p (static inline symtab_node *get (const_tree decl)): created from symtab_get_node (static void dump_table (FILE *)): created from dump_symtab (static inline DEBUG_FUNCTION void debug_symtab (void)): created from debug_symtab (static DEBUG_FUNCTION void verify_symtab_nodes (void)): created from verify_symtab (static bool used_from_object_file_p_worker (symtab_node *node)): created from symtab_used_from_object_file_p (void dump_base (FILE *)): created from dump_symtab_base (bool DEBUG_FUNCTION verify_base (void)): created from verify_symtab_base (void unregister (void)): created from symtab_unregister_node (struct symbol_priority_map *priority_info (void)): created from symtab_priority_info (static bool set_implicit_section (symtab_node *n, void *)): created from set_implicit_section (static bool noninterposable_alias (symtab_node *node, void *data)): created from symtab_nonoverwritable_alias_1 * cgraph.h (cgraph_node): (bool remove_symbol_and_inline_clones (cgraph_node *forbidden_node = NULL)): created from cgraph_remove_node_and_inline_clones (void record_stmt_references (gimple stmt)): created from ipa_record_stmt_references (void set_call_stmt_including_clones (gimple old_stmt, gimple new_stmt, bool update_speculative = true)): created from cgraph_set_call_stmt_including_clones (cgraph_node *function_symbol (enum availability *avail = NULL)): created from cgraph_function_node (cgraph_node *create_clone (tree decl, gcov_type count, int freq, bool update_original, vec<cgraph_edge *> redirect_callers, bool call_duplication_hook, struct cgraph_node *new_inlined_to, bitmap args_to_skip)): created from cgraph_create_clone (cgraph_node *create_virtual_clone (vec<cgraph_edge *> redirect_callers, vec<ipa_replace_map *, va_gc> *tree_map, bitmap args_to_skip, const char * suffix)): created from cgraph_create_virtual_clone (cgraph_node *find_replacement (void)): created from cgraph_find_replacement_node (cgraph_node *create_version_clone (tree new_decl, vec<cgraph_edge *> redirect_callers, bitmap bbs_to_copy)): created from cgraph_copy_node_for_versioning (cgraph_node *create_version_clone_with_body (vec<cgraph_edge *> redirect_callers, vec<ipa_replace_map *, va_gc> *tree_map, bitmap args_to_skip, bool skip_return, bitmap bbs_to_copy, basic_block new_entry_block, const char *clone_name)): created from cgraph_function_version_info (struct cgraph_function_version_info *insert_new_function_version (void)): created from insert_new_cgraph_node_version (struct cgraph_function_version_info *function_version (void)): created from get_cgraph_node_version (void analyze (void)): created from analyze_function (cgraph_node * create_thunk (tree alias, tree, bool this_adjusting, HOST_WIDE_INT fixed_offset, HOST_WIDE_INT virtual_value, tree virtual_offset, tree real_alias) cgraph_add_thunk (inline cgraph_node *get_alias_target (void)): created from cgraph_alias_target (cgraph_node *ultimate_alias_target (availability *availability = NULL)): created from cgraph_function_or_thunk_node (bool expand_thunk (bool output_asm_thunks, bool force_gimple_thunk)): created from expand_thunk (void reset (void)): created from cgraph_reset_node (void create_wrapper (cgraph_node *target)): created from cgraph_make_wrapper (void DEBUG_FUNCTION verify_node (void)): created from verify_cgraph_node (void remove (void)): created from cgraph_remove_node (void dump (FILE *f)): created from dump_cgraph_node (void DEBUG_FUNCTION debug (void)): created from debug_cgraph_node (bool get_body (void)): created from cgraph_get_body (void release_body (void)): created from cgraph_release_function_body (void unnest (void)): created from cgraph_unnest_node (void make_local (void)): created from cgraph_make_node_local (void mark_address_taken (void)): created from cgraph_mark_address_taken_node (struct cgraph_edge *create_edge (cgraph_node *callee, gimple call_stmt, gcov_type count, int freq)): created from cgraph_create_edge (struct cgraph_edge *create_indirect_edge (gimple call_stmt, int ecf_flags, gcov_type count, int freq)): created from cgraph_create_indirect_edge (void create_edge_including_clones (struct cgraph_node *callee, gimple old_stmt, gimple stmt, gcov_type count, int freq, cgraph_inline_failed_t reason)): created from cgraph_create_edge_including_clones (cgraph_edge *get_edge (gimple call_stmt)): created from cgraph_edge (vec<cgraph_edge *> collect_callers (void)): created from collect_callers_of_node (void remove_callers (void)): created from cgraph_node_remove_callers (void remove_callees (void)): created from cgraph_node_remove_callees (enum availability get_availability (void)): created from cgraph_function_body_availability (void set_nothrow_flag (bool nothrow)): created from cgraph_set_nothrow_flag (void set_const_flag (bool readonly, bool looping)): created from cgraph_set_const_flag (void set_pure_flag (bool pure, bool looping)): created from cgraph_set_pure_flag (void call_duplication_hooks (cgraph_node *node2)): created from cgraph_call_node_duplication_hooks (bool call_for_symbol_and_aliases (bool (*callback) (cgraph_node *, void *), void *data, bool include_overwritable)): created from cgraph_for_node_and_aliases (bool call_for_symbol_thunks_and_aliases (bool (*callback) (cgraph_node *node, void *data), void *data, bool include_overwritable)): created from cgraph_for_node_thunks_and_aliases (void call_function_insertion_hooks (void)): created from cgraph_call_function_insertion_hooks (inline void mark_force_output (void)): created from cgraph_mark_force_output_node (bool local_p (void)): created from cgraph_local_node (bool can_be_local_p (void)): created from cgraph_node_can_be_local_p (bool cannot_return_p (void)): created from cgraph_node_cannot_return (bool only_called_directly_p (void)): created from cgraph_only_called_directly_p (inline bool only_called_directly_or_aliased_p (void)): created from cgraph_only_called_directly_or_aliased_p (bool will_be_removed_from_program_if_no_direct_calls_p (void)): created from cgraph_will_be_removed_from_program_if_no_direct_calls (bool can_remove_if_no_direct_calls_and_refs_p (void)): created from cgraph_can_remove_if_no_direct_calls_and_refs_p (bool can_remove_if_no_direct_calls_p (void)): created from cgraph_can_remove_if_no_direct_calls_p (inline bool has_gimple_body_p (void)): created from cgraph_function_with_gimple_body_p (bool optimize_for_size_p (void)): created from cgraph_optimize_for_size_p (static void dump_cgraph (FILE *f)): created from dump_cgraph (static inline void debug_cgraph (void)): created from debug_cgraph (static void record_function_versions (tree decl1, tree decl2)): created from record_function_versions (static void delete_function_version (tree decl)): created from delete_function_version (static void add_new_function (tree fndecl, bool lowered)): created from cgraph_add_new_function (static inline cgraph_node *get (const_tree decl)): created from cgraph_get_node (static cgraph_node * create (tree decl)): created from cgraph_create_node (static cgraph_node * create_empty (void)): created from cgraph_create_empty_node (static cgraph_node * get_create (tree)): created from cgraph_get_create_node (static cgraph_node *get_for_asmname (tree asmname)): created from cgraph_node_for_asm (static cgraph_node * create_same_body_alias (tree alias, tree decl)): created from cgraph_same_body_alias (static bool used_from_object_file_p_worker (cgraph_node *node, void *): new function (static bool non_local_p (cgraph_node *node, void *)): created from cgraph_non_local_node_p_1 (static void DEBUG_FUNCTION verify_cgraph_nodes (void)): created from verify_cgraph (static bool make_local (cgraph_node *node, void *)): created from cgraph_make_node_local (static cgraph_node *create_alias (tree alias, tree target)): created from cgraph_create_function_alias (static cgraph_edge * create_edge (cgraph_node *caller, cgraph_node *callee, gimple call_stmt, gcov_type count, int freq, bool indir_unknown_callee)): created from cgraph_create_edge_1 * cgraph.h (varpool_node): (void remove (void)): created from varpool_remove_node (void dump (FILE *f)): created from dump_varpool_node From-SVN: r212982
2014-07-24 14:07:13 +02:00
gcc_assert (first_clone == cgraph_node::get (first_clone->decl));
/* Now reshape the clone tree, so all other clones descends from
first_clone. */
if (first_clone->next_sibling_clone)
{
for (n = first_clone->next_sibling_clone; n->next_sibling_clone;
n = n->next_sibling_clone)
n->clone_of = first_clone;
n->clone_of = first_clone;
n->next_sibling_clone = first_clone->clones;
if (first_clone->clones)
first_clone->clones->prev_sibling_clone = n;
first_clone->clones = first_clone->next_sibling_clone;
first_clone->next_sibling_clone->prev_sibling_clone = NULL;
first_clone->next_sibling_clone = NULL;
gcc_assert (!first_clone->prev_sibling_clone);
}
first_clone->clone_of = NULL;
/* Now node in question has no clones. */
node->clones = NULL;
/* Inline clones share decl with the function they are cloned
from. Walk the whole clone tree and redirect them all to the
new decl. */
if (first_clone->clones)
for (n = first_clone->clones; n != first_clone;)
{
Autogenerated fixes of "->symbol." to "->" This is the autogenerated part of the conversion of the symtable types to a C++ class hierarchy. gcc/ Patch autogenerated by refactor_symtab.py from https://github.com/davidmalcolm/gcc-refactoring-scripts revision 58bb219cc090b2f4516a9297d868c245495ee622 * asan.c (asan_finish_file): Update for conversion of symtab types to a true class hierarchy. * cfgexpand.c (estimated_stack_frame_size): Likewise. * cgraph.c (cgraph_get_body): Likewise. (cgraph_get_create_real_symbol_node): Likewise. (verify_cgraph_node): Likewise. (verify_edge_corresponds_to_fndecl): Likewise. (verify_edge_count_and_frequency): Likewise. (cgraph_will_be_removed_from_program_if_no_direct_calls): Likewise. (cgraph_can_remove_if_no_direct_calls_p): Likewise. (cgraph_can_remove_if_no_direct_calls_and_refs_p): Likewise. (cgraph_node_cannot_return): Likewise. (cgraph_set_pure_flag_1): Likewise. (cgraph_set_const_flag_1): Likewise. (cgraph_set_nothrow_flag_1): Likewise. (cgraph_make_node_local_1): Likewise. (cgraph_for_node_and_aliases): Likewise. (cgraph_for_node_thunks_and_aliases): Likewise. (cgraph_node_can_be_local_p): Likewise. (cgraph_node_cannot_be_local_p_1): Likewise. (cgraph_function_body_availability): Likewise. (dump_cgraph_node): Likewise. (cgraph_rtl_info): Likewise. (cgraph_mark_address_taken_node): Likewise. (cgraph_remove_node): Likewise. (cgraph_release_function_body): Likewise. (cgraph_update_edges_for_call_stmt_node): Likewise. (cgraph_redirect_edge_call_stmt_to_callee): Likewise. (cgraph_make_edge_direct): Likewise. (cgraph_resolve_speculation): Likewise. (cgraph_speculative_call_info): Likewise. (cgraph_turn_edge_to_speculative): Likewise. (cgraph_create_edge_1): Likewise. (cgraph_set_call_stmt): Likewise. (cgraph_node_for_asm): Likewise. (cgraph_add_thunk): Likewise. (cgraph_same_body_alias): Likewise. (cgraph_create_function_alias): Likewise. (cgraph_create_node): Likewise. (cgraph_create_empty_node): Likewise. (record_function_versions): Likewise. (used_from_object_file_p): Likewise. * cgraph.h (symtab_can_be_discarded): Likewise. (symtab_real_symbol_p): Likewise. (cgraph_mark_force_output_node): Likewise. (cgraph_edge_recursive_p): Likewise. (symtab_alias_target): Likewise. (varpool_all_refs_explicit_p): Likewise. (varpool_can_remove_if_no_refs): Likewise. (cgraph_only_called_directly_or_aliased_p): Likewise. (cgraph_next_function_with_gimple_body): Likewise. (cgraph_first_function_with_gimple_body): Likewise. (cgraph_function_with_gimple_body_p): Likewise. (cgraph_next_function): Likewise. (cgraph_first_function): Likewise. (cgraph_next_defined_function): Likewise. (cgraph_first_defined_function): Likewise. (varpool_next_defined_variable): Likewise. (varpool_first_defined_variable): Likewise. (varpool_next_static_initializer): Likewise. (varpool_first_static_initializer): Likewise. (varpool_next_variable): Likewise. (varpool_first_variable): Likewise. (varpool_node_name): Likewise. (varpool): Likewise. (cgraph): Likewise. (is_a_helper <varpool_node>::test): Likewise. (is_a_helper <cgraph_node>::test): Likewise. (varpool_variable_node): Likewise. (cgraph_function_or_thunk_node): Likewise. (varpool_alias_target): Likewise. (cgraph_alias_target): Likewise. (cgraph_node_name): Likewise. (varpool_node_asm_name): Likewise. (cgraph_node_asm_name): Likewise. * cgraphbuild.c (remove_cgraph_callee_edges): Likewise. (cgraph_rebuild_references): Likewise. (rebuild_cgraph_edges): Likewise. (record_eh_tables): Likewise. (build_cgraph_edges): Likewise. (mark_store): Likewise. (mark_load): Likewise. (mark_address): Likewise. (record_type_list): Likewise. (record_reference): Likewise. * cgraphclones.c (cgraph_materialize_all_clones): Likewise. (cgraph_materialize_clone): Likewise. (cgraph_function_versioning): Likewise. (cgraph_copy_node_for_versioning): Likewise. (update_call_expr): Likewise. (cgraph_find_replacement_node): Likewise. (cgraph_create_virtual_clone): Likewise. (cgraph_clone_node): Likewise. * cgraphunit.c (compile): Likewise. (output_weakrefs): Likewise. (output_in_order): Likewise. (expand_function): Likewise. (assemble_thunks_and_aliases): Likewise. (expand_thunk): Likewise. (mark_functions_to_output): Likewise. (handle_alias_pairs): Likewise. (analyze_functions): Likewise. (walk_polymorphic_call_targets): Likewise. (varpool_finalize_decl): Likewise. (process_function_and_variable_attributes): Likewise. (cgraph_process_same_body_aliases): Likewise. (analyze_function): Likewise. (cgraph_add_new_function): Likewise. (cgraph_finalize_function): Likewise. (referred_to_p): Likewise. (cgraph_reset_node): Likewise. (cgraph_process_new_functions): Likewise. (enqueue_node): Likewise. (decide_is_symbol_needed): Likewise. * coverage.c (coverage_compute_profile_id): Likewise. * dbxout.c (dbxout_expand_expr): Likewise. * dwarf2out.c (premark_types_used_by_global_vars_helper): Likewise. (reference_to_unused): Likewise. * gimple-fold.c (can_refer_decl_in_current_unit_p): Likewise. * gimplify.c (unvisit_body): Likewise. (unshare_body): Likewise. * ipa-cp.c (ipcp_generate_summary): Likewise. (ipcp_decision_stage): Likewise. (identify_dead_nodes): Likewise. (decide_whether_version_node): Likewise. (decide_about_value): Likewise. (perhaps_add_new_callers): Likewise. (create_specialized_node): Likewise. (update_profiling_info): Likewise. (ipcp_propagate_stage): Likewise. (estimate_local_effects): Likewise. (good_cloning_opportunity_p): Likewise. (devirtualization_time_bonus): Likewise. (propagate_constants_accross_call): Likewise. (initialize_node_lattices): Likewise. (ipcp_cloning_candidate_p): Likewise. (determine_versionability): Likewise. (print_all_lattices): Likewise. (print_lattice): Likewise. (ipcp_discover_new_direct_edges): Likewise. * ipa-devirt.c (ipa_devirt): Likewise. (likely_target_p): Likewise. (update_type_inheritance_graph): Likewise. (possible_polymorphic_call_target_p): Likewise. (dump_possible_polymorphic_call_targets): Likewise. (devirt_variable_node_removal_hook): Likewise. (record_binfo): Likewise. (maybe_record_node): Likewise. (build_type_inheritance_graph): Likewise. * ipa-inline-analysis.c (inline_write_summary): Likewise. (inline_generate_summary): Likewise. (inline_analyze_function): Likewise. (do_estimate_growth): Likewise. (simple_edge_hints): Likewise. (estimate_node_size_and_time): Likewise. (estimate_edge_devirt_benefit): Likewise. (compute_inline_parameters): Likewise. (estimate_function_body_sizes): Likewise. (compute_bb_predicates): Likewise. (initialize_inline_failed): Likewise. (dump_inline_summary): Likewise. (dump_inline_edge_summary): Likewise. * ipa-inline-transform.c (inline_transform): Likewise. (preserve_function_body_p): Likewise. (save_inline_function_body): Likewise. (inline_call): Likewise. (clone_inlined_nodes): Likewise. (can_remove_node_now_p): Likewise. (can_remove_node_now_p_1): Likewise. * ipa-inline.c (early_inliner): Likewise. (early_inline_small_functions): Likewise. (inline_always_inline_functions): Likewise. (ipa_inline): Likewise. (flatten_function): Likewise. (inline_small_functions): Likewise. (speculation_useful_p): Likewise. (recursive_inlining): Likewise. (update_caller_keys): Likewise. (reset_edge_caches): Likewise. (update_edge_key): Likewise. (edge_badness): Likewise. (relative_time_benefit): Likewise. (want_inline_self_recursive_call_p): Likewise. (want_inline_small_function_p): Likewise. (want_early_inline_function_p): Likewise. (num_calls): Likewise. (can_early_inline_edge_p): Likewise. (can_inline_edge_p): Likewise. (report_inline_failed_reason): Likewise. * ipa-profile.c (ipa_profile): Likewise. (ipa_propagate_frequency): Likewise. (ipa_propagate_frequency_1): Likewise. (ipa_profile_generate_summary): Likewise. * ipa-prop.c (ipcp_transform_function): Likewise. (read_replacements_section): Likewise. (ipa_prop_read_section): Likewise. (ipa_modify_call_arguments): Likewise. (ipa_print_node_params): Likewise. (propagate_controlled_uses): Likewise. (update_indirect_edges_after_inlining): Likewise. (remove_described_reference): Likewise. (ipa_make_edge_direct_to_target): Likewise. (ipa_analyze_node): Likewise. (ipa_analyze_params_uses): Likewise. (ipa_compute_jump_functions): Likewise. (ipa_get_callee_param_type): Likewise. (ipa_print_node_jump_functions): Likewise. (ipa_initialize_node_params): Likewise. (ipa_populate_param_decls): Likewise. (ipa_func_spec_opts_forbid_analysis_p): Likewise. (write_agg_replacement_chain): Likewise. (ipa_write_node_info): Likewise. (ipa_edge_duplication_hook): Likewise. (try_decrement_rdesc_refcount): Likewise. * ipa-pure-const.c (propagate_nothrow): Likewise. (propagate_pure_const): Likewise. (pure_const_read_summary): Likewise. (pure_const_write_summary): Likewise. (analyze_function): Likewise. * ipa-ref-inline.h (ipa_ref_referred_ref_list): Likewise. (ipa_ref_referring_ref_list): Likewise. * ipa-ref.c (ipa_clear_stmts_in_references): Likewise. (ipa_remove_stmt_references): Likewise. (ipa_find_reference): Likewise. (ipa_dump_referring): Likewise. (ipa_dump_references): Likewise. (ipa_record_reference): Likewise. * ipa-reference.c (ipa_reference_read_optimization_summary): Likewise. (ipa_reference_write_optimization_summary): Likewise. (write_node_summary_p): Likewise. (propagate): Likewise. (read_write_all_from_decl): Likewise. (generate_summary): Likewise. (analyze_function): Likewise. (propagate_bits): Likewise. (ipa_reference_get_not_written_global): Likewise. (ipa_reference_get_not_read_global): Likewise. * ipa-split.c (execute_split_functions): Likewise. (split_function): Likewise. * ipa-utils.c (ipa_merge_profiles): Likewise. (dump_cgraph_node_set): Likewise. (ipa_reverse_postorder): Likewise. (ipa_edge_within_scc): Likewise. (ipa_get_nodes_in_cycle): Likewise. (ipa_free_postorder_info): Likewise. (ipa_reduced_postorder): Likewise. (searchc): Likewise. (recursive_call_p): Likewise. * ipa.c (ipa_cdtor_merge): Likewise. (record_cdtor_fn): Likewise. (function_and_variable_visibility): Likewise. (varpool_externally_visible_p): Likewise. (cgraph_externally_visible_p): Likewise. (comdat_can_be_unshared_p): Likewise. (comdat_can_be_unshared_p_1): Likewise. (address_taken_from_non_vtable_p): Likewise. (ipa_discover_readonly_nonaddressable_vars): Likewise. (symtab_remove_unreachable_nodes): Likewise. (walk_polymorphic_call_targets): Likewise. (process_references): Likewise. (enqueue_node): Likewise. (has_addr_references_p): Likewise. (cgraph_non_local_node_p_1): Likewise. * is-a.h (varpool_analyze_node): Likewise. * lto-cgraph.c (input_symtab): Likewise. (merge_profile_summaries): Likewise. (input_cgraph_1): Likewise. (input_edge): Likewise. (input_varpool_node): Likewise. (input_node): Likewise. (input_overwrite_node): Likewise. (compute_ltrans_boundary): Likewise. (output_refs): Likewise. (lto_output_varpool_node): Likewise. (lto_output_node): Likewise. (reachable_from_other_partition_p): Likewise. (referenced_from_other_partition_p): Likewise. (lto_output_edge): Likewise. (output_node_opt_summary): Likewise. (add_node_to): Likewise. (reachable_from_this_partition_p): Likewise. (lto_set_symtab_encoder_in_partition): Likewise. (lto_symtab_encoder_in_partition_p): Likewise. (lto_set_symtab_encoder_encode_initializer): Likewise. (lto_symtab_encoder_encode_initializer_p): Likewise. (lto_set_symtab_encoder_encode_body): Likewise. (lto_symtab_encoder_encode_body_p): Likewise. * lto-section-in.c (lto_free_function_in_decl_state_for_node): Likewise. * lto-streamer-in.c (lto_read_body): Likewise. (fixup_call_stmt_edges): Likewise. (fixup_call_stmt_edges_1): Likewise. * lto-streamer-out.c (produce_symtab): Likewise. (output_symbol_p): Likewise. (write_symbol): Likewise. (lto_output): Likewise. (copy_function): Likewise. (output_function): Likewise. * passes.c (function_called_by_processed_nodes_p): Likewise. (ipa_write_optimization_summaries): Likewise. (ipa_write_summaries): Likewise. (do_per_function_toporder): Likewise. (do_per_function): Likewise. (dump_passes): Likewise. * symtab.c (symtab_semantically_equivalent_p): Likewise. (symtab_nonoverwritable_alias): Likewise. (symtab_nonoverwritable_alias_1): Likewise. (symtab_for_node_and_aliases): Likewise. (symtab_resolve_alias): Likewise. (fixup_same_cpp_alias_visibility): Likewise. (symtab_alias_ultimate_target): Likewise. (symtab_used_from_object_file_p): Likewise. (verify_symtab_base): Likewise. (dump_symtab_base): Likewise. (symtab_node_name): Likewise. (symtab_node_asm_name): Likewise. (symtab_dissolve_same_comdat_group_list): Likewise. (symtab_add_to_same_comdat_group): Likewise. (symtab_unregister_node): Likewise. (symtab_insert_node_to_hashtable): Likewise. (symtab_register_node): Likewise. (unlink_from_assembler_name_hash): Likewise. (insert_to_assembler_name_hash): Likewise. (eq_assembler_name): Likewise. (hash_node_by_assembler_name): Likewise. (eq_node): Likewise. (hash_node): Likewise. * toplev.c (wrapup_global_declaration_2): Likewise. * trans-mem.c (ipa_tm_execute): Likewise. (ipa_tm_transform_clone): Likewise. (ipa_tm_transform_transaction): Likewise. (ipa_tm_transform_calls_redirect): Likewise. (ipa_tm_insert_gettmclone_call): Likewise. (ipa_tm_insert_irr_call): Likewise. (ipa_tm_create_version): Likewise. (ipa_tm_create_version_alias): Likewise. (ipa_tm_mark_forced_by_abi_node): Likewise. (ipa_tm_mark_force_output_node): Likewise. (ipa_tm_diagnose_tm_safe): Likewise. (ipa_tm_mayenterirr_function): Likewise. (ipa_tm_scan_irr_function): Likewise. (ipa_tm_note_irrevocable): Likewise. (ipa_tm_scan_calls_clone): Likewise. (get_cg_data): Likewise. * tree-eh.c (tree_could_trap_p): Likewise. * tree-emutls.c (ipa_lower_emutls): Likewise. (create_emultls_var): Likewise. (lower_emutls_function_body): Likewise. (gen_emutls_addr): Likewise. (emutls_decl): Likewise. (new_emutls_decl): Likewise. * tree-inline.c (tree_function_versioning): Likewise. (optimize_inline_calls): Likewise. (expand_call_inline): Likewise. (estimate_num_insns): Likewise. (copy_bb): Likewise. (delete_unreachable_blocks_update_callgraph): Likewise. * tree-nested.c (gimplify_all_functions): Likewise. (create_nesting_tree): Likewise. (check_for_nested_with_variably_modified): Likewise. * tree-pretty-print.c (dump_function_header): Likewise. * tree-profile.c (tree_profiling): Likewise. * tree-sra.c (ipa_sra_preliminary_function_checks): Likewise. (modify_function): Likewise. (convert_callers): Likewise. (convert_callers_for_node): Likewise. * tree-ssa-structalias.c (ipa_pta_execute): Likewise. (associate_varinfo_to_alias): Likewise. (create_variable_info_for): Likewise. (get_constraint_for_ssa_var): Likewise. * tree-vectorizer.c (increase_alignment): Likewise. * tree.c (find_decls_types_in_var): Likewise. (find_decls_types_in_node): Likewise. (free_lang_data_in_decl): Likewise. * value-prof.c (gimple_ic_transform): Likewise. (gimple_ic): Likewise. (check_ic_target): Likewise. (init_node_map): Likewise. * varasm.c (decl_binds_to_current_def_p): Likewise. (default_binds_local_p_1): Likewise. (dump_tm_clone_pairs): Likewise. (assemble_alias): Likewise. (find_decl): Likewise. (mark_decl_referenced): Likewise. * varpool.c (varpool_for_node_and_aliases): Likewise. (varpool_extra_name_alias): Likewise. (varpool_create_variable_alias): Likewise. (add_new_static_var): Likewise. (varpool_finalize_named_section_flags): Likewise. (varpool_remove_unreferenced_decls): Likewise. (enqueue_node): Likewise. (varpool_assemble_decl): Likewise. (assemble_aliases): Likewise. (varpool_analyze_node): Likewise. (cgraph_variable_initializer_availability): Likewise. (varpool_add_new_variable): Likewise. (ctor_for_folding): Likewise. (dump_varpool_node): Likewise. (varpool_remove_initializer): Likewise. (varpool_remove_node): Likewise. (varpool_node_for_decl): Likewise. (varpool_create_empty_node): Likewise. * config/i386/i386.c (ix86_generate_version_dispatcher_body): Likewise. (ix86_get_function_versions_dispatcher): Likewise. gcc/ada/ Patch autogenerated by refactor_symtab.py from https://github.com/davidmalcolm/gcc-refactoring-scripts revision 58bb219cc090b2f4516a9297d868c245495ee622 * gcc-interface/trans.c (finalize_nrv): Update for conversion of symtab types to a true class hierarchy. * gcc-interface/utils.c (gnat_write_global_declarations): Likewise. gcc/c-family/ Patch autogenerated by refactor_symtab.py from https://github.com/davidmalcolm/gcc-refactoring-scripts revision 58bb219cc090b2f4516a9297d868c245495ee622 * c-gimplify.c (c_genericize): Update for conversion of symtab types to a true class hierarchy. * c-pragma.c (maybe_apply_pending_pragma_weaks): Likewise. gcc/cp/ Patch autogenerated by refactor_symtab.py from https://github.com/davidmalcolm/gcc-refactoring-scripts revision 58bb219cc090b2f4516a9297d868c245495ee622 * call.c (mark_versions_used): Update for conversion of symtab types to a true class hierarchy. * decl2.c (cp_write_global_declarations): Likewise. (clear_decl_external): Likewise. (build_java_method_aliases): Likewise. (collect_candidates_for_java_method_aliases): Likewise. (mark_needed): Likewise. (var_finalized_p): Likewise. (maybe_make_one_only): Likewise. (maybe_emit_vtables): Likewise. * lambda.c (maybe_add_lambda_conv_op): Likewise. * method.c (use_thunk): Likewise. * optimize.c (maybe_clone_body): Likewise. * tree.c (cp_fix_function_decl_p): Likewise. gcc/java/ Patch autogenerated by refactor_symtab.py from https://github.com/davidmalcolm/gcc-refactoring-scripts revision 58bb219cc090b2f4516a9297d868c245495ee622 * decl.c (java_mark_decl_local): Update for conversion of symtab types to a true class hierarchy. gcc/lto/ Patch autogenerated by refactor_symtab.py from https://github.com/davidmalcolm/gcc-refactoring-scripts revision 58bb219cc090b2f4516a9297d868c245495ee622 * lto-partition.c (lto_promote_cross_file_statics): Update for conversion of symtab types to a true class hierarchy. (rename_statics): Likewise. (promote_symbol): Likewise. (privatize_symbol_name): Likewise. (lto_balanced_map): Likewise. (varpool_node_cmp): Likewise. (node_cmp): Likewise. (lto_1_to_1_map): Likewise. (undo_partition): Likewise. (add_symbol_to_partition): Likewise. (contained_in_symbol): Likewise. (add_symbol_to_partition_1): Likewise. (add_references_to_partition): Likewise. (symbol_partitioned_p): Likewise. (get_symbol_class): Likewise. (lto_max_map): Likewise. * lto-symtab.c (lto_symtab_prevailing_decl): Likewise. (lto_symtab_merge_symbols): Likewise. (lto_symtab_merge_symbols_1): Likewise. (lto_symtab_merge_decls): Likewise. (lto_symtab_merge_decls_1): Likewise. (lto_symtab_merge_decls_2): Likewise. (lto_symtab_resolve_symbols): Likewise. (lto_symtab_resolve_can_prevail_p): Likewise. (lto_symtab_symbol_p): Likewise. (lto_symtab_resolve_replaceable_p): Likewise. (lto_symtab_merge): Likewise. (lto_varpool_replace_node): Likewise. (lto_cgraph_replace_node): Likewise. * lto.c (lto_main): Likewise. (do_whole_program_analysis): Likewise. (materialize_cgraph): Likewise. (read_cgraph_and_symbols): Likewise. (cmp_partitions_order): Likewise. (lto_materialize_function): Likewise. (has_analyzed_clone_p): Likewise. From-SVN: r204171
2013-10-29 19:30:00 +01:00
gcc_assert (n->decl == node->decl);
n->decl = first_clone->decl;
if (n->clones)
n = n->clones;
else if (n->next_sibling_clone)
n = n->next_sibling_clone;
else
{
while (n != first_clone && !n->next_sibling_clone)
n = n->clone_of;
if (n != first_clone)
n = n->next_sibling_clone;
}
}
/* Copy the OLD_VERSION_NODE function tree to the new version. */
Autogenerated fixes of "->symbol." to "->" This is the autogenerated part of the conversion of the symtable types to a C++ class hierarchy. gcc/ Patch autogenerated by refactor_symtab.py from https://github.com/davidmalcolm/gcc-refactoring-scripts revision 58bb219cc090b2f4516a9297d868c245495ee622 * asan.c (asan_finish_file): Update for conversion of symtab types to a true class hierarchy. * cfgexpand.c (estimated_stack_frame_size): Likewise. * cgraph.c (cgraph_get_body): Likewise. (cgraph_get_create_real_symbol_node): Likewise. (verify_cgraph_node): Likewise. (verify_edge_corresponds_to_fndecl): Likewise. (verify_edge_count_and_frequency): Likewise. (cgraph_will_be_removed_from_program_if_no_direct_calls): Likewise. (cgraph_can_remove_if_no_direct_calls_p): Likewise. (cgraph_can_remove_if_no_direct_calls_and_refs_p): Likewise. (cgraph_node_cannot_return): Likewise. (cgraph_set_pure_flag_1): Likewise. (cgraph_set_const_flag_1): Likewise. (cgraph_set_nothrow_flag_1): Likewise. (cgraph_make_node_local_1): Likewise. (cgraph_for_node_and_aliases): Likewise. (cgraph_for_node_thunks_and_aliases): Likewise. (cgraph_node_can_be_local_p): Likewise. (cgraph_node_cannot_be_local_p_1): Likewise. (cgraph_function_body_availability): Likewise. (dump_cgraph_node): Likewise. (cgraph_rtl_info): Likewise. (cgraph_mark_address_taken_node): Likewise. (cgraph_remove_node): Likewise. (cgraph_release_function_body): Likewise. (cgraph_update_edges_for_call_stmt_node): Likewise. (cgraph_redirect_edge_call_stmt_to_callee): Likewise. (cgraph_make_edge_direct): Likewise. (cgraph_resolve_speculation): Likewise. (cgraph_speculative_call_info): Likewise. (cgraph_turn_edge_to_speculative): Likewise. (cgraph_create_edge_1): Likewise. (cgraph_set_call_stmt): Likewise. (cgraph_node_for_asm): Likewise. (cgraph_add_thunk): Likewise. (cgraph_same_body_alias): Likewise. (cgraph_create_function_alias): Likewise. (cgraph_create_node): Likewise. (cgraph_create_empty_node): Likewise. (record_function_versions): Likewise. (used_from_object_file_p): Likewise. * cgraph.h (symtab_can_be_discarded): Likewise. (symtab_real_symbol_p): Likewise. (cgraph_mark_force_output_node): Likewise. (cgraph_edge_recursive_p): Likewise. (symtab_alias_target): Likewise. (varpool_all_refs_explicit_p): Likewise. (varpool_can_remove_if_no_refs): Likewise. (cgraph_only_called_directly_or_aliased_p): Likewise. (cgraph_next_function_with_gimple_body): Likewise. (cgraph_first_function_with_gimple_body): Likewise. (cgraph_function_with_gimple_body_p): Likewise. (cgraph_next_function): Likewise. (cgraph_first_function): Likewise. (cgraph_next_defined_function): Likewise. (cgraph_first_defined_function): Likewise. (varpool_next_defined_variable): Likewise. (varpool_first_defined_variable): Likewise. (varpool_next_static_initializer): Likewise. (varpool_first_static_initializer): Likewise. (varpool_next_variable): Likewise. (varpool_first_variable): Likewise. (varpool_node_name): Likewise. (varpool): Likewise. (cgraph): Likewise. (is_a_helper <varpool_node>::test): Likewise. (is_a_helper <cgraph_node>::test): Likewise. (varpool_variable_node): Likewise. (cgraph_function_or_thunk_node): Likewise. (varpool_alias_target): Likewise. (cgraph_alias_target): Likewise. (cgraph_node_name): Likewise. (varpool_node_asm_name): Likewise. (cgraph_node_asm_name): Likewise. * cgraphbuild.c (remove_cgraph_callee_edges): Likewise. (cgraph_rebuild_references): Likewise. (rebuild_cgraph_edges): Likewise. (record_eh_tables): Likewise. (build_cgraph_edges): Likewise. (mark_store): Likewise. (mark_load): Likewise. (mark_address): Likewise. (record_type_list): Likewise. (record_reference): Likewise. * cgraphclones.c (cgraph_materialize_all_clones): Likewise. (cgraph_materialize_clone): Likewise. (cgraph_function_versioning): Likewise. (cgraph_copy_node_for_versioning): Likewise. (update_call_expr): Likewise. (cgraph_find_replacement_node): Likewise. (cgraph_create_virtual_clone): Likewise. (cgraph_clone_node): Likewise. * cgraphunit.c (compile): Likewise. (output_weakrefs): Likewise. (output_in_order): Likewise. (expand_function): Likewise. (assemble_thunks_and_aliases): Likewise. (expand_thunk): Likewise. (mark_functions_to_output): Likewise. (handle_alias_pairs): Likewise. (analyze_functions): Likewise. (walk_polymorphic_call_targets): Likewise. (varpool_finalize_decl): Likewise. (process_function_and_variable_attributes): Likewise. (cgraph_process_same_body_aliases): Likewise. (analyze_function): Likewise. (cgraph_add_new_function): Likewise. (cgraph_finalize_function): Likewise. (referred_to_p): Likewise. (cgraph_reset_node): Likewise. (cgraph_process_new_functions): Likewise. (enqueue_node): Likewise. (decide_is_symbol_needed): Likewise. * coverage.c (coverage_compute_profile_id): Likewise. * dbxout.c (dbxout_expand_expr): Likewise. * dwarf2out.c (premark_types_used_by_global_vars_helper): Likewise. (reference_to_unused): Likewise. * gimple-fold.c (can_refer_decl_in_current_unit_p): Likewise. * gimplify.c (unvisit_body): Likewise. (unshare_body): Likewise. * ipa-cp.c (ipcp_generate_summary): Likewise. (ipcp_decision_stage): Likewise. (identify_dead_nodes): Likewise. (decide_whether_version_node): Likewise. (decide_about_value): Likewise. (perhaps_add_new_callers): Likewise. (create_specialized_node): Likewise. (update_profiling_info): Likewise. (ipcp_propagate_stage): Likewise. (estimate_local_effects): Likewise. (good_cloning_opportunity_p): Likewise. (devirtualization_time_bonus): Likewise. (propagate_constants_accross_call): Likewise. (initialize_node_lattices): Likewise. (ipcp_cloning_candidate_p): Likewise. (determine_versionability): Likewise. (print_all_lattices): Likewise. (print_lattice): Likewise. (ipcp_discover_new_direct_edges): Likewise. * ipa-devirt.c (ipa_devirt): Likewise. (likely_target_p): Likewise. (update_type_inheritance_graph): Likewise. (possible_polymorphic_call_target_p): Likewise. (dump_possible_polymorphic_call_targets): Likewise. (devirt_variable_node_removal_hook): Likewise. (record_binfo): Likewise. (maybe_record_node): Likewise. (build_type_inheritance_graph): Likewise. * ipa-inline-analysis.c (inline_write_summary): Likewise. (inline_generate_summary): Likewise. (inline_analyze_function): Likewise. (do_estimate_growth): Likewise. (simple_edge_hints): Likewise. (estimate_node_size_and_time): Likewise. (estimate_edge_devirt_benefit): Likewise. (compute_inline_parameters): Likewise. (estimate_function_body_sizes): Likewise. (compute_bb_predicates): Likewise. (initialize_inline_failed): Likewise. (dump_inline_summary): Likewise. (dump_inline_edge_summary): Likewise. * ipa-inline-transform.c (inline_transform): Likewise. (preserve_function_body_p): Likewise. (save_inline_function_body): Likewise. (inline_call): Likewise. (clone_inlined_nodes): Likewise. (can_remove_node_now_p): Likewise. (can_remove_node_now_p_1): Likewise. * ipa-inline.c (early_inliner): Likewise. (early_inline_small_functions): Likewise. (inline_always_inline_functions): Likewise. (ipa_inline): Likewise. (flatten_function): Likewise. (inline_small_functions): Likewise. (speculation_useful_p): Likewise. (recursive_inlining): Likewise. (update_caller_keys): Likewise. (reset_edge_caches): Likewise. (update_edge_key): Likewise. (edge_badness): Likewise. (relative_time_benefit): Likewise. (want_inline_self_recursive_call_p): Likewise. (want_inline_small_function_p): Likewise. (want_early_inline_function_p): Likewise. (num_calls): Likewise. (can_early_inline_edge_p): Likewise. (can_inline_edge_p): Likewise. (report_inline_failed_reason): Likewise. * ipa-profile.c (ipa_profile): Likewise. (ipa_propagate_frequency): Likewise. (ipa_propagate_frequency_1): Likewise. (ipa_profile_generate_summary): Likewise. * ipa-prop.c (ipcp_transform_function): Likewise. (read_replacements_section): Likewise. (ipa_prop_read_section): Likewise. (ipa_modify_call_arguments): Likewise. (ipa_print_node_params): Likewise. (propagate_controlled_uses): Likewise. (update_indirect_edges_after_inlining): Likewise. (remove_described_reference): Likewise. (ipa_make_edge_direct_to_target): Likewise. (ipa_analyze_node): Likewise. (ipa_analyze_params_uses): Likewise. (ipa_compute_jump_functions): Likewise. (ipa_get_callee_param_type): Likewise. (ipa_print_node_jump_functions): Likewise. (ipa_initialize_node_params): Likewise. (ipa_populate_param_decls): Likewise. (ipa_func_spec_opts_forbid_analysis_p): Likewise. (write_agg_replacement_chain): Likewise. (ipa_write_node_info): Likewise. (ipa_edge_duplication_hook): Likewise. (try_decrement_rdesc_refcount): Likewise. * ipa-pure-const.c (propagate_nothrow): Likewise. (propagate_pure_const): Likewise. (pure_const_read_summary): Likewise. (pure_const_write_summary): Likewise. (analyze_function): Likewise. * ipa-ref-inline.h (ipa_ref_referred_ref_list): Likewise. (ipa_ref_referring_ref_list): Likewise. * ipa-ref.c (ipa_clear_stmts_in_references): Likewise. (ipa_remove_stmt_references): Likewise. (ipa_find_reference): Likewise. (ipa_dump_referring): Likewise. (ipa_dump_references): Likewise. (ipa_record_reference): Likewise. * ipa-reference.c (ipa_reference_read_optimization_summary): Likewise. (ipa_reference_write_optimization_summary): Likewise. (write_node_summary_p): Likewise. (propagate): Likewise. (read_write_all_from_decl): Likewise. (generate_summary): Likewise. (analyze_function): Likewise. (propagate_bits): Likewise. (ipa_reference_get_not_written_global): Likewise. (ipa_reference_get_not_read_global): Likewise. * ipa-split.c (execute_split_functions): Likewise. (split_function): Likewise. * ipa-utils.c (ipa_merge_profiles): Likewise. (dump_cgraph_node_set): Likewise. (ipa_reverse_postorder): Likewise. (ipa_edge_within_scc): Likewise. (ipa_get_nodes_in_cycle): Likewise. (ipa_free_postorder_info): Likewise. (ipa_reduced_postorder): Likewise. (searchc): Likewise. (recursive_call_p): Likewise. * ipa.c (ipa_cdtor_merge): Likewise. (record_cdtor_fn): Likewise. (function_and_variable_visibility): Likewise. (varpool_externally_visible_p): Likewise. (cgraph_externally_visible_p): Likewise. (comdat_can_be_unshared_p): Likewise. (comdat_can_be_unshared_p_1): Likewise. (address_taken_from_non_vtable_p): Likewise. (ipa_discover_readonly_nonaddressable_vars): Likewise. (symtab_remove_unreachable_nodes): Likewise. (walk_polymorphic_call_targets): Likewise. (process_references): Likewise. (enqueue_node): Likewise. (has_addr_references_p): Likewise. (cgraph_non_local_node_p_1): Likewise. * is-a.h (varpool_analyze_node): Likewise. * lto-cgraph.c (input_symtab): Likewise. (merge_profile_summaries): Likewise. (input_cgraph_1): Likewise. (input_edge): Likewise. (input_varpool_node): Likewise. (input_node): Likewise. (input_overwrite_node): Likewise. (compute_ltrans_boundary): Likewise. (output_refs): Likewise. (lto_output_varpool_node): Likewise. (lto_output_node): Likewise. (reachable_from_other_partition_p): Likewise. (referenced_from_other_partition_p): Likewise. (lto_output_edge): Likewise. (output_node_opt_summary): Likewise. (add_node_to): Likewise. (reachable_from_this_partition_p): Likewise. (lto_set_symtab_encoder_in_partition): Likewise. (lto_symtab_encoder_in_partition_p): Likewise. (lto_set_symtab_encoder_encode_initializer): Likewise. (lto_symtab_encoder_encode_initializer_p): Likewise. (lto_set_symtab_encoder_encode_body): Likewise. (lto_symtab_encoder_encode_body_p): Likewise. * lto-section-in.c (lto_free_function_in_decl_state_for_node): Likewise. * lto-streamer-in.c (lto_read_body): Likewise. (fixup_call_stmt_edges): Likewise. (fixup_call_stmt_edges_1): Likewise. * lto-streamer-out.c (produce_symtab): Likewise. (output_symbol_p): Likewise. (write_symbol): Likewise. (lto_output): Likewise. (copy_function): Likewise. (output_function): Likewise. * passes.c (function_called_by_processed_nodes_p): Likewise. (ipa_write_optimization_summaries): Likewise. (ipa_write_summaries): Likewise. (do_per_function_toporder): Likewise. (do_per_function): Likewise. (dump_passes): Likewise. * symtab.c (symtab_semantically_equivalent_p): Likewise. (symtab_nonoverwritable_alias): Likewise. (symtab_nonoverwritable_alias_1): Likewise. (symtab_for_node_and_aliases): Likewise. (symtab_resolve_alias): Likewise. (fixup_same_cpp_alias_visibility): Likewise. (symtab_alias_ultimate_target): Likewise. (symtab_used_from_object_file_p): Likewise. (verify_symtab_base): Likewise. (dump_symtab_base): Likewise. (symtab_node_name): Likewise. (symtab_node_asm_name): Likewise. (symtab_dissolve_same_comdat_group_list): Likewise. (symtab_add_to_same_comdat_group): Likewise. (symtab_unregister_node): Likewise. (symtab_insert_node_to_hashtable): Likewise. (symtab_register_node): Likewise. (unlink_from_assembler_name_hash): Likewise. (insert_to_assembler_name_hash): Likewise. (eq_assembler_name): Likewise. (hash_node_by_assembler_name): Likewise. (eq_node): Likewise. (hash_node): Likewise. * toplev.c (wrapup_global_declaration_2): Likewise. * trans-mem.c (ipa_tm_execute): Likewise. (ipa_tm_transform_clone): Likewise. (ipa_tm_transform_transaction): Likewise. (ipa_tm_transform_calls_redirect): Likewise. (ipa_tm_insert_gettmclone_call): Likewise. (ipa_tm_insert_irr_call): Likewise. (ipa_tm_create_version): Likewise. (ipa_tm_create_version_alias): Likewise. (ipa_tm_mark_forced_by_abi_node): Likewise. (ipa_tm_mark_force_output_node): Likewise. (ipa_tm_diagnose_tm_safe): Likewise. (ipa_tm_mayenterirr_function): Likewise. (ipa_tm_scan_irr_function): Likewise. (ipa_tm_note_irrevocable): Likewise. (ipa_tm_scan_calls_clone): Likewise. (get_cg_data): Likewise. * tree-eh.c (tree_could_trap_p): Likewise. * tree-emutls.c (ipa_lower_emutls): Likewise. (create_emultls_var): Likewise. (lower_emutls_function_body): Likewise. (gen_emutls_addr): Likewise. (emutls_decl): Likewise. (new_emutls_decl): Likewise. * tree-inline.c (tree_function_versioning): Likewise. (optimize_inline_calls): Likewise. (expand_call_inline): Likewise. (estimate_num_insns): Likewise. (copy_bb): Likewise. (delete_unreachable_blocks_update_callgraph): Likewise. * tree-nested.c (gimplify_all_functions): Likewise. (create_nesting_tree): Likewise. (check_for_nested_with_variably_modified): Likewise. * tree-pretty-print.c (dump_function_header): Likewise. * tree-profile.c (tree_profiling): Likewise. * tree-sra.c (ipa_sra_preliminary_function_checks): Likewise. (modify_function): Likewise. (convert_callers): Likewise. (convert_callers_for_node): Likewise. * tree-ssa-structalias.c (ipa_pta_execute): Likewise. (associate_varinfo_to_alias): Likewise. (create_variable_info_for): Likewise. (get_constraint_for_ssa_var): Likewise. * tree-vectorizer.c (increase_alignment): Likewise. * tree.c (find_decls_types_in_var): Likewise. (find_decls_types_in_node): Likewise. (free_lang_data_in_decl): Likewise. * value-prof.c (gimple_ic_transform): Likewise. (gimple_ic): Likewise. (check_ic_target): Likewise. (init_node_map): Likewise. * varasm.c (decl_binds_to_current_def_p): Likewise. (default_binds_local_p_1): Likewise. (dump_tm_clone_pairs): Likewise. (assemble_alias): Likewise. (find_decl): Likewise. (mark_decl_referenced): Likewise. * varpool.c (varpool_for_node_and_aliases): Likewise. (varpool_extra_name_alias): Likewise. (varpool_create_variable_alias): Likewise. (add_new_static_var): Likewise. (varpool_finalize_named_section_flags): Likewise. (varpool_remove_unreferenced_decls): Likewise. (enqueue_node): Likewise. (varpool_assemble_decl): Likewise. (assemble_aliases): Likewise. (varpool_analyze_node): Likewise. (cgraph_variable_initializer_availability): Likewise. (varpool_add_new_variable): Likewise. (ctor_for_folding): Likewise. (dump_varpool_node): Likewise. (varpool_remove_initializer): Likewise. (varpool_remove_node): Likewise. (varpool_node_for_decl): Likewise. (varpool_create_empty_node): Likewise. * config/i386/i386.c (ix86_generate_version_dispatcher_body): Likewise. (ix86_get_function_versions_dispatcher): Likewise. gcc/ada/ Patch autogenerated by refactor_symtab.py from https://github.com/davidmalcolm/gcc-refactoring-scripts revision 58bb219cc090b2f4516a9297d868c245495ee622 * gcc-interface/trans.c (finalize_nrv): Update for conversion of symtab types to a true class hierarchy. * gcc-interface/utils.c (gnat_write_global_declarations): Likewise. gcc/c-family/ Patch autogenerated by refactor_symtab.py from https://github.com/davidmalcolm/gcc-refactoring-scripts revision 58bb219cc090b2f4516a9297d868c245495ee622 * c-gimplify.c (c_genericize): Update for conversion of symtab types to a true class hierarchy. * c-pragma.c (maybe_apply_pending_pragma_weaks): Likewise. gcc/cp/ Patch autogenerated by refactor_symtab.py from https://github.com/davidmalcolm/gcc-refactoring-scripts revision 58bb219cc090b2f4516a9297d868c245495ee622 * call.c (mark_versions_used): Update for conversion of symtab types to a true class hierarchy. * decl2.c (cp_write_global_declarations): Likewise. (clear_decl_external): Likewise. (build_java_method_aliases): Likewise. (collect_candidates_for_java_method_aliases): Likewise. (mark_needed): Likewise. (var_finalized_p): Likewise. (maybe_make_one_only): Likewise. (maybe_emit_vtables): Likewise. * lambda.c (maybe_add_lambda_conv_op): Likewise. * method.c (use_thunk): Likewise. * optimize.c (maybe_clone_body): Likewise. * tree.c (cp_fix_function_decl_p): Likewise. gcc/java/ Patch autogenerated by refactor_symtab.py from https://github.com/davidmalcolm/gcc-refactoring-scripts revision 58bb219cc090b2f4516a9297d868c245495ee622 * decl.c (java_mark_decl_local): Update for conversion of symtab types to a true class hierarchy. gcc/lto/ Patch autogenerated by refactor_symtab.py from https://github.com/davidmalcolm/gcc-refactoring-scripts revision 58bb219cc090b2f4516a9297d868c245495ee622 * lto-partition.c (lto_promote_cross_file_statics): Update for conversion of symtab types to a true class hierarchy. (rename_statics): Likewise. (promote_symbol): Likewise. (privatize_symbol_name): Likewise. (lto_balanced_map): Likewise. (varpool_node_cmp): Likewise. (node_cmp): Likewise. (lto_1_to_1_map): Likewise. (undo_partition): Likewise. (add_symbol_to_partition): Likewise. (contained_in_symbol): Likewise. (add_symbol_to_partition_1): Likewise. (add_references_to_partition): Likewise. (symbol_partitioned_p): Likewise. (get_symbol_class): Likewise. (lto_max_map): Likewise. * lto-symtab.c (lto_symtab_prevailing_decl): Likewise. (lto_symtab_merge_symbols): Likewise. (lto_symtab_merge_symbols_1): Likewise. (lto_symtab_merge_decls): Likewise. (lto_symtab_merge_decls_1): Likewise. (lto_symtab_merge_decls_2): Likewise. (lto_symtab_resolve_symbols): Likewise. (lto_symtab_resolve_can_prevail_p): Likewise. (lto_symtab_symbol_p): Likewise. (lto_symtab_resolve_replaceable_p): Likewise. (lto_symtab_merge): Likewise. (lto_varpool_replace_node): Likewise. (lto_cgraph_replace_node): Likewise. * lto.c (lto_main): Likewise. (do_whole_program_analysis): Likewise. (materialize_cgraph): Likewise. (read_cgraph_and_symbols): Likewise. (cmp_partitions_order): Likewise. (lto_materialize_function): Likewise. (has_analyzed_clone_p): Likewise. From-SVN: r204171
2013-10-29 19:30:00 +01:00
tree_function_versioning (node->decl, first_clone->decl,
This patch rewrites the old VEC macro-based interface into a new one based on the template class 'vec'. This patch rewrites the old VEC macro-based interface into a new one based on the template class 'vec'. The user-visible changes are described in http://gcc.gnu.org/wiki/cxx-conversion/cxx-vec. I have tested the patch pretty extensively: - Regular bootstraps on x86_64, ppc, ia64, sparc and hppa. - Bootstraps with --enable-checking=release - Bootstraps with --enable-checking=gc,gcac - Basic builds on all targets (using contrib/config-list.mk). We no longer access the vectors via VEC_* macros. The pattern is "VEC_operation (T, A, V, args)" becomes "V.operation (args)". The only thing I could not do is create proper ctors and dtors for the vec class. Since these vectors are stored in unions, we have to keep them as PODs (C++03 does not allow non-PODs in unions). This means that creation and destruction must be explicit. There is a new method vec<type, allocation, layout>::create() and another vec<type, allocation, layout>::destroy() to allocate the internal vector. For vectors that must be pointers, there is a family of free functions that implement the operations that need to tolerate NULL vectors. These functions all start with the prefix 'vec_safe_'. See the wiki page for details. The gengtype change removes the special handling for VEC() that used to exist in gengtype. Additionally, it allows gengtype to recognize templates of more than one argument and introduces the concept of an undefined type (useful for template arguments that may or may not be types). When a TYPE_UNDEFINED is reached, gengtype will ignore it if it happens inside a type marked with GTY((user)). Otherwise, it will emit an error. Finally, gengtype rejects root types marked GTY((user)) that are not first class pointers. 2012-11-16 Diego Novillo <dnovillo@google.com> VEC API overhaul (http://gcc.gnu.org/wiki/cxx-conversion/cxx-vec) * vec.c (register_overhead): Convert it into member function of vec_prefix. (release_overhead): Likewise. (calculate_allocation): Likewise. (vec_heap_free): Remove. (vec_gc_o_reserve_1): Remove. (vec_heap_o_reserve_1): Remove. (vec_stack_o_reserve_1): Remove. (vec_stack_o_reserve_exact): Remove. (register_stack_vec): New. (stack_vec_register_index): New. (unregister_stack_vec): New. (vec_assert_fail): Remove. * vec.h: Conditionally include ggc.h. Document conditional hackery. Update top-level documentation. (ALONE_VEC_CHECK_INFO): Remove. (VEC_CHECK_INFO): Remove. (ALONE_VEC_CHECK_DECL): Remove. (VEC_CHECK_DECL): Remove. (ALONE_VEC_CHECK_PASS): Remove. (VEC_CHECK_PASS): Remove. (VEC_ASSERT): Remove. (vec_prefix): Add friends va_gc, va_gc_atomic, va_heap and va_stack. Mark fields alloc_ and num_ as protected. (struct vec_t): Remove. Remove all function members. (struct vl_embed): Declare. (struct vl_ptr): Declare. (free): Remove. (reserve_exact): Remove. (reserve): Remove. (safe_splice): Remove. (safe_push): Remove. (safe_grow): Remove. (safe_grow_cleared): Remove. (safe_insert): Remove. (DEF_VEC_I): Remove. (DEF_VEC_ALLOC_I): Remove. (DEF_VEC_P): Remove. (DEF_VEC_ALLOC_P): Remove. (DEF_VEC_O): Remove. (DEF_VEC_ALLOC_O): Remove. (DEF_VEC_ALLOC_P_STACK): Remove. (DEF_VEC_ALLOC_O_STACK): Remove. (DEF_VEC_ALLOC_I_STACK): Remove. (DEF_VEC_A): Remove. (DEF_VEC_ALLOC_A): Remove. (vec_stack_p_reserve_exact_1): Remove. (vec_stack_o_reserve): Remove. (vec_stack_o_reserve_exact): Remove. (VEC_length): Remove. (VEC_empty): Remove. (VEC_address): Remove. (vec_address): Remove. (VEC_last): Remove. (VEC_index): Remove. (VEC_iterate): Remove. (VEC_embedded_size): Remove. (VEC_embedded_init): Remove. (VEC_free): Remove. (VEC_copy): Remove. (VEC_space): Remove. (VEC_reserve): Remove. (VEC_reserve_exact): Remove. (VEC_splice): Remove. (VEC_safe_splice): Remove. (VEC_quick_push): Remove. (VEC_safe_push): Remove. (VEC_pop): Remove. (VEC_truncate): Remove. (VEC_safe_grow): Remove. (VEC_replace): Remove. (VEC_quick_insert): Remove. (VEC_safe_insert): Remove. (VEC_ordered_remove): Remove. (VEC_unordered_remove): Remove. (VEC_block_remove): Remove. (VEC_lower_bound): Remove. (VEC_alloc): Remove. (VEC_qsort): Remove. (va_heap): Declare. (va_heap::default_layout): New typedef to vl_ptr. (va_heap::reserve): New. (va_heap::release): New. (va_gc): Declare. (va_gc::default_layout): New typedef to vl_embed. (va_gc::reserve): New. (va_gc::release): New. (va_gc_atomic): Declare. Inherit from va_gc. (va_stack): Declare. (va_stack::default_layout): New typedef to vl_ptr. (va_stack::alloc): New. (va_stack::reserve): New. (va_stack::release): New. (register_stack_vec): Declare. (stack_vec_register_index): Declare. (unregister_stack_vec): Declare. (vec<T, A = va_heap, L = typename A::default_layout>): Declare empty vec template. (vec<T, A, vl_embed>): Partial specialization for embedded layout. (vec<T, A, vl_embed>::allocated): New. (vec<T, A, vl_embed>::length): New. (vec<T, A, vl_embed>::is_empty): New. (vec<T, A, vl_embed>::address): New. (vec<T, A, vl_embed>::operator[]): New. (vec<T, A, vl_embed>::last New. (vec<T, A, vl_embed>::space): New. (vec<T, A, vl_embed>::iterate): New. (vec<T, A, vl_embed>::iterate): New. (vec<T, A, vl_embed>::copy): New. (vec<T, A, vl_embed>::splice): New. (vec<T, A, vl_embed>::quick_push New. (vec<T, A, vl_embed>::pop New. (vec<T, A, vl_embed>::truncate): New. (vec<T, A, vl_embed>::quick_insert): New. (vec<T, A, vl_embed>::ordered_remove): New. (vec<T, A, vl_embed>::unordered_remove): New. (vec<T, A, vl_embed>::block_remove): New. (vec<T, A, vl_embed>::qsort): New. (vec<T, A, vl_embed>::lower_bound): New. (vec<T, A, vl_embed>::embedded_size): New. (vec<T, A, vl_embed>::embedded_init): New. (vec<T, A, vl_embed>::quick_grow): New. (vec<T, A, vl_embed>::quick_grow_cleared): New. (vec_safe_space): New. (vec_safe_length): New. (vec_safe_address): New. (vec_safe_is_empty): New. (vec_safe_reserve): New. (vec_safe_reserve_exact): New. (vec_alloc): New. (vec_free): New. (vec_safe_grow): New. (vec_safe_grow_cleared): New. (vec_safe_iterate): New. (vec_safe_push): New. (vec_safe_insert): New. (vec_safe_truncate): New. (vec_safe_copy): New. (vec_safe_splice): New. (vec<T, A, vl_ptr>): New partial specialization for the space efficient layout. (vec<T, A, vl_ptr>::exists): New. (vec<T, A, vl_ptr>::is_empty): New. (vec<T, A, vl_ptr>::length): New. (vec<T, A, vl_ptr>::address): New. (vec<T, A, vl_ptr>::operator[]): New. (vec<T, A, vl_ptr>::operator!=): New. (vec<T, A, vl_ptr>::operator==): New. (vec<T, A, vl_ptr>::last): New. (vec<T, A, vl_ptr>::space): New. (vec<T, A, vl_ptr>::iterate): New. (vec<T, A, vl_ptr>::copy): New. (vec<T, A, vl_ptr>::reserve): New. (vec<T, A, vl_ptr>::reserve_exact): New. (vec<T, A, vl_ptr>::splice): New. (vec<T, A, vl_ptr>::safe_splice): New. (vec<T, A, vl_ptr>::quick_push): New. (vec<T, A, vl_ptr>::safe_push): New. (vec<T, A, vl_ptr>::pop): New. (vec<T, A, vl_ptr>::truncate): New. (vec<T, A, vl_ptr>::safe_grow): New. (vec<T, A, vl_ptr>::safe_grow_cleared): New. (vec<T, A, vl_ptr>::quick_grow): New. (vec<T, A, vl_ptr>::quick_grow_cleared): New. (vec<T, A, vl_ptr>::quick_insert): New. (vec<T, A, vl_ptr>::safe_insert): New. (vec<T, A, vl_ptr>::ordered_remove): New. (vec<T, A, vl_ptr>::unordered_remove): New. (vec<T, A, vl_ptr>::block_remove): New. (vec<T, A, vl_ptr>::qsort): New. (vec<T, A, vl_ptr>::lower_bound): New. (vec_stack_alloc): Define. (FOR_EACH_VEC_SAFE_ELT): Define. * vecir.h: Remove. Update all users. * vecprim.h: Remove. Update all users. Move uchar to coretypes.h. * Makefile.in (VEC_H): Add $(GGC_H). Remove vecir.h and vecprim.h dependencies everywhere. 2012-11-16 Diego Novillo <dnovillo@google.com> * gengtype-lex.l (VEC): Remove. Add characters in the set [\!\>\.-]. * gengtype-parse.c (token_names): Remove "VEC". (require_template_declaration): Remove handling of VEC_TOKEN. (type): Likewise. Call create_user_defined_type when parsing GTY((user)). * gengtype-state.c (type_lineloc): handle TYPE_UNDEFINED. (write_state_undefined_type): New. (write_state_type): Call write_state_undefined_type for TYPE_UNDEFINED. (read_state_type): Call read_state_undefined_type for TYPE_UNDEFINED. * gengtype.c (dbgprint_count_type_at): Handle TYPE_UNDEFINED. (create_user_defined_type): Make extern. (type_for_name): Factor out of resolve_typedef. (create_undefined_type): New (resolve_typedef): Call it when we cannot find a previous typedef and the type is not a template. (find_structure): Accept TYPE_UNDEFINED. (set_gc_used_type): Add argument ALLOWED_UNDEFINED_TYPES, default to false. Emit an error for TYPE_UNDEFINED unless LEVEL is GC_UNUSED or ALLOWED_UNDEFINED_TYPES is set. Set ALLOWED_UNDEFINED_TYPES to true for TYPE_USER_STRUCT. (filter_type_name): Accept templates with more than one argument. (output_mangled_typename): Handle TYPE_UNDEFINED (walk_type): Likewise. (write_types_process_field): Likewise. (write_func_for_structure): If CHAIN_NEXT is set, ORIG_S should not be a user-defined type. (write_types_local_user_process_field): Handle TYPE_ARRAY, TYPE_NONE and TYPE_UNDEFINED. (write_types_local_process_field): Likewise. (contains_scalar_p): Return 0 for TYPE_USER_STRUCT. (write_root): Reject user-defined types that are not pointers. Handle TYPE_NONE, TYPE_UNDEFINED, TYPE_UNION, TYPE_LANG_STRUCT and TYPE_PARAM_STRUCT. (output_typename): Handle TYPE_NONE, TYPE_UNDEFINED, and TYPE_ARRAY. (dump_typekind): Handle TYPE_UNDEFINED. * gengtype.h (enum typekind): Add TYPE_UNDEFINED. (create_user_defined_type): Declare. (enum gty_token): Remove VEC_TOKEN. 2012-11-16 Diego Novillo <dnovillo@google.com> Adjust for new vec API (http://gcc.gnu.org/wiki/cxx-conversion/cxx-vec) * coretypes.h (uchar): Define. * alias.c: Use new vec API in vec.h. * asan.c: Likewise. * attribs.c: Likewise. * basic-block.h: Likewise. * bb-reorder.c: Likewise. * builtins.c: Likewise. * calls.c: Likewise. * cfg.c: Likewise. * cfganal.c: Likewise. * cfgcleanup.c: Likewise. * cfgexpand.c: Likewise. * cfghooks.c: Likewise. * cfghooks.h: Likewise. * cfgloop.c: Likewise. * cfgloop.h: Likewise. * cfgloopanal.c: Likewise. * cfgloopmanip.c: Likewise. * cfgrtl.c: Likewise. * cgraph.c: Likewise. * cgraph.h: Likewise. * cgraphclones.c: Likewise. * cgraphunit.c: Likewise. * combine.c: Likewise. * compare-elim.c: Likewise. * coverage.c: Likewise. * cprop.c: Likewise. * data-streamer.h: Likewise. * dbxout.c: Likewise. * dce.c: Likewise. * df-core.c: Likewise. * df-problems.c: Likewise. * df-scan.c: Likewise. * dominance.c: Likewise. * domwalk.c: Likewise. * domwalk.h: Likewise. * dse.c: Likewise. * dwarf2cfi.c: Likewise. * dwarf2out.c: Likewise. * dwarf2out.h: Likewise. * emit-rtl.c: Likewise. * except.c: Likewise. * except.h: Likewise. * expr.c: Likewise. * expr.h: Likewise. * final.c: Likewise. * fold-const.c: Likewise. * function.c: Likewise. * function.h: Likewise. * fwprop.c: Likewise. * gcc.c: Likewise. * gcse.c: Likewise. * genattr.c: Likewise. * genattrtab.c: Likewise. * genautomata.c: Likewise. * genextract.c: Likewise. * genopinit.c: Likewise * ggc-common.c: Likewise. * ggc.h: Likewise. * gimple-low.c: Likewise. * gimple-ssa-strength-reduction.c: Likewise. * gimple-streamer-in.c: Likewise. * gimple.c: Likewise. * gimple.h: Likewise. * gimplify.c: Likewise. * graph.c: Likewise. * graphds.c: Likewise. * graphds.h: Likewise. * graphite-blocking.c: Likewise. * graphite-clast-to-gimple.c: Likewise. * graphite-dependences.c: Likewise. * graphite-interchange.c: Likewise. * graphite-optimize-isl.c: Likewise. * graphite-poly.c: Likewise. * graphite-poly.h: Likewise. * graphite-scop-detection.c: Likewise. * graphite-scop-detection.h: Likewise. * graphite-sese-to-poly.c: Likewise. * graphite.c: Likewise. * godump.c: Likewise. * haifa-sched.c: Likewise. * hw-doloop.c: Likewise. * hw-doloop.h: Likewise. * ifcvt.c: Likewise. * insn-addr.h: Likewise. * ipa-cp.c: Likewise. * ipa-inline-analysis.c: Likewise. * ipa-inline-transform.c: Likewise. * ipa-inline.c: Likewise. * ipa-inline.h: Likewise. * ipa-prop.c: Likewise. * ipa-prop.h: Likewise. * ipa-pure-const.c: Likewise. * ipa-ref-inline.h: Likewise. * ipa-ref.c: Likewise. * ipa-ref.h: Likewise. * ipa-reference.c: Likewise. * ipa-split.c: Likewise. * ipa-utils.c: Likewise. * ipa-utils.h: Likewise. * ipa.c: Likewise. * ira-build.c: Likewise. * ira-color.c: Likewise. * ira-emit.c: Likewise. * ira-int.h: Likewise. * ira.c: Likewise. * loop-invariant.c: Likewise. * loop-unroll.c: Likewise. * lower-subreg.c: Likewise. * lra-lives.c: Likewise. * lra.c: Likewise. * lto-cgraph.c: Likewise. * lto-section-out.c: Likewise. * lto-streamer-in.c: Likewise. * lto-streamer-out.c: Likewise. * lto-streamer.h: Likewise. * lto-symtab.c: Likewise. * mcf.c: Likewise. * modulo-sched.c: Likewise. * omp-low.c: Likewise. * opts-common.c: Likewise. * opts-global.c: Likewise. * opts.c: Likewise. * opts.h: Likewise. * passes.c: Likewise. * predict.c: Likewise. * print-tree.c: Likewise. * profile.c: Likewise. * profile.h: Likewise. * read-rtl.c: Likewise. * ree.c: Likewise. * reg-stack.c: Likewise. * regrename.c: Likewise. * regrename.h: Likewise. * reload.c: Likewise. * reload.h: Likewise. * reload1.c: Likewise. * rtl.h: Likewise. * sched-deps.c: Likewise. * sched-int.h: Likewise. * sdbout.c: Likewise. * sel-sched-dump.c: Likewise. * sel-sched-ir.c: Likewise. * sel-sched-ir.h: Likewise. * sel-sched.c: Likewise. * sese.c: Likewise. * sese.h: Likewise. * statistics.h: Likewise. * stmt.c: Likewise. * stor-layout.c: Likewise. * store-motion.c: Likewise. * tlink.c: Likewise. * toplev.c: Likewise. * trans-mem.c: Likewise. * tree-browser.c: Likewise. * tree-call-cdce.c: Likewise. * tree-cfg.c: Likewise. * tree-cfgcleanup.c: Likewise. * tree-chrec.c: Likewise. * tree-chrec.h: Likewise. * tree-complex.c: Likewise. * tree-data-ref.c: Likewise. * tree-data-ref.h: Likewise. * tree-dfa.c: Likewise. * tree-diagnostic.c: Likewise. * tree-dump.c: Likewise. * tree-eh.c: Likewise. * tree-emutls.c: Likewise. * tree-flow.h: Likewise. * tree-if-conv.c: Likewise. * tree-inline.c: Likewise. * tree-inline.h: Likewise. * tree-into-ssa.c: Likewise. * tree-iterator.c: Likewise. * tree-loop-distribution.c: Likewise. * tree-mudflap.c: Likewise. * tree-optimize.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-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-dce.c: Likewise. * tree-ssa-dom.c: Likewise. * tree-ssa-forwprop.c: Likewise. * tree-ssa-live.c: Likewise. * tree-ssa-live.h: 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-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-sccvn.h: Likewise. * tree-ssa-strlen.c: Likewise. * tree-ssa-structalias.c: Likewise. * tree-ssa-tail-merge.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-streamer.h: Likewise. * tree-switch-conversion.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-vectorizer.h: Likewise. * tree-vrp.c: Likewise. * tree.c: Likewise. * tree.h: Likewise. * value-prof.c: Likewise. * value-prof.h: Likewise. * var-tracking.c: Likewise. * varasm.c: Likewise. * varpool.c: Likewise. * vmsdbgout.c: Likewise. * config/bfin/bfin.c: Likewise. * config/c6x/c6x.c: Likewise. * config/darwin.c: Likewise. * config/i386/i386.c: Likewise. * config/ia64/ia64.c: Likewise. * config/mep/mep.c: Likewise. * config/mips/mips.c: Likewise. * config/pa/pa.c: Likewise. * config/rs6000/rs6000-c.c: Likewise. * config/rs6000/rs6000.c: Likewise. * config/rx/rx.c: Likewise. * config/spu/spu-c.c: Likewise. * config/vms/vms.c: Likewise. * config/vxworks.c: Likewise. * config/epiphany/resolve-sw-modes.c: Likewise. From-SVN: r193595
2012-11-18 03:54:30 +01:00
NULL, true, NULL, false,
NULL, NULL);
/* The function will be short lived and removed after we inline all the clones,
but make it internal so we won't confuse ourself. */
Autogenerated fixes of "->symbol." to "->" This is the autogenerated part of the conversion of the symtable types to a C++ class hierarchy. gcc/ Patch autogenerated by refactor_symtab.py from https://github.com/davidmalcolm/gcc-refactoring-scripts revision 58bb219cc090b2f4516a9297d868c245495ee622 * asan.c (asan_finish_file): Update for conversion of symtab types to a true class hierarchy. * cfgexpand.c (estimated_stack_frame_size): Likewise. * cgraph.c (cgraph_get_body): Likewise. (cgraph_get_create_real_symbol_node): Likewise. (verify_cgraph_node): Likewise. (verify_edge_corresponds_to_fndecl): Likewise. (verify_edge_count_and_frequency): Likewise. (cgraph_will_be_removed_from_program_if_no_direct_calls): Likewise. (cgraph_can_remove_if_no_direct_calls_p): Likewise. (cgraph_can_remove_if_no_direct_calls_and_refs_p): Likewise. (cgraph_node_cannot_return): Likewise. (cgraph_set_pure_flag_1): Likewise. (cgraph_set_const_flag_1): Likewise. (cgraph_set_nothrow_flag_1): Likewise. (cgraph_make_node_local_1): Likewise. (cgraph_for_node_and_aliases): Likewise. (cgraph_for_node_thunks_and_aliases): Likewise. (cgraph_node_can_be_local_p): Likewise. (cgraph_node_cannot_be_local_p_1): Likewise. (cgraph_function_body_availability): Likewise. (dump_cgraph_node): Likewise. (cgraph_rtl_info): Likewise. (cgraph_mark_address_taken_node): Likewise. (cgraph_remove_node): Likewise. (cgraph_release_function_body): Likewise. (cgraph_update_edges_for_call_stmt_node): Likewise. (cgraph_redirect_edge_call_stmt_to_callee): Likewise. (cgraph_make_edge_direct): Likewise. (cgraph_resolve_speculation): Likewise. (cgraph_speculative_call_info): Likewise. (cgraph_turn_edge_to_speculative): Likewise. (cgraph_create_edge_1): Likewise. (cgraph_set_call_stmt): Likewise. (cgraph_node_for_asm): Likewise. (cgraph_add_thunk): Likewise. (cgraph_same_body_alias): Likewise. (cgraph_create_function_alias): Likewise. (cgraph_create_node): Likewise. (cgraph_create_empty_node): Likewise. (record_function_versions): Likewise. (used_from_object_file_p): Likewise. * cgraph.h (symtab_can_be_discarded): Likewise. (symtab_real_symbol_p): Likewise. (cgraph_mark_force_output_node): Likewise. (cgraph_edge_recursive_p): Likewise. (symtab_alias_target): Likewise. (varpool_all_refs_explicit_p): Likewise. (varpool_can_remove_if_no_refs): Likewise. (cgraph_only_called_directly_or_aliased_p): Likewise. (cgraph_next_function_with_gimple_body): Likewise. (cgraph_first_function_with_gimple_body): Likewise. (cgraph_function_with_gimple_body_p): Likewise. (cgraph_next_function): Likewise. (cgraph_first_function): Likewise. (cgraph_next_defined_function): Likewise. (cgraph_first_defined_function): Likewise. (varpool_next_defined_variable): Likewise. (varpool_first_defined_variable): Likewise. (varpool_next_static_initializer): Likewise. (varpool_first_static_initializer): Likewise. (varpool_next_variable): Likewise. (varpool_first_variable): Likewise. (varpool_node_name): Likewise. (varpool): Likewise. (cgraph): Likewise. (is_a_helper <varpool_node>::test): Likewise. (is_a_helper <cgraph_node>::test): Likewise. (varpool_variable_node): Likewise. (cgraph_function_or_thunk_node): Likewise. (varpool_alias_target): Likewise. (cgraph_alias_target): Likewise. (cgraph_node_name): Likewise. (varpool_node_asm_name): Likewise. (cgraph_node_asm_name): Likewise. * cgraphbuild.c (remove_cgraph_callee_edges): Likewise. (cgraph_rebuild_references): Likewise. (rebuild_cgraph_edges): Likewise. (record_eh_tables): Likewise. (build_cgraph_edges): Likewise. (mark_store): Likewise. (mark_load): Likewise. (mark_address): Likewise. (record_type_list): Likewise. (record_reference): Likewise. * cgraphclones.c (cgraph_materialize_all_clones): Likewise. (cgraph_materialize_clone): Likewise. (cgraph_function_versioning): Likewise. (cgraph_copy_node_for_versioning): Likewise. (update_call_expr): Likewise. (cgraph_find_replacement_node): Likewise. (cgraph_create_virtual_clone): Likewise. (cgraph_clone_node): Likewise. * cgraphunit.c (compile): Likewise. (output_weakrefs): Likewise. (output_in_order): Likewise. (expand_function): Likewise. (assemble_thunks_and_aliases): Likewise. (expand_thunk): Likewise. (mark_functions_to_output): Likewise. (handle_alias_pairs): Likewise. (analyze_functions): Likewise. (walk_polymorphic_call_targets): Likewise. (varpool_finalize_decl): Likewise. (process_function_and_variable_attributes): Likewise. (cgraph_process_same_body_aliases): Likewise. (analyze_function): Likewise. (cgraph_add_new_function): Likewise. (cgraph_finalize_function): Likewise. (referred_to_p): Likewise. (cgraph_reset_node): Likewise. (cgraph_process_new_functions): Likewise. (enqueue_node): Likewise. (decide_is_symbol_needed): Likewise. * coverage.c (coverage_compute_profile_id): Likewise. * dbxout.c (dbxout_expand_expr): Likewise. * dwarf2out.c (premark_types_used_by_global_vars_helper): Likewise. (reference_to_unused): Likewise. * gimple-fold.c (can_refer_decl_in_current_unit_p): Likewise. * gimplify.c (unvisit_body): Likewise. (unshare_body): Likewise. * ipa-cp.c (ipcp_generate_summary): Likewise. (ipcp_decision_stage): Likewise. (identify_dead_nodes): Likewise. (decide_whether_version_node): Likewise. (decide_about_value): Likewise. (perhaps_add_new_callers): Likewise. (create_specialized_node): Likewise. (update_profiling_info): Likewise. (ipcp_propagate_stage): Likewise. (estimate_local_effects): Likewise. (good_cloning_opportunity_p): Likewise. (devirtualization_time_bonus): Likewise. (propagate_constants_accross_call): Likewise. (initialize_node_lattices): Likewise. (ipcp_cloning_candidate_p): Likewise. (determine_versionability): Likewise. (print_all_lattices): Likewise. (print_lattice): Likewise. (ipcp_discover_new_direct_edges): Likewise. * ipa-devirt.c (ipa_devirt): Likewise. (likely_target_p): Likewise. (update_type_inheritance_graph): Likewise. (possible_polymorphic_call_target_p): Likewise. (dump_possible_polymorphic_call_targets): Likewise. (devirt_variable_node_removal_hook): Likewise. (record_binfo): Likewise. (maybe_record_node): Likewise. (build_type_inheritance_graph): Likewise. * ipa-inline-analysis.c (inline_write_summary): Likewise. (inline_generate_summary): Likewise. (inline_analyze_function): Likewise. (do_estimate_growth): Likewise. (simple_edge_hints): Likewise. (estimate_node_size_and_time): Likewise. (estimate_edge_devirt_benefit): Likewise. (compute_inline_parameters): Likewise. (estimate_function_body_sizes): Likewise. (compute_bb_predicates): Likewise. (initialize_inline_failed): Likewise. (dump_inline_summary): Likewise. (dump_inline_edge_summary): Likewise. * ipa-inline-transform.c (inline_transform): Likewise. (preserve_function_body_p): Likewise. (save_inline_function_body): Likewise. (inline_call): Likewise. (clone_inlined_nodes): Likewise. (can_remove_node_now_p): Likewise. (can_remove_node_now_p_1): Likewise. * ipa-inline.c (early_inliner): Likewise. (early_inline_small_functions): Likewise. (inline_always_inline_functions): Likewise. (ipa_inline): Likewise. (flatten_function): Likewise. (inline_small_functions): Likewise. (speculation_useful_p): Likewise. (recursive_inlining): Likewise. (update_caller_keys): Likewise. (reset_edge_caches): Likewise. (update_edge_key): Likewise. (edge_badness): Likewise. (relative_time_benefit): Likewise. (want_inline_self_recursive_call_p): Likewise. (want_inline_small_function_p): Likewise. (want_early_inline_function_p): Likewise. (num_calls): Likewise. (can_early_inline_edge_p): Likewise. (can_inline_edge_p): Likewise. (report_inline_failed_reason): Likewise. * ipa-profile.c (ipa_profile): Likewise. (ipa_propagate_frequency): Likewise. (ipa_propagate_frequency_1): Likewise. (ipa_profile_generate_summary): Likewise. * ipa-prop.c (ipcp_transform_function): Likewise. (read_replacements_section): Likewise. (ipa_prop_read_section): Likewise. (ipa_modify_call_arguments): Likewise. (ipa_print_node_params): Likewise. (propagate_controlled_uses): Likewise. (update_indirect_edges_after_inlining): Likewise. (remove_described_reference): Likewise. (ipa_make_edge_direct_to_target): Likewise. (ipa_analyze_node): Likewise. (ipa_analyze_params_uses): Likewise. (ipa_compute_jump_functions): Likewise. (ipa_get_callee_param_type): Likewise. (ipa_print_node_jump_functions): Likewise. (ipa_initialize_node_params): Likewise. (ipa_populate_param_decls): Likewise. (ipa_func_spec_opts_forbid_analysis_p): Likewise. (write_agg_replacement_chain): Likewise. (ipa_write_node_info): Likewise. (ipa_edge_duplication_hook): Likewise. (try_decrement_rdesc_refcount): Likewise. * ipa-pure-const.c (propagate_nothrow): Likewise. (propagate_pure_const): Likewise. (pure_const_read_summary): Likewise. (pure_const_write_summary): Likewise. (analyze_function): Likewise. * ipa-ref-inline.h (ipa_ref_referred_ref_list): Likewise. (ipa_ref_referring_ref_list): Likewise. * ipa-ref.c (ipa_clear_stmts_in_references): Likewise. (ipa_remove_stmt_references): Likewise. (ipa_find_reference): Likewise. (ipa_dump_referring): Likewise. (ipa_dump_references): Likewise. (ipa_record_reference): Likewise. * ipa-reference.c (ipa_reference_read_optimization_summary): Likewise. (ipa_reference_write_optimization_summary): Likewise. (write_node_summary_p): Likewise. (propagate): Likewise. (read_write_all_from_decl): Likewise. (generate_summary): Likewise. (analyze_function): Likewise. (propagate_bits): Likewise. (ipa_reference_get_not_written_global): Likewise. (ipa_reference_get_not_read_global): Likewise. * ipa-split.c (execute_split_functions): Likewise. (split_function): Likewise. * ipa-utils.c (ipa_merge_profiles): Likewise. (dump_cgraph_node_set): Likewise. (ipa_reverse_postorder): Likewise. (ipa_edge_within_scc): Likewise. (ipa_get_nodes_in_cycle): Likewise. (ipa_free_postorder_info): Likewise. (ipa_reduced_postorder): Likewise. (searchc): Likewise. (recursive_call_p): Likewise. * ipa.c (ipa_cdtor_merge): Likewise. (record_cdtor_fn): Likewise. (function_and_variable_visibility): Likewise. (varpool_externally_visible_p): Likewise. (cgraph_externally_visible_p): Likewise. (comdat_can_be_unshared_p): Likewise. (comdat_can_be_unshared_p_1): Likewise. (address_taken_from_non_vtable_p): Likewise. (ipa_discover_readonly_nonaddressable_vars): Likewise. (symtab_remove_unreachable_nodes): Likewise. (walk_polymorphic_call_targets): Likewise. (process_references): Likewise. (enqueue_node): Likewise. (has_addr_references_p): Likewise. (cgraph_non_local_node_p_1): Likewise. * is-a.h (varpool_analyze_node): Likewise. * lto-cgraph.c (input_symtab): Likewise. (merge_profile_summaries): Likewise. (input_cgraph_1): Likewise. (input_edge): Likewise. (input_varpool_node): Likewise. (input_node): Likewise. (input_overwrite_node): Likewise. (compute_ltrans_boundary): Likewise. (output_refs): Likewise. (lto_output_varpool_node): Likewise. (lto_output_node): Likewise. (reachable_from_other_partition_p): Likewise. (referenced_from_other_partition_p): Likewise. (lto_output_edge): Likewise. (output_node_opt_summary): Likewise. (add_node_to): Likewise. (reachable_from_this_partition_p): Likewise. (lto_set_symtab_encoder_in_partition): Likewise. (lto_symtab_encoder_in_partition_p): Likewise. (lto_set_symtab_encoder_encode_initializer): Likewise. (lto_symtab_encoder_encode_initializer_p): Likewise. (lto_set_symtab_encoder_encode_body): Likewise. (lto_symtab_encoder_encode_body_p): Likewise. * lto-section-in.c (lto_free_function_in_decl_state_for_node): Likewise. * lto-streamer-in.c (lto_read_body): Likewise. (fixup_call_stmt_edges): Likewise. (fixup_call_stmt_edges_1): Likewise. * lto-streamer-out.c (produce_symtab): Likewise. (output_symbol_p): Likewise. (write_symbol): Likewise. (lto_output): Likewise. (copy_function): Likewise. (output_function): Likewise. * passes.c (function_called_by_processed_nodes_p): Likewise. (ipa_write_optimization_summaries): Likewise. (ipa_write_summaries): Likewise. (do_per_function_toporder): Likewise. (do_per_function): Likewise. (dump_passes): Likewise. * symtab.c (symtab_semantically_equivalent_p): Likewise. (symtab_nonoverwritable_alias): Likewise. (symtab_nonoverwritable_alias_1): Likewise. (symtab_for_node_and_aliases): Likewise. (symtab_resolve_alias): Likewise. (fixup_same_cpp_alias_visibility): Likewise. (symtab_alias_ultimate_target): Likewise. (symtab_used_from_object_file_p): Likewise. (verify_symtab_base): Likewise. (dump_symtab_base): Likewise. (symtab_node_name): Likewise. (symtab_node_asm_name): Likewise. (symtab_dissolve_same_comdat_group_list): Likewise. (symtab_add_to_same_comdat_group): Likewise. (symtab_unregister_node): Likewise. (symtab_insert_node_to_hashtable): Likewise. (symtab_register_node): Likewise. (unlink_from_assembler_name_hash): Likewise. (insert_to_assembler_name_hash): Likewise. (eq_assembler_name): Likewise. (hash_node_by_assembler_name): Likewise. (eq_node): Likewise. (hash_node): Likewise. * toplev.c (wrapup_global_declaration_2): Likewise. * trans-mem.c (ipa_tm_execute): Likewise. (ipa_tm_transform_clone): Likewise. (ipa_tm_transform_transaction): Likewise. (ipa_tm_transform_calls_redirect): Likewise. (ipa_tm_insert_gettmclone_call): Likewise. (ipa_tm_insert_irr_call): Likewise. (ipa_tm_create_version): Likewise. (ipa_tm_create_version_alias): Likewise. (ipa_tm_mark_forced_by_abi_node): Likewise. (ipa_tm_mark_force_output_node): Likewise. (ipa_tm_diagnose_tm_safe): Likewise. (ipa_tm_mayenterirr_function): Likewise. (ipa_tm_scan_irr_function): Likewise. (ipa_tm_note_irrevocable): Likewise. (ipa_tm_scan_calls_clone): Likewise. (get_cg_data): Likewise. * tree-eh.c (tree_could_trap_p): Likewise. * tree-emutls.c (ipa_lower_emutls): Likewise. (create_emultls_var): Likewise. (lower_emutls_function_body): Likewise. (gen_emutls_addr): Likewise. (emutls_decl): Likewise. (new_emutls_decl): Likewise. * tree-inline.c (tree_function_versioning): Likewise. (optimize_inline_calls): Likewise. (expand_call_inline): Likewise. (estimate_num_insns): Likewise. (copy_bb): Likewise. (delete_unreachable_blocks_update_callgraph): Likewise. * tree-nested.c (gimplify_all_functions): Likewise. (create_nesting_tree): Likewise. (check_for_nested_with_variably_modified): Likewise. * tree-pretty-print.c (dump_function_header): Likewise. * tree-profile.c (tree_profiling): Likewise. * tree-sra.c (ipa_sra_preliminary_function_checks): Likewise. (modify_function): Likewise. (convert_callers): Likewise. (convert_callers_for_node): Likewise. * tree-ssa-structalias.c (ipa_pta_execute): Likewise. (associate_varinfo_to_alias): Likewise. (create_variable_info_for): Likewise. (get_constraint_for_ssa_var): Likewise. * tree-vectorizer.c (increase_alignment): Likewise. * tree.c (find_decls_types_in_var): Likewise. (find_decls_types_in_node): Likewise. (free_lang_data_in_decl): Likewise. * value-prof.c (gimple_ic_transform): Likewise. (gimple_ic): Likewise. (check_ic_target): Likewise. (init_node_map): Likewise. * varasm.c (decl_binds_to_current_def_p): Likewise. (default_binds_local_p_1): Likewise. (dump_tm_clone_pairs): Likewise. (assemble_alias): Likewise. (find_decl): Likewise. (mark_decl_referenced): Likewise. * varpool.c (varpool_for_node_and_aliases): Likewise. (varpool_extra_name_alias): Likewise. (varpool_create_variable_alias): Likewise. (add_new_static_var): Likewise. (varpool_finalize_named_section_flags): Likewise. (varpool_remove_unreferenced_decls): Likewise. (enqueue_node): Likewise. (varpool_assemble_decl): Likewise. (assemble_aliases): Likewise. (varpool_analyze_node): Likewise. (cgraph_variable_initializer_availability): Likewise. (varpool_add_new_variable): Likewise. (ctor_for_folding): Likewise. (dump_varpool_node): Likewise. (varpool_remove_initializer): Likewise. (varpool_remove_node): Likewise. (varpool_node_for_decl): Likewise. (varpool_create_empty_node): Likewise. * config/i386/i386.c (ix86_generate_version_dispatcher_body): Likewise. (ix86_get_function_versions_dispatcher): Likewise. gcc/ada/ Patch autogenerated by refactor_symtab.py from https://github.com/davidmalcolm/gcc-refactoring-scripts revision 58bb219cc090b2f4516a9297d868c245495ee622 * gcc-interface/trans.c (finalize_nrv): Update for conversion of symtab types to a true class hierarchy. * gcc-interface/utils.c (gnat_write_global_declarations): Likewise. gcc/c-family/ Patch autogenerated by refactor_symtab.py from https://github.com/davidmalcolm/gcc-refactoring-scripts revision 58bb219cc090b2f4516a9297d868c245495ee622 * c-gimplify.c (c_genericize): Update for conversion of symtab types to a true class hierarchy. * c-pragma.c (maybe_apply_pending_pragma_weaks): Likewise. gcc/cp/ Patch autogenerated by refactor_symtab.py from https://github.com/davidmalcolm/gcc-refactoring-scripts revision 58bb219cc090b2f4516a9297d868c245495ee622 * call.c (mark_versions_used): Update for conversion of symtab types to a true class hierarchy. * decl2.c (cp_write_global_declarations): Likewise. (clear_decl_external): Likewise. (build_java_method_aliases): Likewise. (collect_candidates_for_java_method_aliases): Likewise. (mark_needed): Likewise. (var_finalized_p): Likewise. (maybe_make_one_only): Likewise. (maybe_emit_vtables): Likewise. * lambda.c (maybe_add_lambda_conv_op): Likewise. * method.c (use_thunk): Likewise. * optimize.c (maybe_clone_body): Likewise. * tree.c (cp_fix_function_decl_p): Likewise. gcc/java/ Patch autogenerated by refactor_symtab.py from https://github.com/davidmalcolm/gcc-refactoring-scripts revision 58bb219cc090b2f4516a9297d868c245495ee622 * decl.c (java_mark_decl_local): Update for conversion of symtab types to a true class hierarchy. gcc/lto/ Patch autogenerated by refactor_symtab.py from https://github.com/davidmalcolm/gcc-refactoring-scripts revision 58bb219cc090b2f4516a9297d868c245495ee622 * lto-partition.c (lto_promote_cross_file_statics): Update for conversion of symtab types to a true class hierarchy. (rename_statics): Likewise. (promote_symbol): Likewise. (privatize_symbol_name): Likewise. (lto_balanced_map): Likewise. (varpool_node_cmp): Likewise. (node_cmp): Likewise. (lto_1_to_1_map): Likewise. (undo_partition): Likewise. (add_symbol_to_partition): Likewise. (contained_in_symbol): Likewise. (add_symbol_to_partition_1): Likewise. (add_references_to_partition): Likewise. (symbol_partitioned_p): Likewise. (get_symbol_class): Likewise. (lto_max_map): Likewise. * lto-symtab.c (lto_symtab_prevailing_decl): Likewise. (lto_symtab_merge_symbols): Likewise. (lto_symtab_merge_symbols_1): Likewise. (lto_symtab_merge_decls): Likewise. (lto_symtab_merge_decls_1): Likewise. (lto_symtab_merge_decls_2): Likewise. (lto_symtab_resolve_symbols): Likewise. (lto_symtab_resolve_can_prevail_p): Likewise. (lto_symtab_symbol_p): Likewise. (lto_symtab_resolve_replaceable_p): Likewise. (lto_symtab_merge): Likewise. (lto_varpool_replace_node): Likewise. (lto_cgraph_replace_node): Likewise. * lto.c (lto_main): Likewise. (do_whole_program_analysis): Likewise. (materialize_cgraph): Likewise. (read_cgraph_and_symbols): Likewise. (cmp_partitions_order): Likewise. (lto_materialize_function): Likewise. (has_analyzed_clone_p): Likewise. From-SVN: r204171
2013-10-29 19:30:00 +01:00
DECL_EXTERNAL (first_clone->decl) = 0;
TREE_PUBLIC (first_clone->decl) = 0;
DECL_COMDAT (first_clone->decl) = 0;
This patch rewrites the old VEC macro-based interface into a new one based on the template class 'vec'. This patch rewrites the old VEC macro-based interface into a new one based on the template class 'vec'. The user-visible changes are described in http://gcc.gnu.org/wiki/cxx-conversion/cxx-vec. I have tested the patch pretty extensively: - Regular bootstraps on x86_64, ppc, ia64, sparc and hppa. - Bootstraps with --enable-checking=release - Bootstraps with --enable-checking=gc,gcac - Basic builds on all targets (using contrib/config-list.mk). We no longer access the vectors via VEC_* macros. The pattern is "VEC_operation (T, A, V, args)" becomes "V.operation (args)". The only thing I could not do is create proper ctors and dtors for the vec class. Since these vectors are stored in unions, we have to keep them as PODs (C++03 does not allow non-PODs in unions). This means that creation and destruction must be explicit. There is a new method vec<type, allocation, layout>::create() and another vec<type, allocation, layout>::destroy() to allocate the internal vector. For vectors that must be pointers, there is a family of free functions that implement the operations that need to tolerate NULL vectors. These functions all start with the prefix 'vec_safe_'. See the wiki page for details. The gengtype change removes the special handling for VEC() that used to exist in gengtype. Additionally, it allows gengtype to recognize templates of more than one argument and introduces the concept of an undefined type (useful for template arguments that may or may not be types). When a TYPE_UNDEFINED is reached, gengtype will ignore it if it happens inside a type marked with GTY((user)). Otherwise, it will emit an error. Finally, gengtype rejects root types marked GTY((user)) that are not first class pointers. 2012-11-16 Diego Novillo <dnovillo@google.com> VEC API overhaul (http://gcc.gnu.org/wiki/cxx-conversion/cxx-vec) * vec.c (register_overhead): Convert it into member function of vec_prefix. (release_overhead): Likewise. (calculate_allocation): Likewise. (vec_heap_free): Remove. (vec_gc_o_reserve_1): Remove. (vec_heap_o_reserve_1): Remove. (vec_stack_o_reserve_1): Remove. (vec_stack_o_reserve_exact): Remove. (register_stack_vec): New. (stack_vec_register_index): New. (unregister_stack_vec): New. (vec_assert_fail): Remove. * vec.h: Conditionally include ggc.h. Document conditional hackery. Update top-level documentation. (ALONE_VEC_CHECK_INFO): Remove. (VEC_CHECK_INFO): Remove. (ALONE_VEC_CHECK_DECL): Remove. (VEC_CHECK_DECL): Remove. (ALONE_VEC_CHECK_PASS): Remove. (VEC_CHECK_PASS): Remove. (VEC_ASSERT): Remove. (vec_prefix): Add friends va_gc, va_gc_atomic, va_heap and va_stack. Mark fields alloc_ and num_ as protected. (struct vec_t): Remove. Remove all function members. (struct vl_embed): Declare. (struct vl_ptr): Declare. (free): Remove. (reserve_exact): Remove. (reserve): Remove. (safe_splice): Remove. (safe_push): Remove. (safe_grow): Remove. (safe_grow_cleared): Remove. (safe_insert): Remove. (DEF_VEC_I): Remove. (DEF_VEC_ALLOC_I): Remove. (DEF_VEC_P): Remove. (DEF_VEC_ALLOC_P): Remove. (DEF_VEC_O): Remove. (DEF_VEC_ALLOC_O): Remove. (DEF_VEC_ALLOC_P_STACK): Remove. (DEF_VEC_ALLOC_O_STACK): Remove. (DEF_VEC_ALLOC_I_STACK): Remove. (DEF_VEC_A): Remove. (DEF_VEC_ALLOC_A): Remove. (vec_stack_p_reserve_exact_1): Remove. (vec_stack_o_reserve): Remove. (vec_stack_o_reserve_exact): Remove. (VEC_length): Remove. (VEC_empty): Remove. (VEC_address): Remove. (vec_address): Remove. (VEC_last): Remove. (VEC_index): Remove. (VEC_iterate): Remove. (VEC_embedded_size): Remove. (VEC_embedded_init): Remove. (VEC_free): Remove. (VEC_copy): Remove. (VEC_space): Remove. (VEC_reserve): Remove. (VEC_reserve_exact): Remove. (VEC_splice): Remove. (VEC_safe_splice): Remove. (VEC_quick_push): Remove. (VEC_safe_push): Remove. (VEC_pop): Remove. (VEC_truncate): Remove. (VEC_safe_grow): Remove. (VEC_replace): Remove. (VEC_quick_insert): Remove. (VEC_safe_insert): Remove. (VEC_ordered_remove): Remove. (VEC_unordered_remove): Remove. (VEC_block_remove): Remove. (VEC_lower_bound): Remove. (VEC_alloc): Remove. (VEC_qsort): Remove. (va_heap): Declare. (va_heap::default_layout): New typedef to vl_ptr. (va_heap::reserve): New. (va_heap::release): New. (va_gc): Declare. (va_gc::default_layout): New typedef to vl_embed. (va_gc::reserve): New. (va_gc::release): New. (va_gc_atomic): Declare. Inherit from va_gc. (va_stack): Declare. (va_stack::default_layout): New typedef to vl_ptr. (va_stack::alloc): New. (va_stack::reserve): New. (va_stack::release): New. (register_stack_vec): Declare. (stack_vec_register_index): Declare. (unregister_stack_vec): Declare. (vec<T, A = va_heap, L = typename A::default_layout>): Declare empty vec template. (vec<T, A, vl_embed>): Partial specialization for embedded layout. (vec<T, A, vl_embed>::allocated): New. (vec<T, A, vl_embed>::length): New. (vec<T, A, vl_embed>::is_empty): New. (vec<T, A, vl_embed>::address): New. (vec<T, A, vl_embed>::operator[]): New. (vec<T, A, vl_embed>::last New. (vec<T, A, vl_embed>::space): New. (vec<T, A, vl_embed>::iterate): New. (vec<T, A, vl_embed>::iterate): New. (vec<T, A, vl_embed>::copy): New. (vec<T, A, vl_embed>::splice): New. (vec<T, A, vl_embed>::quick_push New. (vec<T, A, vl_embed>::pop New. (vec<T, A, vl_embed>::truncate): New. (vec<T, A, vl_embed>::quick_insert): New. (vec<T, A, vl_embed>::ordered_remove): New. (vec<T, A, vl_embed>::unordered_remove): New. (vec<T, A, vl_embed>::block_remove): New. (vec<T, A, vl_embed>::qsort): New. (vec<T, A, vl_embed>::lower_bound): New. (vec<T, A, vl_embed>::embedded_size): New. (vec<T, A, vl_embed>::embedded_init): New. (vec<T, A, vl_embed>::quick_grow): New. (vec<T, A, vl_embed>::quick_grow_cleared): New. (vec_safe_space): New. (vec_safe_length): New. (vec_safe_address): New. (vec_safe_is_empty): New. (vec_safe_reserve): New. (vec_safe_reserve_exact): New. (vec_alloc): New. (vec_free): New. (vec_safe_grow): New. (vec_safe_grow_cleared): New. (vec_safe_iterate): New. (vec_safe_push): New. (vec_safe_insert): New. (vec_safe_truncate): New. (vec_safe_copy): New. (vec_safe_splice): New. (vec<T, A, vl_ptr>): New partial specialization for the space efficient layout. (vec<T, A, vl_ptr>::exists): New. (vec<T, A, vl_ptr>::is_empty): New. (vec<T, A, vl_ptr>::length): New. (vec<T, A, vl_ptr>::address): New. (vec<T, A, vl_ptr>::operator[]): New. (vec<T, A, vl_ptr>::operator!=): New. (vec<T, A, vl_ptr>::operator==): New. (vec<T, A, vl_ptr>::last): New. (vec<T, A, vl_ptr>::space): New. (vec<T, A, vl_ptr>::iterate): New. (vec<T, A, vl_ptr>::copy): New. (vec<T, A, vl_ptr>::reserve): New. (vec<T, A, vl_ptr>::reserve_exact): New. (vec<T, A, vl_ptr>::splice): New. (vec<T, A, vl_ptr>::safe_splice): New. (vec<T, A, vl_ptr>::quick_push): New. (vec<T, A, vl_ptr>::safe_push): New. (vec<T, A, vl_ptr>::pop): New. (vec<T, A, vl_ptr>::truncate): New. (vec<T, A, vl_ptr>::safe_grow): New. (vec<T, A, vl_ptr>::safe_grow_cleared): New. (vec<T, A, vl_ptr>::quick_grow): New. (vec<T, A, vl_ptr>::quick_grow_cleared): New. (vec<T, A, vl_ptr>::quick_insert): New. (vec<T, A, vl_ptr>::safe_insert): New. (vec<T, A, vl_ptr>::ordered_remove): New. (vec<T, A, vl_ptr>::unordered_remove): New. (vec<T, A, vl_ptr>::block_remove): New. (vec<T, A, vl_ptr>::qsort): New. (vec<T, A, vl_ptr>::lower_bound): New. (vec_stack_alloc): Define. (FOR_EACH_VEC_SAFE_ELT): Define. * vecir.h: Remove. Update all users. * vecprim.h: Remove. Update all users. Move uchar to coretypes.h. * Makefile.in (VEC_H): Add $(GGC_H). Remove vecir.h and vecprim.h dependencies everywhere. 2012-11-16 Diego Novillo <dnovillo@google.com> * gengtype-lex.l (VEC): Remove. Add characters in the set [\!\>\.-]. * gengtype-parse.c (token_names): Remove "VEC". (require_template_declaration): Remove handling of VEC_TOKEN. (type): Likewise. Call create_user_defined_type when parsing GTY((user)). * gengtype-state.c (type_lineloc): handle TYPE_UNDEFINED. (write_state_undefined_type): New. (write_state_type): Call write_state_undefined_type for TYPE_UNDEFINED. (read_state_type): Call read_state_undefined_type for TYPE_UNDEFINED. * gengtype.c (dbgprint_count_type_at): Handle TYPE_UNDEFINED. (create_user_defined_type): Make extern. (type_for_name): Factor out of resolve_typedef. (create_undefined_type): New (resolve_typedef): Call it when we cannot find a previous typedef and the type is not a template. (find_structure): Accept TYPE_UNDEFINED. (set_gc_used_type): Add argument ALLOWED_UNDEFINED_TYPES, default to false. Emit an error for TYPE_UNDEFINED unless LEVEL is GC_UNUSED or ALLOWED_UNDEFINED_TYPES is set. Set ALLOWED_UNDEFINED_TYPES to true for TYPE_USER_STRUCT. (filter_type_name): Accept templates with more than one argument. (output_mangled_typename): Handle TYPE_UNDEFINED (walk_type): Likewise. (write_types_process_field): Likewise. (write_func_for_structure): If CHAIN_NEXT is set, ORIG_S should not be a user-defined type. (write_types_local_user_process_field): Handle TYPE_ARRAY, TYPE_NONE and TYPE_UNDEFINED. (write_types_local_process_field): Likewise. (contains_scalar_p): Return 0 for TYPE_USER_STRUCT. (write_root): Reject user-defined types that are not pointers. Handle TYPE_NONE, TYPE_UNDEFINED, TYPE_UNION, TYPE_LANG_STRUCT and TYPE_PARAM_STRUCT. (output_typename): Handle TYPE_NONE, TYPE_UNDEFINED, and TYPE_ARRAY. (dump_typekind): Handle TYPE_UNDEFINED. * gengtype.h (enum typekind): Add TYPE_UNDEFINED. (create_user_defined_type): Declare. (enum gty_token): Remove VEC_TOKEN. 2012-11-16 Diego Novillo <dnovillo@google.com> Adjust for new vec API (http://gcc.gnu.org/wiki/cxx-conversion/cxx-vec) * coretypes.h (uchar): Define. * alias.c: Use new vec API in vec.h. * asan.c: Likewise. * attribs.c: Likewise. * basic-block.h: Likewise. * bb-reorder.c: Likewise. * builtins.c: Likewise. * calls.c: Likewise. * cfg.c: Likewise. * cfganal.c: Likewise. * cfgcleanup.c: Likewise. * cfgexpand.c: Likewise. * cfghooks.c: Likewise. * cfghooks.h: Likewise. * cfgloop.c: Likewise. * cfgloop.h: Likewise. * cfgloopanal.c: Likewise. * cfgloopmanip.c: Likewise. * cfgrtl.c: Likewise. * cgraph.c: Likewise. * cgraph.h: Likewise. * cgraphclones.c: Likewise. * cgraphunit.c: Likewise. * combine.c: Likewise. * compare-elim.c: Likewise. * coverage.c: Likewise. * cprop.c: Likewise. * data-streamer.h: Likewise. * dbxout.c: Likewise. * dce.c: Likewise. * df-core.c: Likewise. * df-problems.c: Likewise. * df-scan.c: Likewise. * dominance.c: Likewise. * domwalk.c: Likewise. * domwalk.h: Likewise. * dse.c: Likewise. * dwarf2cfi.c: Likewise. * dwarf2out.c: Likewise. * dwarf2out.h: Likewise. * emit-rtl.c: Likewise. * except.c: Likewise. * except.h: Likewise. * expr.c: Likewise. * expr.h: Likewise. * final.c: Likewise. * fold-const.c: Likewise. * function.c: Likewise. * function.h: Likewise. * fwprop.c: Likewise. * gcc.c: Likewise. * gcse.c: Likewise. * genattr.c: Likewise. * genattrtab.c: Likewise. * genautomata.c: Likewise. * genextract.c: Likewise. * genopinit.c: Likewise * ggc-common.c: Likewise. * ggc.h: Likewise. * gimple-low.c: Likewise. * gimple-ssa-strength-reduction.c: Likewise. * gimple-streamer-in.c: Likewise. * gimple.c: Likewise. * gimple.h: Likewise. * gimplify.c: Likewise. * graph.c: Likewise. * graphds.c: Likewise. * graphds.h: Likewise. * graphite-blocking.c: Likewise. * graphite-clast-to-gimple.c: Likewise. * graphite-dependences.c: Likewise. * graphite-interchange.c: Likewise. * graphite-optimize-isl.c: Likewise. * graphite-poly.c: Likewise. * graphite-poly.h: Likewise. * graphite-scop-detection.c: Likewise. * graphite-scop-detection.h: Likewise. * graphite-sese-to-poly.c: Likewise. * graphite.c: Likewise. * godump.c: Likewise. * haifa-sched.c: Likewise. * hw-doloop.c: Likewise. * hw-doloop.h: Likewise. * ifcvt.c: Likewise. * insn-addr.h: Likewise. * ipa-cp.c: Likewise. * ipa-inline-analysis.c: Likewise. * ipa-inline-transform.c: Likewise. * ipa-inline.c: Likewise. * ipa-inline.h: Likewise. * ipa-prop.c: Likewise. * ipa-prop.h: Likewise. * ipa-pure-const.c: Likewise. * ipa-ref-inline.h: Likewise. * ipa-ref.c: Likewise. * ipa-ref.h: Likewise. * ipa-reference.c: Likewise. * ipa-split.c: Likewise. * ipa-utils.c: Likewise. * ipa-utils.h: Likewise. * ipa.c: Likewise. * ira-build.c: Likewise. * ira-color.c: Likewise. * ira-emit.c: Likewise. * ira-int.h: Likewise. * ira.c: Likewise. * loop-invariant.c: Likewise. * loop-unroll.c: Likewise. * lower-subreg.c: Likewise. * lra-lives.c: Likewise. * lra.c: Likewise. * lto-cgraph.c: Likewise. * lto-section-out.c: Likewise. * lto-streamer-in.c: Likewise. * lto-streamer-out.c: Likewise. * lto-streamer.h: Likewise. * lto-symtab.c: Likewise. * mcf.c: Likewise. * modulo-sched.c: Likewise. * omp-low.c: Likewise. * opts-common.c: Likewise. * opts-global.c: Likewise. * opts.c: Likewise. * opts.h: Likewise. * passes.c: Likewise. * predict.c: Likewise. * print-tree.c: Likewise. * profile.c: Likewise. * profile.h: Likewise. * read-rtl.c: Likewise. * ree.c: Likewise. * reg-stack.c: Likewise. * regrename.c: Likewise. * regrename.h: Likewise. * reload.c: Likewise. * reload.h: Likewise. * reload1.c: Likewise. * rtl.h: Likewise. * sched-deps.c: Likewise. * sched-int.h: Likewise. * sdbout.c: Likewise. * sel-sched-dump.c: Likewise. * sel-sched-ir.c: Likewise. * sel-sched-ir.h: Likewise. * sel-sched.c: Likewise. * sese.c: Likewise. * sese.h: Likewise. * statistics.h: Likewise. * stmt.c: Likewise. * stor-layout.c: Likewise. * store-motion.c: Likewise. * tlink.c: Likewise. * toplev.c: Likewise. * trans-mem.c: Likewise. * tree-browser.c: Likewise. * tree-call-cdce.c: Likewise. * tree-cfg.c: Likewise. * tree-cfgcleanup.c: Likewise. * tree-chrec.c: Likewise. * tree-chrec.h: Likewise. * tree-complex.c: Likewise. * tree-data-ref.c: Likewise. * tree-data-ref.h: Likewise. * tree-dfa.c: Likewise. * tree-diagnostic.c: Likewise. * tree-dump.c: Likewise. * tree-eh.c: Likewise. * tree-emutls.c: Likewise. * tree-flow.h: Likewise. * tree-if-conv.c: Likewise. * tree-inline.c: Likewise. * tree-inline.h: Likewise. * tree-into-ssa.c: Likewise. * tree-iterator.c: Likewise. * tree-loop-distribution.c: Likewise. * tree-mudflap.c: Likewise. * tree-optimize.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-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-dce.c: Likewise. * tree-ssa-dom.c: Likewise. * tree-ssa-forwprop.c: Likewise. * tree-ssa-live.c: Likewise. * tree-ssa-live.h: 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-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-sccvn.h: Likewise. * tree-ssa-strlen.c: Likewise. * tree-ssa-structalias.c: Likewise. * tree-ssa-tail-merge.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-streamer.h: Likewise. * tree-switch-conversion.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-vectorizer.h: Likewise. * tree-vrp.c: Likewise. * tree.c: Likewise. * tree.h: Likewise. * value-prof.c: Likewise. * value-prof.h: Likewise. * var-tracking.c: Likewise. * varasm.c: Likewise. * varpool.c: Likewise. * vmsdbgout.c: Likewise. * config/bfin/bfin.c: Likewise. * config/c6x/c6x.c: Likewise. * config/darwin.c: Likewise. * config/i386/i386.c: Likewise. * config/ia64/ia64.c: Likewise. * config/mep/mep.c: Likewise. * config/mips/mips.c: Likewise. * config/pa/pa.c: Likewise. * config/rs6000/rs6000-c.c: Likewise. * config/rs6000/rs6000.c: Likewise. * config/rx/rx.c: Likewise. * config/spu/spu-c.c: Likewise. * config/vms/vms.c: Likewise. * config/vxworks.c: Likewise. * config/epiphany/resolve-sw-modes.c: Likewise. From-SVN: r193595
2012-11-18 03:54:30 +01:00
first_clone->ipa_transforms_to_apply.release ();
/* When doing recursive inlining, the clone may become unnecessary.
This is possible i.e. in the case when the recursive function is proved to be
non-throwing and the recursion happens only in the EH landing pad.
We can not remove the clone until we are done with saving the body.
Remove it now. */
if (!first_clone->callers)
{
IPA C++ refactoring 1/N * cgraph.h (symtab_node): (void register_symbol (void)): created from symtab_register_node (void remove (void)): created from symtab_remove_node (void dump (FILE *f)): created from dump_symtab_node (void DEBUG_FUNCTION debug (void)): created from debug_symtab_node (void DEBUG_FUNCTION verify (void)): created from verify_symtab_node (struct ipa_ref *add_reference (symtab_node *referred_node, enum ipa_ref_use use_type)): created from add_reference (struct ipa_ref *add_reference (symtab_node *referred_node, enum ipa_ref_use use_type, gimple stmt)): created from add_reference (struct ipa_ref *maybe_add_reference (tree val, enum ipa_ref_use use_type, gimple stmt)): created from maybe_add_reference (bool semantically_equivalent_p (symtab_node *target)): created from symtab_semantically_equivalent_p (void remove_from_same_comdat_group (void)): created from remove_from_same_comdat_group (void add_to_same_comdat_group (symtab_node *old_node)): created from symtab_add_to_same_comdat_group (void dissolve_same_comdat_group_list (void)): created from symtab_dissolve_same_comdat_group_list (bool used_from_object_file_p (void)): created from symtab_used_from_object_file_p (symtab_node *ultimate_alias_target (enum availability *avail = NULL)): created from symtab_alias_ultimate_target (inline symtab_node *next_defined_symbol (void)): created from symtab_next_defined_symbol (bool resolve_alias (symtab_node *target)): created from symtab_resolve_alias (bool call_for_symbol_and_aliases (bool (*callback) (symtab_node *, void *), void *data, bool include_overwrite)): created from symtab_for_node_and_aliases (symtab_node *noninterposable_alias (void)): created from symtab_nonoverwritable_alias (inline symtab_node *get_alias_target (void)): created from symtab_alias_target (void set_section (const char *section)): created from set_section_1 (enum availability get_availability (void)): created from symtab_node_availability (void make_decl_local (void)): created from symtab_make_decl_local (bool real_symbol_p (void)): created from symtab_read_node (can_be_discarded_p (void)): created from symtab_can_be_discarded (inline bool comdat_local_p (void)): created from symtab_comdat_local_p (inline bool in_same_comdat_group_p (symtab_node *target)): created from symtab_in_same_comdat_p; (bool address_taken_from_non_vtable_p (void)): created from address_taken_from_non_vtable_p (static inline symtab_node *get (const_tree decl)): created from symtab_get_node (static void dump_table (FILE *)): created from dump_symtab (static inline DEBUG_FUNCTION void debug_symtab (void)): created from debug_symtab (static DEBUG_FUNCTION void verify_symtab_nodes (void)): created from verify_symtab (static bool used_from_object_file_p_worker (symtab_node *node)): created from symtab_used_from_object_file_p (void dump_base (FILE *)): created from dump_symtab_base (bool DEBUG_FUNCTION verify_base (void)): created from verify_symtab_base (void unregister (void)): created from symtab_unregister_node (struct symbol_priority_map *priority_info (void)): created from symtab_priority_info (static bool set_implicit_section (symtab_node *n, void *)): created from set_implicit_section (static bool noninterposable_alias (symtab_node *node, void *data)): created from symtab_nonoverwritable_alias_1 * cgraph.h (cgraph_node): (bool remove_symbol_and_inline_clones (cgraph_node *forbidden_node = NULL)): created from cgraph_remove_node_and_inline_clones (void record_stmt_references (gimple stmt)): created from ipa_record_stmt_references (void set_call_stmt_including_clones (gimple old_stmt, gimple new_stmt, bool update_speculative = true)): created from cgraph_set_call_stmt_including_clones (cgraph_node *function_symbol (enum availability *avail = NULL)): created from cgraph_function_node (cgraph_node *create_clone (tree decl, gcov_type count, int freq, bool update_original, vec<cgraph_edge *> redirect_callers, bool call_duplication_hook, struct cgraph_node *new_inlined_to, bitmap args_to_skip)): created from cgraph_create_clone (cgraph_node *create_virtual_clone (vec<cgraph_edge *> redirect_callers, vec<ipa_replace_map *, va_gc> *tree_map, bitmap args_to_skip, const char * suffix)): created from cgraph_create_virtual_clone (cgraph_node *find_replacement (void)): created from cgraph_find_replacement_node (cgraph_node *create_version_clone (tree new_decl, vec<cgraph_edge *> redirect_callers, bitmap bbs_to_copy)): created from cgraph_copy_node_for_versioning (cgraph_node *create_version_clone_with_body (vec<cgraph_edge *> redirect_callers, vec<ipa_replace_map *, va_gc> *tree_map, bitmap args_to_skip, bool skip_return, bitmap bbs_to_copy, basic_block new_entry_block, const char *clone_name)): created from cgraph_function_version_info (struct cgraph_function_version_info *insert_new_function_version (void)): created from insert_new_cgraph_node_version (struct cgraph_function_version_info *function_version (void)): created from get_cgraph_node_version (void analyze (void)): created from analyze_function (cgraph_node * create_thunk (tree alias, tree, bool this_adjusting, HOST_WIDE_INT fixed_offset, HOST_WIDE_INT virtual_value, tree virtual_offset, tree real_alias) cgraph_add_thunk (inline cgraph_node *get_alias_target (void)): created from cgraph_alias_target (cgraph_node *ultimate_alias_target (availability *availability = NULL)): created from cgraph_function_or_thunk_node (bool expand_thunk (bool output_asm_thunks, bool force_gimple_thunk)): created from expand_thunk (void reset (void)): created from cgraph_reset_node (void create_wrapper (cgraph_node *target)): created from cgraph_make_wrapper (void DEBUG_FUNCTION verify_node (void)): created from verify_cgraph_node (void remove (void)): created from cgraph_remove_node (void dump (FILE *f)): created from dump_cgraph_node (void DEBUG_FUNCTION debug (void)): created from debug_cgraph_node (bool get_body (void)): created from cgraph_get_body (void release_body (void)): created from cgraph_release_function_body (void unnest (void)): created from cgraph_unnest_node (void make_local (void)): created from cgraph_make_node_local (void mark_address_taken (void)): created from cgraph_mark_address_taken_node (struct cgraph_edge *create_edge (cgraph_node *callee, gimple call_stmt, gcov_type count, int freq)): created from cgraph_create_edge (struct cgraph_edge *create_indirect_edge (gimple call_stmt, int ecf_flags, gcov_type count, int freq)): created from cgraph_create_indirect_edge (void create_edge_including_clones (struct cgraph_node *callee, gimple old_stmt, gimple stmt, gcov_type count, int freq, cgraph_inline_failed_t reason)): created from cgraph_create_edge_including_clones (cgraph_edge *get_edge (gimple call_stmt)): created from cgraph_edge (vec<cgraph_edge *> collect_callers (void)): created from collect_callers_of_node (void remove_callers (void)): created from cgraph_node_remove_callers (void remove_callees (void)): created from cgraph_node_remove_callees (enum availability get_availability (void)): created from cgraph_function_body_availability (void set_nothrow_flag (bool nothrow)): created from cgraph_set_nothrow_flag (void set_const_flag (bool readonly, bool looping)): created from cgraph_set_const_flag (void set_pure_flag (bool pure, bool looping)): created from cgraph_set_pure_flag (void call_duplication_hooks (cgraph_node *node2)): created from cgraph_call_node_duplication_hooks (bool call_for_symbol_and_aliases (bool (*callback) (cgraph_node *, void *), void *data, bool include_overwritable)): created from cgraph_for_node_and_aliases (bool call_for_symbol_thunks_and_aliases (bool (*callback) (cgraph_node *node, void *data), void *data, bool include_overwritable)): created from cgraph_for_node_thunks_and_aliases (void call_function_insertion_hooks (void)): created from cgraph_call_function_insertion_hooks (inline void mark_force_output (void)): created from cgraph_mark_force_output_node (bool local_p (void)): created from cgraph_local_node (bool can_be_local_p (void)): created from cgraph_node_can_be_local_p (bool cannot_return_p (void)): created from cgraph_node_cannot_return (bool only_called_directly_p (void)): created from cgraph_only_called_directly_p (inline bool only_called_directly_or_aliased_p (void)): created from cgraph_only_called_directly_or_aliased_p (bool will_be_removed_from_program_if_no_direct_calls_p (void)): created from cgraph_will_be_removed_from_program_if_no_direct_calls (bool can_remove_if_no_direct_calls_and_refs_p (void)): created from cgraph_can_remove_if_no_direct_calls_and_refs_p (bool can_remove_if_no_direct_calls_p (void)): created from cgraph_can_remove_if_no_direct_calls_p (inline bool has_gimple_body_p (void)): created from cgraph_function_with_gimple_body_p (bool optimize_for_size_p (void)): created from cgraph_optimize_for_size_p (static void dump_cgraph (FILE *f)): created from dump_cgraph (static inline void debug_cgraph (void)): created from debug_cgraph (static void record_function_versions (tree decl1, tree decl2)): created from record_function_versions (static void delete_function_version (tree decl)): created from delete_function_version (static void add_new_function (tree fndecl, bool lowered)): created from cgraph_add_new_function (static inline cgraph_node *get (const_tree decl)): created from cgraph_get_node (static cgraph_node * create (tree decl)): created from cgraph_create_node (static cgraph_node * create_empty (void)): created from cgraph_create_empty_node (static cgraph_node * get_create (tree)): created from cgraph_get_create_node (static cgraph_node *get_for_asmname (tree asmname)): created from cgraph_node_for_asm (static cgraph_node * create_same_body_alias (tree alias, tree decl)): created from cgraph_same_body_alias (static bool used_from_object_file_p_worker (cgraph_node *node, void *): new function (static bool non_local_p (cgraph_node *node, void *)): created from cgraph_non_local_node_p_1 (static void DEBUG_FUNCTION verify_cgraph_nodes (void)): created from verify_cgraph (static bool make_local (cgraph_node *node, void *)): created from cgraph_make_node_local (static cgraph_node *create_alias (tree alias, tree target)): created from cgraph_create_function_alias (static cgraph_edge * create_edge (cgraph_node *caller, cgraph_node *callee, gimple call_stmt, gcov_type count, int freq, bool indir_unknown_callee)): created from cgraph_create_edge_1 * cgraph.h (varpool_node): (void remove (void)): created from varpool_remove_node (void dump (FILE *f)): created from dump_varpool_node From-SVN: r212982
2014-07-24 14:07:13 +02:00
first_clone->remove_symbol_and_inline_clones ();
first_clone = NULL;
}
[PATCH 7/9] ENABLE_CHECKING refactoring: middle-end, LTO FE [PATCH 7/9] ENABLE_CHECKING refactoring: middle-end, LTO FE gcc/lto/ChangeLog: 2015-10-27 Mikhail Maltsev <maltsevm@gmail.com> * lto.c (unify_scc): Use flag_checking and remove ENABLE_CHECKING conditionals. (lto_fixup_state): Likewise. (do_whole_program_analysis): Use symtab_node::checking_verify_symtab_nodes and remove ENABLE_CHECKING conditionals. gcc/ChangeLog: 2015-10-27 Mikhail Maltsev <maltsevm@gmail.com> * attribs.c (check_attribute_tables): New function, broken out from... (init_attributes): Use it. * cfgcleanup.c (try_optimize_cfg): Use flag_checking, CHECKING_P gcc_checking_assert and checking_* functions to eliminate ENABLE_CHECKING conditionals. * cfgexpand.c (expand_goto, expand_debug_expr): Likewise. (pass_expand::execute): Likewise. * cgraphclones.c (symbol_table::materialize_all_clones): Likewise. * cgraphunit.c (mark_functions_to_output): Likewise. (cgraph_node::expand_thunk): Likewise. (symbol_table::compile): Likewise. * ddg.c (add_cross_iteration_register_deps): Likewise. (create_ddg_all_sccs): Likewise. * df-core.c (df_finish_pass, df_analyze): Likewise. * diagnostic-core.h: Likewise. * diagnostic.c (diagnostic_report_diagnostic): Likewise. * dominance.c (calculate_dominance_info): Likewise. * dwarf2out.c (add_AT_die_ref): Likewise. (const_ok_for_output_1, mem_loc_descriptor): Likewise. (loc_list_from_tree, gen_lexical_block_die): Likewise. gen_type_die_with_usage, gen_type_die): Likewise. (dwarf2out_decl): Likewise. * emit-rtl.c (verify_rtx_sharing, reorder_insns_nobb): Likewise. * except.c (duplicate_eh_regions): Likewise. * fwprop.c (register_active_defs, update_df_init): Likewise. (fwprop_init, fwprop_done): Likewise. (update_uses): Likewise. * ggc-page.c (ggc_grow): Likewise. * gimplify.c (gimplify_body): Likewise. (gimplify_hasher::equal): Likewise. * graphite-isl-ast-to-gimple.c (graphite_verify): Likewise. * graphite-scop-detection.c (canonicalize_loop_closed_ssa_form): Likewise. * graphite-sese-to-poly.c (rewrite_reductions_out_of_ssa): Likewise. (rewrite_cross_bb_scalar_deps_out_of_ssa): Likwise. * hash-table.h (::find_empty_slot_for_expand): Likewise. * ifcvt.c (if_convert): Likewise. * ipa-cp.c (ipcp_propagate_stage): Likewise. * ipa-devirt.c (type_in_anonymous_namespace_p): Likewise. (odr_type_p, odr_types_equivalent_p): Likewise. (add_type_duplicate, get_odr_type): Likewise. * ipa-icf.c (sem_item_optimizer::execute): Likewise. (sem_item_optimizer::subdivide_classes_by_equality): Likewise. (sem_item_optimizer::verify_classes): Likewise. (sem_item_optimizer::traverse_congruence_split): Likewise. (sem_item_optimizer::checking_verify_classes): New. * ipa-icf.h (sem_item_optimizer::checking_verify_classes): Add new method. * cfgrtl.c (commit_edge_insertions): Likewise. (fixup_reorder_chain, cfg_layout_finalize): Likewise. (rtl_flow_call_edges_add): Likewise. * cgraph.c (symbol_table::create_edge): Likewise. (cgraph_edge::redirect_call_stmt_to_callee): Likewise. * cgraph.h (symtab_node): Likewise. (symtab_node::checking_verify_symtab_nodes): Define. (cgraph_node::checking_verify_cgraph_nodes): Define. * cfghooks.h (checking_verify_flow_info): Define. * cfgloop.h (checking_verify_loop_structure): Define. * dominance.h (checking_verify_dominators): Define. * et-forest.c: Fix comment. * ipa-inline-analysis.c (compute_inline_parameters): Use flag_checking, CHECKING_P gcc_checking_assert and checking_* functions to eliminate ENABLE_CHECKING conditionals. * ipa-inline-transform.c (save_inline_function_body): Likewise. * ipa-inline.c (inline_small_functions): Likewise. (early_inliner): Likewise. * ipa-inline.h (estimate_edge_growth): Likewise. * ipa-visibility.c (function_and_variable_visibility): Likewise. * ipa.c (symbol_table::remove_unreachable_nodes): Likewise. (ipa_single_use): Likewise. * ira-int.h: Likewise. * ira.c (ira): Likewise. * loop-doloop.c (doloop_optimize_loops): Likewise. * loop-init.c (loop_optimizer_init, fix_loop_structure): Likewise. * loop-invariant.c (move_loop_invariants): Likewise. * lra-assigns.c (lra_assign): Likewise. * lra-constraints.c (lra_constraints): Likewise. * lra-eliminations.c (lra_eliminate): Likewise. * lra-int.h (struct lra_reg): Likewise. * lra-lives.c (check_pseudos_live_through_calls): Likewise. (lra_create_live_ranges_1): Likewise. * lra-remat.c (create_remat_bb_data): Likewise. * lra.c (lra_update_insn_recog_data, restore_scratches): Likewise. (lra): Likewise. (check_rtl): Always define. Remove incorrect guard around extract_constrain_insn call. * lto-cgraph.c (input_cgraph_1: Use flag_checking, CHECKING_P gcc_checking_assert and checking_* functions to eliminate ENABLE_CHECKING conditionals. * lto-streamer-out.c (DFS::DFS): Likewise. (lto_output): Likewise. * lto-streamer.c (lto_streamer_init): Likewise. * omp-low.c (scan_omp_target, expand_omp_taskreg): Likewise. expand_omp_target, execute_expand_omp): Likewise. (lower_omp_target): Likewise. * passes.c (execute_function_todo): Likewise. (execute_todo, execute_one_pass): Likewise. (verify_curr_properties): Always define. * predict.c (tree_estimate_probability: Use flag_checking, CHECKING_P gcc_checking_assert and checking_* functions to eliminate ENABLE_CHECKING conditionals. (propagate_freq): Likewise. * pretty-print.c (pp_format): Likewise. * real.c (real_to_decimal_for_mode): Likewise. * recog.c (split_all_insns): Likewise. * regcprop.c (kill_value_one_regno): Likewise. (copy_value): Likewise. (validate_value_data): Define unconditionally. * reload.c: Fix comment. * timevar.c: Include options.h * tree-ssa.h (checking_verify_ssa): Define. * tree-ssa-loop-manip.h (checking_verify_loop_closed_ssa): Define. * sched-deps.c (CHECK): Remove unused macro. (add_or_update_dep_1, sd_add_dep: Use flag_checking, CHECKING_P gcc_checking_assert and checking_* functions to eliminate ENABLE_CHECKING conditionals. * sel-sched-ir.c (free_regset_pool, tidy_control_flow): Likewise. * sel-sched.c (struct moveop_static_params): Likewise. (find_best_reg_for_expr, move_cond_jump): Likewise. (move_op_orig_expr_not_found): Likewise. (code_motion_process_successors, move_op): Likewise. * ssa-iterators.h (first_readonly_imm_use): Likewise. (next_readonly_imm_use): Likewise. * store-motion.c (compute_store_table): Likewise. * symbol-summary.h (function_summary::function_summary): Likewise. * target.h (cumulative_args_t): Likewise. (get_cumulative_args, pack_cumulative_args): Likewise. * timevar.c: (timer::print): Likewise. * trans-mem.c (ipa_tm_execute): Likewise. * tree-cfg.c (move_stmt_op): Likewise. (move_sese_region_to_fn): Likewise. (gimple_flow_call_edges_add): Likewise. * tree-cfgcleanup.c (cleanup_tree_cfg_noloop, repair_loop_structures): Likewise. * tree-eh.c (remove_unreachable_handlers): Likewise. * tree-if-conv.c (pass_if_conversion::execute): Likewise. * tree-inline.c (expand_call_inline, optimize_inline_calls): Likewise. * tree-into-ssa.c (update_ssa): Likewise. * tree-loop-distribution.c (pass_loop_distribution::execute): Likewise. * tree-outof-ssa.c (eliminate_useless_phis, rewrite_trees): Likewise. * tree-parloops.c (pass_parallelize_loops::execute): Likewise. * tree-predcom.c (suitable_component_p): Likewise. * tree-profile.c (gimple_gen_const_delta_profiler): Likewise. * tree-ssa-alias.c (refs_may_alias_p_1): Likewise. * tree-ssa-live.c (verify_live_on_entry): Likewise. * tree-ssa-live.h (register_ssa_partition): Likewise. * tree-ssa-loop-ivcanon.c (tree_unroll_loops_completely): Likewise. * tree-ssa-loop-manip.c (add_exit_phi): Likewise. (tree_transform_and_unroll_loop): Likewise. * tree-ssa-math-opts.c (pass_cse_reciprocals::execute): Likewise. * tree-ssa-operands.c (get_expr_operands): Likewise. * tree-ssa-propagate.c (replace_exp_1): Likewise. * tree-ssa-structalias.c (rewrite_constraints): Likewise. * tree-ssa-ter.c (free_temp_expr_table): Likewise. * tree-ssa-threadupdate.c (duplicate_thread_path): Likewise. * tree-ssanames.c (release_ssa_name_fn): Likewise. * tree-stdarg.c (expand_ifn_va_arg): Likewise. * tree-vect-loop-manip.c (slpeel_tree_duplicate_loop_to_edge_cfg): Likewise. (slpeel_checking_verify_cfg_after_peeling): Likewise. (vect_do_peeling_for_loop_bound): Likewise. (vect_do_peeling_for_alignment): Likewise. * tree-vrp.c (supports_overflow_infinity): Likewise. (set_value_range): Likewise. * tree.c (free_lang_data_in_cgraph): Likewise. * value-prof.c (gimple_remove_histogram_value): Likewise. (free_hist): Likewise. * var-tracking.c (canonicalize_values_star): Likewise. (compute_bb_dataflow, vt_find_locations, vt_emit_notes): Likewise. From-SVN: r229470
2015-10-28 02:05:53 +01:00
else if (flag_checking)
IPA C++ refactoring 1/N * cgraph.h (symtab_node): (void register_symbol (void)): created from symtab_register_node (void remove (void)): created from symtab_remove_node (void dump (FILE *f)): created from dump_symtab_node (void DEBUG_FUNCTION debug (void)): created from debug_symtab_node (void DEBUG_FUNCTION verify (void)): created from verify_symtab_node (struct ipa_ref *add_reference (symtab_node *referred_node, enum ipa_ref_use use_type)): created from add_reference (struct ipa_ref *add_reference (symtab_node *referred_node, enum ipa_ref_use use_type, gimple stmt)): created from add_reference (struct ipa_ref *maybe_add_reference (tree val, enum ipa_ref_use use_type, gimple stmt)): created from maybe_add_reference (bool semantically_equivalent_p (symtab_node *target)): created from symtab_semantically_equivalent_p (void remove_from_same_comdat_group (void)): created from remove_from_same_comdat_group (void add_to_same_comdat_group (symtab_node *old_node)): created from symtab_add_to_same_comdat_group (void dissolve_same_comdat_group_list (void)): created from symtab_dissolve_same_comdat_group_list (bool used_from_object_file_p (void)): created from symtab_used_from_object_file_p (symtab_node *ultimate_alias_target (enum availability *avail = NULL)): created from symtab_alias_ultimate_target (inline symtab_node *next_defined_symbol (void)): created from symtab_next_defined_symbol (bool resolve_alias (symtab_node *target)): created from symtab_resolve_alias (bool call_for_symbol_and_aliases (bool (*callback) (symtab_node *, void *), void *data, bool include_overwrite)): created from symtab_for_node_and_aliases (symtab_node *noninterposable_alias (void)): created from symtab_nonoverwritable_alias (inline symtab_node *get_alias_target (void)): created from symtab_alias_target (void set_section (const char *section)): created from set_section_1 (enum availability get_availability (void)): created from symtab_node_availability (void make_decl_local (void)): created from symtab_make_decl_local (bool real_symbol_p (void)): created from symtab_read_node (can_be_discarded_p (void)): created from symtab_can_be_discarded (inline bool comdat_local_p (void)): created from symtab_comdat_local_p (inline bool in_same_comdat_group_p (symtab_node *target)): created from symtab_in_same_comdat_p; (bool address_taken_from_non_vtable_p (void)): created from address_taken_from_non_vtable_p (static inline symtab_node *get (const_tree decl)): created from symtab_get_node (static void dump_table (FILE *)): created from dump_symtab (static inline DEBUG_FUNCTION void debug_symtab (void)): created from debug_symtab (static DEBUG_FUNCTION void verify_symtab_nodes (void)): created from verify_symtab (static bool used_from_object_file_p_worker (symtab_node *node)): created from symtab_used_from_object_file_p (void dump_base (FILE *)): created from dump_symtab_base (bool DEBUG_FUNCTION verify_base (void)): created from verify_symtab_base (void unregister (void)): created from symtab_unregister_node (struct symbol_priority_map *priority_info (void)): created from symtab_priority_info (static bool set_implicit_section (symtab_node *n, void *)): created from set_implicit_section (static bool noninterposable_alias (symtab_node *node, void *data)): created from symtab_nonoverwritable_alias_1 * cgraph.h (cgraph_node): (bool remove_symbol_and_inline_clones (cgraph_node *forbidden_node = NULL)): created from cgraph_remove_node_and_inline_clones (void record_stmt_references (gimple stmt)): created from ipa_record_stmt_references (void set_call_stmt_including_clones (gimple old_stmt, gimple new_stmt, bool update_speculative = true)): created from cgraph_set_call_stmt_including_clones (cgraph_node *function_symbol (enum availability *avail = NULL)): created from cgraph_function_node (cgraph_node *create_clone (tree decl, gcov_type count, int freq, bool update_original, vec<cgraph_edge *> redirect_callers, bool call_duplication_hook, struct cgraph_node *new_inlined_to, bitmap args_to_skip)): created from cgraph_create_clone (cgraph_node *create_virtual_clone (vec<cgraph_edge *> redirect_callers, vec<ipa_replace_map *, va_gc> *tree_map, bitmap args_to_skip, const char * suffix)): created from cgraph_create_virtual_clone (cgraph_node *find_replacement (void)): created from cgraph_find_replacement_node (cgraph_node *create_version_clone (tree new_decl, vec<cgraph_edge *> redirect_callers, bitmap bbs_to_copy)): created from cgraph_copy_node_for_versioning (cgraph_node *create_version_clone_with_body (vec<cgraph_edge *> redirect_callers, vec<ipa_replace_map *, va_gc> *tree_map, bitmap args_to_skip, bool skip_return, bitmap bbs_to_copy, basic_block new_entry_block, const char *clone_name)): created from cgraph_function_version_info (struct cgraph_function_version_info *insert_new_function_version (void)): created from insert_new_cgraph_node_version (struct cgraph_function_version_info *function_version (void)): created from get_cgraph_node_version (void analyze (void)): created from analyze_function (cgraph_node * create_thunk (tree alias, tree, bool this_adjusting, HOST_WIDE_INT fixed_offset, HOST_WIDE_INT virtual_value, tree virtual_offset, tree real_alias) cgraph_add_thunk (inline cgraph_node *get_alias_target (void)): created from cgraph_alias_target (cgraph_node *ultimate_alias_target (availability *availability = NULL)): created from cgraph_function_or_thunk_node (bool expand_thunk (bool output_asm_thunks, bool force_gimple_thunk)): created from expand_thunk (void reset (void)): created from cgraph_reset_node (void create_wrapper (cgraph_node *target)): created from cgraph_make_wrapper (void DEBUG_FUNCTION verify_node (void)): created from verify_cgraph_node (void remove (void)): created from cgraph_remove_node (void dump (FILE *f)): created from dump_cgraph_node (void DEBUG_FUNCTION debug (void)): created from debug_cgraph_node (bool get_body (void)): created from cgraph_get_body (void release_body (void)): created from cgraph_release_function_body (void unnest (void)): created from cgraph_unnest_node (void make_local (void)): created from cgraph_make_node_local (void mark_address_taken (void)): created from cgraph_mark_address_taken_node (struct cgraph_edge *create_edge (cgraph_node *callee, gimple call_stmt, gcov_type count, int freq)): created from cgraph_create_edge (struct cgraph_edge *create_indirect_edge (gimple call_stmt, int ecf_flags, gcov_type count, int freq)): created from cgraph_create_indirect_edge (void create_edge_including_clones (struct cgraph_node *callee, gimple old_stmt, gimple stmt, gcov_type count, int freq, cgraph_inline_failed_t reason)): created from cgraph_create_edge_including_clones (cgraph_edge *get_edge (gimple call_stmt)): created from cgraph_edge (vec<cgraph_edge *> collect_callers (void)): created from collect_callers_of_node (void remove_callers (void)): created from cgraph_node_remove_callers (void remove_callees (void)): created from cgraph_node_remove_callees (enum availability get_availability (void)): created from cgraph_function_body_availability (void set_nothrow_flag (bool nothrow)): created from cgraph_set_nothrow_flag (void set_const_flag (bool readonly, bool looping)): created from cgraph_set_const_flag (void set_pure_flag (bool pure, bool looping)): created from cgraph_set_pure_flag (void call_duplication_hooks (cgraph_node *node2)): created from cgraph_call_node_duplication_hooks (bool call_for_symbol_and_aliases (bool (*callback) (cgraph_node *, void *), void *data, bool include_overwritable)): created from cgraph_for_node_and_aliases (bool call_for_symbol_thunks_and_aliases (bool (*callback) (cgraph_node *node, void *data), void *data, bool include_overwritable)): created from cgraph_for_node_thunks_and_aliases (void call_function_insertion_hooks (void)): created from cgraph_call_function_insertion_hooks (inline void mark_force_output (void)): created from cgraph_mark_force_output_node (bool local_p (void)): created from cgraph_local_node (bool can_be_local_p (void)): created from cgraph_node_can_be_local_p (bool cannot_return_p (void)): created from cgraph_node_cannot_return (bool only_called_directly_p (void)): created from cgraph_only_called_directly_p (inline bool only_called_directly_or_aliased_p (void)): created from cgraph_only_called_directly_or_aliased_p (bool will_be_removed_from_program_if_no_direct_calls_p (void)): created from cgraph_will_be_removed_from_program_if_no_direct_calls (bool can_remove_if_no_direct_calls_and_refs_p (void)): created from cgraph_can_remove_if_no_direct_calls_and_refs_p (bool can_remove_if_no_direct_calls_p (void)): created from cgraph_can_remove_if_no_direct_calls_p (inline bool has_gimple_body_p (void)): created from cgraph_function_with_gimple_body_p (bool optimize_for_size_p (void)): created from cgraph_optimize_for_size_p (static void dump_cgraph (FILE *f)): created from dump_cgraph (static inline void debug_cgraph (void)): created from debug_cgraph (static void record_function_versions (tree decl1, tree decl2)): created from record_function_versions (static void delete_function_version (tree decl)): created from delete_function_version (static void add_new_function (tree fndecl, bool lowered)): created from cgraph_add_new_function (static inline cgraph_node *get (const_tree decl)): created from cgraph_get_node (static cgraph_node * create (tree decl)): created from cgraph_create_node (static cgraph_node * create_empty (void)): created from cgraph_create_empty_node (static cgraph_node * get_create (tree)): created from cgraph_get_create_node (static cgraph_node *get_for_asmname (tree asmname)): created from cgraph_node_for_asm (static cgraph_node * create_same_body_alias (tree alias, tree decl)): created from cgraph_same_body_alias (static bool used_from_object_file_p_worker (cgraph_node *node, void *): new function (static bool non_local_p (cgraph_node *node, void *)): created from cgraph_non_local_node_p_1 (static void DEBUG_FUNCTION verify_cgraph_nodes (void)): created from verify_cgraph (static bool make_local (cgraph_node *node, void *)): created from cgraph_make_node_local (static cgraph_node *create_alias (tree alias, tree target)): created from cgraph_create_function_alias (static cgraph_edge * create_edge (cgraph_node *caller, cgraph_node *callee, gimple call_stmt, gcov_type count, int freq, bool indir_unknown_callee)): created from cgraph_create_edge_1 * cgraph.h (varpool_node): (void remove (void)): created from varpool_remove_node (void dump (FILE *f)): created from dump_varpool_node From-SVN: r212982
2014-07-24 14:07:13 +02:00
first_clone->verify ();
[PATCH 7/9] ENABLE_CHECKING refactoring: middle-end, LTO FE [PATCH 7/9] ENABLE_CHECKING refactoring: middle-end, LTO FE gcc/lto/ChangeLog: 2015-10-27 Mikhail Maltsev <maltsevm@gmail.com> * lto.c (unify_scc): Use flag_checking and remove ENABLE_CHECKING conditionals. (lto_fixup_state): Likewise. (do_whole_program_analysis): Use symtab_node::checking_verify_symtab_nodes and remove ENABLE_CHECKING conditionals. gcc/ChangeLog: 2015-10-27 Mikhail Maltsev <maltsevm@gmail.com> * attribs.c (check_attribute_tables): New function, broken out from... (init_attributes): Use it. * cfgcleanup.c (try_optimize_cfg): Use flag_checking, CHECKING_P gcc_checking_assert and checking_* functions to eliminate ENABLE_CHECKING conditionals. * cfgexpand.c (expand_goto, expand_debug_expr): Likewise. (pass_expand::execute): Likewise. * cgraphclones.c (symbol_table::materialize_all_clones): Likewise. * cgraphunit.c (mark_functions_to_output): Likewise. (cgraph_node::expand_thunk): Likewise. (symbol_table::compile): Likewise. * ddg.c (add_cross_iteration_register_deps): Likewise. (create_ddg_all_sccs): Likewise. * df-core.c (df_finish_pass, df_analyze): Likewise. * diagnostic-core.h: Likewise. * diagnostic.c (diagnostic_report_diagnostic): Likewise. * dominance.c (calculate_dominance_info): Likewise. * dwarf2out.c (add_AT_die_ref): Likewise. (const_ok_for_output_1, mem_loc_descriptor): Likewise. (loc_list_from_tree, gen_lexical_block_die): Likewise. gen_type_die_with_usage, gen_type_die): Likewise. (dwarf2out_decl): Likewise. * emit-rtl.c (verify_rtx_sharing, reorder_insns_nobb): Likewise. * except.c (duplicate_eh_regions): Likewise. * fwprop.c (register_active_defs, update_df_init): Likewise. (fwprop_init, fwprop_done): Likewise. (update_uses): Likewise. * ggc-page.c (ggc_grow): Likewise. * gimplify.c (gimplify_body): Likewise. (gimplify_hasher::equal): Likewise. * graphite-isl-ast-to-gimple.c (graphite_verify): Likewise. * graphite-scop-detection.c (canonicalize_loop_closed_ssa_form): Likewise. * graphite-sese-to-poly.c (rewrite_reductions_out_of_ssa): Likewise. (rewrite_cross_bb_scalar_deps_out_of_ssa): Likwise. * hash-table.h (::find_empty_slot_for_expand): Likewise. * ifcvt.c (if_convert): Likewise. * ipa-cp.c (ipcp_propagate_stage): Likewise. * ipa-devirt.c (type_in_anonymous_namespace_p): Likewise. (odr_type_p, odr_types_equivalent_p): Likewise. (add_type_duplicate, get_odr_type): Likewise. * ipa-icf.c (sem_item_optimizer::execute): Likewise. (sem_item_optimizer::subdivide_classes_by_equality): Likewise. (sem_item_optimizer::verify_classes): Likewise. (sem_item_optimizer::traverse_congruence_split): Likewise. (sem_item_optimizer::checking_verify_classes): New. * ipa-icf.h (sem_item_optimizer::checking_verify_classes): Add new method. * cfgrtl.c (commit_edge_insertions): Likewise. (fixup_reorder_chain, cfg_layout_finalize): Likewise. (rtl_flow_call_edges_add): Likewise. * cgraph.c (symbol_table::create_edge): Likewise. (cgraph_edge::redirect_call_stmt_to_callee): Likewise. * cgraph.h (symtab_node): Likewise. (symtab_node::checking_verify_symtab_nodes): Define. (cgraph_node::checking_verify_cgraph_nodes): Define. * cfghooks.h (checking_verify_flow_info): Define. * cfgloop.h (checking_verify_loop_structure): Define. * dominance.h (checking_verify_dominators): Define. * et-forest.c: Fix comment. * ipa-inline-analysis.c (compute_inline_parameters): Use flag_checking, CHECKING_P gcc_checking_assert and checking_* functions to eliminate ENABLE_CHECKING conditionals. * ipa-inline-transform.c (save_inline_function_body): Likewise. * ipa-inline.c (inline_small_functions): Likewise. (early_inliner): Likewise. * ipa-inline.h (estimate_edge_growth): Likewise. * ipa-visibility.c (function_and_variable_visibility): Likewise. * ipa.c (symbol_table::remove_unreachable_nodes): Likewise. (ipa_single_use): Likewise. * ira-int.h: Likewise. * ira.c (ira): Likewise. * loop-doloop.c (doloop_optimize_loops): Likewise. * loop-init.c (loop_optimizer_init, fix_loop_structure): Likewise. * loop-invariant.c (move_loop_invariants): Likewise. * lra-assigns.c (lra_assign): Likewise. * lra-constraints.c (lra_constraints): Likewise. * lra-eliminations.c (lra_eliminate): Likewise. * lra-int.h (struct lra_reg): Likewise. * lra-lives.c (check_pseudos_live_through_calls): Likewise. (lra_create_live_ranges_1): Likewise. * lra-remat.c (create_remat_bb_data): Likewise. * lra.c (lra_update_insn_recog_data, restore_scratches): Likewise. (lra): Likewise. (check_rtl): Always define. Remove incorrect guard around extract_constrain_insn call. * lto-cgraph.c (input_cgraph_1: Use flag_checking, CHECKING_P gcc_checking_assert and checking_* functions to eliminate ENABLE_CHECKING conditionals. * lto-streamer-out.c (DFS::DFS): Likewise. (lto_output): Likewise. * lto-streamer.c (lto_streamer_init): Likewise. * omp-low.c (scan_omp_target, expand_omp_taskreg): Likewise. expand_omp_target, execute_expand_omp): Likewise. (lower_omp_target): Likewise. * passes.c (execute_function_todo): Likewise. (execute_todo, execute_one_pass): Likewise. (verify_curr_properties): Always define. * predict.c (tree_estimate_probability: Use flag_checking, CHECKING_P gcc_checking_assert and checking_* functions to eliminate ENABLE_CHECKING conditionals. (propagate_freq): Likewise. * pretty-print.c (pp_format): Likewise. * real.c (real_to_decimal_for_mode): Likewise. * recog.c (split_all_insns): Likewise. * regcprop.c (kill_value_one_regno): Likewise. (copy_value): Likewise. (validate_value_data): Define unconditionally. * reload.c: Fix comment. * timevar.c: Include options.h * tree-ssa.h (checking_verify_ssa): Define. * tree-ssa-loop-manip.h (checking_verify_loop_closed_ssa): Define. * sched-deps.c (CHECK): Remove unused macro. (add_or_update_dep_1, sd_add_dep: Use flag_checking, CHECKING_P gcc_checking_assert and checking_* functions to eliminate ENABLE_CHECKING conditionals. * sel-sched-ir.c (free_regset_pool, tidy_control_flow): Likewise. * sel-sched.c (struct moveop_static_params): Likewise. (find_best_reg_for_expr, move_cond_jump): Likewise. (move_op_orig_expr_not_found): Likewise. (code_motion_process_successors, move_op): Likewise. * ssa-iterators.h (first_readonly_imm_use): Likewise. (next_readonly_imm_use): Likewise. * store-motion.c (compute_store_table): Likewise. * symbol-summary.h (function_summary::function_summary): Likewise. * target.h (cumulative_args_t): Likewise. (get_cumulative_args, pack_cumulative_args): Likewise. * timevar.c: (timer::print): Likewise. * trans-mem.c (ipa_tm_execute): Likewise. * tree-cfg.c (move_stmt_op): Likewise. (move_sese_region_to_fn): Likewise. (gimple_flow_call_edges_add): Likewise. * tree-cfgcleanup.c (cleanup_tree_cfg_noloop, repair_loop_structures): Likewise. * tree-eh.c (remove_unreachable_handlers): Likewise. * tree-if-conv.c (pass_if_conversion::execute): Likewise. * tree-inline.c (expand_call_inline, optimize_inline_calls): Likewise. * tree-into-ssa.c (update_ssa): Likewise. * tree-loop-distribution.c (pass_loop_distribution::execute): Likewise. * tree-outof-ssa.c (eliminate_useless_phis, rewrite_trees): Likewise. * tree-parloops.c (pass_parallelize_loops::execute): Likewise. * tree-predcom.c (suitable_component_p): Likewise. * tree-profile.c (gimple_gen_const_delta_profiler): Likewise. * tree-ssa-alias.c (refs_may_alias_p_1): Likewise. * tree-ssa-live.c (verify_live_on_entry): Likewise. * tree-ssa-live.h (register_ssa_partition): Likewise. * tree-ssa-loop-ivcanon.c (tree_unroll_loops_completely): Likewise. * tree-ssa-loop-manip.c (add_exit_phi): Likewise. (tree_transform_and_unroll_loop): Likewise. * tree-ssa-math-opts.c (pass_cse_reciprocals::execute): Likewise. * tree-ssa-operands.c (get_expr_operands): Likewise. * tree-ssa-propagate.c (replace_exp_1): Likewise. * tree-ssa-structalias.c (rewrite_constraints): Likewise. * tree-ssa-ter.c (free_temp_expr_table): Likewise. * tree-ssa-threadupdate.c (duplicate_thread_path): Likewise. * tree-ssanames.c (release_ssa_name_fn): Likewise. * tree-stdarg.c (expand_ifn_va_arg): Likewise. * tree-vect-loop-manip.c (slpeel_tree_duplicate_loop_to_edge_cfg): Likewise. (slpeel_checking_verify_cfg_after_peeling): Likewise. (vect_do_peeling_for_loop_bound): Likewise. (vect_do_peeling_for_alignment): Likewise. * tree-vrp.c (supports_overflow_infinity): Likewise. (set_value_range): Likewise. * tree.c (free_lang_data_in_cgraph): Likewise. * value-prof.c (gimple_remove_histogram_value): Likewise. (free_hist): Likewise. * var-tracking.c (canonicalize_values_star): Likewise. (compute_bb_dataflow, vt_find_locations, vt_emit_notes): Likewise. From-SVN: r229470
2015-10-28 02:05:53 +01:00
return first_clone;
}
cgraphunit.c: Update toplevel comment. * cgraphunit.c: Update toplevel comment. (tree_rest_of_compilation): Merge into cgraph_expand_function. (cgraph_analyze_function): Make static. (cgraph_decide_is_function_needed): Make static. (cgraph_add_new_function): Use expand_function instead of rest_of_compilation. (clone_of_p, verify_edge_count_and_frequency, cgraph_debug_gimple_stmt, verify_edge_corresponds_to_fndecl, verify_cgraph_node, verify_cgraph): Move to cgraph.c (cgraph_inline_p): Remove. (cgraph_preserve_function_body_p): Move to ipa-inline-transform. (init_cgraph): Add comment. * cgraphbuild.c (record_reference, mark_address, mark_load, mark_store): Do not call analyze_expr hook. * cgraph.c: Update toplevel comment. (clone_of_p, verify_edge_count_and_frequency, cgraph_debug_gimple_stmt, verify_edge_corresponds_to_fndecl, verify_cgraph_node, verify_cgraph): Move fere from cgraphunit.c (cgraph_mark_force_output_node): Move to cgraph.h * cgraph.h: Reorder so the comments match the function placement. (cgraph_analyze_function, cgraph_decide_is_function_needed): Remove. (cgraph_mark_force_output_node): Move here from cgraph.c * tree.c (free_lang_data): Do not clear analyze_expr hook. * ipa-inline-transform.c (preserve_function_body_p): New function. (inline_transform): Update. * langhooks.c (lhd_callgraph_analyze_expr): Remove. * langhooks.h (lang_hooks_for_callgraph): Remove. (lang_hooks): Remove callgraph. * tree-inline.c (expand_call_inline): Do not use cgraph_inline_p. * varpool.c: Remove out of date comment. * langhooks-def.h (lhd_callgraph_analyze_expr): Remove. (LANG_HOOKS_CALLGRAPH_ANALYZE_EXPR): Remove. From-SVN: r186832
2012-04-25 18:31:42 +02:00
/* Return true when function body of DECL still needs to be kept around
for later re-use. */
cgraph.c (ld_plugin_symbol_resolution_names): Move to symtab.c * cgraph.c (ld_plugin_symbol_resolution_names): Move to symtab.c (cgraph_asm_nodes, cgraph_asm_last_node): Move to cgraphunit.c (cgraph_add_to_same_comdat_group): Remove. (cgraph_add_asm_node): Move to cgraphunit.c. (cgraph_make_decl_local): Move to symtab.c (cgraph_make_node_local_1): Update. (cgraph_can_remove_if_no_direct_calls_and): Update. (used_from_object_file_p): Update. (resolution_used_from_other_file_p): Move to symtab.c (cgraph_used_from_object_file_p): move to symtab.c (verify_cgraph_node): Verify same comdat groups. * cgraph.h (cgraph_asm_node): Rename to ... (asm_node): ... this one. (cgraph_asm_nodes): Rename to ... (asm_nodes): ... this one. (symtab_add_to_same_comdat_group): New function. (symtab_dissolve_same_comdat_group_list): New function. (symtab_used_from_object_file_p): Declare. (symtab_make_decl_local): Declare. (cgraph_add_to_same_comdat_group): Remove. (cgraph_add_asm_node): Remove. (cgraph_used_from_object_file_p, varpool_used_from_object_file_p): Remove. (cgraph_finalize_compilation_unit): Rename to ... (finalize_compilation_unit): ... this one. (cgraph_optimize): Rename to .... (compile): ... this one. (add_asm_node): Declare. (fixup_same_cpp_alias_visibility): Declare. (cgraph_make_decl_local): Remove. (varpool_assemble_pending_decls): Rename to ... (varpool_output_variables): ... this one. (varpool_remove_unreferenced_decls): Remove. * ipa-inline-transform.c (clone_inlined_nodes): Dissolve comdat groups. (preserve_function_body_p): Make static. * toplev.c (compile_file): Update comments; update. * cgraphunit.c: Update comments. (cgraph_expand_all_functions): Rename to ... (expand_all_functions): ... this one; update. (cgraph_mark_functions_to_output): Rename to ... (mark_functions_to_output): ... this one; cleanup. (cgraph_output_pending_asms): Remove prototype. (asm_nodes, asm_last_node): New static vars. (cgraph_process_new_functions): Update. (cgraph_reset_node): Cleanup; add comment. (cgraph_add_new_function): Update. (cgraph_output_pending_asms): Rename to ... (output_asm_statements): ... this one. (add_asm_node): New function. (fixup_same_cpp_alias_visibility): New function based on code in cgraph_analyze_function. (cgraph_analyze_function): Use it. (cgraph_order_sort): Update. (cgraph_output_in_order): Update. (cgraph_function_versioning): Update. (cgraph_optimize): Rename to ... (compile): ... this one; initialize streamer hooks here. (cgraph_finalize_compilation_unit): Rename to ... (finalize_compilation_unit): ... this one; do not initialize streamer hook here. * lto-streamer-out.c (lto_output_toplevel_asms): Update. * dwarf2out.c: Update ocmment. * optimize.c (maybe_clone_body): Use symtab_add_to_same_comdat_group. * method.c (use_thunk): Likewise. * semantics.c (maybe_add_lambda_conv_op): Likewise. * decl2.c (maybe_emit_vtables): Likewise. (cp_write_global_declarations): Use finalize_compilation_unit. * parser.c (cp_parser_asm_definition): Use add_asm_node. * lto-streamer-in.c (lto_input_toplevel_asms): Use add_asm_node * c-decl.c (c_write_global_declarations): Use finalize_compilation_unit. * langhooks.c (write_global_declarations): Update. * ipa.c (cgraph_externally_visible_p): Update. (dissolve_same_comdat_group_list): Remove. (function_and_variable_visibility): Update. * symtab.c: Inlcude lto-streamer.h and rtl.h (ld_plugin_symbol_resolution_names): New. (symtab_add_to_same_comdat_group): New. (symtab_dissolve_same_comdat_group_list): New. (resolution_used_from_other_file_p): Move here from cgraph.c (symtab_used_from_object_file_p): New. (symtab_make_decl_local): New. * passes.c (register_pass): Update comments. * c-parser.c (c_parser_asm_definition): Update. * varpool.c (varpool_analyze_node): Use fixup_same_cpp_alias_visibility. (varpool_remove_unreferenced_decls): Make static. (varpool_assemble_pending_decls): Rename to ... (varpool_output_variables): ... this one; call varpool_remove_unreferenced_decls. (varpool_used_from_object_file_p): Remove. * gogo-tree.cc (Gogo::write_globals): Use finalize_compilation_unit. * gcc-interface/utils.c (rest_of_subprog_body_compilation): Update comment. (gnat_write_global_declarations): Use finalize_compilation_unit. * f95-lang.c (gfc_finish): Update comments. * lto.c (lto_main): Use compile (). * lto-partition.c (partition_cgraph_node_p): Use symtab_used_from_object_file_p. (partition_varpool_node_p): Likewise. From-SVN: r186998
2012-04-30 19:55:29 +02:00
static bool
cgraphunit.c: Update toplevel comment. * cgraphunit.c: Update toplevel comment. (tree_rest_of_compilation): Merge into cgraph_expand_function. (cgraph_analyze_function): Make static. (cgraph_decide_is_function_needed): Make static. (cgraph_add_new_function): Use expand_function instead of rest_of_compilation. (clone_of_p, verify_edge_count_and_frequency, cgraph_debug_gimple_stmt, verify_edge_corresponds_to_fndecl, verify_cgraph_node, verify_cgraph): Move to cgraph.c (cgraph_inline_p): Remove. (cgraph_preserve_function_body_p): Move to ipa-inline-transform. (init_cgraph): Add comment. * cgraphbuild.c (record_reference, mark_address, mark_load, mark_store): Do not call analyze_expr hook. * cgraph.c: Update toplevel comment. (clone_of_p, verify_edge_count_and_frequency, cgraph_debug_gimple_stmt, verify_edge_corresponds_to_fndecl, verify_cgraph_node, verify_cgraph): Move fere from cgraphunit.c (cgraph_mark_force_output_node): Move to cgraph.h * cgraph.h: Reorder so the comments match the function placement. (cgraph_analyze_function, cgraph_decide_is_function_needed): Remove. (cgraph_mark_force_output_node): Move here from cgraph.c * tree.c (free_lang_data): Do not clear analyze_expr hook. * ipa-inline-transform.c (preserve_function_body_p): New function. (inline_transform): Update. * langhooks.c (lhd_callgraph_analyze_expr): Remove. * langhooks.h (lang_hooks_for_callgraph): Remove. (lang_hooks): Remove callgraph. * tree-inline.c (expand_call_inline): Do not use cgraph_inline_p. * varpool.c: Remove out of date comment. * langhooks-def.h (lhd_callgraph_analyze_expr): Remove. (LANG_HOOKS_CALLGRAPH_ANALYZE_EXPR): Remove. From-SVN: r186832
2012-04-25 18:31:42 +02:00
preserve_function_body_p (struct cgraph_node *node)
{
IPA C++ refactoring 4/N * cgraph.h (symtab_node): (bool needed_p (void)): created from decide_is_symbol_needed (bool referred_to_p (void)): created from referred_to_p (static cgraph_node *get_for_asmname (tree asmname)): created from symtab_node_for_asm * cgraph.h (cgraph_node): (void assemble_thunks_and_aliases (void)): created from assemble_thunks_and_aliases (void expand (void)): created from expand_function (static void finalize_function (tree, bool)): created from cgraph_finalize_function (static cgraph_local_info *local_info (tree decl)): created from cgraph_local_info (static cgraph_global_info *global_info (tree)): created from cgraph_global_info (static cgraph_rtl_info *rtl_info (tree)): created from cgraph_rtl_info * cgraph.h (varpool_node): (static void add (tree decl): created from varpool_add_new_variable * cgraph.h (cgraph_edge): void remove (void); (void remove_caller (void)): created from cgraph_edge_remove_caller (void remove_callee (void)): created from cgraph_edge_remove_callee (void set_call_stmt (gimple new_stmt, bool update_speculative = true)): created from cgraph_set_call_stmt (void redirect_callee (cgraph_node *n)): created from cgraph_redirect_edge_callee (cgraph_edge *make_direct (cgraph_node *callee)): created from cgraph_make_edge_direct (cgraph_edge *make_speculative (cgraph_node *n2, gcov_type direct_count, gimple redirect_call_stmt_to_callee (void)): created from cgraph_turn_edge_to_speculative (void speculative_call_info (cgraph_edge *&direct, cgraph_edge *&indirect, ipa_ref *&reference)): created from cgraph_speculative_call_info (cgraph_edge * clone (cgraph_node *n, gimple call_stmt, unsigned stmt_uid, gcov_type count_scale, int freq_scale, bool update_original)): created from cgraph_clone_edge (cgraph_edge *resolve_speculation (tree callee_decl)): created from cgraph_resolve_speculation (bool cannot_lead_to_return_p (void)): created from cannot_lead_to_return_p (bool recursive_p (void)): created from cgraph_edge_recursive_p (bool maybe_hot_p (void)): created from cgraph_maybe_hot_edge_p (static unsigned int rebuild_edges (void)): created from rebuild_cgraph_edges (static void rebuild_references (void)): created from cgraph_rebuild_references * cgraph.h (symbol_table): (create_reference): renamed from add_reference (maybe_create_reference): renamed from maybe_add_reference (void register_symbol (symtab_node *node)): new function (void clear_asm_symbols (void)): new function (void unregister (symtab_node *node)): new function (void release_symbol (cgraph_node *node, int uid)): new function (cgraph_node * allocate_cgraph_symbol (void)): new function (void initialize (void)): created from cgraph_init (symtab_node *first_symbol (void)):new function (asm_node *first_asm_symbol (void)):new function (symtab_node *first_defined_symbol (void)):new function (varpool_node *first_variable (void)):new function (varpool_node *next_variable (varpool_node *node)):new function (varpool_node *first_static_initializer (void)):new function (varpool_node *next_static_initializer (varpool_node *node)):new function (varpool_node *first_defined_variable (void)):new function (varpool_node *next_defined_variable (varpool_node *node)):new function (cgraph_node *first_defined_function (void)):new function (cgraph_node *next_defined_function (cgraph_node *node)):new function (cgraph_node *first_function (void)):new function (cgraph_node *next_function (cgraph_node *node)):new function (cgraph_node *first_function_with_gimple_body (void)):new function (asm_node *finalize_toplevel_asm (tree asm_str)): created from add_asm_node (bool remove_unreachable_nodes (bool before_inlining_p, FILE *file)): created from symtab_remove_unreachable_nodes (void remove_unreferenced_decls (void)): created from varpool_remove_unreferenced_decls (void process_new_functions (void)): created from cgraph_process_new_functions (void process_same_body_aliases (void)): created from cgraph_process_same_body_aliases (bool output_variables (void)): created from varpool_node::output_variables (void output_asm_statements (void)): created from output_asm_statements (void finalize_compilation_unit (void)): created from finalize_compilation_unit (void compile (void)): created from compile (void output_weakrefs (void)): created from output_weakrefs (cgraph_node *create_empty (void)): created from cgraph_node::create_empty (cgraph_edge *create_edge (cgraph_node *caller, cgraph_node *callee, gimple call_stmt, gcov_type count, int freq, bool indir_unknown_callee)): created from cgraph_node::create_edge (void free_edge (cgraph_edge *e)): created from cgraph_free_edge (cgraph_node *next_function_with_gimple_body (cgraph_node *node)): created from cgraph_next_function_with_gimple_body (void remove_edge_removal_hook (cgraph_edge_hook_list *)): created from cgraph_remove_edge_removal_hook (cgraph_node_hook_list *add_cgraph_removal_hook (cgraph_node_hook, void *)): created from cgraph_add_node_removal_hook (void remove_cgraph_removal_hook (cgraph_node_hook_list *)): created from cgraph_remove_node_removal_hook (varpool_node_hook_list *add_varpool_removal_hook (varpool_node_hook, void *)): created from varpool_add_node_removal_hook (void remove_varpool_removal_hook (varpool_node_hook_list *)): created from varpool_remove_node_removal_hook (cgraph_node_hook_list *add_cgraph_insertion_hook (cgraph_node_hook, void *)): created from cgraph_add_function_insertion_hook (void remove_cgraph_insertion_hook (cgraph_node_hook_list *)): created from cgraph_remove_function_insertion_hook (varpool_node_hook_list *add_varpool_insertion_hook (varpool_node_hook, void *)): created from varpool_add_variable_insertion_hook (void remove_varpool_insertion_hook (varpool_node_hook_list *)): created from varpool_remove_variable_insertion_hook (cgraph_2edge_hook_list *add_edge_duplication_hook (cgraph_2edge_hook, void *)): created from cgraph_add_edge_duplication_hook (void remove_edge_duplication_hook (cgraph_2edge_hook_list *)): created from cgraph_remove_edge_duplication_hook (cgraph_2node_hook_list *add_cgraph_duplication_hook (cgraph_2node_hook, void *)): created from cgraph_add_node_duplication_hook (void remove_cgraph_duplication_hook (cgraph_2node_hook_list *)): created from cgraph_remove_node_duplication_hook (void call_edge_removal_hooks (cgraph_edge *e)): created from cgraph_call_edge_removal_hooks (void call_cgraph_insertion_hooks (cgraph_node *node)): created from call_function_insertion_hooks (void call_cgraph_removal_hooks (cgraph_node *node)): created from cgraph_call_node_removal_hooks (void call_cgraph_duplication_hooks (cgraph_node *node, cgraph_node *node2)): created from cgraph_node::call_duplication_hooks (void call_edge_duplication_hooks (cgraph_edge *cs1, cgraph_edge *cs2)): created from cgraph_call_edge_duplication_hooks (void call_varpool_removal_hooks (varpool_node *node)): created from varpool_call_node_removal_hooks (void call_varpool_insertion_hooks (varpool_node *node)): created from varpool_call_variable_insertion_hooks (void insert_to_assembler_name_hash (symtab_node *node, bool with_clones)): created from insert_to_assembler_name_hash (void unlink_from_assembler_name_hash (symtab_node *node, bool with_clones)): created from unlink_from_assembler_name_hash (void symtab_prevail_in_asm_name_hash (symtab_node *node)): created from symtab_prevail_in_asm_name_hash (void symtab_initialize_asm_name_hash (void)): created from symtab_initialize_asm_name_hash (void change_decl_assembler_name (tree decl, tree name)): created from change_decl_assembler_name (void materialize_all_clones (void)): created from cgraph_materialize_all_clones (static hashval_t decl_assembler_name_hash (const_tree asmname)): created from decl_assembler_name_hash (static bool decl_assembler_name_equal (tree decl, const_tree asmname)): created from decl_assembler_name_equal (static hashval_t hash_node_by_assembler_name (const void *p)): created from hash_node_by_assembler_name (static int eq_assembler_name (const void *p1, const void *p2)): created from eq_assembler_name From-SVN: r214422
2014-08-25 15:01:47 +02:00
gcc_assert (symtab->global_info_ready);
Autogenerated fixes of "->symbol." to "->" This is the autogenerated part of the conversion of the symtable types to a C++ class hierarchy. gcc/ Patch autogenerated by refactor_symtab.py from https://github.com/davidmalcolm/gcc-refactoring-scripts revision 58bb219cc090b2f4516a9297d868c245495ee622 * asan.c (asan_finish_file): Update for conversion of symtab types to a true class hierarchy. * cfgexpand.c (estimated_stack_frame_size): Likewise. * cgraph.c (cgraph_get_body): Likewise. (cgraph_get_create_real_symbol_node): Likewise. (verify_cgraph_node): Likewise. (verify_edge_corresponds_to_fndecl): Likewise. (verify_edge_count_and_frequency): Likewise. (cgraph_will_be_removed_from_program_if_no_direct_calls): Likewise. (cgraph_can_remove_if_no_direct_calls_p): Likewise. (cgraph_can_remove_if_no_direct_calls_and_refs_p): Likewise. (cgraph_node_cannot_return): Likewise. (cgraph_set_pure_flag_1): Likewise. (cgraph_set_const_flag_1): Likewise. (cgraph_set_nothrow_flag_1): Likewise. (cgraph_make_node_local_1): Likewise. (cgraph_for_node_and_aliases): Likewise. (cgraph_for_node_thunks_and_aliases): Likewise. (cgraph_node_can_be_local_p): Likewise. (cgraph_node_cannot_be_local_p_1): Likewise. (cgraph_function_body_availability): Likewise. (dump_cgraph_node): Likewise. (cgraph_rtl_info): Likewise. (cgraph_mark_address_taken_node): Likewise. (cgraph_remove_node): Likewise. (cgraph_release_function_body): Likewise. (cgraph_update_edges_for_call_stmt_node): Likewise. (cgraph_redirect_edge_call_stmt_to_callee): Likewise. (cgraph_make_edge_direct): Likewise. (cgraph_resolve_speculation): Likewise. (cgraph_speculative_call_info): Likewise. (cgraph_turn_edge_to_speculative): Likewise. (cgraph_create_edge_1): Likewise. (cgraph_set_call_stmt): Likewise. (cgraph_node_for_asm): Likewise. (cgraph_add_thunk): Likewise. (cgraph_same_body_alias): Likewise. (cgraph_create_function_alias): Likewise. (cgraph_create_node): Likewise. (cgraph_create_empty_node): Likewise. (record_function_versions): Likewise. (used_from_object_file_p): Likewise. * cgraph.h (symtab_can_be_discarded): Likewise. (symtab_real_symbol_p): Likewise. (cgraph_mark_force_output_node): Likewise. (cgraph_edge_recursive_p): Likewise. (symtab_alias_target): Likewise. (varpool_all_refs_explicit_p): Likewise. (varpool_can_remove_if_no_refs): Likewise. (cgraph_only_called_directly_or_aliased_p): Likewise. (cgraph_next_function_with_gimple_body): Likewise. (cgraph_first_function_with_gimple_body): Likewise. (cgraph_function_with_gimple_body_p): Likewise. (cgraph_next_function): Likewise. (cgraph_first_function): Likewise. (cgraph_next_defined_function): Likewise. (cgraph_first_defined_function): Likewise. (varpool_next_defined_variable): Likewise. (varpool_first_defined_variable): Likewise. (varpool_next_static_initializer): Likewise. (varpool_first_static_initializer): Likewise. (varpool_next_variable): Likewise. (varpool_first_variable): Likewise. (varpool_node_name): Likewise. (varpool): Likewise. (cgraph): Likewise. (is_a_helper <varpool_node>::test): Likewise. (is_a_helper <cgraph_node>::test): Likewise. (varpool_variable_node): Likewise. (cgraph_function_or_thunk_node): Likewise. (varpool_alias_target): Likewise. (cgraph_alias_target): Likewise. (cgraph_node_name): Likewise. (varpool_node_asm_name): Likewise. (cgraph_node_asm_name): Likewise. * cgraphbuild.c (remove_cgraph_callee_edges): Likewise. (cgraph_rebuild_references): Likewise. (rebuild_cgraph_edges): Likewise. (record_eh_tables): Likewise. (build_cgraph_edges): Likewise. (mark_store): Likewise. (mark_load): Likewise. (mark_address): Likewise. (record_type_list): Likewise. (record_reference): Likewise. * cgraphclones.c (cgraph_materialize_all_clones): Likewise. (cgraph_materialize_clone): Likewise. (cgraph_function_versioning): Likewise. (cgraph_copy_node_for_versioning): Likewise. (update_call_expr): Likewise. (cgraph_find_replacement_node): Likewise. (cgraph_create_virtual_clone): Likewise. (cgraph_clone_node): Likewise. * cgraphunit.c (compile): Likewise. (output_weakrefs): Likewise. (output_in_order): Likewise. (expand_function): Likewise. (assemble_thunks_and_aliases): Likewise. (expand_thunk): Likewise. (mark_functions_to_output): Likewise. (handle_alias_pairs): Likewise. (analyze_functions): Likewise. (walk_polymorphic_call_targets): Likewise. (varpool_finalize_decl): Likewise. (process_function_and_variable_attributes): Likewise. (cgraph_process_same_body_aliases): Likewise. (analyze_function): Likewise. (cgraph_add_new_function): Likewise. (cgraph_finalize_function): Likewise. (referred_to_p): Likewise. (cgraph_reset_node): Likewise. (cgraph_process_new_functions): Likewise. (enqueue_node): Likewise. (decide_is_symbol_needed): Likewise. * coverage.c (coverage_compute_profile_id): Likewise. * dbxout.c (dbxout_expand_expr): Likewise. * dwarf2out.c (premark_types_used_by_global_vars_helper): Likewise. (reference_to_unused): Likewise. * gimple-fold.c (can_refer_decl_in_current_unit_p): Likewise. * gimplify.c (unvisit_body): Likewise. (unshare_body): Likewise. * ipa-cp.c (ipcp_generate_summary): Likewise. (ipcp_decision_stage): Likewise. (identify_dead_nodes): Likewise. (decide_whether_version_node): Likewise. (decide_about_value): Likewise. (perhaps_add_new_callers): Likewise. (create_specialized_node): Likewise. (update_profiling_info): Likewise. (ipcp_propagate_stage): Likewise. (estimate_local_effects): Likewise. (good_cloning_opportunity_p): Likewise. (devirtualization_time_bonus): Likewise. (propagate_constants_accross_call): Likewise. (initialize_node_lattices): Likewise. (ipcp_cloning_candidate_p): Likewise. (determine_versionability): Likewise. (print_all_lattices): Likewise. (print_lattice): Likewise. (ipcp_discover_new_direct_edges): Likewise. * ipa-devirt.c (ipa_devirt): Likewise. (likely_target_p): Likewise. (update_type_inheritance_graph): Likewise. (possible_polymorphic_call_target_p): Likewise. (dump_possible_polymorphic_call_targets): Likewise. (devirt_variable_node_removal_hook): Likewise. (record_binfo): Likewise. (maybe_record_node): Likewise. (build_type_inheritance_graph): Likewise. * ipa-inline-analysis.c (inline_write_summary): Likewise. (inline_generate_summary): Likewise. (inline_analyze_function): Likewise. (do_estimate_growth): Likewise. (simple_edge_hints): Likewise. (estimate_node_size_and_time): Likewise. (estimate_edge_devirt_benefit): Likewise. (compute_inline_parameters): Likewise. (estimate_function_body_sizes): Likewise. (compute_bb_predicates): Likewise. (initialize_inline_failed): Likewise. (dump_inline_summary): Likewise. (dump_inline_edge_summary): Likewise. * ipa-inline-transform.c (inline_transform): Likewise. (preserve_function_body_p): Likewise. (save_inline_function_body): Likewise. (inline_call): Likewise. (clone_inlined_nodes): Likewise. (can_remove_node_now_p): Likewise. (can_remove_node_now_p_1): Likewise. * ipa-inline.c (early_inliner): Likewise. (early_inline_small_functions): Likewise. (inline_always_inline_functions): Likewise. (ipa_inline): Likewise. (flatten_function): Likewise. (inline_small_functions): Likewise. (speculation_useful_p): Likewise. (recursive_inlining): Likewise. (update_caller_keys): Likewise. (reset_edge_caches): Likewise. (update_edge_key): Likewise. (edge_badness): Likewise. (relative_time_benefit): Likewise. (want_inline_self_recursive_call_p): Likewise. (want_inline_small_function_p): Likewise. (want_early_inline_function_p): Likewise. (num_calls): Likewise. (can_early_inline_edge_p): Likewise. (can_inline_edge_p): Likewise. (report_inline_failed_reason): Likewise. * ipa-profile.c (ipa_profile): Likewise. (ipa_propagate_frequency): Likewise. (ipa_propagate_frequency_1): Likewise. (ipa_profile_generate_summary): Likewise. * ipa-prop.c (ipcp_transform_function): Likewise. (read_replacements_section): Likewise. (ipa_prop_read_section): Likewise. (ipa_modify_call_arguments): Likewise. (ipa_print_node_params): Likewise. (propagate_controlled_uses): Likewise. (update_indirect_edges_after_inlining): Likewise. (remove_described_reference): Likewise. (ipa_make_edge_direct_to_target): Likewise. (ipa_analyze_node): Likewise. (ipa_analyze_params_uses): Likewise. (ipa_compute_jump_functions): Likewise. (ipa_get_callee_param_type): Likewise. (ipa_print_node_jump_functions): Likewise. (ipa_initialize_node_params): Likewise. (ipa_populate_param_decls): Likewise. (ipa_func_spec_opts_forbid_analysis_p): Likewise. (write_agg_replacement_chain): Likewise. (ipa_write_node_info): Likewise. (ipa_edge_duplication_hook): Likewise. (try_decrement_rdesc_refcount): Likewise. * ipa-pure-const.c (propagate_nothrow): Likewise. (propagate_pure_const): Likewise. (pure_const_read_summary): Likewise. (pure_const_write_summary): Likewise. (analyze_function): Likewise. * ipa-ref-inline.h (ipa_ref_referred_ref_list): Likewise. (ipa_ref_referring_ref_list): Likewise. * ipa-ref.c (ipa_clear_stmts_in_references): Likewise. (ipa_remove_stmt_references): Likewise. (ipa_find_reference): Likewise. (ipa_dump_referring): Likewise. (ipa_dump_references): Likewise. (ipa_record_reference): Likewise. * ipa-reference.c (ipa_reference_read_optimization_summary): Likewise. (ipa_reference_write_optimization_summary): Likewise. (write_node_summary_p): Likewise. (propagate): Likewise. (read_write_all_from_decl): Likewise. (generate_summary): Likewise. (analyze_function): Likewise. (propagate_bits): Likewise. (ipa_reference_get_not_written_global): Likewise. (ipa_reference_get_not_read_global): Likewise. * ipa-split.c (execute_split_functions): Likewise. (split_function): Likewise. * ipa-utils.c (ipa_merge_profiles): Likewise. (dump_cgraph_node_set): Likewise. (ipa_reverse_postorder): Likewise. (ipa_edge_within_scc): Likewise. (ipa_get_nodes_in_cycle): Likewise. (ipa_free_postorder_info): Likewise. (ipa_reduced_postorder): Likewise. (searchc): Likewise. (recursive_call_p): Likewise. * ipa.c (ipa_cdtor_merge): Likewise. (record_cdtor_fn): Likewise. (function_and_variable_visibility): Likewise. (varpool_externally_visible_p): Likewise. (cgraph_externally_visible_p): Likewise. (comdat_can_be_unshared_p): Likewise. (comdat_can_be_unshared_p_1): Likewise. (address_taken_from_non_vtable_p): Likewise. (ipa_discover_readonly_nonaddressable_vars): Likewise. (symtab_remove_unreachable_nodes): Likewise. (walk_polymorphic_call_targets): Likewise. (process_references): Likewise. (enqueue_node): Likewise. (has_addr_references_p): Likewise. (cgraph_non_local_node_p_1): Likewise. * is-a.h (varpool_analyze_node): Likewise. * lto-cgraph.c (input_symtab): Likewise. (merge_profile_summaries): Likewise. (input_cgraph_1): Likewise. (input_edge): Likewise. (input_varpool_node): Likewise. (input_node): Likewise. (input_overwrite_node): Likewise. (compute_ltrans_boundary): Likewise. (output_refs): Likewise. (lto_output_varpool_node): Likewise. (lto_output_node): Likewise. (reachable_from_other_partition_p): Likewise. (referenced_from_other_partition_p): Likewise. (lto_output_edge): Likewise. (output_node_opt_summary): Likewise. (add_node_to): Likewise. (reachable_from_this_partition_p): Likewise. (lto_set_symtab_encoder_in_partition): Likewise. (lto_symtab_encoder_in_partition_p): Likewise. (lto_set_symtab_encoder_encode_initializer): Likewise. (lto_symtab_encoder_encode_initializer_p): Likewise. (lto_set_symtab_encoder_encode_body): Likewise. (lto_symtab_encoder_encode_body_p): Likewise. * lto-section-in.c (lto_free_function_in_decl_state_for_node): Likewise. * lto-streamer-in.c (lto_read_body): Likewise. (fixup_call_stmt_edges): Likewise. (fixup_call_stmt_edges_1): Likewise. * lto-streamer-out.c (produce_symtab): Likewise. (output_symbol_p): Likewise. (write_symbol): Likewise. (lto_output): Likewise. (copy_function): Likewise. (output_function): Likewise. * passes.c (function_called_by_processed_nodes_p): Likewise. (ipa_write_optimization_summaries): Likewise. (ipa_write_summaries): Likewise. (do_per_function_toporder): Likewise. (do_per_function): Likewise. (dump_passes): Likewise. * symtab.c (symtab_semantically_equivalent_p): Likewise. (symtab_nonoverwritable_alias): Likewise. (symtab_nonoverwritable_alias_1): Likewise. (symtab_for_node_and_aliases): Likewise. (symtab_resolve_alias): Likewise. (fixup_same_cpp_alias_visibility): Likewise. (symtab_alias_ultimate_target): Likewise. (symtab_used_from_object_file_p): Likewise. (verify_symtab_base): Likewise. (dump_symtab_base): Likewise. (symtab_node_name): Likewise. (symtab_node_asm_name): Likewise. (symtab_dissolve_same_comdat_group_list): Likewise. (symtab_add_to_same_comdat_group): Likewise. (symtab_unregister_node): Likewise. (symtab_insert_node_to_hashtable): Likewise. (symtab_register_node): Likewise. (unlink_from_assembler_name_hash): Likewise. (insert_to_assembler_name_hash): Likewise. (eq_assembler_name): Likewise. (hash_node_by_assembler_name): Likewise. (eq_node): Likewise. (hash_node): Likewise. * toplev.c (wrapup_global_declaration_2): Likewise. * trans-mem.c (ipa_tm_execute): Likewise. (ipa_tm_transform_clone): Likewise. (ipa_tm_transform_transaction): Likewise. (ipa_tm_transform_calls_redirect): Likewise. (ipa_tm_insert_gettmclone_call): Likewise. (ipa_tm_insert_irr_call): Likewise. (ipa_tm_create_version): Likewise. (ipa_tm_create_version_alias): Likewise. (ipa_tm_mark_forced_by_abi_node): Likewise. (ipa_tm_mark_force_output_node): Likewise. (ipa_tm_diagnose_tm_safe): Likewise. (ipa_tm_mayenterirr_function): Likewise. (ipa_tm_scan_irr_function): Likewise. (ipa_tm_note_irrevocable): Likewise. (ipa_tm_scan_calls_clone): Likewise. (get_cg_data): Likewise. * tree-eh.c (tree_could_trap_p): Likewise. * tree-emutls.c (ipa_lower_emutls): Likewise. (create_emultls_var): Likewise. (lower_emutls_function_body): Likewise. (gen_emutls_addr): Likewise. (emutls_decl): Likewise. (new_emutls_decl): Likewise. * tree-inline.c (tree_function_versioning): Likewise. (optimize_inline_calls): Likewise. (expand_call_inline): Likewise. (estimate_num_insns): Likewise. (copy_bb): Likewise. (delete_unreachable_blocks_update_callgraph): Likewise. * tree-nested.c (gimplify_all_functions): Likewise. (create_nesting_tree): Likewise. (check_for_nested_with_variably_modified): Likewise. * tree-pretty-print.c (dump_function_header): Likewise. * tree-profile.c (tree_profiling): Likewise. * tree-sra.c (ipa_sra_preliminary_function_checks): Likewise. (modify_function): Likewise. (convert_callers): Likewise. (convert_callers_for_node): Likewise. * tree-ssa-structalias.c (ipa_pta_execute): Likewise. (associate_varinfo_to_alias): Likewise. (create_variable_info_for): Likewise. (get_constraint_for_ssa_var): Likewise. * tree-vectorizer.c (increase_alignment): Likewise. * tree.c (find_decls_types_in_var): Likewise. (find_decls_types_in_node): Likewise. (free_lang_data_in_decl): Likewise. * value-prof.c (gimple_ic_transform): Likewise. (gimple_ic): Likewise. (check_ic_target): Likewise. (init_node_map): Likewise. * varasm.c (decl_binds_to_current_def_p): Likewise. (default_binds_local_p_1): Likewise. (dump_tm_clone_pairs): Likewise. (assemble_alias): Likewise. (find_decl): Likewise. (mark_decl_referenced): Likewise. * varpool.c (varpool_for_node_and_aliases): Likewise. (varpool_extra_name_alias): Likewise. (varpool_create_variable_alias): Likewise. (add_new_static_var): Likewise. (varpool_finalize_named_section_flags): Likewise. (varpool_remove_unreferenced_decls): Likewise. (enqueue_node): Likewise. (varpool_assemble_decl): Likewise. (assemble_aliases): Likewise. (varpool_analyze_node): Likewise. (cgraph_variable_initializer_availability): Likewise. (varpool_add_new_variable): Likewise. (ctor_for_folding): Likewise. (dump_varpool_node): Likewise. (varpool_remove_initializer): Likewise. (varpool_remove_node): Likewise. (varpool_node_for_decl): Likewise. (varpool_create_empty_node): Likewise. * config/i386/i386.c (ix86_generate_version_dispatcher_body): Likewise. (ix86_get_function_versions_dispatcher): Likewise. gcc/ada/ Patch autogenerated by refactor_symtab.py from https://github.com/davidmalcolm/gcc-refactoring-scripts revision 58bb219cc090b2f4516a9297d868c245495ee622 * gcc-interface/trans.c (finalize_nrv): Update for conversion of symtab types to a true class hierarchy. * gcc-interface/utils.c (gnat_write_global_declarations): Likewise. gcc/c-family/ Patch autogenerated by refactor_symtab.py from https://github.com/davidmalcolm/gcc-refactoring-scripts revision 58bb219cc090b2f4516a9297d868c245495ee622 * c-gimplify.c (c_genericize): Update for conversion of symtab types to a true class hierarchy. * c-pragma.c (maybe_apply_pending_pragma_weaks): Likewise. gcc/cp/ Patch autogenerated by refactor_symtab.py from https://github.com/davidmalcolm/gcc-refactoring-scripts revision 58bb219cc090b2f4516a9297d868c245495ee622 * call.c (mark_versions_used): Update for conversion of symtab types to a true class hierarchy. * decl2.c (cp_write_global_declarations): Likewise. (clear_decl_external): Likewise. (build_java_method_aliases): Likewise. (collect_candidates_for_java_method_aliases): Likewise. (mark_needed): Likewise. (var_finalized_p): Likewise. (maybe_make_one_only): Likewise. (maybe_emit_vtables): Likewise. * lambda.c (maybe_add_lambda_conv_op): Likewise. * method.c (use_thunk): Likewise. * optimize.c (maybe_clone_body): Likewise. * tree.c (cp_fix_function_decl_p): Likewise. gcc/java/ Patch autogenerated by refactor_symtab.py from https://github.com/davidmalcolm/gcc-refactoring-scripts revision 58bb219cc090b2f4516a9297d868c245495ee622 * decl.c (java_mark_decl_local): Update for conversion of symtab types to a true class hierarchy. gcc/lto/ Patch autogenerated by refactor_symtab.py from https://github.com/davidmalcolm/gcc-refactoring-scripts revision 58bb219cc090b2f4516a9297d868c245495ee622 * lto-partition.c (lto_promote_cross_file_statics): Update for conversion of symtab types to a true class hierarchy. (rename_statics): Likewise. (promote_symbol): Likewise. (privatize_symbol_name): Likewise. (lto_balanced_map): Likewise. (varpool_node_cmp): Likewise. (node_cmp): Likewise. (lto_1_to_1_map): Likewise. (undo_partition): Likewise. (add_symbol_to_partition): Likewise. (contained_in_symbol): Likewise. (add_symbol_to_partition_1): Likewise. (add_references_to_partition): Likewise. (symbol_partitioned_p): Likewise. (get_symbol_class): Likewise. (lto_max_map): Likewise. * lto-symtab.c (lto_symtab_prevailing_decl): Likewise. (lto_symtab_merge_symbols): Likewise. (lto_symtab_merge_symbols_1): Likewise. (lto_symtab_merge_decls): Likewise. (lto_symtab_merge_decls_1): Likewise. (lto_symtab_merge_decls_2): Likewise. (lto_symtab_resolve_symbols): Likewise. (lto_symtab_resolve_can_prevail_p): Likewise. (lto_symtab_symbol_p): Likewise. (lto_symtab_resolve_replaceable_p): Likewise. (lto_symtab_merge): Likewise. (lto_varpool_replace_node): Likewise. (lto_cgraph_replace_node): Likewise. * lto.c (lto_main): Likewise. (do_whole_program_analysis): Likewise. (materialize_cgraph): Likewise. (read_cgraph_and_symbols): Likewise. (cmp_partitions_order): Likewise. (lto_materialize_function): Likewise. (has_analyzed_clone_p): Likewise. From-SVN: r204171
2013-10-29 19:30:00 +01:00
gcc_assert (!node->alias && !node->thunk.thunk_p);
cgraphunit.c: Update toplevel comment. * cgraphunit.c: Update toplevel comment. (tree_rest_of_compilation): Merge into cgraph_expand_function. (cgraph_analyze_function): Make static. (cgraph_decide_is_function_needed): Make static. (cgraph_add_new_function): Use expand_function instead of rest_of_compilation. (clone_of_p, verify_edge_count_and_frequency, cgraph_debug_gimple_stmt, verify_edge_corresponds_to_fndecl, verify_cgraph_node, verify_cgraph): Move to cgraph.c (cgraph_inline_p): Remove. (cgraph_preserve_function_body_p): Move to ipa-inline-transform. (init_cgraph): Add comment. * cgraphbuild.c (record_reference, mark_address, mark_load, mark_store): Do not call analyze_expr hook. * cgraph.c: Update toplevel comment. (clone_of_p, verify_edge_count_and_frequency, cgraph_debug_gimple_stmt, verify_edge_corresponds_to_fndecl, verify_cgraph_node, verify_cgraph): Move fere from cgraphunit.c (cgraph_mark_force_output_node): Move to cgraph.h * cgraph.h: Reorder so the comments match the function placement. (cgraph_analyze_function, cgraph_decide_is_function_needed): Remove. (cgraph_mark_force_output_node): Move here from cgraph.c * tree.c (free_lang_data): Do not clear analyze_expr hook. * ipa-inline-transform.c (preserve_function_body_p): New function. (inline_transform): Update. * langhooks.c (lhd_callgraph_analyze_expr): Remove. * langhooks.h (lang_hooks_for_callgraph): Remove. (lang_hooks): Remove callgraph. * tree-inline.c (expand_call_inline): Do not use cgraph_inline_p. * varpool.c: Remove out of date comment. * langhooks-def.h (lhd_callgraph_analyze_expr): Remove. (LANG_HOOKS_CALLGRAPH_ANALYZE_EXPR): Remove. From-SVN: r186832
2012-04-25 18:31:42 +02:00
/* Look if there is any non-thunk clone around. */
for (node = node->clones; node; node = node->next_sibling_clone)
if (!node->thunk.thunk_p)
return true;
cgraphunit.c: Update toplevel comment. * cgraphunit.c: Update toplevel comment. (tree_rest_of_compilation): Merge into cgraph_expand_function. (cgraph_analyze_function): Make static. (cgraph_decide_is_function_needed): Make static. (cgraph_add_new_function): Use expand_function instead of rest_of_compilation. (clone_of_p, verify_edge_count_and_frequency, cgraph_debug_gimple_stmt, verify_edge_corresponds_to_fndecl, verify_cgraph_node, verify_cgraph): Move to cgraph.c (cgraph_inline_p): Remove. (cgraph_preserve_function_body_p): Move to ipa-inline-transform. (init_cgraph): Add comment. * cgraphbuild.c (record_reference, mark_address, mark_load, mark_store): Do not call analyze_expr hook. * cgraph.c: Update toplevel comment. (clone_of_p, verify_edge_count_and_frequency, cgraph_debug_gimple_stmt, verify_edge_corresponds_to_fndecl, verify_cgraph_node, verify_cgraph): Move fere from cgraphunit.c (cgraph_mark_force_output_node): Move to cgraph.h * cgraph.h: Reorder so the comments match the function placement. (cgraph_analyze_function, cgraph_decide_is_function_needed): Remove. (cgraph_mark_force_output_node): Move here from cgraph.c * tree.c (free_lang_data): Do not clear analyze_expr hook. * ipa-inline-transform.c (preserve_function_body_p): New function. (inline_transform): Update. * langhooks.c (lhd_callgraph_analyze_expr): Remove. * langhooks.h (lang_hooks_for_callgraph): Remove. (lang_hooks): Remove callgraph. * tree-inline.c (expand_call_inline): Do not use cgraph_inline_p. * varpool.c: Remove out of date comment. * langhooks-def.h (lhd_callgraph_analyze_expr): Remove. (LANG_HOOKS_CALLGRAPH_ANALYZE_EXPR): Remove. From-SVN: r186832
2012-04-25 18:31:42 +02:00
return false;
}
/* Apply inline plan to function. */
unsigned int
inline_transform (struct cgraph_node *node)
{
unsigned int todo = 0;
struct cgraph_edge *e, *next;
ipa-cp.c (ipcp_cloning_candidate_p): Use opt_for_fn. * ipa-cp.c (ipcp_cloning_candidate_p): Use opt_for_fn. (ipa_value_from_jfunc, ipa_context_from_jfunc): Skip sanity check. (ipa_get_indirect_edge_target_1): Use opt_for_fn. (good_cloning_opportunity_p): Likewise. (ipa-cp gate): Enable ipa-cp with LTO. * ipa-profile.c (ipa_propagate_frequency): Use opt_for_fn. * ipa.c (symbol_table::remove_unreachable_nodes): Always build type inheritance. * ipa-inline-transform.c (inline_transform): Check if there are inlines to apply even at -O0. * cgraphunit.c (cgraph_node::finalize_function): Use opt_for_fn. (analyze_functions): Build type inheritance graph. * ipa-inline.c (can_inline_edge_p): Use opt_for_fn. (want_early_inline_function_p, want_inline_small_function_p): Likewise. (check_callers): Likewise. (edge_badness): Likewise. (inline_small_functions): Always be ready for indirect inlining to happend. (ipa_inline): Always use want_inline_function_to_all_callers_p. (early_inline_small_functions): Use opt_for_fn. * ipa-inline-analysis.c (estimate_function_body_sizes): use opt_for_fn. (estimate_function_body_sizes): Likewise. (compute_inline_parameters): Likewise. (estimate_edge_devirt_benefit): Likewise. (inline_analyze_function): Likewise. * ipa-devirt.c (ipa_devirt): Likewise. (gate): Use in_lto_p. * ipa-prop.c (ipa_func_spec_opts_forbid_analysis_p): Use opt_for_fn. (try_make_edge_direct_virtual_call): Likewise. (update_indirect_edges_after_inlining): Likewise. (ipa_free_all_structures_after_ipa_cp): Add in_lto_p check. * common.opt (findirect-inlining): Turn into optimization. * ipa-pure-const.c (add_new_function): Use opt_for_fn. (pure_const_generate_summary): Likewise. (gate_pure_const): Always enable with in_lto_p. From-SVN: r217737
2014-11-18 21:44:16 +01:00
bool has_inline = false;
/* FIXME: Currently the pass manager is adding inline transform more than
once to some clones. This needs revisiting after WPA cleanups. */
if (cfun->after_inlining)
return 0;
/* We might need the body of this function so that we can expand
it inline somewhere else. */
cgraphunit.c: Update toplevel comment. * cgraphunit.c: Update toplevel comment. (tree_rest_of_compilation): Merge into cgraph_expand_function. (cgraph_analyze_function): Make static. (cgraph_decide_is_function_needed): Make static. (cgraph_add_new_function): Use expand_function instead of rest_of_compilation. (clone_of_p, verify_edge_count_and_frequency, cgraph_debug_gimple_stmt, verify_edge_corresponds_to_fndecl, verify_cgraph_node, verify_cgraph): Move to cgraph.c (cgraph_inline_p): Remove. (cgraph_preserve_function_body_p): Move to ipa-inline-transform. (init_cgraph): Add comment. * cgraphbuild.c (record_reference, mark_address, mark_load, mark_store): Do not call analyze_expr hook. * cgraph.c: Update toplevel comment. (clone_of_p, verify_edge_count_and_frequency, cgraph_debug_gimple_stmt, verify_edge_corresponds_to_fndecl, verify_cgraph_node, verify_cgraph): Move fere from cgraphunit.c (cgraph_mark_force_output_node): Move to cgraph.h * cgraph.h: Reorder so the comments match the function placement. (cgraph_analyze_function, cgraph_decide_is_function_needed): Remove. (cgraph_mark_force_output_node): Move here from cgraph.c * tree.c (free_lang_data): Do not clear analyze_expr hook. * ipa-inline-transform.c (preserve_function_body_p): New function. (inline_transform): Update. * langhooks.c (lhd_callgraph_analyze_expr): Remove. * langhooks.h (lang_hooks_for_callgraph): Remove. (lang_hooks): Remove callgraph. * tree-inline.c (expand_call_inline): Do not use cgraph_inline_p. * varpool.c: Remove out of date comment. * langhooks-def.h (lhd_callgraph_analyze_expr): Remove. (LANG_HOOKS_CALLGRAPH_ANALYZE_EXPR): Remove. From-SVN: r186832
2012-04-25 18:31:42 +02:00
if (preserve_function_body_p (node))
save_inline_function_body (node);
for (e = node->callees; e; e = next)
{
ipa-cp.c (ipcp_cloning_candidate_p): Use opt_for_fn. * ipa-cp.c (ipcp_cloning_candidate_p): Use opt_for_fn. (ipa_value_from_jfunc, ipa_context_from_jfunc): Skip sanity check. (ipa_get_indirect_edge_target_1): Use opt_for_fn. (good_cloning_opportunity_p): Likewise. (ipa-cp gate): Enable ipa-cp with LTO. * ipa-profile.c (ipa_propagate_frequency): Use opt_for_fn. * ipa.c (symbol_table::remove_unreachable_nodes): Always build type inheritance. * ipa-inline-transform.c (inline_transform): Check if there are inlines to apply even at -O0. * cgraphunit.c (cgraph_node::finalize_function): Use opt_for_fn. (analyze_functions): Build type inheritance graph. * ipa-inline.c (can_inline_edge_p): Use opt_for_fn. (want_early_inline_function_p, want_inline_small_function_p): Likewise. (check_callers): Likewise. (edge_badness): Likewise. (inline_small_functions): Always be ready for indirect inlining to happend. (ipa_inline): Always use want_inline_function_to_all_callers_p. (early_inline_small_functions): Use opt_for_fn. * ipa-inline-analysis.c (estimate_function_body_sizes): use opt_for_fn. (estimate_function_body_sizes): Likewise. (compute_inline_parameters): Likewise. (estimate_edge_devirt_benefit): Likewise. (inline_analyze_function): Likewise. * ipa-devirt.c (ipa_devirt): Likewise. (gate): Use in_lto_p. * ipa-prop.c (ipa_func_spec_opts_forbid_analysis_p): Use opt_for_fn. (try_make_edge_direct_virtual_call): Likewise. (update_indirect_edges_after_inlining): Likewise. (ipa_free_all_structures_after_ipa_cp): Add in_lto_p check. * common.opt (findirect-inlining): Turn into optimization. * ipa-pure-const.c (add_new_function): Use opt_for_fn. (pure_const_generate_summary): Likewise. (gate_pure_const): Always enable with in_lto_p. From-SVN: r217737
2014-11-18 21:44:16 +01:00
if (!e->inline_failed)
has_inline = true;
next = e->next_callee;
IPA C++ refactoring 4/N * cgraph.h (symtab_node): (bool needed_p (void)): created from decide_is_symbol_needed (bool referred_to_p (void)): created from referred_to_p (static cgraph_node *get_for_asmname (tree asmname)): created from symtab_node_for_asm * cgraph.h (cgraph_node): (void assemble_thunks_and_aliases (void)): created from assemble_thunks_and_aliases (void expand (void)): created from expand_function (static void finalize_function (tree, bool)): created from cgraph_finalize_function (static cgraph_local_info *local_info (tree decl)): created from cgraph_local_info (static cgraph_global_info *global_info (tree)): created from cgraph_global_info (static cgraph_rtl_info *rtl_info (tree)): created from cgraph_rtl_info * cgraph.h (varpool_node): (static void add (tree decl): created from varpool_add_new_variable * cgraph.h (cgraph_edge): void remove (void); (void remove_caller (void)): created from cgraph_edge_remove_caller (void remove_callee (void)): created from cgraph_edge_remove_callee (void set_call_stmt (gimple new_stmt, bool update_speculative = true)): created from cgraph_set_call_stmt (void redirect_callee (cgraph_node *n)): created from cgraph_redirect_edge_callee (cgraph_edge *make_direct (cgraph_node *callee)): created from cgraph_make_edge_direct (cgraph_edge *make_speculative (cgraph_node *n2, gcov_type direct_count, gimple redirect_call_stmt_to_callee (void)): created from cgraph_turn_edge_to_speculative (void speculative_call_info (cgraph_edge *&direct, cgraph_edge *&indirect, ipa_ref *&reference)): created from cgraph_speculative_call_info (cgraph_edge * clone (cgraph_node *n, gimple call_stmt, unsigned stmt_uid, gcov_type count_scale, int freq_scale, bool update_original)): created from cgraph_clone_edge (cgraph_edge *resolve_speculation (tree callee_decl)): created from cgraph_resolve_speculation (bool cannot_lead_to_return_p (void)): created from cannot_lead_to_return_p (bool recursive_p (void)): created from cgraph_edge_recursive_p (bool maybe_hot_p (void)): created from cgraph_maybe_hot_edge_p (static unsigned int rebuild_edges (void)): created from rebuild_cgraph_edges (static void rebuild_references (void)): created from cgraph_rebuild_references * cgraph.h (symbol_table): (create_reference): renamed from add_reference (maybe_create_reference): renamed from maybe_add_reference (void register_symbol (symtab_node *node)): new function (void clear_asm_symbols (void)): new function (void unregister (symtab_node *node)): new function (void release_symbol (cgraph_node *node, int uid)): new function (cgraph_node * allocate_cgraph_symbol (void)): new function (void initialize (void)): created from cgraph_init (symtab_node *first_symbol (void)):new function (asm_node *first_asm_symbol (void)):new function (symtab_node *first_defined_symbol (void)):new function (varpool_node *first_variable (void)):new function (varpool_node *next_variable (varpool_node *node)):new function (varpool_node *first_static_initializer (void)):new function (varpool_node *next_static_initializer (varpool_node *node)):new function (varpool_node *first_defined_variable (void)):new function (varpool_node *next_defined_variable (varpool_node *node)):new function (cgraph_node *first_defined_function (void)):new function (cgraph_node *next_defined_function (cgraph_node *node)):new function (cgraph_node *first_function (void)):new function (cgraph_node *next_function (cgraph_node *node)):new function (cgraph_node *first_function_with_gimple_body (void)):new function (asm_node *finalize_toplevel_asm (tree asm_str)): created from add_asm_node (bool remove_unreachable_nodes (bool before_inlining_p, FILE *file)): created from symtab_remove_unreachable_nodes (void remove_unreferenced_decls (void)): created from varpool_remove_unreferenced_decls (void process_new_functions (void)): created from cgraph_process_new_functions (void process_same_body_aliases (void)): created from cgraph_process_same_body_aliases (bool output_variables (void)): created from varpool_node::output_variables (void output_asm_statements (void)): created from output_asm_statements (void finalize_compilation_unit (void)): created from finalize_compilation_unit (void compile (void)): created from compile (void output_weakrefs (void)): created from output_weakrefs (cgraph_node *create_empty (void)): created from cgraph_node::create_empty (cgraph_edge *create_edge (cgraph_node *caller, cgraph_node *callee, gimple call_stmt, gcov_type count, int freq, bool indir_unknown_callee)): created from cgraph_node::create_edge (void free_edge (cgraph_edge *e)): created from cgraph_free_edge (cgraph_node *next_function_with_gimple_body (cgraph_node *node)): created from cgraph_next_function_with_gimple_body (void remove_edge_removal_hook (cgraph_edge_hook_list *)): created from cgraph_remove_edge_removal_hook (cgraph_node_hook_list *add_cgraph_removal_hook (cgraph_node_hook, void *)): created from cgraph_add_node_removal_hook (void remove_cgraph_removal_hook (cgraph_node_hook_list *)): created from cgraph_remove_node_removal_hook (varpool_node_hook_list *add_varpool_removal_hook (varpool_node_hook, void *)): created from varpool_add_node_removal_hook (void remove_varpool_removal_hook (varpool_node_hook_list *)): created from varpool_remove_node_removal_hook (cgraph_node_hook_list *add_cgraph_insertion_hook (cgraph_node_hook, void *)): created from cgraph_add_function_insertion_hook (void remove_cgraph_insertion_hook (cgraph_node_hook_list *)): created from cgraph_remove_function_insertion_hook (varpool_node_hook_list *add_varpool_insertion_hook (varpool_node_hook, void *)): created from varpool_add_variable_insertion_hook (void remove_varpool_insertion_hook (varpool_node_hook_list *)): created from varpool_remove_variable_insertion_hook (cgraph_2edge_hook_list *add_edge_duplication_hook (cgraph_2edge_hook, void *)): created from cgraph_add_edge_duplication_hook (void remove_edge_duplication_hook (cgraph_2edge_hook_list *)): created from cgraph_remove_edge_duplication_hook (cgraph_2node_hook_list *add_cgraph_duplication_hook (cgraph_2node_hook, void *)): created from cgraph_add_node_duplication_hook (void remove_cgraph_duplication_hook (cgraph_2node_hook_list *)): created from cgraph_remove_node_duplication_hook (void call_edge_removal_hooks (cgraph_edge *e)): created from cgraph_call_edge_removal_hooks (void call_cgraph_insertion_hooks (cgraph_node *node)): created from call_function_insertion_hooks (void call_cgraph_removal_hooks (cgraph_node *node)): created from cgraph_call_node_removal_hooks (void call_cgraph_duplication_hooks (cgraph_node *node, cgraph_node *node2)): created from cgraph_node::call_duplication_hooks (void call_edge_duplication_hooks (cgraph_edge *cs1, cgraph_edge *cs2)): created from cgraph_call_edge_duplication_hooks (void call_varpool_removal_hooks (varpool_node *node)): created from varpool_call_node_removal_hooks (void call_varpool_insertion_hooks (varpool_node *node)): created from varpool_call_variable_insertion_hooks (void insert_to_assembler_name_hash (symtab_node *node, bool with_clones)): created from insert_to_assembler_name_hash (void unlink_from_assembler_name_hash (symtab_node *node, bool with_clones)): created from unlink_from_assembler_name_hash (void symtab_prevail_in_asm_name_hash (symtab_node *node)): created from symtab_prevail_in_asm_name_hash (void symtab_initialize_asm_name_hash (void)): created from symtab_initialize_asm_name_hash (void change_decl_assembler_name (tree decl, tree name)): created from change_decl_assembler_name (void materialize_all_clones (void)): created from cgraph_materialize_all_clones (static hashval_t decl_assembler_name_hash (const_tree asmname)): created from decl_assembler_name_hash (static bool decl_assembler_name_equal (tree decl, const_tree asmname)): created from decl_assembler_name_equal (static hashval_t hash_node_by_assembler_name (const void *p)): created from hash_node_by_assembler_name (static int eq_assembler_name (const void *p1, const void *p2)): created from eq_assembler_name From-SVN: r214422
2014-08-25 15:01:47 +02:00
e->redirect_call_stmt_to_callee ();
}
IPA REF refactoring * Makefile.in: Removed header file (ipa-ref-inline.h). * cgraph.c (cgraph_turn_edge_to_speculative): New IPA REF function called. (cgraph_speculative_call_info): Likewise. (cgraph_for_node_thunks_and_aliases): Likewise. (cgraph_for_node_and_aliases): Likewise. (verify_cgraph_node): Likewise. * cgraph.h: Batch of IPA REF functions become member functions of symtab_node: add_reference, maybe_add_reference, clone_references, clone_referring, clone_reference, find_reference, remove_stmt_references, remove_all_references, remove_all_referring, dump_references, dump_referring, has_alias_p, iterate_reference, iterate_referring. * cgraphbuild.c (record_reference): New IPA REF function used. (record_type_list): Likewise. (record_eh_tables): Likewise. (mark_address): Likewise. (mark_load): Likewise. (mark_store): Likewise. (pass_build_cgraph_edges): Likewise. (rebuild_cgraph_edge): Likewise. (cgraph_rebuild_references): Likewise. (pass_remove_cgraph_callee_edges): Likewise. * cgraphclones.c (cgraph_clone_node): Likewise. (cgraph_create_virtual_clone): Likewise. (cgraph_materialize_clone): Likewise. (cgraph_materialize_all_clones): Likewise. * cgraphunit.c (cgraph_reset_node): Likewise. (cgraph_reset_node): Likewise. (analyze_function): Likewise. (assemble_thunks_and_aliases): Likewise. (expand_function): Likewise. * ipa-comdats.c (propagate_comdat_group): Likewise. (enqueue_references): Likewise. * ipa-cp.c (ipcp_discover_new_direct_edges): Likewise. (create_specialized_node): Likewise. * ipa-devirt.c (referenced_from_vtable_p): Likewise. * ipa-inline-transform.c (can_remove_node_now_p_1): Likewise. * ipa-inline.c (reset_edge_caches): Likewise. (update_caller_keys): Likewise. (execute): Likewise. * ipa-prop.c (remove_described_reference): Likewise. (propagate_controlled_uses): Likewise. (ipa_edge_duplication_hook): Likewise. (ipa_modify_call_arguments): Likewise. * ipa-pure-const.c (propagate_pure_const): Likewise. * ipa-ref-inline.h: Header file removed, functions moved to symtab_node class. * ipa-ref.c (remove_reference): New class member function. (cannot_lead_to_return): New class member function. (referring_ref_list): Likewise. (referred_ref_list): Likewise. Rest of functions moved to symtab_node class. * ipa-ref.h: New member functions remove_reference, cannot_lead_to_return, referring_ref_list, referred_ref_list added to ipa_ref class. ipa_ref_list class has new member functions: first_reference, first_referring, clear, nreferences. * ipa-reference.c (analyze_function): New IPA REF function used. (write_node_summary_p): Likewise. (ipa_reference_write_optimization_summary): Likewise. * ipa-split.c (split_function): Likewise. * ipa-utils.c (ipa_reverse_postorder): Likewise. * ipa-visibility.c (cgraph_non_local_node_p_1): Likewise. (function_and_variable_visibility): Likewise. * ipa.c (has_addr_references_p): Likewise. (process_references): Argument type changed. (symtab_remove_unreachable_nodes): New IPA REF function used. (process_references): Likewise. (set_writeonly_bit): Likewise. * lto-cgraph.c: Implementation of new symtab_node member functions that uses new IPA REF functions. * lto-streamer-in.c (fixup_call_stmt_edges_1): New IPA REF function used. * lto-streamer-out.c (output_symbol_p): Likewise. * lto-streamer.h (referenced_from_this_partition_p): Argument type changed. * lto/lto-partition.c (add_references_to_partition): New IPA REF function used. (add_symbol_to_partition_1): Likewise. (lto_balanced_map): Likewise. * lto/lto-symtab.c (lto_cgraph_replace_node): Likewise. * symtab.c: Implementation of new IPA REF API. * trans-mem.c (ipa_tm_create_version_alias): New IPA REF function used. (ipa_tm_create_version): Likewise. (ipa_tm_execute): Likewise. * tree-emutls.c (gen_emutls_addr): Likewise. * tree-inline.c (copy_bb): Likewise. (delete_unreachable_blocks_update_callgraph): Likewise. * varpool.c (varpool_remove_unreferenced_decls): Likewise. (varpool_for_node_and_aliases): Likewise. From-SVN: r211987
2014-06-25 18:55:46 +02:00
node->remove_all_references ();
timevar_push (TV_INTEGRATION);
if (node->callees && (opt_for_fn (node->decl, optimize) || has_inline))
todo = optimize_inline_calls (current_function_decl);
timevar_pop (TV_INTEGRATION);
cfun->always_inline_functions_inlined = true;
cfun->after_inlining = true;
todo |= execute_fixup_cfg ();
if (!(todo & TODO_update_ssa_any))
/* Redirecting edges might lead to a need for vops to be recomputed. */
todo |= TODO_update_ssa_only_virtuals;
return todo;
}