The name (and comment describing) of llvm::GetFirstDebuigLocInBasicBlock no longer...
authorEli Bendersky <eli.bendersky@intel.com>
Mon, 25 Jun 2012 10:13:14 +0000 (10:13 +0000)
committerEli Bendersky <eli.bendersky@intel.com>
Mon, 25 Jun 2012 10:13:14 +0000 (10:13 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@159133 91177308-0d34-0410-b5e6-96231b3b80d8

include/llvm/Transforms/Utils/BasicBlockUtils.h
lib/Transforms/Utils/BasicBlockUtils.cpp
lib/Transforms/Utils/SSAUpdater.cpp

index 2f9dc54541b90f64b56f8303dc0795048311c14f..8a939cc75ed3604b69f5a4895a1549fbf14ca1d5 100644 (file)
@@ -202,10 +202,6 @@ void SplitLandingPadPredecessors(BasicBlock *OrigBB,ArrayRef<BasicBlock*> Preds,
 ReturnInst *FoldReturnIntoUncondBranch(ReturnInst *RI, BasicBlock *BB,
                                        BasicBlock *Pred);
 
-/// GetFirstDebugLocInBasicBlock - Return first valid DebugLoc entry in a
-/// given basic block.
-DebugLoc GetFirstDebugLocInBasicBlock(const BasicBlock *BB);
-
 } // End llvm namespace
 
 #endif
index 3859a1aec4a745f62bc9e70a0a03e3791e53ff16..557643214911f57f8833215995fab2d1542b456d 100644 (file)
@@ -671,12 +671,3 @@ ReturnInst *llvm::FoldReturnIntoUncondBranch(ReturnInst *RI, BasicBlock *BB,
   return cast<ReturnInst>(NewRet);
 }
 
-/// GetFirstDebugLocInBasicBlock - Return first valid DebugLoc entry in a 
-/// given basic block.
-DebugLoc llvm::GetFirstDebugLocInBasicBlock(const BasicBlock *BB) {
-  if (const Instruction *I = BB->getFirstNonPHI())
-    return I->getDebugLoc();
-  // Scanning entire block may be too expensive, if the first instruction
-  // does not have valid location info.
-  return DebugLoc();
-}
index 184b67f3e635726ad04dc7c1eb4c0c310d1caca5..b3f5289fcda94447c7d3355448dedf57ba24cc33 100644 (file)
@@ -190,8 +190,11 @@ Value *SSAUpdater::GetValueInMiddleOfBlock(BasicBlock *BB) {
     return V;
   }
 
-  // Set DebugLoc.
-  InsertedPHI->setDebugLoc(GetFirstDebugLocInBasicBlock(BB));
+  // Set the DebugLoc of the inserted PHI, if available.
+  DebugLoc DL;
+  if (const Instruction *I = BB->getFirstNonPHI())
+      DL = I->getDebugLoc();
+  InsertedPHI->setDebugLoc(DL);
 
   // If the client wants to know about all new instructions, tell it.
   if (InsertedPHIs) InsertedPHIs->push_back(InsertedPHI);