]> granicus.if.org Git - clang/commitdiff
Use the qualified name for tag types.
authorAnders Carlsson <andersca@mac.com>
Sat, 26 Sep 2009 19:03:24 +0000 (19:03 +0000)
committerAnders Carlsson <andersca@mac.com>
Sat, 26 Sep 2009 19:03:24 +0000 (19:03 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@82870 91177308-0d34-0410-b5e6-96231b3b80d8

lib/CodeGen/CodeGenTypes.cpp

index 87b3d1144f410d22569e14d803078e1b833052d2..dedf824ef9fd46d608bad5d6398afa3f7fe9b038 100644 (file)
@@ -342,9 +342,16 @@ const llvm::Type *CodeGenTypes::ConvertNewType(QualType T) {
     // Name the codegen type after the typedef name
     // if there is no tag type name available
     if (TD->getIdentifier())
-      TypeName += TD->getNameAsString();
+      // FIXME: We should not have to check for a null decl context here.
+      // Right now we do it because the implicit Obj-C decls don't have one.
+      TypeName += TD->getDeclContext() ? TD->getQualifiedNameAsString() :
+        TD->getNameAsString();
     else if (const TypedefType *TdT = dyn_cast<TypedefType>(T))
-      TypeName += TdT->getDecl()->getNameAsString();
+      // FIXME: We should not have to check for a null decl context here.
+      // Right now we do it because the implicit Obj-C decls don't have one.
+      TypeName += TdT->getDecl()->getDeclContext() ? 
+        TdT->getDecl()->getQualifiedNameAsString() :
+        TdT->getDecl()->getNameAsString();
     else
       TypeName += "anon";