tree.h macro patches

GrahamS grahams@rcp.co.uk
Mon May 17 06:51:00 GMT 1999


Hi

Here is a patch for tree.h  which adds parenthesis around each use of 
a macro parameter.

The patch is against the egcs-19990502 snapshot.

Graham

ChangeLog

        * tree.h (IS_EXPR_CODE_CLASS): Add parenthesis to uses of macro
parameter.
	* (STRIP_NOPS): Remove extraneous semicolon.
	* (STRIP_TYPE_NOPS): Likewise.
	* (NULL_TREE): Parenthesise macro.

*** tree.h.orig	Sun May  9 19:37:10 1999
--- tree.h	Sun May  9 19:41:34 1999
*************** extern char tree_code_type[MAX_TREE_CODE
*** 55,61 ****
     expression.  */
  
  #define IS_EXPR_CODE_CLASS(CLASS) \
!   (CLASS == '<' || CLASS == '1' || CLASS == '2' || CLASS == 'e')
  
  /* Number of argument-words in each kind of tree-node.  */
  
--- 55,61 ----
     expression.  */
  
  #define IS_EXPR_CODE_CLASS(CLASS) \
!   ((CLASS) == '<' || (CLASS) == '1' || (CLASS) == '2' || (CLASS) ==
'e')
  
  /* Number of argument-words in each kind of tree-node.  */
  
*************** struct tree_common
*** 364,370 ****
  	  || TREE_CODE (EXP) == NON_LVALUE_EXPR)		\
  	 && (TYPE_MODE (TREE_TYPE (EXP))			\
  	     == TYPE_MODE (TREE_TYPE (TREE_OPERAND (EXP, 0)))))	\
!     (EXP) = TREE_OPERAND (EXP, 0);
  
  /* Like STRIP_NOPS, but don't alter the TREE_TYPE either.  */
  
--- 364,370 ----
  	  || TREE_CODE (EXP) == NON_LVALUE_EXPR)		\
  	 && (TYPE_MODE (TREE_TYPE (EXP))			\
  	     == TYPE_MODE (TREE_TYPE (TREE_OPERAND (EXP, 0)))))	\
!     (EXP) = TREE_OPERAND (EXP, 0)
  
  /* Like STRIP_NOPS, but don't alter the TREE_TYPE either.  */
  
*************** struct tree_common
*** 374,380 ****
  	  || TREE_CODE (EXP) == NON_LVALUE_EXPR)		\
  	 && (TREE_TYPE (EXP)					\
  	     == TREE_TYPE (TREE_OPERAND (EXP, 0))))		\
!     (EXP) = TREE_OPERAND (EXP, 0);
  
  /* Nonzero if TYPE represents an integral type.  Note that we do not
     include COMPLEX types here.  */
--- 374,380 ----
  	  || TREE_CODE (EXP) == NON_LVALUE_EXPR)		\
  	 && (TREE_TYPE (EXP)					\
  	     == TREE_TYPE (TREE_OPERAND (EXP, 0))))		\
!     (EXP) = TREE_OPERAND (EXP, 0)
  
  /* Nonzero if TYPE represents an integral type.  Note that we do not
     include COMPLEX types here.  */
*************** union tree_node
*** 1375,1381 ****
    struct tree_block block;
   };
  
! #define NULL_TREE (tree) NULL
  
  /* The following functions accept a wide integer argument.  Rather
than
     having to cast on every function call, we use a macro instead, that
is
--- 1375,1381 ----
    struct tree_block block;
   };
  
! #define NULL_TREE ((tree) NULL)
  
  /* The following functions accept a wide integer argument.  Rather
than
     having to cast on every function call, we use a macro instead, that
is


More information about the Gcc-patches mailing list