aboutsummaryrefslogtreecommitdiff
path: root/lib/CodeGen
diff options
context:
space:
mode:
Diffstat (limited to 'lib/CodeGen')
-rw-r--r--lib/CodeGen/CGDebugInfo.cpp4
-rw-r--r--lib/CodeGen/CodeGenFunction.h9
2 files changed, 6 insertions, 7 deletions
diff --git a/lib/CodeGen/CGDebugInfo.cpp b/lib/CodeGen/CGDebugInfo.cpp
index 11a5ddc7ce..c604e56539 100644
--- a/lib/CodeGen/CGDebugInfo.cpp
+++ b/lib/CodeGen/CGDebugInfo.cpp
@@ -2135,6 +2135,10 @@ void CGDebugInfo::EmitLexicalBlockStart(CGBuilderTy &Builder, SourceLocation Loc
/// region - end of a DW_TAG_lexical_block.
void CGDebugInfo::EmitLexicalBlockEnd(CGBuilderTy &Builder, SourceLocation Loc) {
assert(!LexicalBlockStack.empty() && "Region stack mismatch, stack empty!");
+
+ // Provide an entry in the line table for the end of the block.
+ EmitLocation(Builder, Loc);
+
LexicalBlockStack.pop_back();
}
diff --git a/lib/CodeGen/CodeGenFunction.h b/lib/CodeGen/CodeGenFunction.h
index 8740fd06df..b737a9ed7a 100644
--- a/lib/CodeGen/CodeGenFunction.h
+++ b/lib/CodeGen/CodeGenFunction.h
@@ -854,11 +854,8 @@ public:
/// cleanups.
~LexicalScope() {
if (PopDebugStack) {
- if (CGDebugInfo *DI = CGF.getDebugInfo()) {
- if (RunCleanupsScope::requiresCleanups())
- DI->EmitLocation(CGF.Builder, Range.getEnd());
- DI->EmitLexicalBlockEnd(CGF.Builder, Range.getEnd());
- }
+ CGDebugInfo *DI = CGF.getDebugInfo();
+ if (DI) DI->EmitLexicalBlockEnd(CGF.Builder, Range.getEnd());
}
}
@@ -867,8 +864,6 @@ public:
void ForceCleanup() {
RunCleanupsScope::ForceCleanup();
if (CGDebugInfo *DI = CGF.getDebugInfo()) {
- if (RunCleanupsScope::requiresCleanups())
- DI->EmitLocation(CGF.Builder, Range.getEnd());
DI->EmitLexicalBlockEnd(CGF.Builder, Range.getEnd());
PopDebugStack = false;
}