[cfe-commits] r128513 - in /cfe/trunk/lib/CodeGen: CGExprScalar.cpp CGStmt.cpp
Devang Patel
dpatel at apple.com
Tue Mar 29 17:08:32 PDT 2011
Author: dpatel
Date: Tue Mar 29 19:08:31 2011
New Revision: 128513
URL: http://llvm.org/viewvc/llvm-project?rev=128513&view=rev
Log:
Fix in r128471 is very broad. Some of the unconditional branches need line number information for better user experience.
Restrict the fix. This fixes break.exp failures from gdb testsuite.
Modified:
cfe/trunk/lib/CodeGen/CGExprScalar.cpp
cfe/trunk/lib/CodeGen/CGStmt.cpp
Modified: cfe/trunk/lib/CodeGen/CGExprScalar.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/CodeGen/CGExprScalar.cpp?rev=128513&r1=128512&r2=128513&view=diff
==============================================================================
--- cfe/trunk/lib/CodeGen/CGExprScalar.cpp (original)
+++ cfe/trunk/lib/CodeGen/CGExprScalar.cpp Tue Mar 29 19:08:31 2011
@@ -2317,6 +2317,9 @@
// Emit an unconditional branch from this block to ContBlock. Insert an entry
// into the phi node for the edge with the value of RHSCond.
+ if (CGF.getDebugInfo())
+ // There is no need to emit line number for unconditional branch.
+ Builder.SetCurrentDebugLocation(llvm::DebugLoc());
CGF.EmitBlock(ContBlock);
PN->addIncoming(RHSCond, RHSBlock);
Modified: cfe/trunk/lib/CodeGen/CGStmt.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/CodeGen/CGStmt.cpp?rev=128513&r1=128512&r2=128513&view=diff
==============================================================================
--- cfe/trunk/lib/CodeGen/CGStmt.cpp (original)
+++ cfe/trunk/lib/CodeGen/CGStmt.cpp Tue Mar 29 19:08:31 2011
@@ -270,9 +270,6 @@
// 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 @@
// 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);
}
More information about the cfe-commits
mailing list