diff options
author | Nathan Sidwell <nathan@codesourcery.com> | 2004-12-21 17:43:27 +0000 |
---|---|---|
committer | Nathan Sidwell <nathan@gcc.gnu.org> | 2004-12-21 17:43:27 +0000 |
commit | 38b3627d6fcedf4e1b99e988440c1c366f6dba10 (patch) | |
tree | 4b5adf425ed835f3fe30098c1efdec407152dc19 /gcc/tree.h | |
parent | 1763d00076ac7e7da7a781a74932bb8aef649b8b (diff) | |
download | gcc-38b3627d6fcedf4e1b99e988440c1c366f6dba10.zip gcc-38b3627d6fcedf4e1b99e988440c1c366f6dba10.tar.gz gcc-38b3627d6fcedf4e1b99e988440c1c366f6dba10.tar.bz2 |
system.c (IN_RANGE): Use plain unsigned, not unsigned HOST_WIDE_INT.
* system.c (IN_RANGE): Use plain unsigned, not unsigned
HOST_WIDE_INT.
* tree.def (VOID_TYPE, INTEGER_TYPE, REAL_TYPE, COMPLEX_TYPE,
VECTOR_TYPE, OFFSET_TYPE, ENUMERAL_TYPE, BOOLEAN_TYPE, CHAR_TYPE,
POINTER_TYPE, REFERENCE_TYPE, METHOD_TYPE, FUNCTION_TYPE,
FILE_TYPE, ARRAY_TYPE, RECORD_TYPE, UNION_TYPE,
QUAL_UNION_TYPE): Reorder for better code efficiency.
(CONST_DECL, TYPE_DECL, VAR_DECL, FIELD_DECL, PARM_DECL): Likewise.
(INDIRECT_REF, ALIGN_INDIRECT_REF, MISALIGNED_INDIRECT_REF): Likewise.
* tree.h (INDIRECT_REF_P): Reorder checks for better optimization.
(IS_EXPR_CODE_CLASS): Use IN_RANGE.
(INTEGRAL_TYPE_P, FLOAT_TYPE_P): Reorder checks for better
optimization.
* cp/cp-tree.def (TEMPLATE_TYPE_PARM,
BOUND_TEMPLATE_TEMPLATE_PARM, TYPE_OF_TYPE, TYPENAME_TYPE): Reorder
for better code efficiency.
* cp/cp-tree.h (CLASS_TYPE_P): Short circuit IS_AGGR_TYPE check.
(CAN_HAVE_FULL_LANG_DECL_P): Reorder for better optimization.
(INTEGRAL_CODE_P, CP_INTEGRAL_TYPE_P,
INTEGRAL_OR_ENUMERATION_TYPE_P, SCALAR_TYPE_P,
CP_AGGREGATE_TYPE_P, TYPE_PTROB_P, TYPE_REF_OBJ_P,
TYPE_PTROBV_P): Likewise.
From-SVN: r92463
Diffstat (limited to 'gcc/tree.h')
-rw-r--r-- | gcc/tree.h | 36 |
1 files changed, 23 insertions, 13 deletions
@@ -51,6 +51,7 @@ enum tree_code { enum tree_code_class { tcc_exceptional, /* An exceptional code (fits no category). */ tcc_constant, /* A constant. */ + /* Order of tcc_type and tcc_declaration is important. */ tcc_type, /* A type object code. */ tcc_declaration, /* A declaration (also serving as variable refs). */ tcc_reference, /* A reference to storage. */ @@ -96,11 +97,12 @@ extern const enum tree_code_class tree_code_type[]; #define DECL_P(CODE)\ (TREE_CODE_CLASS (TREE_CODE (CODE)) == tcc_declaration) -/* Nonzero if CODE represents a INDIRECT_REF. */ +/* Nonzero if CODE represents a INDIRECT_REF. Keep these checks in + ascending code order. */ #define INDIRECT_REF_P(CODE)\ (TREE_CODE (CODE) == INDIRECT_REF \ - || TREE_CODE (CODE) == MISALIGNED_INDIRECT_REF \ - || TREE_CODE (CODE) == ALIGN_INDIRECT_REF) + || TREE_CODE (CODE) == ALIGN_INDIRECT_REF \ + || TREE_CODE (CODE) == MISALIGNED_INDIRECT_REF) /* Nonzero if CODE represents a reference. */ @@ -145,7 +147,7 @@ extern const enum tree_code_class tree_code_type[]; expression. */ #define IS_EXPR_CODE_CLASS(CLASS)\ - (((CLASS) >= tcc_reference) && ((CLASS) <= tcc_expression)) + (IN_RANGE (CLASS, tcc_reference, tcc_expression)) /* Returns nonzero iff NODE is an expression of some kind. */ @@ -737,11 +739,14 @@ extern void tree_operand_check_failed (int, enum tree_code, EXP = TREE_OPERAND (EXP, 0) /* Nonzero if TYPE represents an integral type. Note that we do not - include COMPLEX types here. */ + include COMPLEX types here. Keep these checks in ascending code + order. */ #define INTEGRAL_TYPE_P(TYPE) \ - (TREE_CODE (TYPE) == INTEGER_TYPE || TREE_CODE (TYPE) == ENUMERAL_TYPE \ - || TREE_CODE (TYPE) == BOOLEAN_TYPE || TREE_CODE (TYPE) == CHAR_TYPE) + (TREE_CODE (TYPE) == ENUMERAL_TYPE \ + || TREE_CODE (TYPE) == BOOLEAN_TYPE \ + || TREE_CODE (TYPE) == CHAR_TYPE \ + || TREE_CODE (TYPE) == INTEGER_TYPE) /* Nonzero if TYPE represents a scalar floating-point type. */ @@ -760,20 +765,25 @@ extern void tree_operand_check_failed (int, enum tree_code, && TREE_CODE (TREE_TYPE (TYPE)) == REAL_TYPE) /* Nonzero if TYPE represents a floating-point type, including complex - and vector floating-point types. */ + and vector floating-point types. The vector and complex check does + not use the previous two macros to enable early folding. */ -#define FLOAT_TYPE_P(TYPE) \ - (SCALAR_FLOAT_TYPE_P (TYPE) || COMPLEX_FLOAT_TYPE_P (TYPE) \ - || VECTOR_FLOAT_TYPE_P (TYPE)) +#define FLOAT_TYPE_P(TYPE) \ + (SCALAR_FLOAT_TYPE_P (TYPE) \ + || ((TREE_CODE (TYPE) == COMPLEX_TYPE \ + || TREE_CODE (TYPE) == VECTOR_TYPE) \ + && SCALAR_FLOAT_TYPE_P (TREE_TYPE (TYPE)))) -/* Nonzero if TYPE represents an aggregate (multi-component) type. */ +/* Nonzero if TYPE represents an aggregate (multi-component) type. + Keep these checks in ascending code order. */ #define AGGREGATE_TYPE_P(TYPE) \ (TREE_CODE (TYPE) == ARRAY_TYPE || TREE_CODE (TYPE) == RECORD_TYPE \ || TREE_CODE (TYPE) == UNION_TYPE || TREE_CODE (TYPE) == QUAL_UNION_TYPE) /* Nonzero if TYPE represents a pointer or reference type. - (It should be renamed to INDIRECT_TYPE_P.) */ + (It should be renamed to INDIRECT_TYPE_P.) Keep these checks in + ascending code order. */ #define POINTER_TYPE_P(TYPE) \ (TREE_CODE (TYPE) == POINTER_TYPE || TREE_CODE (TYPE) == REFERENCE_TYPE) |