diff mbox

[195/236] Convert PATTERN from a macro to a pair of inline functions

Message ID 1407345815-14551-196-git-send-email-dmalcolm@redhat.com
State New
Headers show

Commit Message

David Malcolm Aug. 6, 2014, 5:22 p.m. UTC
gcc/
	* rtl.h (PATTERN): Convert this macro into a pair of inline
	functions, for now, requiring const_rtx and rtx.
---
 gcc/rtl.h | 10 +++++++++-
 1 file changed, 9 insertions(+), 1 deletion(-)

Comments

Jakub Jelinek Aug. 6, 2014, 6:03 p.m. UTC | #1
On Wed, Aug 06, 2014 at 01:22:54PM -0400, David Malcolm wrote:
> gcc/
> 	* rtl.h (PATTERN): Convert this macro into a pair of inline
> 	functions, for now, requiring const_rtx and rtx.
> ---
>  gcc/rtl.h | 10 +++++++++-
>  1 file changed, 9 insertions(+), 1 deletion(-)
> 
> diff --git a/gcc/rtl.h b/gcc/rtl.h
> index 79cca1b..640616f 100644
> --- a/gcc/rtl.h
> +++ b/gcc/rtl.h
> @@ -1226,7 +1226,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);
> +}

:(, that is going to make debugging harder.  Can you make sure they are
ignored by gdb?
skip file rtl.h
probably in gdbinit.in.  I guess we also want skip file gimple.h and
similarly for some other headers where we have just tiny inlines we really
don't want to step in through.

	Jakub
diff mbox

Patch

diff --git a/gcc/rtl.h b/gcc/rtl.h
index 79cca1b..640616f 100644
--- a/gcc/rtl.h
+++ b/gcc/rtl.h
@@ -1226,7 +1226,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)