LLVM API Documentation

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

#include <MCAssembler.h>

Public Types

typedef iplist< MCSectionDataSectionDataListType
 
typedef iplist< MCSymbolDataSymbolDataListType
 
typedef
SectionDataListType::const_iterator 
const_iterator
 
typedef
SectionDataListType::iterator 
iterator
 
typedef
SymbolDataListType::const_iterator 
const_symbol_iterator
 
typedef
SymbolDataListType::iterator 
symbol_iterator
 
typedef std::vector< std::string > FileNameVectorType
 
typedef
FileNameVectorType::const_iterator 
const_file_name_iterator
 
typedef std::vector
< IndirectSymbolData >
::const_iterator 
const_indirect_symbol_iterator
 
typedef std::vector
< IndirectSymbolData >
::iterator 
indirect_symbol_iterator
 
typedef std::vector
< DataRegionData >
::const_iterator 
const_data_region_iterator
 
typedef std::vector
< DataRegionData >::iterator 
data_region_iterator
 

Public Member Functions

uint64_t computeFragmentSize (const MCAsmLayout &Layout, const MCFragment &F) const
 
const MCSymbolDatagetAtom (const MCSymbolData *Symbol) const
 
bool isSymbolLinkerVisible (const MCSymbol &SD) const
 
void writeSectionData (const MCSectionData *Section, const MCAsmLayout &Layout) const
 Emit the section contents using the given object writer. More...
 
bool isThumbFunc (const MCSymbol *Func) const
 Check whether a given symbol has been flagged with .thumb_func. More...
 
void setIsThumbFunc (const MCSymbol *Func)
 Flag a function symbol as the target of a .thumb_func directive. More...
 
unsigned getELFHeaderEFlags () const
 ELF e_header flags. More...
 
void setELFHeaderEFlags (unsigned Flags)
 
 MCAssembler (MCContext &Context_, MCAsmBackend &Backend_, MCCodeEmitter &Emitter_, MCObjectWriter &Writer_, raw_ostream &OS)
 
 ~MCAssembler ()
 
void reset ()
 
MCContextgetContext () const
 
MCAsmBackendgetBackend () const
 
MCCodeEmittergetEmitter () const
 
MCObjectWritergetWriter () const
 
void Finish ()
 
bool getSubsectionsViaSymbols () const
 
void setSubsectionsViaSymbols (bool Value)
 
bool getRelaxAll () const
 
void setRelaxAll (bool Value)
 
bool getNoExecStack () const
 
void setNoExecStack (bool Value)
 
bool isBundlingEnabled () const
 
unsigned getBundleAlignSize () const
 
void setBundleAlignSize (unsigned Size)
 
void dump ()
 
Section List Access
const SectionDataListTypegetSectionList () const
 
SectionDataListTypegetSectionList ()
 
iterator begin ()
 
const_iterator begin () const
 
iterator end ()
 
const_iterator end () const
 
size_t size () const
 
Symbol List Access
const SymbolDataListTypegetSymbolList () const
 
SymbolDataListTypegetSymbolList ()
 
symbol_iterator symbol_begin ()
 
const_symbol_iterator symbol_begin () const
 
symbol_iterator symbol_end ()
 
const_symbol_iterator symbol_end () const
 
size_t symbol_size () const
 
Indirect Symbol List Access
std::vector< IndirectSymbolData > & getIndirectSymbols ()
 
indirect_symbol_iterator indirect_symbol_begin ()
 
const_indirect_symbol_iterator indirect_symbol_begin () const
 
indirect_symbol_iterator indirect_symbol_end ()
 
const_indirect_symbol_iterator indirect_symbol_end () const
 
size_t indirect_symbol_size () const
 
Linker Option List Access
std::vector< std::vector
< std::string > > & 
getLinkerOptions ()
 
Data Region List Access
std::vector< DataRegionData > & getDataRegions ()
 
