diff options
author | jsm28 <jsm28@138bc75d-0d04-0410-961f-82ee72b054a4> | 2004-07-19 08:38:52 +0000 |
---|---|---|
committer | jsm28 <jsm28@138bc75d-0d04-0410-961f-82ee72b054a4> | 2004-07-19 08:38:52 +0000 |
commit | 066f26bfdffc5e058cb43c3a2ff271bb45a7bded (patch) | |
tree | 435cb0f3950c18eee6ce95cc4156e770e0aac344 /gcc/c-tree.h | |
parent | c39b724a12e87469887286fd7172faf43452978e (diff) | |
download | gcc-066f26bfdffc5e058cb43c3a2ff271bb45a7bded.tar.gz |
* c-tree.h (struct c_expr): Define.
(C_SET_EXP_ORIGINAL_CODE): Remove.
(parser_build_binary_op, build_compound_expr): Update prototypes.
* c-parse.in (%union): Add exprtype.
(FUNC_NAME): Mark as ttype.
(expr, expr_no_commas, cast_expr, unary_expr, primary): Change to
exprtype.
(expr): Update. Define directly in terms of expr_no_commas
instead of using nonnull_exprlist.
(nonnull_exprlist, unary_expr, cast_expr, expr_no_commas, primary,
offsetof_member_designator, typespec_nonreserved_nonattr, init,
initval, designator, component_declarator,
component_notype_declarator, enumerator, array_declarator,
condition, exexpr, switch_statement, stmt_nocomp, stmt,
nonnull_asm_operands, ivar_declarator, receiver): Update. Don't
set C_EXP_ORIGINAL_CODE. Use TREE_NO_WARNING for assignments
where appropriate.
* c-common.h (C_EXP_ORIGINAL_CODE): Remove.
* c-common.c (c_common_truthvalue_conversion): Don't check
C_EXP_ORIGINAL_CODE.
* c-typeck.c (parser_build_binary_op): Use c_expr structures.
Don't use C_EXP_ORIGINAL_CODE.
(default_conversion, default_function_array_conversion): Don't use
C_EXP_ORIGINAL_CODE. Preserve TREE_NO_WARNING.
(internal_build_compound_expr): Merge into build_compound_expr.
(build_compound_expr): Take two operands instead of a TREE_LIST.
* objc/objc-act.c (get_super_receiver): Update calls to
build_compound_expr.
cp:
* typeck.c (build_modify_expr, build_x_modify_expr): Set
TREE_NO_WARNING on assignments with an operator other than '='.
testsuite:
* g++.dg/warn/Wparentheses-1.C, g++.dg/warn/Wparentheses-2.C,
gcc.dg/Wparentheses-10.c: New tests.
* gcc.dg/Wparentheses-5.c: Remove XFAILs.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@84911 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/c-tree.h')
-rw-r--r-- | gcc/c-tree.h | 21 |
1 files changed, 15 insertions, 6 deletions
diff --git a/gcc/c-tree.h b/gcc/c-tree.h index 7cb69baf415..d6cdc97be13 100644 --- a/gcc/c-tree.h +++ b/gcc/c-tree.h @@ -80,10 +80,6 @@ struct lang_type GTY(()) #define C_TYPE_VARIABLE_SIZE(TYPE) TYPE_LANG_FLAG_1 (TYPE) #define C_DECL_VARIABLE_SIZE(TYPE) DECL_LANG_FLAG_0 (TYPE) -/* Store a value in that field. */ -#define C_SET_EXP_ORIGINAL_CODE(EXP, CODE) \ - (TREE_COMPLEXITY (EXP) = (int) (CODE)) - /* Record whether a typedef for type `int' was actually `signed int'. */ #define C_TYPEDEF_EXPLICITLY_SIGNED(EXP) DECL_LANG_FLAG_1 (EXP) @@ -116,6 +112,18 @@ struct lang_type GTY(()) without prototypes. */ #define TYPE_ACTUAL_ARG_TYPES(NODE) TYPE_LANG_SLOT_1 (NODE) +/* Record parser information about an expression that is irrelevant + for code generation alongside a tree representing its value. */ +struct c_expr +{ + /* The value of the expression. */ + tree value; + /* Record the original binary operator of an expression, which may + have been changed by fold, or ERROR_MARK for other expressions + (including parenthesized expressions). */ + enum tree_code original_code; +}; + /* Save and restore the variables in this file and elsewhere that keep track of the progress of compilation of the current function. Used for nested functions. */ @@ -225,10 +233,11 @@ extern tree build_component_ref (tree, tree); extern tree build_indirect_ref (tree, const char *); extern tree build_array_ref (tree, tree); extern tree build_external_ref (tree, int); -extern tree parser_build_binary_op (enum tree_code, tree, tree); +extern struct c_expr parser_build_binary_op (enum tree_code, struct c_expr, + struct c_expr); extern void readonly_error (tree, const char *); extern tree build_conditional_expr (tree, tree, tree); -extern tree build_compound_expr (tree); +extern tree build_compound_expr (tree, tree); extern tree c_cast_expr (tree, tree); extern tree build_c_cast (tree, tree); extern tree build_modify_expr (tree, enum tree_code, tree); |