diff options
| author | Anders Carlsson <andersca@mac.com> | 2010-11-24 21:05:09 +0000 |
|---|---|---|
| committer | Anders Carlsson <andersca@mac.com> | 2010-11-24 21:05:09 +0000 |
| commit | 0c75b49dc18e1be685d9725ccb0e25ce3120542f (patch) | |
| tree | fe6758341ebe023a4ccbf095bd1aab0a8faa6085 /clang | |
| parent | 0e4dfebe6300d06aff9f60a1be8c0120a2b2e11c (diff) | |
| download | bcm5719-llvm-0c75b49dc18e1be685d9725ccb0e25ce3120542f.tar.gz bcm5719-llvm-0c75b49dc18e1be685d9725ccb0e25ce3120542f.zip | |
Fix a (probably very old) regression where we weren't using the typedef name for anonymous tag types.
llvm-svn: 120113
Diffstat (limited to 'clang')
| -rw-r--r-- | clang/lib/CodeGen/CodeGenTypes.cpp | 11 | ||||
| -rw-r--r-- | clang/test/CodeGen/regparm.c | 2 | ||||
| -rw-r--r-- | clang/test/CodeGen/transparent-union.c | 2 |
3 files changed, 7 insertions, 8 deletions
diff --git a/clang/lib/CodeGen/CodeGenTypes.cpp b/clang/lib/CodeGen/CodeGenTypes.cpp index fdfdd9895b8..dde1322e3c2 100644 --- a/clang/lib/CodeGen/CodeGenTypes.cpp +++ b/clang/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; diff --git a/clang/test/CodeGen/regparm.c b/clang/test/CodeGen/regparm.c index ec5cbab16a5..dd0be968185 100644 --- a/clang/test/CodeGen/regparm.c +++ b/clang/test/CodeGen/regparm.c @@ -21,7 +21,7 @@ void f1(int i, int j, int k) { } int main(void) { - // CHECK: call void @reduced(i8 signext inreg 0, {{.*}} %struct.anon* inreg null + // CHECK: call void @reduced(i8 signext inreg 0, {{.*}} %struct.foo* inreg null reduced(0, 0.0, 0, 0.0, 0); // CHECK: call x86_stdcallcc void {{.*}}(i32 inreg 1, i32 inreg 2) bar(1,2); diff --git a/clang/test/CodeGen/transparent-union.c b/clang/test/CodeGen/transparent-union.c index 0bdbd577f90..97a731855c7 100644 --- a/clang/test/CodeGen/transparent-union.c +++ b/clang/test/CodeGen/transparent-union.c @@ -11,7 +11,7 @@ typedef union { void f0(transp_t0 obj); // CHECK: define void @f1_0(i32* %a0) -// CHECK: call void @f0(%union.anon* byval %{{.*}}) +// CHECK: call void @f0(%union.transp_t0* byval %{{.*}}) // CHECK: call void %{{.*}}(i8* %{{[a-z0-9]*}}) // CHECK: } void f1_0(int *a0) { |

