mirror of
https://git.suyu.dev/suyu/dynarmic.git
synced 2025-12-26 17:24:57 +01:00
basic_block: Add proxy member functions for the instruction list
Currently basic block kind of acts like a 'dumb struct' which makes things a little more verbose to write (as opposed to keeping it all in one place, I guess). It's also a little wonky conceptually, considering a block is composed of instructions (i.e. 'contains' them). So providing accessors that make it act more like a container can make working with algorithms a little nicer. It also makes the API a little more defined. Ideally, the list would be only available through a function, but currently, the pool allocator is exposed, which seems somewhat odd, considering the block itself should manage its overall allocations (with placement new, and regular new), rather than putting that sanitizing directly on the IR emitter (it should just care about emission, not block state). However, recontaining that can be followed up with, as it's very trivial to do.
This commit is contained in:
parent
226d66dd5b
commit
1abe881921
7 changed files with 41 additions and 11 deletions
|
|
@ -57,7 +57,7 @@ std::string DumpBlock(const IR::Block& block) {
|
|||
}
|
||||
};
|
||||
|
||||
for (auto inst = block.instructions.begin(); inst != block.instructions.end(); ++inst) {
|
||||
for (auto inst = block.begin(); inst != block.end(); ++inst) {
|
||||
const Opcode op = inst->GetOpcode();
|
||||
|
||||
if (GetTypeOf(op) != Type::Void) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue