aboutsummaryrefslogtreecommitdiff
path: root/gcc
diff options
context:
space:
mode:
Diffstat (limited to 'gcc')
-rw-r--r--gcc/d/d-compiler.cc11
-rw-r--r--gcc/d/typeinfo.cc4
2 files changed, 13 insertions, 2 deletions
diff --git a/gcc/d/d-compiler.cc b/gcc/d/d-compiler.cc
index ada9721..ef19df1 100644
--- a/gcc/d/d-compiler.cc
+++ b/gcc/d/d-compiler.cc
@@ -130,8 +130,7 @@ Compiler::onParseModule (Module *m)
{
if (md->packages.length == 0)
{
- Identifier *id = (md && md->id) ? md->id : m->ident;
- if (!strcmp (id->toChars (), "object"))
+ if (!strcmp (md->id->toChars (), "object"))
{
create_tinfo_types (m);
return;
@@ -147,6 +146,14 @@ Compiler::onParseModule (Module *m)
}
}
}
+ else if (m->ident)
+ {
+ if (!strcmp (m->ident->toChars (), "object"))
+ {
+ create_tinfo_types (m);
+ return;
+ }
+ }
if (!flag_no_builtin)
d_add_builtin_module (m);
diff --git a/gcc/d/typeinfo.cc b/gcc/d/typeinfo.cc
index d1f0d59..3577f66 100644
--- a/gcc/d/typeinfo.cc
+++ b/gcc/d/typeinfo.cc
@@ -244,6 +244,10 @@ make_frontend_typeinfo (Identifier *ident, ClassDeclaration *base = NULL)
void
create_tinfo_types (Module *mod)
{
+ /* Already generated internal types for the object module. */
+ if (object_module != NULL)
+ return;
+
/* Build the internal TypeInfo and ClassInfo types.
See TypeInfoVisitor for documentation of field layout. */
make_internal_typeinfo (TK_TYPEINFO_TYPE, Identifier::idPool ("TypeInfo"),