diff options
| author | Devang Patel <dpatel@apple.com> | 2011-02-22 20:55:26 +0000 |
|---|---|---|
| committer | Devang Patel <dpatel@apple.com> | 2011-02-22 20:55:26 +0000 |
| commit | b6ed369e774b34eebe14a172c4dbc954684001d1 (patch) | |
| tree | 49afa7c52832e27a0464c562d4dd95bdabb57fdc /clang/lib/CodeGen | |
| parent | ba9006df9e64c549855e88c6ab4d19866024d9c6 (diff) | |
| download | bcm5719-llvm-b6ed369e774b34eebe14a172c4dbc954684001d1.tar.gz bcm5719-llvm-b6ed369e774b34eebe14a172c4dbc954684001d1.zip | |
A constructor call should force class's debug info even if -flimit-debug-info is enabled.
llvm-svn: 126246
Diffstat (limited to 'clang/lib/CodeGen')
| -rw-r--r-- | clang/lib/CodeGen/CGClass.cpp | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/clang/lib/CodeGen/CGClass.cpp b/clang/lib/CodeGen/CGClass.cpp index 8e88beb3cf0..cd28bbe44db 100644 --- a/clang/lib/CodeGen/CGClass.cpp +++ b/clang/lib/CodeGen/CGClass.cpp @@ -17,6 +17,7 @@ #include "clang/AST/EvaluatedExprVisitor.h" #include "clang/AST/RecordLayout.h" #include "clang/AST/StmtCXX.h" +#include "clang/Frontend/CodeGenOptions.h" using namespace clang; using namespace CodeGen; @@ -1140,6 +1141,16 @@ CodeGenFunction::EmitCXXConstructorCall(const CXXConstructorDecl *D, llvm::Value *This, CallExpr::const_arg_iterator ArgBeg, CallExpr::const_arg_iterator ArgEnd) { + + CGDebugInfo *DI = getDebugInfo(); + if (DI && CGM.getCodeGenOpts().LimitDebugInfo) { + // If debug info for this class has been emitted then this is the right time + // to do so. + const CXXRecordDecl *Parent = D->getParent(); + DI->getOrCreateRecordType(CGM.getContext().getTypeDeclType(Parent), + Parent->getLocation()); + } + if (D->isTrivial()) { if (ArgBeg == ArgEnd) { // Trivial default constructor, no codegen required. |

