ir_emitter: Allow the insertion point for new instructions to be set

This commit is contained in:
MerryMage 2018-01-26 23:30:17 +00:00
parent af793c2527
commit e01b500aea
4 changed files with 33 additions and 5 deletions

View file

@ -21,6 +21,10 @@
namespace Dynarmic::IR {
void Block::AppendNewInst(Opcode opcode, std::initializer_list<IR::Value> args) {
PrependNewInst(end(), opcode, args);
}
Block::iterator Block::PrependNewInst(iterator insertion_point, Opcode opcode, std::initializer_list<Value> args) {
IR::Inst* inst = new(instruction_alloc_pool->Alloc()) IR::Inst(opcode);
ASSERT(args.size() == inst->NumArgs());
@ -29,7 +33,7 @@ void Block::AppendNewInst(Opcode opcode, std::initializer_list<IR::Value> args)
index++;
});
instructions.push_back(inst);
return instructions.insert_before(insertion_point, inst);
}
LocationDescriptor Block::Location() const {