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 | c69e1cf04323f2e786d40e8a5ba84e77ee1c6827 (patch) | |
tree | 95f650485a7f95f2ee8acb727460aeb7a2612075 /lib/CodeGen/CGExprCXX.cpp | |
parent | 297c706f219701b4c9464cccf527f3fe833afc95 (diff) |
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.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@115188 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/CodeGen/CGExprCXX.cpp')
-rw-r--r-- | lib/CodeGen/CGExprCXX.cpp | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/lib/CodeGen/CGExprCXX.cpp b/lib/CodeGen/CGExprCXX.cpp index 68f4058389..bc4059593f 100644 --- a/lib/CodeGen/CGExprCXX.cpp +++ b/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); |