From 484a2b6c2fdcf1dd529c32d850528efc29bed873 Mon Sep 17 00:00:00 2001 From: "Duncan P. N. Exon Smith" Date: Fri, 11 Apr 2014 23:20:52 +0000 Subject: [PATCH] blockfreq: Use getSuccessorIndex() No functionality change. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@206082 91177308-0d34-0410-b5e6-96231b3b80d8 --- lib/Analysis/BranchProbabilityInfo.cpp | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/lib/Analysis/BranchProbabilityInfo.cpp b/lib/Analysis/BranchProbabilityInfo.cpp index b901c546270..62cc686211a 100644 --- a/lib/Analysis/BranchProbabilityInfo.cpp +++ b/lib/Analysis/BranchProbabilityInfo.cpp @@ -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