diff options
Diffstat (limited to 'lib/CodeGen/CGStmt.cpp')
-rw-r--r-- | lib/CodeGen/CGStmt.cpp | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/lib/CodeGen/CGStmt.cpp b/lib/CodeGen/CGStmt.cpp index add85a2a06..e72d5c73f5 100644 --- a/lib/CodeGen/CGStmt.cpp +++ b/lib/CodeGen/CGStmt.cpp @@ -270,9 +270,6 @@ void CodeGenFunction::EmitBranch(llvm::BasicBlock *Target) { // terminated, don't touch it. } else { // Otherwise, create a fall-through branch. - // There is no need to emit line number for unconditional branch. - if (getDebugInfo()) - Builder.SetCurrentDebugLocation(llvm::DebugLoc()); Builder.CreateBr(Target); } @@ -400,11 +397,17 @@ 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); { RunCleanupsScope ElseScope(*this); EmitStmt(Else); } + // There is no need to emit line number for unconditional branch. + if (getDebugInfo()) + Builder.SetCurrentDebugLocation(llvm::DebugLoc()); EmitBranch(ContBlock); } |