summaryrefslogtreecommitdiffstats
path: root/clang/lib/CodeGen
diff options
context:
space:
mode:
authorEric Christopher <echristo@apple.com>2011-09-29 00:00:35 +0000
committerEric Christopher <echristo@apple.com>2011-09-29 00:00:35 +0000
commite655657c94b20710e65fd20da2a7f622ed6a0e1c (patch)
tree85d6f0c10b6806396499c9c3fbcf72c87892f69e /clang/lib/CodeGen
parent250511bc75cf7c0d560a4ec4bcd615e8d6e4fce8 (diff)
downloadbcm5719-llvm-e655657c94b20710e65fd20da2a7f622ed6a0e1c.tar.gz
bcm5719-llvm-e655657c94b20710e65fd20da2a7f622ed6a0e1c.zip
Call UpdateLineDirectiveRegion every time we want to emit a stop
point in the code. Ensures that we don't miss any places and the check is reasonably cheap. llvm-svn: 140737
Diffstat (limited to 'clang/lib/CodeGen')
-rw-r--r--clang/lib/CodeGen/CGDebugInfo.cpp4
-rw-r--r--clang/lib/CodeGen/CGDebugInfo.h8
-rw-r--r--clang/lib/CodeGen/CGExpr.cpp1
-rw-r--r--clang/lib/CodeGen/CGStmt.cpp1
4 files changed, 8 insertions, 6 deletions
diff --git a/clang/lib/CodeGen/CGDebugInfo.cpp b/clang/lib/CodeGen/CGDebugInfo.cpp
index b48475f432a..2edb065dd6e 100644
--- a/clang/lib/CodeGen/CGDebugInfo.cpp
+++ b/clang/lib/CodeGen/CGDebugInfo.cpp
@@ -1763,6 +1763,10 @@ void CGDebugInfo::EmitStopPoint(CGBuilderTy &Builder) {
if (!Builder.getCurrentDebugLocation().isUnknown())
return;
+ // The file may have had a line directive change. Process any of
+ // those before updating the state.
+ UpdateLineDirectiveRegion(Builder);
+
// Update last state.
PrevLoc = CurLoc;
diff --git a/clang/lib/CodeGen/CGDebugInfo.h b/clang/lib/CodeGen/CGDebugInfo.h
index fdc3baf2f37..e59aed91a6a 100644
--- a/clang/lib/CodeGen/CGDebugInfo.h
+++ b/clang/lib/CodeGen/CGDebugInfo.h
@@ -149,6 +149,10 @@ class CGDebugInfo {
llvm::DIFile F,
SmallVectorImpl<llvm::Value *> &EltTys);
+ // UpdateLineDirectiveRegion - Update region stack only if #line directive
+ // has introduced scope change.
+ void UpdateLineDirectiveRegion(CGBuilderTy &Builder);
+
public:
CGDebugInfo(CodeGenModule &CGM);
~CGDebugInfo();
@@ -170,10 +174,6 @@ public:
/// EmitFunctionEnd - Constructs the debug code for exiting a function.
void EmitFunctionEnd(CGBuilderTy &Builder);
- /// UpdateLineDirectiveRegion - Update region stack only if #line directive
- /// has introduced scope change.
- void UpdateLineDirectiveRegion(CGBuilderTy &Builder);
-
/// UpdateCompletedType - Update type cache because the type is now
/// translated.
void UpdateCompletedType(const TagDecl *TD);
diff --git a/clang/lib/CodeGen/CGExpr.cpp b/clang/lib/CodeGen/CGExpr.cpp
index 22f264b8e9f..5fe33ff1d3f 100644
--- a/clang/lib/CodeGen/CGExpr.cpp
+++ b/clang/lib/CodeGen/CGExpr.cpp
@@ -2170,7 +2170,6 @@ RValue CodeGenFunction::EmitCallExpr(const CallExpr *E,
ReturnValueSlot ReturnValue) {
if (CGDebugInfo *DI = getDebugInfo()) {
DI->setLocation(E->getLocStart());
- DI->UpdateLineDirectiveRegion(Builder);
DI->EmitStopPoint(Builder);
}
diff --git a/clang/lib/CodeGen/CGStmt.cpp b/clang/lib/CodeGen/CGStmt.cpp
index 93763e31438..e070cc312a9 100644
--- a/clang/lib/CodeGen/CGStmt.cpp
+++ b/clang/lib/CodeGen/CGStmt.cpp
@@ -35,7 +35,6 @@ void CodeGenFunction::EmitStopPoint(const Stmt *S) {
DI->setLocation(S->getLocEnd());
else
DI->setLocation(S->getLocStart());
- DI->UpdateLineDirectiveRegion(Builder);
DI->EmitStopPoint(Builder);
}
}
OpenPOWER on IntegriCloud