ir/block: Default ctor and dtor in the cpp file
Prevents potentially inlining allocation code everywhere. While we're at it, also explicitly delete/default the copy/move constructor/assignment operators to be explicit about them.
This commit is contained in:
parent
699ad98b2a
commit
9309d95b17
2 changed files with 19 additions and 3 deletions
|
@ -20,6 +20,16 @@
|
||||||
|
|
||||||
namespace Dynarmic::IR {
|
namespace Dynarmic::IR {
|
||||||
|
|
||||||
|
Block::Block(const LocationDescriptor& location)
|
||||||
|
: location{location}, end_location{location},
|
||||||
|
instruction_alloc_pool{std::make_unique<Common::Pool>(sizeof(Inst), 4096)} {}
|
||||||
|
|
||||||
|
Block::~Block() = default;
|
||||||
|
|
||||||
|
Block::Block(Block&&) = default;
|
||||||
|
|
||||||
|
Block& Block::operator=(Block&&) = default;
|
||||||
|
|
||||||
void Block::AppendNewInst(Opcode opcode, std::initializer_list<IR::Value> args) {
|
void Block::AppendNewInst(Opcode opcode, std::initializer_list<IR::Value> args) {
|
||||||
PrependNewInst(end(), opcode, args);
|
PrependNewInst(end(), opcode, args);
|
||||||
}
|
}
|
||||||
|
|
|
@ -39,8 +39,14 @@ public:
|
||||||
using reverse_iterator = InstructionList::reverse_iterator;
|
using reverse_iterator = InstructionList::reverse_iterator;
|
||||||
using const_reverse_iterator = InstructionList::const_reverse_iterator;
|
using const_reverse_iterator = InstructionList::const_reverse_iterator;
|
||||||
|
|
||||||
explicit Block(const LocationDescriptor& location)
|
explicit Block(const LocationDescriptor& location);
|
||||||
: location(location), end_location(location) {}
|
~Block();
|
||||||
|
|
||||||
|
Block(const Block&) = delete;
|
||||||
|
Block& operator=(const Block&) = delete;
|
||||||
|
|
||||||
|
Block(Block&&);
|
||||||
|
Block& operator=(Block&&);
|
||||||
|
|
||||||
bool empty() const { return instructions.empty(); }
|
bool empty() const { return instructions.empty(); }
|
||||||
size_type size() const { return instructions.size(); }
|
size_type size() const { return instructions.size(); }
|
||||||
|
@ -145,7 +151,7 @@ private:
|
||||||
/// List of instructions in this block.
|
/// List of instructions in this block.
|
||||||
InstructionList instructions;
|
InstructionList instructions;
|
||||||
/// Memory pool for instruction list
|
/// Memory pool for instruction list
|
||||||
std::unique_ptr<Common::Pool> instruction_alloc_pool = std::make_unique<Common::Pool>(sizeof(Inst), 4096);
|
std::unique_ptr<Common::Pool> instruction_alloc_pool;
|
||||||
/// Terminal instruction of this block.
|
/// Terminal instruction of this block.
|
||||||
Terminal terminal = Term::Invalid{};
|
Terminal terminal = Term::Invalid{};
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue