+++ /dev/null
-#ifndef INCLUDE__LLVMBasicBlock_hxx
-#define INCLUDE__LLVMBasicBlock_hxx
-
-#include "core/BasicBlock.hxx"
-
-class Disassembler;
-
-class LLVMBasicBlock : public BasicBlock {
-public:
- LLVMBasicBlock(uint64_t start_address, Disassembler * disassembler) {
- setStartAddress(start_address);
- }
-
- Disassembler * getDisassembler() {
- return disassembler;
- }
-
-private:
- Disassembler * disassembler;
-};
-
-#endif
#include "disassembler/llvm/LLVMDisassembler.hxx"
-#include "disassembler/llvm/LLVMBasicBlock.hxx"
#include "core/InformationManager.hxx"
#include "core/Function.hxx"
+#include "core/BasicBlock.hxx"
#include <stack>
#include <algorithm>
template <typename ELFT>
void LLVMDisassembler<ELFT>::disassembleFunction(Function* function) {
- std::stack<LLVMBasicBlock*> remaining_blocks;
+ std::stack<BasicBlock*> remaining_blocks;
SectionRef text_section = sections[".text"];
StringRef bytes;
text_section.getContents(bytes);
LOG4CXX_DEBUG(logger, "Handling function " << function->getName());
- LLVMBasicBlock * block = new LLVMBasicBlock(function->getStartAddress(), this);
+ BasicBlock * block = new BasicBlock(function->getStartAddress(), this);
remaining_blocks.push(block);
blocks.insert(std::make_pair(block->getStartAddress(), block));
function->addBasicBlock(block);
while (remaining_blocks.size()) {
- LLVMBasicBlock * current_block = remaining_blocks.top();
+ BasicBlock * current_block = remaining_blocks.top();
remaining_blocks.pop();
LOG4CXX_DEBUG(logger, "Handling Block starting at " << std::hex << current_block->getStartAddress());
} else {
current_block->setNextBlock(0, jmptarget);
if (blocks.find(jmptarget) == blocks.end()) {
- LLVMBasicBlock * block = new LLVMBasicBlock(jmptarget, this);
+ BasicBlock * block = new BasicBlock(jmptarget, this);
blocks.insert(std::make_pair(block->getStartAddress(), block));
function->addBasicBlock(block);
remaining_blocks.push(block);
jmptarget = base_address + current_address + inst_size;
current_block->setNextBlock(1, jmptarget);
if (blocks.find(jmptarget) == blocks.end()) {
- LLVMBasicBlock * block = new LLVMBasicBlock(jmptarget, this);
+ BasicBlock * block = new BasicBlock(jmptarget, this);
blocks.insert(std::make_pair(block->getStartAddress(), block));
function->addBasicBlock(block);
remaining_blocks.push(block);