Commit 73243d63 by Paolo Carlini Committed by Paolo Carlini

cp-tree.h (TAGGED_TYPE_P): Remove.

2013-04-02  Paolo Carlini  <paolo.carlini@oracle.com>

	* cp-tree.h (TAGGED_TYPE_P): Remove.
	(IS_OVERLOAD_TYPE): Rename to OVERLOAD_TYPE_P, adjust.
	(TYPE_ANONYMOUS_P): Adjust.
	* call.c (build_new_op_1): Likewise.
	* class.c (find_abi_tags_r): Likewise.
	* decl.c (warn_misplaced_attr_for_class_type, start_decl,
	type_is_deprecated): Likewise.
	* decl2.c (grokfield, min_vis_r): Likewise.
	* pt.c (get_template_info): Likewise.
	* tree.c (handle_abi_tag_attribute): Likewise.

From-SVN: r197347
parent d8c69a92
2013-04-02 Paolo Carlini <paolo.carlini@oracle.com>
* cp-tree.h (TAGGED_TYPE_P): Remove.
(IS_OVERLOAD_TYPE): Rename to OVERLOAD_TYPE_P, adjust.
(TYPE_ANONYMOUS_P): Adjust.
* call.c (build_new_op_1): Likewise.
* class.c (find_abi_tags_r): Likewise.
* decl.c (warn_misplaced_attr_for_class_type, start_decl,
type_is_deprecated): Likewise.
* decl2.c (grokfield, min_vis_r): Likewise.
* pt.c (get_template_info): Likewise.
* tree.c (handle_abi_tag_attribute): Likewise.
2013-04-01 Jason Merrill <jason@redhat.com> 2013-04-01 Jason Merrill <jason@redhat.com>
* semantics.c (maybe_constant_value): Check * semantics.c (maybe_constant_value): Check
......
...@@ -5097,8 +5097,8 @@ build_new_op_1 (location_t loc, enum tree_code code, int flags, tree arg1, ...@@ -5097,8 +5097,8 @@ build_new_op_1 (location_t loc, enum tree_code code, int flags, tree arg1,
if (code == COND_EXPR) if (code == COND_EXPR)
/* Use build_conditional_expr instead. */ /* Use build_conditional_expr instead. */
gcc_unreachable (); gcc_unreachable ();
else if (! IS_OVERLOAD_TYPE (TREE_TYPE (arg1)) else if (! OVERLOAD_TYPE_P (TREE_TYPE (arg1))
&& (! arg2 || ! IS_OVERLOAD_TYPE (TREE_TYPE (arg2)))) && (! arg2 || ! OVERLOAD_TYPE_P (TREE_TYPE (arg2))))
goto builtin; goto builtin;
if (code == POSTINCREMENT_EXPR || code == POSTDECREMENT_EXPR) if (code == POSTINCREMENT_EXPR || code == POSTDECREMENT_EXPR)
......
...@@ -1319,7 +1319,7 @@ struct abi_tag_data ...@@ -1319,7 +1319,7 @@ struct abi_tag_data
static tree static tree
find_abi_tags_r (tree *tp, int */*walk_subtrees*/, void *data) find_abi_tags_r (tree *tp, int */*walk_subtrees*/, void *data)
{ {
if (!TAGGED_TYPE_P (*tp)) if (!OVERLOAD_TYPE_P (*tp))
return NULL_TREE; return NULL_TREE;
if (tree attributes = lookup_attribute ("abi_tag", TYPE_ATTRIBUTES (*tp))) if (tree attributes = lookup_attribute ("abi_tag", TYPE_ATTRIBUTES (*tp)))
......
...@@ -1233,7 +1233,7 @@ enum languages { lang_c, lang_cplusplus, lang_java }; ...@@ -1233,7 +1233,7 @@ enum languages { lang_c, lang_cplusplus, lang_java };
/* Nonzero if NODE has no name for linkage purposes. */ /* Nonzero if NODE has no name for linkage purposes. */
#define TYPE_ANONYMOUS_P(NODE) \ #define TYPE_ANONYMOUS_P(NODE) \
(TAGGED_TYPE_P (NODE) && ANON_AGGRNAME_P (TYPE_LINKAGE_IDENTIFIER (NODE))) (OVERLOAD_TYPE_P (NODE) && ANON_AGGRNAME_P (TYPE_LINKAGE_IDENTIFIER (NODE)))
/* The _DECL for this _TYPE. */ /* The _DECL for this _TYPE. */
#define TYPE_MAIN_DECL(NODE) (TYPE_STUB_DECL (TYPE_MAIN_VARIANT (NODE))) #define TYPE_MAIN_DECL(NODE) (TYPE_STUB_DECL (TYPE_MAIN_VARIANT (NODE)))
...@@ -1270,9 +1270,8 @@ enum languages { lang_c, lang_cplusplus, lang_java }; ...@@ -1270,9 +1270,8 @@ enum languages { lang_c, lang_cplusplus, lang_java };
/* Keep these checks in ascending code order. */ /* Keep these checks in ascending code order. */
#define RECORD_OR_UNION_CODE_P(T) \ #define RECORD_OR_UNION_CODE_P(T) \
((T) == RECORD_TYPE || (T) == UNION_TYPE) ((T) == RECORD_TYPE || (T) == UNION_TYPE)
#define TAGGED_TYPE_P(T) \ #define OVERLOAD_TYPE_P(T) \
(CLASS_TYPE_P (T) || TREE_CODE (T) == ENUMERAL_TYPE) (CLASS_TYPE_P (T) || TREE_CODE (T) == ENUMERAL_TYPE)
#define IS_OVERLOAD_TYPE(T) TAGGED_TYPE_P (T)
/* True if this a "Java" type, defined in 'extern "Java"'. */ /* True if this a "Java" type, defined in 'extern "Java"'. */
#define TYPE_FOR_JAVA(NODE) TYPE_LANG_FLAG_3 (NODE) #define TYPE_FOR_JAVA(NODE) TYPE_LANG_FLAG_3 (NODE)
......
...@@ -4182,7 +4182,7 @@ void ...@@ -4182,7 +4182,7 @@ void
warn_misplaced_attr_for_class_type (source_location location, warn_misplaced_attr_for_class_type (source_location location,
tree class_type) tree class_type)
{ {
gcc_assert (TAGGED_TYPE_P (class_type)); gcc_assert (OVERLOAD_TYPE_P (class_type));
warning_at (location, OPT_Wattributes, warning_at (location, OPT_Wattributes,
"attribute ignored in declaration " "attribute ignored in declaration "
...@@ -4497,7 +4497,7 @@ start_decl (const cp_declarator *declarator, ...@@ -4497,7 +4497,7 @@ start_decl (const cp_declarator *declarator,
/* If this is a typedef that names the class for linkage purposes /* If this is a typedef that names the class for linkage purposes
(7.1.3p8), apply any attributes directly to the type. */ (7.1.3p8), apply any attributes directly to the type. */
if (TREE_CODE (decl) == TYPE_DECL if (TREE_CODE (decl) == TYPE_DECL
&& TAGGED_TYPE_P (TREE_TYPE (decl)) && OVERLOAD_TYPE_P (TREE_TYPE (decl))
&& decl == TYPE_NAME (TYPE_MAIN_VARIANT (TREE_TYPE (decl)))) && decl == TYPE_NAME (TYPE_MAIN_VARIANT (TREE_TYPE (decl))))
flags = ATTR_FLAG_TYPE_IN_PLACE; flags = ATTR_FLAG_TYPE_IN_PLACE;
else else
...@@ -10938,7 +10938,7 @@ type_is_deprecated (tree type) ...@@ -10938,7 +10938,7 @@ type_is_deprecated (tree type)
return type; return type;
/* Do warn about using typedefs to a deprecated class. */ /* Do warn about using typedefs to a deprecated class. */
if (TAGGED_TYPE_P (type) && type != TYPE_MAIN_VARIANT (type)) if (OVERLOAD_TYPE_P (type) && type != TYPE_MAIN_VARIANT (type))
return type_is_deprecated (TYPE_MAIN_VARIANT (type)); return type_is_deprecated (TYPE_MAIN_VARIANT (type));
code = TREE_CODE (type); code = TREE_CODE (type);
......
...@@ -868,7 +868,7 @@ grokfield (const cp_declarator *declarator, ...@@ -868,7 +868,7 @@ grokfield (const cp_declarator *declarator,
/* If this is a typedef that names the class for linkage purposes /* If this is a typedef that names the class for linkage purposes
(7.1.3p8), apply any attributes directly to the type. */ (7.1.3p8), apply any attributes directly to the type. */
if (TAGGED_TYPE_P (TREE_TYPE (value)) if (OVERLOAD_TYPE_P (TREE_TYPE (value))
&& value == TYPE_NAME (TYPE_MAIN_VARIANT (TREE_TYPE (value)))) && value == TYPE_NAME (TYPE_MAIN_VARIANT (TREE_TYPE (value))))
attrflags = ATTR_FLAG_TYPE_IN_PLACE; attrflags = ATTR_FLAG_TYPE_IN_PLACE;
...@@ -1934,7 +1934,7 @@ min_vis_r (tree *tp, int *walk_subtrees, void *data) ...@@ -1934,7 +1934,7 @@ min_vis_r (tree *tp, int *walk_subtrees, void *data)
{ {
*walk_subtrees = 0; *walk_subtrees = 0;
} }
else if (TAGGED_TYPE_P (*tp) else if (OVERLOAD_TYPE_P (*tp)
&& !TREE_PUBLIC (TYPE_MAIN_DECL (*tp))) && !TREE_PUBLIC (TYPE_MAIN_DECL (*tp)))
{ {
*vis_p = VISIBILITY_ANON; *vis_p = VISIBILITY_ANON;
......
...@@ -324,7 +324,7 @@ get_template_info (const_tree t) ...@@ -324,7 +324,7 @@ get_template_info (const_tree t)
if (!tinfo && DECL_IMPLICIT_TYPEDEF_P (t)) if (!tinfo && DECL_IMPLICIT_TYPEDEF_P (t))
t = TREE_TYPE (t); t = TREE_TYPE (t);
if (TAGGED_TYPE_P (t)) if (OVERLOAD_TYPE_P (t))
tinfo = TYPE_TEMPLATE_INFO (t); tinfo = TYPE_TEMPLATE_INFO (t);
else if (TREE_CODE (t) == BOUND_TEMPLATE_TEMPLATE_PARM) else if (TREE_CODE (t) == BOUND_TEMPLATE_TEMPLATE_PARM)
tinfo = TEMPLATE_TEMPLATE_PARM_TEMPLATE_INFO (t); tinfo = TEMPLATE_TEMPLATE_PARM_TEMPLATE_INFO (t);
......
...@@ -3306,7 +3306,7 @@ handle_abi_tag_attribute (tree* node, tree name, tree args, ...@@ -3306,7 +3306,7 @@ handle_abi_tag_attribute (tree* node, tree name, tree args,
{ {
if (TYPE_P (*node)) if (TYPE_P (*node))
{ {
if (!TAGGED_TYPE_P (*node)) if (!OVERLOAD_TYPE_P (*node))
{ {
error ("%qE attribute applied to non-class, non-enum type %qT", error ("%qE attribute applied to non-class, non-enum type %qT",
name, *node); name, *node);
......
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