LLVM API Documentation

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
Public Member Functions | Static Public Member Functions | Friends | List of all members
llvm::MCTextAtom Class Reference

An atom consisting of disassembled instructions. More...

#include <MCAtom.h>

Inheritance diagram for llvm::MCTextAtom:
Inheritance graph
[legend]
Collaboration diagram for llvm::MCTextAtom:
Collaboration graph
[legend]

Public Member Functions

void addInst (const MCInst &Inst, uint64_t Size)
 Append an instruction, expanding the atom if necessary. More...
 
Atom type specific split/truncate logic.
MCTextAtomsplit (uint64_t SplitPt) LLVM_OVERRIDE
 Splits the atom in two at a given address. More...
 
void truncate (uint64_t TruncPt) LLVM_OVERRIDE
 Truncates an atom, discarding everything after TruncPt. More...
 
- Public Member Functions inherited from llvm::MCAtom
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...
 
StringRef getName () const
 
void setName (StringRef NewName)
 

Static Public Member Functions

static bool classof (const MCAtom *A)
 

Friends

class MCModule
 

Instruction list access

typedef InstListTy::const_iterator const_iterator
 
const_iterator begin () const
 
const_iterator end () const
 
const MCDecodedInstback () const
 
const MCDecodedInstat (size_t n) const
 
size_t size () const
 

Additional Inherited Members

- Public Types inherited from llvm::MCAtom
enum  AtomKind { TextAtom, DataAtom }
 
- Protected Member Functions inherited from llvm::MCAtom
 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 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 inherited from llvm::MCAtom
const AtomKind Kind
 
std::string Name
 
MCModuleParent
 
uint64_t Begin
 
uint64_t End
 

Detailed Description

An atom consisting of disassembled instructions.

Definition at line 123 of file MCAtom.h.

Member Typedef Documentation

typedef InstListTy::const_iterator llvm::MCTextAtom::const_iterator

Definition at line 137 of file MCAtom.h.

Member Function Documentation

void MCTextAtom::addInst ( const MCInst Inst,
uint64_t  Size 
)

Append an instruction, expanding the atom if necessary.

Definition at line 77 of file MCAtom.cpp.

References llvm::MCAtom::Begin, llvm::MCAtom::End, and llvm::MCAtom::remap().

const MCDecodedInst& llvm::MCTextAtom::at ( size_t  n) const
inline

Definition at line 142 of file MCAtom.h.

const MCDecodedInst& llvm::MCTextAtom::back ( ) const
inline

Definition at line 141 of file MCAtom.h.

const_iterator llvm::MCTextAtom::begin ( ) const
inline

Definition at line 138 of file MCAtom.h.

static bool llvm::MCTextAtom::classof ( const MCAtom A)
inlinestatic

Definition at line 153 of file MCAtom.h.

References llvm::MCAtom::getKind(), and llvm::MCAtom::TextAtom.

const_iterator llvm::MCTextAtom::end ( ) const
inline

Definition at line 139 of file MCAtom.h.

size_t llvm::MCTextAtom::size ( ) const
inline

Definition at line 143 of file MCAtom.h.

MCTextAtom * MCTextAtom::split ( uint64_t  SplitPt)
virtual

Splits the atom in two at a given address.

Parameters
SplitPtAddress at which to start a new atom, splitting this one.
Returns
The newly created atom starting at SplitPt.

Implements llvm::MCAtom.

Definition at line 97 of file MCAtom.cpp.

References llvm::MCModule::createTextAtom(), llvm::MCAtom::getName(), I, llvm::MCAtom::Parent, llvm::MCAtom::remapForSplit(), and llvm::MCAtom::setName().

void MCTextAtom::truncate ( uint64_t  TruncPt)
virtual

Truncates an atom, discarding everything after TruncPt.

Parameters
TruncPtLast byte address to be contained in this atom.

Implements llvm::MCAtom.

Definition at line 84 of file MCAtom.cpp.

References I, and llvm::MCAtom::remapForTruncate().

Friends And Related Function Documentation

friend class MCModule
friend

Definition at line 155 of file MCAtom.h.


The documentation for this class was generated from the following files: