mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2024-12-13 20:32:21 +00:00
CodeGen: assert an instruction is being inserted with the correct iterator.
When "MBB->Insert(It, ...)" is called, we want It to be pointing inside the correct basic block. No actual failures at the moment, but it's caused problems before. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@221953 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
f4742f4c84
commit
0dfb75c92a
@ -486,11 +486,15 @@ public:
|
||||
/// Insert a range of instructions into the instruction list before I.
|
||||
template<typename IT>
|
||||
void insert(iterator I, IT S, IT E) {
|
||||
assert((I == end() || I->getParent() == this) &&
|
||||
"iterator points outside of basic block");
|
||||
Insts.insert(I.getInstrIterator(), S, E);
|
||||
}
|
||||
|
||||
/// Insert MI into the instruction list before I.
|
||||
iterator insert(iterator I, MachineInstr *MI) {
|
||||
assert((I == end() || I->getParent() == this) &&
|
||||
"iterator points outside of basic block");
|
||||
assert(!MI->isBundledWithPred() && !MI->isBundledWithSucc() &&
|
||||
"Cannot insert instruction with bundle flags");
|
||||
return Insts.insert(I.getInstrIterator(), MI);
|
||||
@ -498,6 +502,8 @@ public:
|
||||
|
||||
/// Insert MI into the instruction list after I.
|
||||
iterator insertAfter(iterator I, MachineInstr *MI) {
|
||||
assert((I == end() || I->getParent() == this) &&
|
||||
"iterator points outside of basic block");
|
||||
assert(!MI->isBundledWithPred() && !MI->isBundledWithSucc() &&
|
||||
"Cannot insert instruction with bundle flags");
|
||||
return Insts.insertAfter(I.getInstrIterator(), MI);
|
||||
|
Loading…
Reference in New Issue
Block a user