From: Anders Carlsson Date: Sat, 26 Sep 2009 19:03:24 +0000 (+0000) Subject: Use the qualified name for tag types. X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=6b7fc1344d440b2378d7a1825046c60617cadae2;p=clang Use the qualified name for tag types. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@82870 91177308-0d34-0410-b5e6-96231b3b80d8 --- diff --git a/lib/CodeGen/CodeGenTypes.cpp b/lib/CodeGen/CodeGenTypes.cpp index 87b3d1144f..dedf824ef9 100644 --- a/lib/CodeGen/CodeGenTypes.cpp +++ b/lib/CodeGen/CodeGenTypes.cpp @@ -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(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";