data_region_iterator data_region_begin ()
 
const_data_region_iterator data_region_begin () const
 
data_region_iterator data_region_end ()
 
const_data_region_iterator data_region_end () const
 
size_t data_region_size () const
 
Backend Data Access
MCSectionDatagetSectionData (const MCSection &Section) const
 
MCSectionDatagetOrCreateSectionData (const MCSection &Section, bool *Created=0)
 
MCSymbolDatagetSymbolData (const MCSymbol &Symbol) const
 
MCSymbolDatagetOrCreateSymbolData (const MCSymbol &Symbol, bool *Created=0)
 
const_file_name_iterator file_names_begin () const
 
const_file_name_iterator file_names_end () const
 
void addFileName (StringRef FileName)
 

Friends

class MCAsmLayout
 

Detailed Description

Definition at line 807 of file MCAssembler.h.

Member Typedef Documentation

Definition at line 828 of file MCAssembler.h.

typedef FileNameVectorType::const_iterator llvm::MCAssembler::const_file_name_iterator

Definition at line 821 of file MCAssembler.h.

Definition at line 824 of file MCAssembler.h.

Definition at line 814 of file MCAssembler.h.

Definition at line 817 of file MCAssembler.h.

Definition at line 829 of file MCAssembler.h.

typedef std::vector<std::string> llvm::MCAssembler::FileNameVectorType

Definition at line 820 of file MCAssembler.h.

Definition at line 825 of file MCAssembler.h.

Definition at line 815 of file MCAssembler.h.

Definition at line 811 of file MCAssembler.h.

Definition at line 818 of file MCAssembler.h.

Definition at line 812 of file MCAssembler.h.

Constructor & Destructor Documentation

MCAssembler::MCAssembler ( MCContext Context_,
MCAsmBackend Backend_,
MCCodeEmitter Emitter_,
MCObjectWriter Writer_,
raw_ostream OS 
)

Construct a new assembler instance.

Parameters
OSThe stream to output to.

Definition at line 293 of file MCAssembler.cpp.

MCAssembler::~MCAssembler ( )

Definition at line 301 of file MCAssembler.cpp.

Member Function Documentation

void llvm::MCAssembler::addFileName ( StringRef  FileName)
inline

Definition at line 1170 of file MCAssembler.h.

References file_names_begin(), and file_names_end().

Referenced by llvm::MCELFStreamer::EmitFileDirective().

iterator llvm::MCAssembler::begin ( )
inline
const_iterator llvm::MCAssembler::begin ( ) const
inline

Definition at line 1040 of file MCAssembler.h.

uint64_t MCAssembler::computeFragmentSize ( const MCAsmLayout Layout,
const MCFragment F 
) const
data_region_iterator llvm::MCAssembler::data_region_begin ( )
inline

Definition at line 1108 of file MCAssembler.h.

Referenced by llvm::MachObjectWriter::WriteObject().

const_data_region_iterator llvm::MCAssembler::data_region_begin ( ) const
inline

Definition at line 1111 of file MCAssembler.h.

data_region_iterator llvm::MCAssembler::data_region_end ( )
inline

Definition at line 1115 of file MCAssembler.h.

Referenced by llvm::MachObjectWriter::WriteObject().

const_data_region_iterator llvm::MCAssembler::data_region_end ( ) const
inline

Definition at line 1118 of file MCAssembler.h.

size_t llvm::MCAssembler::data_region_size ( ) const
inline

Definition at line 1122 of file MCAssembler.h.

void MCAssembler::dump ( )

Definition at line 1156 of file MCAssembler.cpp.

References begin(), end(), llvm::errs(), symbol_begin(), and symbol_end().

Referenced by Finish().

iterator llvm::MCAssembler::end ( )
inline
const_iterator llvm::MCAssembler::end ( ) const
inline

Definition at line 1043 of file MCAssembler.h.

