mirror of
https://git.suyu.dev/suyu/dynarmic.git
synced 2025-12-27 01:34:55 +01:00
ir_emitter: Allow the insertion point for new instructions to be set
This commit is contained in:
parent
af793c2527
commit
e01b500aea
4 changed files with 33 additions and 5 deletions
|
|
@ -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 {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue