mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-01-28 06:32:09 +00:00
getSuccWeight returns now default 0 if Weights vector is empty.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@133271 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
799a58a55e
commit
981d82674c
@ -768,6 +768,9 @@ MachineBasicBlock::findDebugLoc(MachineBasicBlock::iterator &MBBI) {
|
||||
/// getSuccWeight - Return weight of the edge from this block to MBB.
|
||||
///
|
||||
uint32_t MachineBasicBlock::getSuccWeight(MachineBasicBlock *succ) {
|
||||
if (Weights.empty())
|
||||
return 0;
|
||||
|
||||
succ_iterator I = std::find(Successors.begin(), Successors.end(), succ);
|
||||
return *getWeightIterator(I);
|
||||
}
|
||||
@ -776,8 +779,7 @@ uint32_t MachineBasicBlock::getSuccWeight(MachineBasicBlock *succ) {
|
||||
/// iterator
|
||||
MachineBasicBlock::weight_iterator MachineBasicBlock::
|
||||
getWeightIterator(MachineBasicBlock::succ_iterator I) {
|
||||
assert((Weights.size() == Successors.size() || Weights.empty()) &&
|
||||
"Async weight list!");
|
||||
assert(Weights.size() == Successors.size() && "Async weight list!");
|
||||
size_t index = std::distance(Successors.begin(), I);
|
||||
assert(index < Weights.size() && "Not a current successor!");
|
||||
return Weights.begin() + index;
|
||||
|
Loading…
x
Reference in New Issue
Block a user