diff options
author | David Blaikie <dblaikie@gmail.com> | 2013-07-13 21:08:14 +0000 |
---|---|---|
committer | David Blaikie <dblaikie@gmail.com> | 2013-07-13 21:08:14 +0000 |
commit | 48ad6dc4633382ce81b5db3dfa9b282ae5eac105 (patch) | |
tree | 1c0b65772e3b8cb979c366bd8c27fd10811307b9 /clang/lib/CodeGen/CGDebugInfo.cpp | |
parent | 66ed89d07ffd6d5c372e4bb566216da30844a796 (diff) | |
download | bcm5719-llvm-48ad6dc4633382ce81b5db3dfa9b282ae5eac105.tar.gz bcm5719-llvm-48ad6dc4633382ce81b5db3dfa9b282ae5eac105.zip |
PR16214, PR14467: DebugInfo: use "RequireCompleteType" to decide when to emit the full definition of a type in -flimit-debug-info
This simplifies the core benefit of -flimit-debug-info by taking a more
systematic approach to avoid emitting debug info definitions for types
that only require declarations. The previous ad-hoc approach (3 cases
removed in this patch) had many holes.
The general approach (adding a bit to TagDecl and callback through
ASTConsumer) has been discussed with Richard Smith - though always open
to revision.
llvm-svn: 186262
Diffstat (limited to 'clang/lib/CodeGen/CGDebugInfo.cpp')
-rw-r--r-- | clang/lib/CodeGen/CGDebugInfo.cpp | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/clang/lib/CodeGen/CGDebugInfo.cpp b/clang/lib/CodeGen/CGDebugInfo.cpp index 11149f47929..4c275462d4b 100644 --- a/clang/lib/CodeGen/CGDebugInfo.cpp +++ b/clang/lib/CodeGen/CGDebugInfo.cpp @@ -1379,7 +1379,8 @@ llvm::DIType CGDebugInfo::CreateType(const RecordType *Ty, bool Declaration) { RecordDecl *RD = Ty->getDecl(); // Limited debug info should only remove struct definitions that can // safely be replaced by a forward declaration in the source code. - if (DebugKind <= CodeGenOptions::LimitedDebugInfo && Declaration) { + if (DebugKind <= CodeGenOptions::LimitedDebugInfo && Declaration && + !RD->isCompleteDefinitionRequired()) { // FIXME: This implementation is problematic; there are some test // cases where we violate the above principle, such as // test/CodeGen/debug-info-records.c . |