summaryrefslogtreecommitdiffstats
path: root/gcc/c-typeck.c
diff options
context:
space:
mode:
authorsayle <sayle@138bc75d-0d04-0410-961f-82ee72b054a4>2005-05-09 20:48:33 +0000
committersayle <sayle@138bc75d-0d04-0410-961f-82ee72b054a4>2005-05-09 20:48:33 +0000
commit5381eb98a264ed2e15673ceba37806390ce85a8f (patch)
tree55b63c7bc470ab9a0ee49ea53a931e7a2f5a48d4 /gcc/c-typeck.c
parent51ea5d02db95170cf781dd7d96f4d783409411b8 (diff)
downloadppe42-gcc-5381eb98a264ed2e15673ceba37806390ce85a8f.tar.gz
ppe42-gcc-5381eb98a264ed2e15673ceba37806390ce85a8f.zip
* 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: svn+ssh://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,
OpenPOWER on IntegriCloud