diff options
author | Nathan Sidwell <nathan@acm.org> | 2017-11-01 15:46:42 +0000 |
---|---|---|
committer | Nathan Sidwell <nathan@gcc.gnu.org> | 2017-11-01 15:46:42 +0000 |
commit | ce12115844ef8f66a28205d1f1e81ea0ccc946b1 (patch) | |
tree | 1dba75c64dce051b6ee0933505d31b39046940fa /gcc/cp/decl.c | |
parent | 4a110e3478460101b4c0d6591d7cdb0b1d3a276b (diff) | |
download | gcc-ce12115844ef8f66a28205d1f1e81ea0ccc946b1.zip gcc-ce12115844ef8f66a28205d1f1e81ea0ccc946b1.tar.gz gcc-ce12115844ef8f66a28205d1f1e81ea0ccc946b1.tar.bz2 |
[C++ PATCH] overloaded operator fns [6/N]
https://gcc.gnu.org/ml/gcc-patches/2017-11/msg00019.html
gcc/cp/
* cp-tree.h (assign_op_identifier, call_op_identifier): Use
compressed code.
(struct lang_decl_fn): Use compressed operator code.
(DECL_OVERLOADED_OPERATOR_CODE): Replace with ...
(DECL_OVERLOADED_OPERATOR_CODE_RAW): ... this.
(DECL_OVERLOADED_OPERATOR_CODE_IS): Use it.
* decl.c (duplicate_decls): Use DECL_OVERLOADED_OPERATOR_CODE_RAW.
(build_library_fn): Likewise.
(grok_op_properties): Likewise.
* mangle.c (write_unqualified_name): Likewise.
* method.c (implicitly_declare_fn): Likewise.
* typeck.c (check_return_expr): Use DECL_OVERLOADED_OPERATOR_IS.
libcc1/
* libcp1plugin.cc (plugin_build_decl): Use
DECL_OVERLOADED_OPERATOR_CODE_RAW.
From-SVN: r254314
Diffstat (limited to 'gcc/cp/decl.c')
-rw-r--r-- | gcc/cp/decl.c | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/gcc/cp/decl.c b/gcc/cp/decl.c index f43c960..d544d06 100644 --- a/gcc/cp/decl.c +++ b/gcc/cp/decl.c @@ -1920,8 +1920,8 @@ next_arg:; DECL_OVERRIDE_P (newdecl) |= DECL_OVERRIDE_P (olddecl); DECL_THIS_STATIC (newdecl) |= DECL_THIS_STATIC (olddecl); if (DECL_OVERLOADED_OPERATOR_P (olddecl)) - DECL_OVERLOADED_OPERATOR_CODE (newdecl) - = DECL_OVERLOADED_OPERATOR_CODE (olddecl); + DECL_OVERLOADED_OPERATOR_CODE_RAW (newdecl) + = DECL_OVERLOADED_OPERATOR_CODE_RAW (olddecl); new_defines_function = DECL_INITIAL (newdecl) != NULL_TREE; /* Optionally warn about more than one declaration for the same @@ -4444,7 +4444,8 @@ build_library_fn (tree name, enum tree_code operator_code, tree type, DECL_EXTERNAL (fn) = 1; TREE_PUBLIC (fn) = 1; DECL_ARTIFICIAL (fn) = 1; - DECL_OVERLOADED_OPERATOR_CODE (fn) = operator_code; + DECL_OVERLOADED_OPERATOR_CODE_RAW (fn) + = OVL_OP_INFO (false, operator_code)->ovl_op_code; SET_DECL_LANGUAGE (fn, lang_c); /* Runtime library routines are, by definition, available in an external shared object. */ @@ -12902,7 +12903,7 @@ grok_op_properties (tree decl, bool complain) operator_code = ovl_op->tree_code; op_flags = ovl_op->flags; gcc_checking_assert (operator_code != ERROR_MARK); - DECL_OVERLOADED_OPERATOR_CODE (decl) = operator_code; + DECL_OVERLOADED_OPERATOR_CODE_RAW (decl) = ovl_op->ovl_op_code; } if (op_flags & OVL_OP_FLAG_ALLOC) @@ -13046,7 +13047,7 @@ grok_op_properties (tree decl, bool complain) const ovl_op_info_t *ovl_op = &ovl_op_info[false][alt]; gcc_checking_assert (ovl_op->flags == OVL_OP_FLAG_UNARY); operator_code = ovl_op->tree_code; - DECL_OVERLOADED_OPERATOR_CODE (decl) = operator_code; + DECL_OVERLOADED_OPERATOR_CODE_RAW (decl) = ovl_op->ovl_op_code; } else if (arity != 2) { |