Commit 686deecb by Joseph Myers Committed by Joseph Myers

* c-parse.in (expr_no_commas, primary), c-typeck.c

	(parser_build_binary_op): Use IS_EXPR_CODE_CLASS.

From-SVN: r46619
parent 0db58ea4
2001-10-29 Joseph S. Myers <jsm28@cam.ac.uk>
* c-parse.in (expr_no_commas, primary), c-typeck.c
(parser_build_binary_op): Use IS_EXPR_CODE_CLASS.
2001-10-29 David Edelsohn <edelsohn@gnu.org> 2001-10-29 David Edelsohn <edelsohn@gnu.org>
Undo assemble_name change in earlier patch. Undo assemble_name change in earlier patch.
......
...@@ -605,8 +605,7 @@ expr_no_commas: ...@@ -605,8 +605,7 @@ expr_no_commas:
{ char class; { char class;
$$ = build_modify_expr ($1, NOP_EXPR, $3); $$ = build_modify_expr ($1, NOP_EXPR, $3);
class = TREE_CODE_CLASS (TREE_CODE ($$)); class = TREE_CODE_CLASS (TREE_CODE ($$));
if (class == 'e' || class == '1' if (IS_EXPR_CODE_CLASS (class))
|| class == '2' || class == '<')
C_SET_EXP_ORIGINAL_CODE ($$, MODIFY_EXPR); C_SET_EXP_ORIGINAL_CODE ($$, MODIFY_EXPR);
} }
| expr_no_commas ASSIGN expr_no_commas | expr_no_commas ASSIGN expr_no_commas
...@@ -614,8 +613,7 @@ expr_no_commas: ...@@ -614,8 +613,7 @@ expr_no_commas:
$$ = build_modify_expr ($1, $2, $3); $$ = build_modify_expr ($1, $2, $3);
/* This inhibits warnings in truthvalue_conversion. */ /* This inhibits warnings in truthvalue_conversion. */
class = TREE_CODE_CLASS (TREE_CODE ($$)); class = TREE_CODE_CLASS (TREE_CODE ($$));
if (class == 'e' || class == '1' if (IS_EXPR_CODE_CLASS (class))
|| class == '2' || class == '<')
C_SET_EXP_ORIGINAL_CODE ($$, ERROR_MARK); C_SET_EXP_ORIGINAL_CODE ($$, ERROR_MARK);
} }
; ;
...@@ -663,8 +661,7 @@ primary: ...@@ -663,8 +661,7 @@ primary:
} }
| '(' expr ')' | '(' expr ')'
{ char class = TREE_CODE_CLASS (TREE_CODE ($2)); { char class = TREE_CODE_CLASS (TREE_CODE ($2));
if (class == 'e' || class == '1' if (IS_EXPR_CODE_CLASS (class))
|| class == '2' || class == '<')
C_SET_EXP_ORIGINAL_CODE ($2, ERROR_MARK); C_SET_EXP_ORIGINAL_CODE ($2, ERROR_MARK);
$$ = $2; } $$ = $2; }
| '(' error ')' | '(' error ')'
......
...@@ -1752,11 +1752,9 @@ parser_build_binary_op (code, arg1, arg2) ...@@ -1752,11 +1752,9 @@ parser_build_binary_op (code, arg1, arg2)
enum tree_code code1 = ERROR_MARK; enum tree_code code1 = ERROR_MARK;
enum tree_code code2 = ERROR_MARK; enum tree_code code2 = ERROR_MARK;
if (class1 == 'e' || class1 == '1' if (IS_EXPR_CODE_CLASS (class1))
|| class1 == '2' || class1 == '<')
code1 = C_EXP_ORIGINAL_CODE (arg1); code1 = C_EXP_ORIGINAL_CODE (arg1);
if (class2 == 'e' || class2 == '1' if (IS_EXPR_CODE_CLASS (class2))
|| class2 == '2' || class2 == '<')
code2 = C_EXP_ORIGINAL_CODE (arg2); code2 = C_EXP_ORIGINAL_CODE (arg2);
/* Check for cases such as x+y<<z which users are likely /* Check for cases such as x+y<<z which users are likely
...@@ -1826,8 +1824,7 @@ parser_build_binary_op (code, arg1, arg2) ...@@ -1826,8 +1824,7 @@ parser_build_binary_op (code, arg1, arg2)
/* Record the code that was specified in the source, /* Record the code that was specified in the source,
for the sake of warnings about confusing nesting. */ for the sake of warnings about confusing nesting. */
if (class == 'e' || class == '1' if (IS_EXPR_CODE_CLASS (class))
|| class == '2' || class == '<')
C_SET_EXP_ORIGINAL_CODE (result, code); C_SET_EXP_ORIGINAL_CODE (result, code);
else else
{ {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment