/* 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;
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");
}
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;
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,
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
if (dump_file)
dump_possible_polymorphic_call_targets
- (dump_file, e);
+ (dump_file, e, (dump_flags & TDF_DETAILS));
npolymorphic++;
bool odr_type_p (const_tree);
bool possible_polymorphic_call_target_p (tree ref, gimple *stmt, struct cgraph_node *n);
void dump_possible_polymorphic_call_targets (FILE *, tree, HOST_WIDE_INT,
- const ipa_polymorphic_call_context &);
+ const ipa_polymorphic_call_context &,
+ bool verbose = true);
bool possible_polymorphic_call_target_p (tree, HOST_WIDE_INT,
const ipa_polymorphic_call_context &,
struct cgraph_node *);
/* Dump possible targets of a polymorphic call E into F. */
inline void
-dump_possible_polymorphic_call_targets (FILE *f, struct cgraph_edge *e)
+dump_possible_polymorphic_call_targets (FILE *f, struct cgraph_edge *e,
+ bool verbose = true)
{
ipa_polymorphic_call_context context(e);
dump_possible_polymorphic_call_targets (f, e->indirect_info->otr_type,
e->indirect_info->otr_token,
- context);
+ context, verbose);
}
/* Return true if N can be possibly target of a polymorphic call of