mirror of
https://github.com/RPCS3/llvm.git
synced 2025-01-16 23:19:37 +00:00
Allow empty Weights vector.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@133265 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
951cd021c1
commit
a6591969ff
@ -776,7 +776,8 @@ uint32_t MachineBasicBlock::getSuccWeight(MachineBasicBlock *succ) {
|
||||
/// iterator
|
||||
MachineBasicBlock::weight_iterator MachineBasicBlock::
|
||||
getWeightIterator(MachineBasicBlock::succ_iterator I) {
|
||||
assert(Weights.size() == Successors.size() && "Async weight list!");
|
||||
assert((Weights.size() == Successors.size() || Weights.empty()) &&
|
||||
"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