From f26881e300b648e46ae89e24575fe493d772802f Mon Sep 17 00:00:00 2001 From: Nathan Sidwell Date: Tue, 31 Oct 2017 16:27:59 +0000 Subject: [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 --- gcc/cp/cp-tree.h | 19 +++++++++++++++---- 1 file changed, 15 insertions(+), 4 deletions(-) (limited to 'gcc/cp/cp-tree.h') 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 -- cgit v1.1