From 03307888f71f81829bc96f569b927a825e5ab2f4 Mon Sep 17 00:00:00 2001 From: Jason Merrill Date: Tue, 13 May 2003 14:58:56 -0400 Subject: tree.h (STRIP_MAIN_TYPE_NOPS): New macro. * tree.h (STRIP_MAIN_TYPE_NOPS): New macro. * tree.c (iterative_hash_expr): New fn. * c-semantics.c (emit_local_var): Don't mess with temp slots if there's no initializer. From-SVN: r66775 --- gcc/tree.h | 12 ++++++++++++ 1 file changed, 12 insertions(+) (limited to 'gcc/tree.h') diff --git a/gcc/tree.h b/gcc/tree.h index 8c01ca1..060ecd1 100644 --- a/gcc/tree.h +++ b/gcc/tree.h @@ -427,6 +427,17 @@ extern void tree_operand_check_failed PARAMS ((int, enum tree_code, == TREE_UNSIGNED (TREE_TYPE (TREE_OPERAND (EXP, 0))))) \ (EXP) = TREE_OPERAND (EXP, 0) +/* Like STRIP_NOPS, but don't alter the TREE_TYPE main variant either. */ + +#define STRIP_MAIN_TYPE_NOPS(EXP) \ + while ((TREE_CODE (EXP) == NOP_EXPR \ + || TREE_CODE (EXP) == CONVERT_EXPR \ + || TREE_CODE (EXP) == NON_LVALUE_EXPR) \ + && TREE_OPERAND (EXP, 0) != error_mark_node \ + && (TYPE_MAIN_VARIANT (TREE_TYPE (EXP)) \ + == TYPE_MAIN_VARIANT (TREE_TYPE (TREE_OPERAND (EXP, 0))))) \ + (EXP) = TREE_OPERAND (EXP, 0) + /* Like STRIP_NOPS, but don't alter the TREE_TYPE either. */ #define STRIP_TYPE_NOPS(EXP) \ @@ -2955,6 +2966,7 @@ extern bool variably_modified_type_p PARAMS ((tree)); extern int tree_log2 PARAMS ((tree)); extern int tree_floor_log2 PARAMS ((tree)); extern int simple_cst_equal PARAMS ((tree, tree)); +extern unsigned int iterative_hash_expr PARAMS ((tree, unsigned int)); extern int compare_tree_int PARAMS ((tree, unsigned HOST_WIDE_INT)); extern int type_list_equal PARAMS ((tree, tree)); -- cgit v1.1