[llvm] r206082 - blockfreq: Use getSuccessorIndex()
Duncan P. N. Exon Smith
dexonsmith at apple.com
Fri Apr 11 16:20:53 PDT 2014
Author: dexonsmith
Date: Fri Apr 11 18:20:52 2014
New Revision: 206082
URL: http://llvm.org/viewvc/llvm-project?rev=206082&view=rev
Log:
blockfreq: Use getSuccessorIndex()
No functionality change.
<rdar://problem/14292693>
Modified:
llvm/trunk/lib/Analysis/BranchProbabilityInfo.cpp
Modified: llvm/trunk/lib/Analysis/BranchProbabilityInfo.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Analysis/BranchProbabilityInfo.cpp?rev=206082&r1=206081&r2=206082&view=diff
==============================================================================
--- llvm/trunk/lib/Analysis/BranchProbabilityInfo.cpp (original)
+++ llvm/trunk/lib/Analysis/BranchProbabilityInfo.cpp Fri Apr 11 18:20:52 2014
@@ -594,11 +594,9 @@ getEdgeWeight(const BasicBlock *Src, uns
return DEFAULT_WEIGHT;
}
-uint32_t
-BranchProbabilityInfo::
-getEdgeWeight(const BasicBlock *Src, succ_const_iterator Dst) const {
- size_t index = std::distance(succ_begin(Src), Dst);
- return getEdgeWeight(Src, index);
+uint32_t BranchProbabilityInfo::getEdgeWeight(const BasicBlock *Src,
+ succ_const_iterator Dst) const {
+ return getEdgeWeight(Src, Dst.getSuccessorIndex());
}
/// Get the raw edge weight calculated for the block pair. This returns the sum
More information about the llvm-commits
mailing list