aboutsummaryrefslogtreecommitdiff
path: root/lib/CodeGen/CodeGenTypes.cpp
diff options
context:
space:
mode:
authorAnders Carlsson <andersca@mac.com>2009-09-26 19:03:24 +0000
committerAnders Carlsson <andersca@mac.com>2009-09-26 19:03:24 +0000
commit6b7fc1344d440b2378d7a1825046c60617cadae2 (patch)
treeb7632565f201e8ac82c2ee33334a3f2288ed40df /lib/CodeGen/CodeGenTypes.cpp
parent41f8a13ac7fa734faef2d8a36feebc3c9a1eed77 (diff)
Use the qualified name for tag types.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@82870 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/CodeGen/CodeGenTypes.cpp')
-rw-r--r--lib/CodeGen/CodeGenTypes.cpp11
1 files changed, 9 insertions, 2 deletions
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<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";