match this. The only sensible operand types are
SSA names and invariants. */
fprintf_indent (f, indent,
- "tree %s = TREE_OPERAND (gimple_assign_rhs1 (def_stmt), %i);\n",
+ "tree %s = TREE_OPERAND (gimple_assign_rhs1 (def), %i);\n",
child_opname, i);
fprintf_indent (f, indent,
"if ((TREE_CODE (%s) == SSA_NAME\n",
}
else
fprintf_indent (f, indent,
- "tree %s = gimple_assign_rhs%u (def_stmt);\n",
+ "tree %s = gimple_assign_rhs%u (def);\n",
child_opname, i + 1);
}
else
fprintf_indent (f, indent,
- "tree %s = gimple_call_arg (def_stmt, %u);\n",
+ "tree %s = gimple_call_arg (def, %u);\n",
child_opname, i);
fprintf_indent (f, indent,
"if ((%s = do_valueize (valueize, %s)))\n",
if (exprs_len)
{
fprintf_indent (f, indent,
- "if (is_gimple_assign (def_stmt))\n");
+ "if (gassign *def = dyn_cast <gassign *> (def_stmt))\n");
fprintf_indent (f, indent,
- " switch (gimple_assign_rhs_code (def_stmt))\n");
+ " switch (gimple_assign_rhs_code (def))\n");
indent += 4;
fprintf_indent (f, indent, "{\n");
for (unsigned i = 0; i < exprs_len; ++i)
if (fns_len)
{
- if (exprs_len)
- fprintf_indent (f, indent, "else ");
- else
- fprintf_indent (f, indent, " ");
-
- fprintf (f, "if (gimple_call_builtin_p (def_stmt, BUILT_IN_NORMAL))\n");
+ fprintf_indent (f, indent,
+ "%sif (gimple_call_builtin_p (def_stmt, BUILT_IN_NORMAL))\n",
+ exprs_len ? "else " : "");
fprintf_indent (f, indent,
" {\n");
fprintf_indent (f, indent,
- " tree fndecl = gimple_call_fndecl (def_stmt);\n");
+ " gcall *def = as_a <gcall *> (def_stmt);\n");
+ fprintf_indent (f, indent,
+ " tree fndecl = gimple_call_fndecl (def);\n");
fprintf_indent (f, indent,
" switch (DECL_FUNCTION_CODE (fndecl))\n");
fprintf_indent (f, indent,