const_file_name_iterator llvm::MCAssembler::file_names_begin ( ) const
inline

Definition at line 1162 of file MCAssembler.h.

Referenced by addFileName().

const_file_name_iterator llvm::MCAssembler::file_names_end ( ) const
inline

Definition at line 1166 of file MCAssembler.h.

Referenced by addFileName().

void MCAssembler::Finish ( )
const MCSymbolData * MCAssembler::getAtom ( const MCSymbolData Symbol) const

Find the symbol which defines the atom containing the given symbol, or null if there is no such symbol.

Definition at line 336 of file MCAssembler.cpp.

References llvm::MCFragment::getAtom(), getBackend(), llvm::MCSymbolData::getFragment(), llvm::MCFragment::getParent(), llvm::MCSectionData::getSection(), llvm::MCSymbolData::getSymbol(), llvm::MCAsmBackend::isSectionAtomizable(), and isSymbolLinkerVisible().

MCAsmBackend& llvm::MCAssembler::getBackend ( ) const
inline
unsigned llvm::MCAssembler::getBundleAlignSize ( ) const
inline

Definition at line 1023 of file MCAssembler.h.

Referenced by llvm::MCAsmLayout::layoutFragment(), and writeFragment().

MCContext& llvm::MCAssembler::getContext ( ) const
inline
std::vector<DataRegionData>& llvm::MCAssembler::getDataRegions ( )
inline

Definition at line 1104 of file MCAssembler.h.

Referenced by llvm::MachObjectWriter::WriteObject().

unsigned llvm::MCAssembler::getELFHeaderEFlags ( ) const
inline

ELF e_header flags.

Definition at line 971 of file MCAssembler.h.

MCCodeEmitter& llvm::MCAssembler::getEmitter ( ) const
inline
std::vector<IndirectSymbolData>& llvm::MCAssembler::getIndirectSymbols ( )
inline

Definition at line 1069 of file MCAssembler.h.

Referenced by llvm::MCELFStreamer::EmitSymbolAttribute().

std::vector<std::vector<std::string> >& llvm::MCAssembler::getLinkerOptions ( )
inline

Definition at line 1093 of file MCAssembler.h.

Referenced by llvm::MachObjectWriter::WriteObject().

bool llvm::MCAssembler::getNoExecStack ( ) const
inline

Definition at line 1016 of file MCAssembler.h.

MCSectionData& llvm::MCAssembler::getOrCreateSectionData ( const MCSection Section,
bool Created = 0 
)
inline
MCSymbolData& llvm::MCAssembler::getOrCreateSymbolData ( const MCSymbol Symbol,
bool Created = 0 
)
inline
bool llvm::MCAssembler::getRelaxAll ( ) const
inline

Definition at line 1013 of file MCAssembler.h.

References RelaxAll().

Referenced by llvm::MCObjectStreamer::EmitInstruction().

MCSectionData& llvm::MCAssembler::getSectionData ( const MCSection Section) const
inline

Definition at line 1128 of file MCAssembler.h.

const SectionDataListType& llvm::MCAssembler::getSectionList ( ) const
inline

Definition at line 1036 of file MCAssembler.h.

Referenced by llvm::MCSectionData::MCSectionData().

SectionDataListType& llvm::MCAssembler::getSectionList ( )
inline

Definition at line 1037 of file MCAssembler.h.

bool llvm::MCAssembler::getSubsectionsViaSymbols ( ) const
inline
MCSymbolData& llvm::MCAssembler::getSymbolData ( const MCSymbol Symbol) const
inline
const SymbolDataListType& llvm::MCAssembler::getSymbolList ( ) const
inline

Definition at line 1051 of file MCAssembler.h.

Referenced by llvm::MCSymbolData::MCSymbolData().

SymbolDataListType& llvm::MCAssembler::getSymbolList ( )
inline

Definition at line 1052 of file MCAssembler.h.

