diff options
author | Jan Hubicka <hubicka@ucw.cz> | 2018-12-24 12:26:15 +0100 |
---|---|---|
committer | Jan Hubicka <hubicka@gcc.gnu.org> | 2018-12-24 11:26:15 +0000 |
commit | c1dd347cbd7c1ac87b750a9100dfbde2f2190c63 (patch) | |
tree | 58767bda9b1fd424ad53a10af66c53629def0dc6 /gcc/ipa-devirt.c | |
parent | 3d7bef8def04568aa63743b7edd46a85af11152a (diff) | |
download | gcc-c1dd347cbd7c1ac87b750a9100dfbde2f2190c63.zip gcc-c1dd347cbd7c1ac87b750a9100dfbde2f2190c63.tar.gz gcc-c1dd347cbd7c1ac87b750a9100dfbde2f2190c63.tar.bz2 |
ipa-devirt.c (dump_targets): Cap number of targets printed.
* ipa-devirt.c (dump_targets): Cap number of targets printed.
(dump_possible_polymorphic_call_targets): Add verbose parameter.
(ipa_devirt): Use it.
* ipa-utils.h (dump_possible_polymorphic_call_targets): Add verbose
parametrs.
From-SVN: r267400
Diffstat (limited to 'gcc/ipa-devirt.c')
-rw-r--r-- | gcc/ipa-devirt.c | 18 |
1 files changed, 13 insertions, 5 deletions
diff --git a/gcc/ipa-devirt.c b/gcc/ipa-devirt.c index 0f42d12..399a6e0 100644 --- a/gcc/ipa-devirt.c +++ b/gcc/ipa-devirt.c @@ -3454,7 +3454,7 @@ add_decl_warning (const tree &key ATTRIBUTE_UNUSED, const decl_warn_count &value /* Dump target list TARGETS into FILE. */ static void -dump_targets (FILE *f, vec <cgraph_node *> targets) +dump_targets (FILE *f, vec <cgraph_node *> targets, bool verbose) { unsigned int i; @@ -3471,6 +3471,13 @@ dump_targets (FILE *f, vec <cgraph_node *> targets) fprintf (f, " (no definition%s)", DECL_DECLARED_INLINE_P (targets[i]->decl) ? " inline" : ""); + /* With many targets for every call polymorphic dumps are going to + be quadratic in size. */ + if (i > 10 && !verbose) + { + fprintf (f, " ... and %i more targets\n", targets.length () - i); + return; + } } fprintf (f, "\n"); } @@ -3481,7 +3488,8 @@ void dump_possible_polymorphic_call_targets (FILE *f, tree otr_type, HOST_WIDE_INT otr_token, - const ipa_polymorphic_call_context &ctx) + const ipa_polymorphic_call_context &ctx, + bool verbose) { vec <cgraph_node *> targets; bool final; @@ -3506,7 +3514,7 @@ dump_possible_polymorphic_call_targets (FILE *f, ctx.maybe_derived_type ? " (derived types included)" : "", ctx.speculative_maybe_derived_type ? " (speculative derived types included)" : ""); len = targets.length (); - dump_targets (f, targets); + dump_targets (f, targets, verbose); targets = possible_polymorphic_call_targets (otr_type, otr_token, ctx, @@ -3514,7 +3522,7 @@ dump_possible_polymorphic_call_targets (FILE *f, if (targets.length () != len) { fprintf (f, " Speculative targets:"); - dump_targets (f, targets); + dump_targets (f, targets, verbose); } /* Ugly: during callgraph construction the target cache may get populated before all targets are found. While this is harmless (because all local @@ -3768,7 +3776,7 @@ ipa_devirt (void) if (dump_file) dump_possible_polymorphic_call_targets - (dump_file, e); + (dump_file, e, (dump_flags & TDF_DETAILS)); npolymorphic++; |