]> granicus.if.org Git - clang/commitdiff
Fix in r128471 is very broad. Some of the unconditional branches need line number...
authorDevang Patel <dpatel@apple.com>
Wed, 30 Mar 2011 00:08:31 +0000 (00:08 +0000)
committerDevang Patel <dpatel@apple.com>
Wed, 30 Mar 2011 00:08:31 +0000 (00:08 +0000)
Restrict the fix. This fixes break.exp failures from gdb testsuite.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@128513 91177308-0d34-0410-b5e6-96231b3b80d8

lib/CodeGen/CGExprScalar.cpp
lib/CodeGen/CGStmt.cpp

index a28de703e54b0ae4186c53c5746090cb7200e9e5..33a0b5d04c62b479985dc418757bc51d3cb6860f 100644 (file)
@@ -2317,6 +2317,9 @@ Value *ScalarExprEmitter::VisitBinLAnd(const BinaryOperator *E) {
 
   // 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);
 
index add85a2a068bdc1d610501f1ab72bebdbd697c3e..e72d5c73f58ff6b728c415e9b10f4947f4636cea 100644 (file)
@@ -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);
   }