summaryrefslogtreecommitdiffstats
path: root/contrib/gcc/cp/rtti.c
diff options
context:
space:
mode:
Diffstat (limited to 'contrib/gcc/cp/rtti.c')
-rw-r--r--contrib/gcc/cp/rtti.c12
1 files changed, 12 insertions, 0 deletions
diff --git a/contrib/gcc/cp/rtti.c b/contrib/gcc/cp/rtti.c
index 39cb1c6..fbb37fe 100644
--- a/contrib/gcc/cp/rtti.c
+++ b/contrib/gcc/cp/rtti.c
@@ -327,6 +327,15 @@ get_tinfo_decl (type)
type = build_function_type (TREE_TYPE (type),
TREE_CHAIN (TYPE_ARG_TYPES (type)));
+ /* For a class type, the variable is cached in the type node
+ itself. */
+ if (CLASS_TYPE_P (type))
+ {
+ d = CLASSTYPE_TYPEINFO_VAR (TYPE_MAIN_VARIANT (type));
+ if (d)
+ return d;
+ }
+
name = mangle_typeinfo_for_type (type);
d = IDENTIFIER_GLOBAL_VALUE (name);
@@ -346,6 +355,9 @@ get_tinfo_decl (type)
pushdecl_top_level (d);
+ if (CLASS_TYPE_P (type))
+ CLASSTYPE_TYPEINFO_VAR (TYPE_MAIN_VARIANT (type)) = d;
+
/* Remember the type it is for. */
TREE_TYPE (name) = type;
}
OpenPOWER on IntegriCloud