aboutsummaryrefslogtreecommitdiff
path: root/gcc/cp/cp-tree.h
diff options
context:
space:
mode:
authorNathan Sidwell <nathan@acm.org>2017-10-31 16:27:59 +0000
committerNathan Sidwell <nathan@gcc.gnu.org>2017-10-31 16:27:59 +0000
commitf26881e300b648e46ae89e24575fe493d772802f (patch)
tree676bf479638e840e2f2ed3e95577fa6e78227ce0 /gcc/cp/cp-tree.h
parent5e36e11e2d3ba4cafa9e6523d161b7ffc9023672 (diff)
downloadgcc-f26881e300b648e46ae89e24575fe493d772802f.zip
gcc-f26881e300b648e46ae89e24575fe493d772802f.tar.gz
gcc-f26881e300b648e46ae89e24575fe493d772802f.tar.bz2
[C++ PATCH] overloaded operator fns [3/N]
https://gcc.gnu.org/ml/gcc-patches/2017-10/msg02343.html * cp-tree.h (enum ovl_op_flags): New. (struct operator_name_info_t): Rename arity to flags. * lex.c (set_operator_ident): New. (init_operators): Use it. Adjust for flags. * mangle.c (write_unqualified_id): Adjust for flags. * operators.def: Replace arity with flags. From-SVN: r254271
Diffstat (limited to 'gcc/cp/cp-tree.h')
-rw-r--r--gcc/cp/cp-tree.h19
1 files changed, 15 insertions, 4 deletions
diff --git a/gcc/cp/cp-tree.h b/gcc/cp/cp-tree.h
index a9b2304..c74a186 100644
--- a/gcc/cp/cp-tree.h
+++ b/gcc/cp/cp-tree.h
@@ -5474,16 +5474,27 @@ enum auto_deduction_context
extern void init_reswords (void);
-typedef struct GTY(()) operator_name_info_t {
+/* Various flags for the overloaded operator information. */
+enum ovl_op_flags
+ {
+ OVL_OP_FLAG_NONE = 0,
+ OVL_OP_FLAG_UNARY = 1,
+ OVL_OP_FLAG_BINARY = 2,
+ OVL_OP_FLAG_ALLOC = 4, /* operator new or delete */
+ OVL_OP_FLAG_DELETE = 1, /* operator delete */
+ OVL_OP_FLAG_VEC = 2 /* vector new or delete */
+ };
+
+struct GTY(()) operator_name_info_t {
/* The IDENTIFIER_NODE for the operator. */
tree identifier;
/* The name of the operator. */
const char *name;
/* The mangled name of the operator. */
const char *mangled_name;
- /* The arity of the operator. */
- int arity;
-} operator_name_info_t;
+ /* The ovl_op_flags of the operator */
+ unsigned flags : 8;
+};
/* A mapping from tree codes to operator name information. */
extern GTY(()) operator_name_info_t operator_name_info