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/ModuleBuilder.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/ModuleBuilder.cpp')
-rw-r--r-- | clang/lib/CodeGen/ModuleBuilder.cpp | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/clang/lib/CodeGen/ModuleBuilder.cpp b/clang/lib/CodeGen/ModuleBuilder.cpp index 763aa12aab1..7e0e3aac072 100644 --- a/clang/lib/CodeGen/ModuleBuilder.cpp +++ b/clang/lib/CodeGen/ModuleBuilder.cpp @@ -13,6 +13,7 @@ #include "clang/CodeGen/ModuleBuilder.h" #include "CodeGenModule.h" +#include "CGDebugInfo.h" #include "clang/AST/ASTContext.h" #include "clang/AST/DeclObjC.h" #include "clang/AST/Expr.h" @@ -93,6 +94,12 @@ namespace { } } + virtual void HandleTagDeclRequiredDefinition(const TagDecl *D) LLVM_OVERRIDE { + if (CodeGen::CGDebugInfo *DI = Builder->getModuleDebugInfo()) + if (const RecordDecl *RD = dyn_cast<RecordDecl>(D)) + DI->completeFwdDecl(*RD); + } + virtual void HandleTranslationUnit(ASTContext &Ctx) { if (Diags.hasErrorOccurred()) { M.reset(); |