diff options
author | Nathan Sidwell <nathan@acm.org> | 2017-10-31 20:08:51 +0000 |
---|---|---|
committer | Nathan Sidwell <nathan@gcc.gnu.org> | 2017-10-31 20:08:51 +0000 |
commit | 881c969cf6797917ad69ea7bf4c47888890125ff (patch) | |
tree | e834aa3532529a8b1d13db828ee7c5e64fbd2442 /gcc/cp/cp-tree.h | |
parent | c67624232a1cb16a99497605dde681eee711dbbd (diff) | |
download | gcc-881c969cf6797917ad69ea7bf4c47888890125ff.zip gcc-881c969cf6797917ad69ea7bf4c47888890125ff.tar.gz gcc-881c969cf6797917ad69ea7bf4c47888890125ff.tar.bz2 |
[C++ PATCH] overloaded operator fns [5/N]
https://gcc.gnu.org/ml/gcc-patches/2017-10/
* cp-tree.h (struct operator_name_info_t): Rename to ...
(struct ovl_op_info_t): ... here. Add tree_code field.
(operator_name_info, assignment_operator_name_info): Delete.
(ovl_op_info): Declare.
(OVL_OP_INFO): Adjust.
* decl.c (grok_op_properties): Use ovl_op_flags.
* lex.c (operator_name_info, assignment_operator_name_info):
Delete.
(ovl_op_info): Define.
(set_operator_ident): Adjust.
(init_operators): Set tree_code.
* mangle.c (write_unqualified_id): Adjust operator array scan.
From-SVN: r254279
Diffstat (limited to 'gcc/cp/cp-tree.h')
-rw-r--r-- | gcc/cp/cp-tree.h | 15 |
1 files changed, 6 insertions, 9 deletions
diff --git a/gcc/cp/cp-tree.h b/gcc/cp/cp-tree.h index c74a186..257c877 100644 --- a/gcc/cp/cp-tree.h +++ b/gcc/cp/cp-tree.h @@ -5485,29 +5485,26 @@ enum ovl_op_flags OVL_OP_FLAG_VEC = 2 /* vector new or delete */ }; -struct GTY(()) operator_name_info_t { +struct GTY(()) ovl_op_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 tree code. */ + enum tree_code tree_code : 16; /* 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 - [(int) MAX_TREE_CODES]; -/* Similar, but for assignment operators. */ -extern GTY(()) operator_name_info_t assignment_operator_name_info - [(int) MAX_TREE_CODES]; +/* Overloaded operator info indexed by ass_op_p & tree_code. */ +extern GTY(()) ovl_op_info_t ovl_op_info[2][MAX_TREE_CODES]; /* Given an ass_op_p boolean and a tree code, return a pointer to its overloaded operator info. */ #define OVL_OP_INFO(IS_ASS_P, TREE_CODE) \ - (((IS_ASS_P) ? assignment_operator_name_info : operator_name_info) \ - + (TREE_CODE)) + (&ovl_op_info[(IS_ASS_P) != 0][(TREE_CODE)]) /* A type-qualifier, or bitmask therefore, using the TYPE_QUAL constants. */ |