diff options
author | neil <neil@138bc75d-0d04-0410-961f-82ee72b054a4> | 2002-04-04 22:19:58 +0000 |
---|---|---|
committer | neil <neil@138bc75d-0d04-0410-961f-82ee72b054a4> | 2002-04-04 22:19:58 +0000 |
commit | aff9e6561ee30f3802fe5993a64cdcd7a53146b4 (patch) | |
tree | 50dc6fe5e989dd9c497bfef9c4a8a5e5f0a8ba33 /gcc/c-parse.in | |
parent | 322fc845e136fcb38a416b552b3e8367388b93a8 (diff) | |
download | gcc-aff9e6561ee30f3802fe5993a64cdcd7a53146b4.tar.gz |
* c-common.c (truthvalue_conversion): Rename, update.
* c-common.h (c_common_truthvalue_conversion): New.
* c-convert.c (convert): Update.
* c-lang.c (LANG_HOOKS_TRUTHVALUE_CONVERSION): Redefine.
* c-parse.in (expr_no_commas, if_prefix, select_or_iter_stmt): Update.
* c-typeck.c (build_binary_op, build_unary_op,
build_conditional_expr): Update.
* fold-const.c (constant_boolean_node, fold): Use langhook.
* langhooks-def.h (LANGHOOK_INITIALIZER): Update.
* langhooks.h (struct lang_hooks): New hook.
* stmt.c (expand_decl_cleanup): Use langhook.
* tree.h (truthvalue_conversion): Remove.
ada:
* gigi.h (truthvalue_conversion): Rename.
* misc.c (LANG_HOOKS_TRUTHVALUE_CONVERSION): Redefine.
* trans.c (tree_transform): Update.
* utils2.c (truthvalue_conversion): Rename, update.
(build_binary_op, build_unary_op): Update.
cp:
* cp-lang.c (LANG_HOOKS_TRUTHVALUE_CONVERSION): Redefine.
* cvt.c: Update comment.
* init.c (expand_cleanup_for_base): Update.
* semantics.c (finish_parenthesized_expr): Update.
* typeck.c (cp_truthvalue_conversion): Update.
f:
* com.c (LANG_HOOKS_TRUTHVALUE_CONVERSION): Redefine.
(truthvalue_conversion): Rename. Update. Make static.
(ffecom_truth_value): Update.
java:
* expr.c (truthvalue_conversion): Rename. Update.
(expand_compare): Update.
* java-tree.h (java_truthvalue_conversion): New.
* lang.c (LANG_HOOKS_TRUTHVALUE_CONVERSION): Redefine.
objc:
* objc-lang.c (LANG_HOOKS_TRUTHVALUE_CONVERSION): Redefine.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@51880 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/c-parse.in')
-rw-r--r-- | gcc/c-parse.in | 28 |
1 files changed, 17 insertions, 11 deletions
diff --git a/gcc/c-parse.in b/gcc/c-parse.in index fa56bfcfce7..e6d61378b9b 100644 --- a/gcc/c-parse.in +++ b/gcc/c-parse.in @@ -566,19 +566,22 @@ expr_no_commas: | expr_no_commas '^' expr_no_commas { $$ = parser_build_binary_op ($2, $1, $3); } | expr_no_commas ANDAND - { $1 = truthvalue_conversion (default_conversion ($1)); + { $1 = c_common_truthvalue_conversion + (default_conversion ($1)); skip_evaluation += $1 == boolean_false_node; } expr_no_commas { skip_evaluation -= $1 == boolean_false_node; $$ = parser_build_binary_op (TRUTH_ANDIF_EXPR, $1, $4); } | expr_no_commas OROR - { $1 = truthvalue_conversion (default_conversion ($1)); + { $1 = c_common_truthvalue_conversion + (default_conversion ($1)); skip_evaluation += $1 == boolean_true_node; } expr_no_commas { skip_evaluation -= $1 == boolean_true_node; $$ = parser_build_binary_op (TRUTH_ORIF_EXPR, $1, $4); } | expr_no_commas '?' - { $1 = truthvalue_conversion (default_conversion ($1)); + { $1 = c_common_truthvalue_conversion + (default_conversion ($1)); skip_evaluation += $1 == boolean_false_node; } expr ':' { skip_evaluation += (($1 == boolean_true_node) @@ -591,7 +594,8 @@ expr_no_commas: pedwarn ("ISO C forbids omitting the middle term of a ?: expression"); /* Make sure first operand is calculated only once. */ $<ttype>2 = save_expr ($1); - $1 = truthvalue_conversion (default_conversion ($<ttype>2)); + $1 = c_common_truthvalue_conversion + (default_conversion ($<ttype>2)); skip_evaluation += $1 == boolean_true_node; } ':' expr_no_commas { skip_evaluation -= $1 == boolean_true_node; @@ -606,7 +610,8 @@ expr_no_commas: | expr_no_commas ASSIGN expr_no_commas { char class; $$ = build_modify_expr ($1, $2, $3); - /* This inhibits warnings in truthvalue_conversion. */ + /* This inhibits warnings in + c_common_truthvalue_conversion. */ class = TREE_CODE_CLASS (TREE_CODE ($$)); if (IS_EXPR_CODE_CLASS (class)) C_SET_EXP_ORIGINAL_CODE ($$, ERROR_MARK); @@ -2189,7 +2194,7 @@ if_prefix: IF { $<ttype>$ = c_begin_if_stmt (); } '(' expr ')' - { c_expand_start_cond (truthvalue_conversion ($4), + { c_expand_start_cond (c_common_truthvalue_conversion ($4), compstmt_count,$<ttype>2); $<itype>$ = stmt_count; if_stmt_file = $<filename>-2; @@ -2301,15 +2306,15 @@ select_or_iter_stmt: { stmt_count++; $<ttype>$ = c_begin_while_stmt (); } '(' expr ')' - { $4 = truthvalue_conversion ($4); - c_finish_while_stmt_cond (truthvalue_conversion ($4), - $<ttype>2); + { $4 = c_common_truthvalue_conversion ($4); + c_finish_while_stmt_cond + (c_common_truthvalue_conversion ($4), $<ttype>2); $<ttype>$ = add_stmt ($<ttype>2); } c99_block_lineno_labeled_stmt { RECHAIN_STMTS ($<ttype>6, WHILE_BODY ($<ttype>6)); } | do_stmt_start '(' expr ')' ';' - { DO_COND ($1) = truthvalue_conversion ($3); } + { DO_COND ($1) = c_common_truthvalue_conversion ($3); } | do_stmt_start error { } | FOR @@ -2321,7 +2326,8 @@ select_or_iter_stmt: RECHAIN_STMTS ($<ttype>2, FOR_INIT_STMT ($<ttype>2)); } xexpr ';' { if ($6) - FOR_COND ($<ttype>2) = truthvalue_conversion ($6); } + FOR_COND ($<ttype>2) + = c_common_truthvalue_conversion ($6); } xexpr ')' { FOR_EXPR ($<ttype>2) = $9; } c99_block_lineno_labeled_stmt |