aboutsummaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorAnders Carlsson <andersca@mac.com>2010-11-24 21:05:09 +0000
committerAnders Carlsson <andersca@mac.com>2010-11-24 21:05:09 +0000
commitcb690b111f698f0e16e59ed82ab6a7d660edb6d1 (patch)
tree6a7c69ed05aeb531b3fe6d61cc611d959cdf2196 /lib
parent2d987772c2ba3bff93b9fbe7b73bf06eed2b1607 (diff)
Fix a (probably very old) regression where we weren't using the typedef name for anonymous tag types.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@120113 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib')
-rw-r--r--lib/CodeGen/CodeGenTypes.cpp11
1 files changed, 5 insertions, 6 deletions
diff --git a/lib/CodeGen/CodeGenTypes.cpp b/lib/CodeGen/CodeGenTypes.cpp
index fdfdd9895b..dde1322e3c 100644
--- a/lib/CodeGen/CodeGenTypes.cpp
+++ b/lib/CodeGen/CodeGenTypes.cpp
@@ -384,16 +384,15 @@ const llvm::Type *CodeGenTypes::ConvertNewType(QualType T) {
OS << TD->getQualifiedNameAsString();
else
TD->printName(OS);
- } else if (const TypedefType *TdT = dyn_cast<TypedefType>(T)) {
+ } else if (const TypedefDecl *TDD = TD->getTypedefForAnonDecl()) {
// 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.
- if (TdT->getDecl()->getDeclContext())
- OS << TdT->getDecl()->getQualifiedNameAsString();
+ if (TDD->getDeclContext())
+ OS << TDD->getQualifiedNameAsString();
else
- TdT->getDecl()->printName(OS);
- } else {
+ TDD->printName(OS);
+ } else
OS << "anon";
- }
TheModule.addTypeName(OS.str(), Res);
return Res;