You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
40 lines
836 B
40 lines
836 B
|
|
#include <vector>
|
|
|
|
#include <llvm/IR/BasicBlock.h>
|
|
|
|
namespace evmcc
|
|
{
|
|
|
|
using ProgramCounter = uint64_t;
|
|
|
|
class BasicBlock
|
|
{
|
|
public:
|
|
using State = std::vector<llvm::Value*>;
|
|
|
|
static const char* NamePrefix;
|
|
|
|
explicit BasicBlock(ProgramCounter _beginInstIdx, ProgramCounter _endInstIdx, llvm::Function* _mainFunc);
|
|
|
|
BasicBlock(const BasicBlock&) = delete;
|
|
void operator=(const BasicBlock&) = delete;
|
|
|
|
operator llvm::BasicBlock*() { return m_llvmBB; }
|
|
llvm::BasicBlock* llvm() { return m_llvmBB; }
|
|
|
|
State& getState() { return m_state; }
|
|
|
|
ProgramCounter begin() { return m_beginInstIdx; }
|
|
ProgramCounter end() { return m_endInstIdx; }
|
|
|
|
private:
|
|
ProgramCounter m_beginInstIdx;
|
|
ProgramCounter m_endInstIdx;
|
|
llvm::BasicBlock* m_llvmBB;
|
|
|
|
/// Basic black state vector - current/end values and their positions
|
|
State m_state;
|
|
};
|
|
|
|
}
|