libTriton version 1.0 build 1592
Loading...
Searching...
No Matches
basicBlock.hpp
Go to the documentation of this file.
1
2/*
3** Copyright (C) - Triton
4**
5** This program is under the terms of the Apache License 2.0.
6*/
7
8#ifndef TRITON_BASICBLOCK_HPP
9#define TRITON_BASICBLOCK_HPP
10
11#include <ostream>
12#include <vector>
13
14#include <triton/dllexport.hpp>
17
18
19
21namespace triton {
28 namespace arch {
38 class BasicBlock {
39 private:
40 std::vector<triton::arch::Instruction> instructions;
41
42 public:
44 TRITON_EXPORT BasicBlock();
45
47 TRITON_EXPORT BasicBlock(const std::vector<triton::arch::Instruction>& instructions);
48
50 TRITON_EXPORT BasicBlock(const BasicBlock& other);
51
53 TRITON_EXPORT BasicBlock& operator=(const BasicBlock& other);
54
56 TRITON_EXPORT ~BasicBlock();
57
59 TRITON_EXPORT void add(const Instruction& instruction);
60
62 TRITON_EXPORT bool remove(triton::uint32 position);
63
65 TRITON_EXPORT std::vector<triton::arch::Instruction>& getInstructions(void);
66
68 TRITON_EXPORT triton::usize getSize(void) const;
69
71 TRITON_EXPORT triton::uint64 getFirstAddress(void) const;
72
74 TRITON_EXPORT triton::uint64 getLastAddress(void) const;
75 };
76
78 TRITON_EXPORT std::ostream& operator<<(std::ostream& stream, BasicBlock& block);
79
81 TRITON_EXPORT std::ostream& operator<<(std::ostream& stream, BasicBlock* block);
82
84 };
86};
87
88#endif /* TRITON_BASICBLOCK_HPP */
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.
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
The Triton namespace.