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

@ -69,7 +69,7 @@ public:
const_reverse_iterator crend() const { return instructions.crend(); }
/**
* Appends a new instruction to this basic block,
* Appends a new instruction to the end of this basic block,
* handling any allocations necessary to do so.
*
* @param op Opcode representing the instruction to add.
@ -77,6 +77,17 @@ public:
*/
void AppendNewInst(Opcode op, std::initializer_list<Value> args);
/**
* Prepends a new instruction to this basic block before the insertion point,
* handling any allocations necessary to do so.
*
* @param insertion_point Where to insert the new instruction.
* @param op Opcode representing the instruction to add.
* @param args A sequence of Value instances used as arguments for the instruction.
* @returns Iterator to the newly created instruction.
*/
iterator PrependNewInst(iterator insertion_point, Opcode op, std::initializer_list<Value> args);
/// Gets the starting location for this basic block.
LocationDescriptor Location() const;
/// Gets the end location for this basic block.