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 <sayle@gcc.gnu.org>2005-05-09 20:48:33 +0000
commit43f6dfd3ec224e73a7175987f651b3d455f7803f (patch)
tree55b63c7bc470ab9a0ee49ea53a931e7a2f5a48d4 /gcc/c-typeck.c
parent32df413ae734d59d5579b05b1751ebe7a79ac014 (diff)
downloadgcc-43f6dfd3ec224e73a7175987f651b3d455f7803f.zip
gcc-43f6dfd3ec224e73a7175987f651b3d455f7803f.tar.gz
gcc-43f6dfd3ec224e73a7175987f651b3d455f7803f.tar.bz2
c-tree.h (parser_build_unary_op): New prototype.
* 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. From-SVN: r99471
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 07471c7..d3b1c95 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,