20 : Name(Name), ParentModule(Parent)
23 MCFunction::~MCFunction() {
30 Blocks.push_back(MCBB);
36 if ((*I)->getInsts()->getBeginAddr() == StartAddr)
48 : Insts(&Insts), Parent(Parent) {
49 getParent()->getParent()->trackBBForAtom(&Insts,
this);
54 Successors.push_back(MCBB);
58 return std::find(Successors.begin(), Successors.end(),
59 MCBB) != Successors.end();
64 Predecessors.push_back(MCBB);
68 return std::find(Predecessors.begin(), Predecessors.end(),
69 MCBB) != Predecessors.end();
74 "Splitting unrelated basic blocks!");
76 assert(SplitBB->Successors.empty() &&
77 "Split basic block shouldn't already have successors!");
78 SplitBB->Successors = Successors;
bool isPredecessor(const MCBasicBlock *MCBB) const
MCBasicBlock & createBlock(const MCTextAtom &Insts)
Create an MCBasicBlock backed by Insts and add it to this function.
An atom consisting of disassembled instructions.
const_iterator begin() const
void addPredecessor(const MCBasicBlock *MCBB)
void addSuccessor(const MCBasicBlock *MCBB)
void splitBasicBlock(MCBasicBlock *SplitBB)
Split block, mirrorring NewAtom = Insts->split(..). This moves all successors to SplitBB, and adds a fallthrough to it. SplitBB The result of splitting Insts, a basic block directly following this basic block.
Represents a function in machine code, containing MCBasicBlocks. MCFunctions are created by MCModule...
uint64_t getBeginAddr() const
Get the start address of the atom.
const MCModule * getParent() const
bool isSuccessor(const MCBasicBlock *MCBB) const
Basic block containing a sequence of disassembled instructions. The basic block is backed by an MCTex...
const_iterator end() const
uint64_t getEndAddr() const
Get the end address, i.e. the last one inside the atom.
A completely disassembled object file or executable. It comprises a list of MCAtom's, each representing a contiguous range of either instructions or data. An MCModule is created using MCObjectDisassembler::buildModule.
BasicBlockListTy::iterator iterator
const MCBasicBlock * find(uint64_t StartAddr) const
Find the basic block, if any, that starts at StartAddr.
BasicBlockListTy::const_iterator const_iterator