This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [PATCH 221/236] Add insn method to rtx_expr_list


On 08/19/14 14:41, Richard Henderson wrote:
On 08/06/2014 10:23 AM, David Malcolm wrote:
gcc/
	* rtl.h (rtx_expr_list::insn): New method.
---
  gcc/rtl.h | 9 +++++++++
  1 file changed, 9 insertions(+)

diff --git a/gcc/rtl.h b/gcc/rtl.h
index d028be1..d5811c2 100644
--- a/gcc/rtl.h
+++ b/gcc/rtl.h
@@ -414,6 +414,10 @@ public:

    /* Get at the underlying rtx.  */
    rtx element () const;
+
+  /* Get at the rtx, casting to rtx_insn *.  */
+  rtx_insn *insn () const;
+
  };

  template <>
@@ -1287,6 +1291,11 @@ inline rtx rtx_expr_list::element () const
    return XEXP (this, 0);
  }

+inline rtx_insn *rtx_expr_list::insn () const
+{
+  return as_a <rtx_insn *> (XEXP (this, 0));
+}
+

Even with the current code base we aren't *supposed* to be putting insns into
an EXPR_LIST -- that's what INSN_LIST is for.  Note the horribleness with which
anything doing this will have in the rtl dumps.

Can we please fix these uses instead of adding this accessor?
I'd be OK with that as a follow-up.

jeff


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]