summaryrefslogtreecommitdiffstats
path: root/clang/lib/CodeGen
diff options
context:
space:
mode:
authorDevang Patel <dpatel@apple.com>2010-10-04 21:46:04 +0000
committerDevang Patel <dpatel@apple.com>2010-10-04 21:46:04 +0000
commit44b8bf0f5bb9e347e6d4357571eed7b7fac25332 (patch)
treee72fbc6e6c5fe44e01d77ef2f991ae0c15ff99d7 /clang/lib/CodeGen
parent69d23282b4fca03e01436930a89d4daeefd55c13 (diff)
downloadbcm5719-llvm-44b8bf0f5bb9e347e6d4357571eed7b7fac25332.tar.gz
bcm5719-llvm-44b8bf0f5bb9e347e6d4357571eed7b7fac25332.zip
Emit debug info for an aggregate while processing MemberExpr if the aggregate's debug info was delayed untill now.
llvm-svn: 115564
Diffstat (limited to 'clang/lib/CodeGen')
-rw-r--r--clang/lib/CodeGen/CGExprScalar.cpp12
1 files changed, 12 insertions, 0 deletions
diff --git a/clang/lib/CodeGen/CGExprScalar.cpp b/clang/lib/CodeGen/CGExprScalar.cpp
index 73e94d1ece1..ed9692a0843 100644
--- a/clang/lib/CodeGen/CGExprScalar.cpp
+++ b/clang/lib/CodeGen/CGExprScalar.cpp
@@ -11,10 +11,12 @@
//
//===----------------------------------------------------------------------===//
+#include "clang/Frontend/CodeGenOptions.h"
#include "CodeGenFunction.h"
#include "CGCXXABI.h"
#include "CGObjCRuntime.h"
#include "CodeGenModule.h"
+#include "CGDebugInfo.h"
#include "clang/AST/ASTContext.h"
#include "clang/AST/DeclObjC.h"
#include "clang/AST/RecordLayout.h"
@@ -721,6 +723,16 @@ Value *ScalarExprEmitter::VisitMemberExpr(MemberExpr *E) {
EmitLValue(E->getBase());
return llvm::ConstantInt::get(VMContext, Result.Val.getInt());
}
+
+ // Emit debug info for aggregate now, if it was delayed to reduce
+ // debug info size.
+ CGDebugInfo *DI = CGF.getDebugInfo();
+ if (DI && CGF.CGM.getCodeGenOpts().LimitDebugInfo) {
+ QualType PQTy = E->getBase()->IgnoreParenImpCasts()->getType();
+ if (const PointerType * PTy = dyn_cast<PointerType>(PQTy))
+ if (FieldDecl *M = cast<FieldDecl>(E->getMemberDecl()))
+ DI->getOrCreateRecordType(PTy->getPointeeType(),
+ M->getParent()->getLocation());
return EmitLoadOfLValue(E);
}
OpenPOWER on IntegriCloud