@@ -127,6 +127,38 @@ can_have_basic_block_p (const rtx_insn *insn)
return true;
}
+/* Subroutine of print_param. Write the name of ARG, if any, to OUTFILE. */
+
+static void
+print_any_param_name (FILE *outfile, tree arg)
+{
+ if (DECL_NAME (arg))
+ fprintf (outfile, " \"%s\"", IDENTIFIER_POINTER (DECL_NAME (arg)));
+}
+
+/* Print a "(param)" directive for ARG to OUTFILE. */
+
+static void
+print_param (FILE *outfile, rtx_writer &w, tree arg)
+{
+ fprintf (outfile, " (param");
+ print_any_param_name (outfile, arg);
+ fprintf (outfile, "\n");
+
+ /* Print the value of DECL_RTL (without lazy-evaluation). */
+ fprintf (outfile, " (DECL_RTL ");
+ rtx decl_rtl = DECL_WRTL_CHECK (arg)->decl_with_rtl.rtl;
+ w.print_rtx (decl_rtl);
+ w.finish_directive ();
+
+ /* Print DECL_INCOMING_RTL. */
+ fprintf (outfile, " (DECL_RTL_INCOMING ");
+ w.print_rtx (DECL_INCOMING_RTL (arg));
+ fprintf (outfile, ")");
+
+ w.finish_directive ();
+}
+
/* Write FN to OUTFILE in a form suitable for parsing, with indentation
and comments to make the structure easy for a human to grok. Track
the basic blocks of insns in the chain, wrapping those that are within
@@ -202,6 +234,10 @@ print_rtx_function (FILE *outfile, function *fn, bool compact)
fprintf (outfile, "(function \"%s\"\n", dname);
+ /* Params. */
+ for (tree arg = DECL_ARGUMENTS (fdecl); arg; arg = DECL_CHAIN (arg))
+ print_param (outfile, w, arg);
+
/* The instruction chain. */
fprintf (outfile, " (insn-chain\n");
basic_block curr_bb = NULL;
@@ -921,6 +921,15 @@ rtx_writer::print_rtx (const_rtx in_rtx)
m_sawclose = 1;
}
+/* Emit a closing parenthesis and newline. */
+
+void
+rtx_writer::finish_directive ()
+{
+ fprintf (m_outfile, ")\n");
+ m_sawclose = 0;
+}
+
/* Print an rtx on the current line of FILE. Initially indent IND
characters. */
@@ -38,6 +38,8 @@ class rtx_writer
void print_rtl (const_rtx rtx_first);
int print_rtl_single_with_indent (const_rtx x, int ind);
+ void finish_directive ();
+
private:
void print_rtx_operand_code_0 (const_rtx in_rtx, int idx);
void print_rtx_operand_code_e (const_rtx in_rtx, int idx);