DebugInfo: Require only the declaration of types only used as parameter and return...
authorDavid Blaikie <dblaikie@gmail.com>
Wed, 21 Aug 2013 23:23:07 +0000 (23:23 +0000)
committerDavid Blaikie <dblaikie@gmail.com>
Wed, 21 Aug 2013 23:23:07 +0000 (23:23 +0000)
llvm-svn: 188962

clang/lib/CodeGen/CGDebugInfo.cpp
clang/test/CodeGenCXX/debug-info-limited.cpp

index 472d35a..bed7fc0 100644 (file)
@@ -769,7 +769,7 @@ llvm::DIType CGDebugInfo::CreateType(const FunctionType *Ty,
   SmallVector<llvm::Value *, 16> EltTys;
 
   // Add the result type at least.
-  EltTys.push_back(getOrCreateType(Ty->getResultType(), Unit));
+  EltTys.push_back(getOrCreateType(Ty->getResultType(), Unit, true));
 
   // Set up remainder of arguments if there is a prototype.
   // FIXME: IF NOT, HOW IS THIS REPRESENTED?  llvm-gcc doesn't represent '...'!
@@ -777,7 +777,7 @@ llvm::DIType CGDebugInfo::CreateType(const FunctionType *Ty,
     EltTys.push_back(DBuilder.createUnspecifiedParameter());
   else if (const FunctionProtoType *FPT = dyn_cast<FunctionProtoType>(Ty)) {
     for (unsigned i = 0, e = FPT->getNumArgs(); i != e; ++i)
-      EltTys.push_back(getOrCreateType(FPT->getArgType(i), Unit));
+      EltTys.push_back(getOrCreateType(FPT->getArgType(i), Unit, true));
   }
 
   llvm::DIArray EltTypeArray = DBuilder.getOrCreateArray(EltTys);
index 12c9c04..54a2424 100644 (file)
@@ -24,3 +24,10 @@ int baz(B *b) {
   return bar(b);
 }
 
+
+// CHECK: ; [ DW_TAG_structure_type ] [C] {{.*}} [decl]
+
+struct C {
+};
+
+C (*x)(C);