Commit 2063b07f by Nathan Sidwell Committed by Nathan Sidwell

cp-tree.h (OVL_USED): Replace with ...

	* cp-tree.h (OVL_USED): Replace with ...
	(OVL_USING_P): ... this.
	(ovl_iterator::using_p): Adjust.
	* name-lookup.c (push_overloaded_decl_1)
	do_nonmember_using_decl): Adjust.
	* search.c (lookup_field_r): Adjust.
	* tree.c (ovl_insert, ovl_scope): Adjust.
(--This line, and those below, will be ignored--

M    cp/tree.c
M    cp/cp-tree.h
M    cp/name-lookup.c
M    cp/search.c
M    cp/ChangeLog

From-SVN: r248229
parent 8264c84d
2017-05-18 Nathan Sidwell <nathan@acm.org> 2017-05-18 Nathan Sidwell <nathan@acm.org>
* cp-tree.h (OVL_USED): Replace with ...
(OVL_USING_P): ... this.
(ovl_iterator::using_p): Adjust.
* name-lookup.c (push_overloaded_decl_1,
do_nonmember_using_decl): Adjust.
* search.c (lookup_field_r): Adjust.
* tree.c (ovl_insert, ovl_scope): Adjust.
* cp-tree.h (lookup_add): Swap args. * cp-tree.h (lookup_add): Swap args.
(ovl_cons, build_overload): Delete. (ovl_cons, build_overload): Delete.
* name-lookup.c (add_function, push_overloaded_decl_1, * name-lookup.c (add_function, push_overloaded_decl_1,
......
...@@ -351,6 +351,7 @@ extern GTY(()) tree cp_global_trees[CPTI_MAX]; ...@@ -351,6 +351,7 @@ extern GTY(()) tree cp_global_trees[CPTI_MAX];
CONSTRUCTOR_NO_IMPLICIT_ZERO (in CONSTRUCTOR) CONSTRUCTOR_NO_IMPLICIT_ZERO (in CONSTRUCTOR)
TINFO_USED_TEMPLATE_ID (in TEMPLATE_INFO) TINFO_USED_TEMPLATE_ID (in TEMPLATE_INFO)
PACK_EXPANSION_SIZEOF_P (in *_PACK_EXPANSION) PACK_EXPANSION_SIZEOF_P (in *_PACK_EXPANSION)
OVL_USING_P (in OVERLOAD)
2: IDENTIFIER_OPNAME_P (in IDENTIFIER_NODE) 2: IDENTIFIER_OPNAME_P (in IDENTIFIER_NODE)
ICS_THIS_FLAG (in _CONV) ICS_THIS_FLAG (in _CONV)
DECL_INITIALIZED_BY_CONSTANT_EXPRESSION_P (in VAR_DECL) DECL_INITIALIZED_BY_CONSTANT_EXPRESSION_P (in VAR_DECL)
...@@ -640,14 +641,12 @@ typedef struct ptrmem_cst * ptrmem_cst_t; ...@@ -640,14 +641,12 @@ typedef struct ptrmem_cst * ptrmem_cst_t;
((TREE_CODE (NODE) == OVERLOAD) ? OVL_FUNCTION (NODE) : (NODE)) ((TREE_CODE (NODE) == OVERLOAD) ? OVL_FUNCTION (NODE) : (NODE))
#define OVL_NEXT(NODE) \ #define OVL_NEXT(NODE) \
((TREE_CODE (NODE) == OVERLOAD) ? TREE_CHAIN (NODE) : NULL_TREE) ((TREE_CODE (NODE) == OVERLOAD) ? TREE_CHAIN (NODE) : NULL_TREE)
/* If set, this was imported in a using declaration.
This is not to confuse with being used somewhere, which
is not important for this node. */
#define OVL_USED(NODE) TREE_USED (OVERLOAD_CHECK (NODE))
/* If set, this OVERLOAD was created for argument-dependent lookup /* If set, this OVERLOAD was created for argument-dependent lookup
and can be freed afterward. */ and can be freed afterward. */
#define OVL_ARG_DEPENDENT(NODE) TREE_LANG_FLAG_0 (OVERLOAD_CHECK (NODE)) #define OVL_ARG_DEPENDENT(NODE) TREE_LANG_FLAG_0 (OVERLOAD_CHECK (NODE))
/* If set, this was imported in a using declaration. */
#define OVL_USING_P(NODE) TREE_LANG_FLAG_1 (OVERLOAD_CHECK (NODE))
/* If set, this overload contains a nested overload. */ /* If set, this overload contains a nested overload. */
#define OVL_NESTED_P(NODE) TREE_LANG_FLAG_3 (OVERLOAD_CHECK (NODE)) #define OVL_NESTED_P(NODE) TREE_LANG_FLAG_3 (OVERLOAD_CHECK (NODE))
/* If set, this overload was constructed during lookup. */ /* If set, this overload was constructed during lookup. */
...@@ -705,7 +704,7 @@ class ovl_iterator ...@@ -705,7 +704,7 @@ class ovl_iterator
/* Whether this overload was introduced by a using decl. */ /* Whether this overload was introduced by a using decl. */
bool using_p () const bool using_p () const
{ {
return TREE_CODE (ovl) == OVERLOAD && OVL_USED (ovl); return TREE_CODE (ovl) == OVERLOAD && OVL_USING_P (ovl);
} }
tree remove_node (tree head) tree remove_node (tree head)
{ {
......
...@@ -2920,7 +2920,7 @@ push_overloaded_decl_1 (tree decl, int flags, bool is_friend) ...@@ -2920,7 +2920,7 @@ push_overloaded_decl_1 (tree decl, int flags, bool is_friend)
tree fn = OVL_CURRENT (tmp); tree fn = OVL_CURRENT (tmp);
tree dup; tree dup;
if (TREE_CODE (tmp) == OVERLOAD && OVL_USED (tmp) if (TREE_CODE (tmp) == OVERLOAD && OVL_USING_P (tmp)
&& !(flags & PUSH_USING) && !(flags & PUSH_USING)
&& compparms_for_decl_and_using_decl (fn, decl) && compparms_for_decl_and_using_decl (fn, decl)
&& ! decls_match (fn, decl)) && ! decls_match (fn, decl))
...@@ -3136,7 +3136,7 @@ do_nonmember_using_decl (tree scope, tree name, tree oldval, tree oldtype, ...@@ -3136,7 +3136,7 @@ do_nonmember_using_decl (tree scope, tree name, tree oldval, tree oldtype,
if (new_fn == old_fn) if (new_fn == old_fn)
/* The function already exists in the current namespace. */ /* The function already exists in the current namespace. */
break; break;
else if (TREE_CODE (tmp1) == OVERLOAD && OVL_USED (tmp1)) else if (TREE_CODE (tmp1) == OVERLOAD && OVL_USING_P (tmp1))
continue; /* this is a using decl */ continue; /* this is a using decl */
else if (compparms_for_decl_and_using_decl (new_fn, old_fn)) else if (compparms_for_decl_and_using_decl (new_fn, old_fn))
{ {
......
...@@ -1106,7 +1106,7 @@ lookup_field_r (tree binfo, void *data) ...@@ -1106,7 +1106,7 @@ lookup_field_r (tree binfo, void *data)
if (!nval) if (!nval)
/* Look for a data member or type. */ /* Look for a data member or type. */
nval = lookup_field_1 (type, lfi->name, lfi->want_type); nval = lookup_field_1 (type, lfi->name, lfi->want_type);
else if (TREE_CODE (nval) == OVERLOAD && OVL_USED (nval)) else if (TREE_CODE (nval) == OVERLOAD && OVL_USING_P (nval))
{ {
/* If we have both dependent and non-dependent using-declarations, return /* If we have both dependent and non-dependent using-declarations, return
the dependent one rather than an incomplete list of functions. */ the dependent one rather than an incomplete list of functions. */
......
...@@ -2138,7 +2138,7 @@ ovl_insert (tree fn, tree maybe_ovl, bool using_p) ...@@ -2138,7 +2138,7 @@ ovl_insert (tree fn, tree maybe_ovl, bool using_p)
/* Find insertion point. */ /* Find insertion point. */
while (maybe_ovl && TREE_CODE (maybe_ovl) == OVERLOAD while (maybe_ovl && TREE_CODE (maybe_ovl) == OVERLOAD
&& (weight < OVL_USED (maybe_ovl))) && (weight < OVL_USING_P (maybe_ovl)))
{ {
if (!result) if (!result)
result = maybe_ovl; result = maybe_ovl;
...@@ -2151,7 +2151,7 @@ ovl_insert (tree fn, tree maybe_ovl, bool using_p) ...@@ -2151,7 +2151,7 @@ ovl_insert (tree fn, tree maybe_ovl, bool using_p)
{ {
trail = ovl_make (fn, maybe_ovl); trail = ovl_make (fn, maybe_ovl);
if (using_p) if (using_p)
OVL_USED (trail) = true; OVL_USING_P (trail) = true;
} }
if (insert_after) if (insert_after)
...@@ -2290,7 +2290,7 @@ ovl_scope (tree ovl) ...@@ -2290,7 +2290,7 @@ ovl_scope (tree ovl)
if (TREE_CODE (ovl) == TEMPLATE_ID_EXPR) if (TREE_CODE (ovl) == TEMPLATE_ID_EXPR)
ovl = TREE_OPERAND (ovl, 0); ovl = TREE_OPERAND (ovl, 0);
/* Skip using-declarations. */ /* Skip using-declarations. */
while (TREE_CODE (ovl) == OVERLOAD && OVL_USED (ovl) && OVL_CHAIN (ovl)) while (TREE_CODE (ovl) == OVERLOAD && OVL_USING_P (ovl) && OVL_CHAIN (ovl))
ovl = OVL_CHAIN (ovl); ovl = OVL_CHAIN (ovl);
return CP_DECL_CONTEXT (OVL_CURRENT (ovl)); return CP_DECL_CONTEXT (OVL_CURRENT (ovl));
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment