Convert PATTERN from a macro to a pair of inline functions
authorDavid Malcolm <dmalcolm@redhat.com>
Wed, 27 Aug 2014 19:38:19 +0000 (19:38 +0000)
committerDavid Malcolm <dmalcolm@gcc.gnu.org>
Wed, 27 Aug 2014 19:38:19 +0000 (19:38 +0000)
gcc/
2014-08-27  David Malcolm  <dmalcolm@redhat.com>

* rtl.h (PATTERN): Convert this macro into a pair of inline
functions, for now, requiring const_rtx and rtx.

From-SVN: r214585

gcc/ChangeLog
gcc/rtl.h

index adb4c19..74767ab 100644 (file)
@@ -1,5 +1,10 @@
 2014-08-27  David Malcolm  <dmalcolm@redhat.com>
 
+       * rtl.h (PATTERN): Convert this macro into a pair of inline
+       functions, for now, requiring const_rtx and rtx.
+
+2014-08-27  David Malcolm  <dmalcolm@redhat.com>
+
        * target.def (unwind_emit): Strengthen param "insn" from rtx to
        rtx_insn *.
        (final_postscan_insn): Likewise.
index 8d74d36..fdf1841 100644 (file)
--- a/gcc/rtl.h
+++ b/gcc/rtl.h
@@ -1207,7 +1207,15 @@ inline rtx& SET_NEXT_INSN (rtx insn)
 #define BLOCK_FOR_INSN(INSN) XBBDEF (INSN, 2)
 
 /* The body of an insn.  */
-#define PATTERN(INSN)  XEXP (INSN, 3)
+inline rtx PATTERN (const_rtx insn)
+{
+  return XEXP (insn, 3);
+}
+
+inline rtx& PATTERN (rtx insn)
+{
+  return XEXP (insn, 3);
+}
 
 #define INSN_LOCATION(INSN) XUINT (INSN, 4)