LLVM API Documentation
Represents a contiguous range of either instructions (a TextAtom) or data (a DataAtom). Address ranges are expressed as closed intervals. More...
#include <MCAtom.h>
Public Types | |
enum | AtomKind { TextAtom, DataAtom } |
Public Member Functions | |
virtual | ~MCAtom () |
AtomKind | getKind () const |
uint64_t | getBeginAddr () const |
Get the start address of the atom. More... | |
uint64_t | getEndAddr () const |
Get the end address, i.e. the last one inside the atom. More... | |
Atom modification methods: | |
When modifying a TextAtom, keep instruction boundaries in mind. For instance, split must me given the start address of an instruction. | |
virtual MCAtom * | split (uint64_t SplitPt)=0 |
Splits the atom in two at a given address. More... | |
virtual void | truncate (uint64_t TruncPt)=0 |
Truncates an atom, discarding everything after TruncPt . More... | |
Naming: | |
This is mostly for display purposes, and may contain anything that hints at what the atom contains: section or symbol name, BB start address, .. | |
StringRef | getName () const |
void | setName (StringRef NewName) |
Protected Member Functions | |
MCAtom (AtomKind K, MCModule *P, uint64_t B, uint64_t E) | |
Atom remapping helpers | |
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 same, but overlapping with other atoms in the module is still forbidden. More... | |
void | remapForTruncate (uint64_t TruncPt) |
Remap the atom to prepare for a truncation at TruncPt. Equivalent to: More... | |
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 {L,R}{Begin,End}. The current atom is truncated to LEnd . More... | |
Protected Attributes | |
const AtomKind | Kind |
std::string | Name |
MCModule * | Parent |
uint64_t | Begin |
uint64_t | End |
Friends | |
class | MCModule |
Represents a contiguous range of either instructions (a TextAtom) or data (a DataAtom). Address ranges are expressed as closed intervals.
|
inline |
Get the start address of the atom.
Definition at line 43 of file MCAtom.h.
References Begin.
Referenced by llvm::MCBasicBlock::splitBasicBlock().
|
inline |
Get the end address, i.e. the last one inside the atom.
Definition at line 45 of file MCAtom.h.
References End.
Referenced by AtomComp(), AtomCompInv(), and llvm::MCBasicBlock::splitBasicBlock().
|
inline |
Definition at line 40 of file MCAtom.h.
References Kind.
Referenced by llvm::MCTextAtom::classof(), and llvm::MCDataAtom::classof().
|
inline |
Definition at line 67 of file MCAtom.h.
References Name.
Referenced by llvm::MCTextAtom::split(), and llvm::MCDataAtom::split().
|
protected |
Remap the atom, using the given range, updating Begin/End. One or both of the bounds can remain the same, but overlapping with other atoms in the module is still forbidden.
Definition at line 20 of file MCAtom.cpp.
References Parent.
Referenced by llvm::MCDataAtom::addData(), llvm::MCTextAtom::addInst(), remapForSplit(), and remapForTruncate().
|
protected |
Remap the atom to prepare for a split at SplitPt. The bounds for the resulting atoms are returned in {L,R}{Begin,End}. The current atom is truncated to LEnd
.
Definition at line 30 of file MCAtom.cpp.
References Begin, End, and remap().
Referenced by llvm::MCTextAtom::split(), and llvm::MCDataAtom::split().
|
protected |
Remap the atom to prepare for a truncation at TruncPt. Equivalent to:
Definition at line 24 of file MCAtom.cpp.
References Begin, End, and remap().
Referenced by llvm::MCTextAtom::truncate(), and llvm::MCDataAtom::truncate().
|
inline |
Definition at line 68 of file MCAtom.h.
References Name, and llvm::StringRef::str().
Referenced by llvm::MCTextAtom::split(), and llvm::MCDataAtom::split().
|
pure virtual |
Splits the atom in two at a given address.
SplitPt | Address at which to start a new atom, splitting this one. |
SplitPt
. Implemented in llvm::MCDataAtom, and llvm::MCTextAtom.
|
pure virtual |
Truncates an atom, discarding everything after TruncPt
.
TruncPt | Last byte address to be contained in this atom. |
Implemented in llvm::MCDataAtom, and llvm::MCTextAtom.
|
protected |
Definition at line 75 of file MCAtom.h.
Referenced by llvm::MCDataAtom::addData(), llvm::MCTextAtom::addInst(), getBeginAddr(), remapForSplit(), remapForTruncate(), and llvm::MCDataAtom::truncate().
|
protected |
Definition at line 75 of file MCAtom.h.
Referenced by llvm::MCDataAtom::addData(), llvm::MCTextAtom::addInst(), getEndAddr(), remapForSplit(), and remapForTruncate().
|
protected |
|
protected |
|
protected |
Definition at line 74 of file MCAtom.h.
Referenced by remap(), llvm::MCTextAtom::split(), and llvm::MCDataAtom::split().