21 this->instructions = instructions;
26 this->instructions = other.instructions;
31 this->instructions = other.instructions;
37 this->instructions.clear();
43 if (this->instructions.size()) {
44 copy.
setAddress(this->instructions.back().getNextAddress());
46 this->instructions.push_back(copy);
51 if (this->instructions.size() <= position)
53 this->instructions.erase(this->instructions.begin() + position);
59 return this->instructions;
64 return this->instructions.size();
69 if (this->instructions.size() == 0)
71 return this->instructions.front().getAddress();
76 if (this->instructions.size() == 0)
78 return this->instructions.back().getAddress();
This class is used to represent a basic block.
TRITON_EXPORT triton::usize getSize(void) const
Returns the number of instructions in the block.
TRITON_EXPORT bool remove(triton::uint32 position)
Remove an instruction from the block at the given position. Returns true if success.
TRITON_EXPORT triton::uint64 getFirstAddress(void) const
Returns the first instruction's address.
TRITON_EXPORT BasicBlock & operator=(const BasicBlock &other)
Copies an BasicBlock.
TRITON_EXPORT void add(const Instruction &instruction)
Add an instruction to the block.
TRITON_EXPORT BasicBlock()
Constructor.
TRITON_EXPORT triton::uint64 getLastAddress(void) const
Returns the last instruction's address.
TRITON_EXPORT std::vector< triton::arch::Instruction > & getInstructions(void)
Gets all instructions of the block.
TRITON_EXPORT ~BasicBlock()
Destructor.
This class is used to represent an instruction.
TRITON_EXPORT void setAddress(triton::uint64 addr)
Sets the address of the instruction.
The exception class used by a basic block.
std::ostream & operator<<(std::ostream &stream, BasicBlock &block)
Displays an BasicBlock.
std::size_t usize
unsigned MAX_INT 32 or 64 bits according to the CPU.
std::uint64_t uint64
unisgned 64-bits
std::uint32_t uint32
unisgned 32-bits