summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDavid Blaikie <dblaikie@gmail.com>2013-08-21 23:23:07 +0000
committerDavid Blaikie <dblaikie@gmail.com>2013-08-21 23:23:07 +0000
commiteaa49e252d8b5e52533f1640fe848071125371f5 (patch)
treed54df5cbfc95642da9cd86b34781f2ab139f519c
parentc4dba32d19e6e82bef1e10ad245f79a8a18bdc51 (diff)
downloadbcm5719-llvm-eaa49e252d8b5e52533f1640fe848071125371f5.tar.gz
bcm5719-llvm-eaa49e252d8b5e52533f1640fe848071125371f5.zip
DebugInfo: Require only the declaration of types only used as parameter and return types
llvm-svn: 188962
-rw-r--r--clang/lib/CodeGen/CGDebugInfo.cpp4
-rw-r--r--clang/test/CodeGenCXX/debug-info-limited.cpp7
2 files changed, 9 insertions, 2 deletions
diff --git a/clang/lib/CodeGen/CGDebugInfo.cpp b/clang/lib/CodeGen/CGDebugInfo.cpp
index 472d35a2b37..bed7fc09931 100644
--- a/clang/lib/CodeGen/CGDebugInfo.cpp
+++ b/clang/lib/CodeGen/CGDebugInfo.cpp
@@ -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);
diff --git a/clang/test/CodeGenCXX/debug-info-limited.cpp b/clang/test/CodeGenCXX/debug-info-limited.cpp
index 12c9c0403ce..54a2424fddd 100644
--- a/clang/test/CodeGenCXX/debug-info-limited.cpp
+++ b/clang/test/CodeGenCXX/debug-info-limited.cpp
@@ -24,3 +24,10 @@ int baz(B *b) {
return bar(b);
}
+
+// CHECK: ; [ DW_TAG_structure_type ] [C] {{.*}} [decl]
+
+struct C {
+};
+
+C (*x)(C);
OpenPOWER on IntegriCloud