16 #ifndef LLVM_MC_MCATOM_H
17 #define LLVM_MC_MCATOM_H
21 #include "llvm/Support/DataTypes.h"
35 virtual void anchor();
59 virtual void truncate(uint64_t TruncPt) = 0;
87 void remap(uint64_t NewBegin, uint64_t NewEnd);
101 uint64_t &LBegin, uint64_t &LEnd,
102 uint64_t &RBegin, uint64_t &REnd);
119 : Inst(Inst), Address(Address), Size(Size) {}
125 typedef std::vector<MCDecodedInst> InstListTy;
130 uint64_t NextInstAddress;
143 size_t size()
const {
return Insts.size(); }
171 std::vector<MCData> Data;
193 Data.reserve(End + 1 - Begin);
void truncate(uint64_t TruncPt) LLVM_OVERRIDE
Truncates an atom, discarding everything after TruncPt.
An atom consisting of disassembled instructions.
StringRef getName() const
std::string str() const
str - Get the contents as an std::string.
MCDataAtom * split(uint64_t SplitPt) LLVM_OVERRIDE
Splits the atom in two at a given address.
const MCDecodedInst & at(size_t n) const
uint8_t MCData
An entry in an MCDataAtom.
const_iterator end() const
void addInst(const MCInst &Inst, uint64_t Size)
Append an instruction, expanding the atom if necessary.
void remapForSplit(uint64_t SplitPt, uint64_t &LBegin, uint64_t &LEnd, uint64_t &RBegin, uint64_t &REnd)
Remap the atom to prepare for a split at SplitPt. The bounds for the resulting atoms are returned in ...
An atom consising of a sequence of bytes.
An entry in an MCTextAtom: a disassembled instruction. NOTE: Both the Address and Size field are actu...
virtual void truncate(uint64_t TruncPt)=0
Truncates an atom, discarding everything after TruncPt.
const MCDecodedInst & back() const
uint64_t getBeginAddr() const
Get the start address of the atom.
static bool classof(const MCAtom *A)
MCAtom(AtomKind K, MCModule *P, uint64_t B, uint64_t E)
void remap(uint64_t NewBegin, uint64_t NewEnd)
Remap the atom, using the given range, updating Begin/End. One or both of the bounds can remain the s...
ArrayRef< MCData > getData() const
Get a reference to the data in this atom.
MCDecodedInst(const MCInst &Inst, uint64_t Address, uint64_t Size)
void setName(StringRef NewName)
void remapForTruncate(uint64_t TruncPt)
Remap the atom to prepare for a truncation at TruncPt. Equivalent to:
Represents a contiguous range of either instructions (a TextAtom) or data (a DataAtom). Address ranges are expressed as closed intervals.
InstListTy::const_iterator const_iterator
void truncate(uint64_t TruncPt) LLVM_OVERRIDE
Truncates an atom, discarding everything after TruncPt.
virtual MCAtom * split(uint64_t SplitPt)=0
Splits the atom in two at a given address.
uint64_t getEndAddr() const
Get the end address, i.e. the last one inside the atom.
MCTextAtom * split(uint64_t SplitPt) LLVM_OVERRIDE
Splits the atom in two at a given address.
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.
static bool classof(const MCAtom *A)
const_iterator begin() const
void addData(const MCData &D)
Append a data entry, expanding the atom if necessary.