summaryrefslogtreecommitdiffstats
path: root/clang/lib/CodeGen
diff options
context:
space:
mode:
authorEric Christopher <echristo@apple.com>2012-07-11 01:49:26 +0000
committerEric Christopher <echristo@apple.com>2012-07-11 01:49:26 +0000
commit2977378974fa8a9a0338dd36cf5b7b0e5d3c1d77 (patch)
treebfad44c829d557a2e9f972c40b5022351cb5e180 /clang/lib/CodeGen
parent296a710b5bd6a6e236ea7d47a6c437d62711e465 (diff)
downloadbcm5719-llvm-2977378974fa8a9a0338dd36cf5b7b0e5d3c1d77.tar.gz
bcm5719-llvm-2977378974fa8a9a0338dd36cf5b7b0e5d3c1d77.zip
The end of a block doesn't necessarily need a line table entry unless
there's something going on there. Remove the unconditional line entry and only add one if we're emitting cleanups (any other statements would be handled normally). Fixes rdar://9199234 llvm-svn: 160033
Diffstat (limited to 'clang/lib/CodeGen')
-rw-r--r--clang/lib/CodeGen/CGDebugInfo.cpp4
-rw-r--r--clang/lib/CodeGen/CodeGenFunction.h9
2 files changed, 7 insertions, 6 deletions
diff --git a/clang/lib/CodeGen/CGDebugInfo.cpp b/clang/lib/CodeGen/CGDebugInfo.cpp
index c604e565391..11a5ddc7ceb 100644
--- a/clang/lib/CodeGen/CGDebugInfo.cpp
+++ b/clang/lib/CodeGen/CGDebugInfo.cpp
@@ -2135,10 +2135,6 @@ 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/clang/lib/CodeGen/CodeGenFunction.h b/clang/lib/CodeGen/CodeGenFunction.h
index b737a9ed7ab..8740fd06df7 100644
--- a/clang/lib/CodeGen/CodeGenFunction.h
+++ b/clang/lib/CodeGen/CodeGenFunction.h
@@ -854,8 +854,11 @@ public:
/// cleanups.
~LexicalScope() {
if (PopDebugStack) {
- CGDebugInfo *DI = CGF.getDebugInfo();
- if (DI) DI->EmitLexicalBlockEnd(CGF.Builder, Range.getEnd());
+ if (CGDebugInfo *DI = CGF.getDebugInfo()) {
+ if (RunCleanupsScope::requiresCleanups())
+ DI->EmitLocation(CGF.Builder, Range.getEnd());
+ DI->EmitLexicalBlockEnd(CGF.Builder, Range.getEnd());
+ }
}
}
@@ -864,6 +867,8 @@ 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;
}
OpenPOWER on IntegriCloud