blockfreq: Use getSuccessorIndex()

No functionality change.

<rdar://problem/14292693>

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@206082 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Duncan P. N. Exon Smith 2014-04-11 23:20:52 +00:00
parent 06e433a099
commit 484a2b6c2f

View File

@ -594,11 +594,9 @@ getEdgeWeight(const BasicBlock *Src, unsigned IndexInSuccessors) const {
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