}
}
-/* Print the jump functions associated with call graph edge CS to file F. */
+/* Print contents of JFUNC to F. If CTX is non-NULL, dump it too. */
-static void
-ipa_print_node_jump_functions_for_edge (FILE *f, struct cgraph_edge *cs)
+DEBUG_FUNCTION void
+ipa_dump_jump_function (FILE *f, ipa_jump_func *jump_func,
+ class ipa_polymorphic_call_context *ctx)
{
- ipa_edge_args *args = ipa_edge_args_sum->get (cs);
- int count = ipa_get_cs_argument_count (args);
+ enum jump_func_type type = jump_func->type;
- for (int i = 0; i < count; i++)
+ if (type == IPA_JF_UNKNOWN)
+ fprintf (f, "UNKNOWN\n");
+ else if (type == IPA_JF_CONST)
{
- struct ipa_jump_func *jump_func;
- enum jump_func_type type;
-
- jump_func = ipa_get_ith_jump_func (args, i);
- type = jump_func->type;
-
- fprintf (f, " param %d: ", i);
- if (type == IPA_JF_UNKNOWN)
- fprintf (f, "UNKNOWN\n");
- else if (type == IPA_JF_CONST)
+ fprintf (f, "CONST: ");
+ ipa_print_constant_value (f, jump_func->value.constant.value);
+ fprintf (f, "\n");
+ }
+ else if (type == IPA_JF_PASS_THROUGH)
+ {
+ fprintf (f, "PASS THROUGH: ");
+ fprintf (f, "%d, op %s",
+ jump_func->value.pass_through.formal_id,
+ get_tree_code_name(jump_func->value.pass_through.operation));
+ if (jump_func->value.pass_through.operation != NOP_EXPR)
{
- fprintf (f, "CONST: ");
- ipa_print_constant_value (f, jump_func->value.constant.value);
- fprintf (f, "\n");
+ fprintf (f, " ");
+ print_generic_expr (f, jump_func->value.pass_through.operand);
}
- else if (type == IPA_JF_PASS_THROUGH)
+ if (jump_func->value.pass_through.agg_preserved)
+ fprintf (f, ", agg_preserved");
+ if (jump_func->value.pass_through.refdesc_decremented)
+ fprintf (f, ", refdesc_decremented");
+ fprintf (f, "\n");
+ }
+ else if (type == IPA_JF_ANCESTOR)
+ {
+ fprintf (f, "ANCESTOR: ");
+ fprintf (f, "%d, offset " HOST_WIDE_INT_PRINT_DEC,
+ jump_func->value.ancestor.formal_id,
+ jump_func->value.ancestor.offset);
+ if (jump_func->value.ancestor.agg_preserved)
+ fprintf (f, ", agg_preserved");
+ if (jump_func->value.ancestor.keep_null)
+ fprintf (f, ", keep_null");
+ fprintf (f, "\n");
+ }
+
+ if (jump_func->agg.items)
+ {
+ struct ipa_agg_jf_item *item;
+ int j;
+
+ fprintf (f, " Aggregate passed by %s:\n",
+ jump_func->agg.by_ref ? "reference" : "value");
+ FOR_EACH_VEC_ELT (*jump_func->agg.items, j, item)
{
- fprintf (f, "PASS THROUGH: ");
- fprintf (f, "%d, op %s",
- jump_func->value.pass_through.formal_id,
- get_tree_code_name(jump_func->value.pass_through.operation));
- if (jump_func->value.pass_through.operation != NOP_EXPR)
+ fprintf (f, " offset: " HOST_WIDE_INT_PRINT_DEC ", ",
+ item->offset);
+ fprintf (f, "type: ");
+ print_generic_expr (f, item->type);
+ fprintf (f, ", ");
+ if (item->jftype == IPA_JF_PASS_THROUGH)
+ fprintf (f, "PASS THROUGH: %d,",
+ item->value.pass_through.formal_id);
+ else if (item->jftype == IPA_JF_LOAD_AGG)
{
- fprintf (f, " ");
- print_generic_expr (f, jump_func->value.pass_through.operand);
+ fprintf (f, "LOAD AGG: %d",
+ item->value.pass_through.formal_id);
+ fprintf (f, " [offset: " HOST_WIDE_INT_PRINT_DEC ", by %s],",
+ item->value.load_agg.offset,
+ item->value.load_agg.by_ref ? "reference"
+ : "value");
}
- if (jump_func->value.pass_through.agg_preserved)
- fprintf (f, ", agg_preserved");
- if (jump_func->value.pass_through.refdesc_decremented)
- fprintf (f, ", refdesc_decremented");
- fprintf (f, "\n");
- }
- else if (type == IPA_JF_ANCESTOR)
- {
- fprintf (f, "ANCESTOR: ");
- fprintf (f, "%d, offset " HOST_WIDE_INT_PRINT_DEC,
- jump_func->value.ancestor.formal_id,
- jump_func->value.ancestor.offset);
- if (jump_func->value.ancestor.agg_preserved)
- fprintf (f, ", agg_preserved");
- if (jump_func->value.ancestor.keep_null)
- fprintf (f, ", keep_null");
- fprintf (f, "\n");
- }
- if (jump_func->agg.items)
- {
- struct ipa_agg_jf_item *item;
- int j;
-
- fprintf (f, " Aggregate passed by %s:\n",
- jump_func->agg.by_ref ? "reference" : "value");
- FOR_EACH_VEC_ELT (*jump_func->agg.items, j, item)
+ if (item->jftype == IPA_JF_PASS_THROUGH
+ || item->jftype == IPA_JF_LOAD_AGG)
{
- fprintf (f, " offset: " HOST_WIDE_INT_PRINT_DEC ", ",
- item->offset);
- fprintf (f, "type: ");
- print_generic_expr (f, item->type);
- fprintf (f, ", ");
- if (item->jftype == IPA_JF_PASS_THROUGH)
- fprintf (f, "PASS THROUGH: %d,",
- item->value.pass_through.formal_id);
- else if (item->jftype == IPA_JF_LOAD_AGG)
- {
- fprintf (f, "LOAD AGG: %d",
- item->value.pass_through.formal_id);
- fprintf (f, " [offset: " HOST_WIDE_INT_PRINT_DEC ", by %s],",
- item->value.load_agg.offset,
- item->value.load_agg.by_ref ? "reference"
- : "value");
- }
-
- if (item->jftype == IPA_JF_PASS_THROUGH
- || item->jftype == IPA_JF_LOAD_AGG)
- {
- fprintf (f, " op %s",
- get_tree_code_name (item->value.pass_through.operation));
- if (item->value.pass_through.operation != NOP_EXPR)
- {
- fprintf (f, " ");
- print_generic_expr (f, item->value.pass_through.operand);
- }
- }
- else if (item->jftype == IPA_JF_CONST)
+ fprintf (f, " op %s",
+ get_tree_code_name (item->value.pass_through.operation));
+ if (item->value.pass_through.operation != NOP_EXPR)
{
- fprintf (f, "CONST: ");
- ipa_print_constant_value (f, item->value.constant);
+ fprintf (f, " ");
+ print_generic_expr (f, item->value.pass_through.operand);
}
- else if (item->jftype == IPA_JF_UNKNOWN)
- fprintf (f, "UNKNOWN: " HOST_WIDE_INT_PRINT_DEC " bits",
- tree_to_uhwi (TYPE_SIZE (item->type)));
- fprintf (f, "\n");
}
+ else if (item->jftype == IPA_JF_CONST)
+ {
+ fprintf (f, "CONST: ");
+ ipa_print_constant_value (f, item->value.constant);
+ }
+ else if (item->jftype == IPA_JF_UNKNOWN)
+ fprintf (f, "UNKNOWN: " HOST_WIDE_INT_PRINT_DEC " bits",
+ tree_to_uhwi (TYPE_SIZE (item->type)));
+ fprintf (f, "\n");
}
+ }
+
+ if (ctx && !ctx->useless_p ())
+ {
+ fprintf (f, " Context: ");
+ ctx->dump (dump_file);
+ }
+
+ if (jump_func->m_vr)
+ {
+ jump_func->m_vr->dump (f);
+ fprintf (f, "\n");
+ }
+ else
+ fprintf (f, " Unknown VR\n");
+}
+/* Print the jump functions associated with call graph edge CS to file F. */
+
+static void
+ipa_print_node_jump_functions_for_edge (FILE *f, struct cgraph_edge *cs)
+{
+ ipa_edge_args *args = ipa_edge_args_sum->get (cs);
+ int count = ipa_get_cs_argument_count (args);
+
+ for (int i = 0; i < count; i++)
+ {
+ struct ipa_jump_func *jump_func = ipa_get_ith_jump_func (args, i);
class ipa_polymorphic_call_context *ctx
= ipa_get_ith_polymorhic_call_context (args, i);
- if (ctx && !ctx->useless_p ())
- {
- fprintf (f, " Context: ");
- ctx->dump (dump_file);
- }
- if (jump_func->m_vr)
- {
- jump_func->m_vr->dump (f);
- fprintf (f, "\n");
- }
- else
- fprintf (f, " Unknown VR\n");
+ fprintf (f, " param %d: ", i);
+ ipa_dump_jump_function (f, jump_func, ctx);
}
}