diff options
author | Eli Bendersky <eli.bendersky@intel.com> | 2012-06-25 10:13:14 +0000 |
---|---|---|
committer | Eli Bendersky <eli.bendersky@intel.com> | 2012-06-25 10:13:14 +0000 |
commit | ccaddf47086742f62fb7fbf97f6509395f31b957 (patch) | |
tree | 07e220fbec97f85de289a55649f62d576bf3a273 | |
parent | fd1753bedb89704ea1ad33da71f184013e942e10 (diff) | |
download | external_llvm-ccaddf47086742f62fb7fbf97f6509395f31b957.zip external_llvm-ccaddf47086742f62fb7fbf97f6509395f31b957.tar.gz external_llvm-ccaddf47086742f62fb7fbf97f6509395f31b957.tar.bz2 |
The name (and comment describing) of llvm::GetFirstDebuigLocInBasicBlock no longer represents what the function does. Therefore, the function is removed and its functionality is folded into the only place in the code-base where it was being used.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@159133 91177308-0d34-0410-b5e6-96231b3b80d8
-rw-r--r-- | include/llvm/Transforms/Utils/BasicBlockUtils.h | 4 | ||||
-rw-r--r-- | lib/Transforms/Utils/BasicBlockUtils.cpp | 9 | ||||
-rw-r--r-- | lib/Transforms/Utils/SSAUpdater.cpp | 7 |
3 files changed, 5 insertions, 15 deletions
diff --git a/include/llvm/Transforms/Utils/BasicBlockUtils.h b/include/llvm/Transforms/Utils/BasicBlockUtils.h index 2f9dc54..8a939cc 100644 --- a/include/llvm/Transforms/Utils/BasicBlockUtils.h +++ b/include/llvm/Transforms/Utils/BasicBlockUtils.h @@ -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 diff --git a/lib/Transforms/Utils/BasicBlockUtils.cpp b/lib/Transforms/Utils/BasicBlockUtils.cpp index 3859a1a..5576432 100644 --- a/lib/Transforms/Utils/BasicBlockUtils.cpp +++ b/lib/Transforms/Utils/BasicBlockUtils.cpp @@ -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(); -} diff --git a/lib/Transforms/Utils/SSAUpdater.cpp b/lib/Transforms/Utils/SSAUpdater.cpp index 184b67f..b3f5289 100644 --- a/lib/Transforms/Utils/SSAUpdater.cpp +++ b/lib/Transforms/Utils/SSAUpdater.cpp @@ -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); |