diff options
author | Devang Patel <dpatel@apple.com> | 2010-09-30 19:05:55 +0000 |
---|---|---|
committer | Devang Patel <dpatel@apple.com> | 2010-09-30 19:05:55 +0000 |
commit | 91bbb5547dd9c50cc120e093de66a4e316e899af (patch) | |
tree | 1d6028777a723ca396dd50e36399b1474dda2e64 /clang/lib/CodeGen/CGExprCXX.cpp | |
parent | f7edb1c8137c7499ac02f562372d57db0ad004dc (diff) | |
download | bcm5719-llvm-91bbb5547dd9c50cc120e093de66a4e316e899af.tar.gz bcm5719-llvm-91bbb5547dd9c50cc120e093de66a4e316e899af.zip |
Introduce -flimit-debug-info.
In this experimental mode try avoiding debug info emission for classes as much as possible. The goal is to reduce size of produced debuginfo without reducing quality of debug info in general. This is a work in progress.
llvm-svn: 115188
Diffstat (limited to 'clang/lib/CodeGen/CGExprCXX.cpp')
-rw-r--r-- | clang/lib/CodeGen/CGExprCXX.cpp | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/clang/lib/CodeGen/CGExprCXX.cpp b/clang/lib/CodeGen/CGExprCXX.cpp index 68f40583892..bc4059593f5 100644 --- a/clang/lib/CodeGen/CGExprCXX.cpp +++ b/clang/lib/CodeGen/CGExprCXX.cpp @@ -11,9 +11,11 @@ // //===----------------------------------------------------------------------===// +#include "clang/Frontend/CodeGenOptions.h" #include "CodeGenFunction.h" #include "CGCXXABI.h" #include "CGObjCRuntime.h" +#include "CGDebugInfo.h" #include "llvm/Intrinsics.h" using namespace clang; using namespace CodeGen; @@ -87,6 +89,15 @@ RValue CodeGenFunction::EmitCXXMemberCallExpr(const CXXMemberCallExpr *CE, const MemberExpr *ME = cast<MemberExpr>(CE->getCallee()->IgnoreParens()); const CXXMethodDecl *MD = cast<CXXMethodDecl>(ME->getMemberDecl()); + CGDebugInfo *DI = getDebugInfo(); + if (DI && CGM.getCodeGenOpts().LimitDebugInfo) { + QualType PQTy = ME->getBase()->IgnoreParenImpCasts()->getType(); + if (const PointerType * PTy = dyn_cast<PointerType>(PQTy)) { + DI->getOrCreateRecordType(PTy->getPointeeType(), + MD->getParent()->getLocation()); + } + } + if (MD->isStatic()) { // The method is static, emit it as we would a regular call. llvm::Value *Callee = CGM.GetAddrOfFunction(MD); |