]> granicus.if.org Git - clang/commitdiff
Fix a (probably very old) regression where we weren't using the typedef name for...
authorAnders Carlsson <andersca@mac.com>
Wed, 24 Nov 2010 21:05:09 +0000 (21:05 +0000)
committerAnders Carlsson <andersca@mac.com>
Wed, 24 Nov 2010 21:05:09 +0000 (21:05 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@120113 91177308-0d34-0410-b5e6-96231b3b80d8

lib/CodeGen/CodeGenTypes.cpp
test/CodeGen/regparm.c
test/CodeGen/transparent-union.c

index fdfdd9895b8d1c5091a1dca6c04cda604070f7bf..dde1322e3c2fbbfbc045e4136a476ab8562129b0 100644 (file)
@@ -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;
index ec5cbab16a5b57a55eef38caa5c2adeeeaf02f50..dd0be968185ee46e6acb495daec69184e7f16edd 100644 (file)
@@ -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);
index 0bdbd577f905b010ad6621365f1278522ec3adf5..97a731855c73d88d4c263bfe3cd3f3befde1ee01 100644 (file)
@@ -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) {