summaryrefslogtreecommitdiffstats
path: root/clang/lib/CodeGen/CGStmt.cpp
diff options
context:
space:
mode:
authorDavid Blaikie <dblaikie@gmail.com>2014-07-10 20:42:59 +0000
committerDavid Blaikie <dblaikie@gmail.com>2014-07-10 20:42:59 +0000
commit1b5adb82d9a72cf36f4c3864c55388a8eb243de4 (patch)
tree5d228a150dcf6f689a6ea34b2833eb0e1daa0ce9 /clang/lib/CodeGen/CGStmt.cpp
parent026861b87d7bfbdaf31ced93e8c916008b72cce8 (diff)
downloadbcm5719-llvm-1b5adb82d9a72cf36f4c3864c55388a8eb243de4.tar.gz
bcm5719-llvm-1b5adb82d9a72cf36f4c3864c55388a8eb243de4.zip
Fix the dtor location issues in PR20038 harder.
Originally committed in r211722, this fixed one case of dtor calls being emitted without locations (this causes problems for debug info if the call is then inlined), this caught only some of the cases. Instead of trying to re-enable the location before the cleanup, simply re-enable the location immediately after the unconditional branches in question using a scoped device to ensure the no-location state doesn't leak out arbitrarily. llvm-svn: 212761
Diffstat (limited to 'clang/lib/CodeGen/CGStmt.cpp')
-rw-r--r--clang/lib/CodeGen/CGStmt.cpp18
1 files changed, 10 insertions, 8 deletions
diff --git a/clang/lib/CodeGen/CGStmt.cpp b/clang/lib/CodeGen/CGStmt.cpp
index cd86eeb1216..b9d74b675a6 100644
--- a/clang/lib/CodeGen/CGStmt.cpp
+++ b/clang/lib/CodeGen/CGStmt.cpp
@@ -524,18 +524,20 @@ void CodeGenFunction::EmitIfStmt(const IfStmt &S) {
// Emit the 'else' code if present.
if (const Stmt *Else = S.getElse()) {
- // There is no need to emit line number for unconditional branch.
- if (getDebugInfo())
- Builder.SetCurrentDebugLocation(llvm::DebugLoc());
- EmitBlock(ElseBlock);
+ {
+ // There is no need to emit line number for unconditional branch.
+ SuppressDebugLocation S(Builder);
+ EmitBlock(ElseBlock);
+ }
{
RunCleanupsScope ElseScope(*this);
EmitStmt(Else);
}
- // There is no need to emit line number for unconditional branch.
- if (getDebugInfo())
- Builder.SetCurrentDebugLocation(llvm::DebugLoc());
- EmitBranch(ContBlock);
+ {
+ // There is no need to emit line number for unconditional branch.
+ SuppressDebugLocation S(Builder);
+ EmitBranch(ContBlock);
+ }
}
// Emit the continuation block for code after the if.
OpenPOWER on IntegriCloud