MCObjectWriter& llvm::MCAssembler::getWriter ( ) const
inline
indirect_symbol_iterator llvm::MCAssembler::indirect_symbol_begin ( )
inline
const_indirect_symbol_iterator llvm::MCAssembler::indirect_symbol_begin ( ) const
inline

Definition at line 1076 of file MCAssembler.h.

indirect_symbol_iterator llvm::MCAssembler::indirect_symbol_end ( )
inline
const_indirect_symbol_iterator llvm::MCAssembler::indirect_symbol_end ( ) const
inline

Definition at line 1083 of file MCAssembler.h.

size_t llvm::MCAssembler::indirect_symbol_size ( ) const
inline

Definition at line 1087 of file MCAssembler.h.

Referenced by llvm::MachObjectWriter::WriteObject().

bool llvm::MCAssembler::isBundlingEnabled ( ) const
inline
bool MCAssembler::isSymbolLinkerVisible ( const MCSymbol SD) const

Check whether a particular symbol is visible to the linker and is required in the symbol table, or whether it can be discarded by the assembler. This also effects whether the assembler treats the label as potentially defining a separate atom.

Definition at line 323 of file MCAssembler.cpp.

References llvm::MCAsmBackend::doesSectionRequireSymbols(), getBackend(), llvm::MCSymbol::getSection(), llvm::MCSymbol::isInSection(), and llvm::MCSymbol::isTemporary().

Referenced by llvm::MachObjectWriter::ComputeSymbolTable(), and getAtom().

bool llvm::MCAssembler::isThumbFunc ( const MCSymbol Func) const
inline

Check whether a given symbol has been flagged with .thumb_func.

Definition at line 963 of file MCAssembler.h.

References llvm::SmallPtrSet< PtrType, SmallSize >::count().

void MCAssembler::reset ( )
void llvm::MCAssembler::setBundleAlignSize ( unsigned  Size)
inline

Definition at line 1027 of file MCAssembler.h.

void llvm::MCAssembler::setELFHeaderEFlags ( unsigned  Flags)
inline

Definition at line 972 of file MCAssembler.h.

Referenced by llvm::MipsTargetELFStreamer::emitMipsHackELFFlags().

void llvm::MCAssembler::setIsThumbFunc ( const MCSymbol Func)
inline

Flag a function symbol as the target of a .thumb_func directive.

Definition at line 968 of file MCAssembler.h.

void llvm::MCAssembler::setNoExecStack ( bool  Value)
inline

Definition at line 1017 of file MCAssembler.h.

Referenced by llvm::createELFStreamer().

void llvm::MCAssembler::setRelaxAll ( bool  Value)
inline

Definition at line 1014 of file MCAssembler.h.

References RelaxAll().

Referenced by llvm::createELFStreamer().

void llvm::MCAssembler::setSubsectionsViaSymbols ( bool  Value)
inline

Definition at line 1009 of file MCAssembler.h.

Referenced by llvm::MCELFStreamer::EmitAssemblerFlag().

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

Definition at line 1045 of file MCAssembler.h.

Referenced by llvm::MachObjectWriter::WriteObject().

symbol_iterator llvm::MCAssembler::symbol_begin ( )
inline
const_symbol_iterator llvm::MCAssembler::symbol_begin ( ) const
inline

Definition at line 1055 of file MCAssembler.h.

symbol_iterator llvm::MCAssembler::symbol_end ( )
inline
const_symbol_iterator llvm::MCAssembler::symbol_end ( ) const
inline

Definition at line 1058 of file MCAssembler.h.

size_t llvm::MCAssembler::symbol_size ( ) const
inline

Definition at line 1060 of file MCAssembler.h.

void MCAssembler::writeSectionData ( const MCSectionData Section,
const MCAsmLayout Layout 
) const

Friends And Related Function Documentation

friend class MCAsmLayout
friend

Definition at line 808 of file MCAssembler.h.


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