From 55a2b3dbffefceb82bc34b5c88699e9c0a0d0b8c Mon Sep 17 00:00:00 2001 From: David Blaikie Date: Wed, 21 Aug 2013 23:23:07 +0000 Subject: [PATCH] DebugInfo: Require only the declaration of types only used as parameter and return types git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@188962 91177308-0d34-0410-b5e6-96231b3b80d8 --- lib/CodeGen/CGDebugInfo.cpp | 4 ++-- test/CodeGenCXX/debug-info-limited.cpp | 7 +++++++ 2 files changed, 9 insertions(+), 2 deletions(-) diff --git a/lib/CodeGen/CGDebugInfo.cpp b/lib/CodeGen/CGDebugInfo.cpp index 472d35a2b3..bed7fc0993 100644 --- a/lib/CodeGen/CGDebugInfo.cpp +++ b/lib/CodeGen/CGDebugInfo.cpp @@ -769,7 +769,7 @@ llvm::DIType CGDebugInfo::CreateType(const FunctionType *Ty, SmallVector 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(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/test/CodeGenCXX/debug-info-limited.cpp b/test/CodeGenCXX/debug-info-limited.cpp index 12c9c0403c..54a2424fdd 100644 --- a/test/CodeGenCXX/debug-info-limited.cpp +++ b/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); -- 2.40.0