#pragma once #include #include namespace evmcc { class Compiler { public: using ProgramCounter = uint64_t; Compiler(); std::unique_ptr compile(const dev::bytes& bytecode); private: llvm::BasicBlock* getOrCreateBasicBlockAtPC(ProgramCounter pc); void createBasicBlocks(const dev::bytes& bytecode); /** * Maps a program counter pc to a basic block which starts at pc (if any). */ std::map basicBlocks; /** * Maps a pc at which there is a JUMP or JUMPI to the target block of the jump. */ std::map jumpTargets; }; }