aboutsummaryrefslogtreecommitdiff
path: root/gcc/c-typeck.c
diff options
context:
space:
mode:
authorRoger Sayle <roger@eyesopen.com>2005-05-09 20:48:33 +0000
committerRoger Sayle <roger@eyesopen.com>2005-05-09 20:48:33 +0000
commit75e0cf80440eea8c8363824d72dd0c138ebe9538 (patch)
tree55b63c7bc470ab9a0ee49ea53a931e7a2f5a48d4 /gcc/c-typeck.c
parentd26fbafce35f63c7dee3ffb602ce4f7c82548175 (diff)
* c-tree.h (parser_build_unary_op): New prototype.
* c-typeck.c (parser_build_unary_op): New function to construct a unary operation in the C parser. * c-parser.c (c_parser_unary_expression): Use the new function parser_build_unary_op when appropriate. git-svn-id: https://gcc.gnu.org/svn/gcc/trunk@99471 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/c-typeck.c')
-rw-r--r--gcc/c-typeck.c26
1 files changed, 21 insertions, 5 deletions
diff --git a/gcc/c-typeck.c b/gcc/c-typeck.c
index 07471c7fd89..d3b1c957020 100644
--- a/gcc/c-typeck.c
+++ b/gcc/c-typeck.c
@@ -2312,11 +2312,27 @@ convert_arguments (tree typelist, tree values, tree function, tree fundecl)
return nreverse (result);
}
-/* This is the entry point used by the parser
- for binary operators in the input.
- In addition to constructing the expression,
- we check for operands that were written with other binary operators
- in a way that is likely to confuse the user. */
+/* This is the entry point used by the parser to build unary operators
+ in the input. CODE, a tree_code, specifies the unary operator, and
+ ARG is the operand. For unary plus, the C parser currently uses
+ CONVERT_EXPR for code. */
+
+struct c_expr
+parser_build_unary_op (enum tree_code code, struct c_expr arg)
+{
+ struct c_expr result;
+
+ result.original_code = ERROR_MARK;
+ result.value = build_unary_op (code, arg.value, 0);
+ overflow_warning (result.value);
+ return result;
+}
+
+/* This is the entry point used by the parser to build binary operators
+ in the input. CODE, a tree_code, specifies the binary operator, and
+ ARG1 and ARG2 are the operands. In addition to constructing the
+ expression, we check for operands that were written with other binary
+ operators in a way that is likely to confuse the user. */
struct c_expr
parser_build_binary_op (enum tree_code code, struct c_expr arg1,