mirror of
https://github.com/RPCS3/llvm.git
synced 2025-02-03 17:24:24 +00:00
Scanning entire basic block may be too expensive in terms of compile time. Instead, just use whatever location info first non-phi instruction has.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@130729 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
d61c40360c
commit
67352b3ce7
@ -542,11 +542,9 @@ ReturnInst *llvm::FoldReturnIntoUncondBranch(ReturnInst *RI, BasicBlock *BB,
|
||||
/// GetFirstDebugLocInBasicBlock - Return first valid DebugLoc entry in a
|
||||
/// given basic block.
|
||||
DebugLoc llvm::GetFirstDebugLocInBasicBlock(const BasicBlock *BB) {
|
||||
for (BasicBlock::const_iterator BI = BB->begin(), BE = BB->end();
|
||||
BI != BE; ++BI) {
|
||||
DebugLoc DL = BI->getDebugLoc();
|
||||
if (!DL.isUnknown())
|
||||
return DL;
|
||||
}
|
||||
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();
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user