mirror of
https://git.suyu.dev/suyu/dynarmic.git
synced 2026-03-07 23:36:27 +00:00
intrusive_list: Add size querying
Since we store pointers and have an interface for iterators set up, the count is just the distance from the beginning to the end of the list. Nice thing is that because of this, basic blocks also get the ability to have a size count without needing to do anything directly.
This commit is contained in:
@@ -30,6 +30,7 @@ namespace IR {
|
||||
class Block final {
|
||||
public:
|
||||
using InstructionList = Common::IntrusiveList<Inst>;
|
||||
using size_type = InstructionList::size_type;
|
||||
using iterator = InstructionList::iterator;
|
||||
using const_iterator = InstructionList::const_iterator;
|
||||
using reverse_iterator = InstructionList::reverse_iterator;
|
||||
@@ -38,6 +39,7 @@ public:
|
||||
explicit Block(const Arm::LocationDescriptor& location) : location(location) {}
|
||||
|
||||
bool empty() const { return instructions.empty(); }
|
||||
size_type size() const { return instructions.size(); }
|
||||
|
||||
Inst& front() { return instructions.front(); }
|
||||
const Inst& front() const { return instructions.front(); }
|
||||
|
||||
Reference in New Issue
Block a user