LLVM  3.7.0
Classes | Public Types | Public Member Functions | Friends | List of all members
llvm::MCAssembler Class Reference

#include <MCAssembler.h>

Classes

struct  VersionMinInfoType
 MachO specific deployment target version info. More...
 

Public Types

typedef std::vector< MCSection * > SectionListType
 
typedef std::vector< const
MCSymbol * > 
SymbolDataListType
 
typedef pointee_iterator
< SectionListType::const_iterator > 
const_iterator
 
typedef pointee_iterator
< SectionListType::iterator > 
iterator
 
typedef pointee_iterator
< SymbolDataListType::const_iterator > 
const_symbol_iterator
 
typedef pointee_iterator
< SymbolDataListType::iterator > 
symbol_iterator
 
typedef iterator_range
< symbol_iterator
symbol_range
 
typedef iterator_range
< const_symbol_iterator
const_symbol_range
 
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
 Compute the effective fragment size assuming it is laid out at the given SectionAddress and FragmentOffset. More...
 
const MCSymbolgetAtom (const MCSymbol &S) const
 Find the symbol which defines the atom containing the given symbol, or null if there is no such symbol. More...
 
bool 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. More...
 
void writeSectionData (const MCSection *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)
 
const VersionMinInfoTypegetVersionMinInfo () const
 MachO deployment target version information. More...
 
void setVersionMinInfo (MCVersionMinType Kind, unsigned Major, unsigned Minor, unsigned Update)
 
 MCAssembler (MCContext &Context_, MCAsmBackend &Backend_, MCCodeEmitter &Emitter_, MCObjectWriter &Writer_, raw_ostream &OS)
 Construct a new assembler instance. More...
 
 ~MCAssembler ()
 
void reset ()
 Reuse an assembler instance. More...
 
MCContextgetContext () const
 
MCAsmBackendgetBackend () const
 
MCCodeEmittergetEmitter () const
 
MCObjectWritergetWriter () const
 
void Finish ()
 Finish - Do final processing and write the object to the output stream. More...
 
bool getSubsectionsViaSymbols () const
 
void setSubsectionsViaSymbols (bool Value)
 
bool getRelaxAll () const
 
void setRelaxAll (bool Value)
 
bool isBundlingEnabled () const
 
unsigned getBundleAlignSize () const
 
void setBundleAlignSize (unsigned Size)
 
void dump ()
 
Section List Access
iterator begin ()
 
const_iterator begin () const
 
iterator end ()
 
const_iterator end () const
 
size_t size () const
 
Symbol List Access
symbol_iterator symbol_begin ()
 
const_symbol_iterator symbol_begin () const
 
symbol_iterator symbol_end ()
 
const_symbol_iterator symbol_end () const
 
symbol_range symbols ()
 
const_symbol_range symbols () 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
 
MCLOHContainergetLOHContainer ()
 
const MCLOHContainergetLOHContainer () const
 
Backend Data Access
bool registerSection (MCSection &Section)
 
void registerSymbol (const MCSymbol &Symbol, bool *Created=nullptr)
 
ArrayRef< std::string > getFileNames ()
 
void addFileName (StringRef FileName)
 
void writeFragmentPadding (const MCFragment &F, uint64_t FSize, MCObjectWriter *OW) const
 Write the necessary bundle padding to the given object writer. More...
 

Friends

class MCAsmLayout
 

Detailed Description

Definition at line 531 of file MCAssembler.h.

Member Typedef Documentation

Definition at line 553 of file MCAssembler.h.

Definition at line 549 of file MCAssembler.h.

typedef pointee_iterator<SectionListType::const_iterator> llvm::MCAssembler::const_iterator

Definition at line 538 of file MCAssembler.h.

typedef pointee_iterator<SymbolDataListType::const_iterator> llvm::MCAssembler::const_symbol_iterator

Definition at line 542 of file MCAssembler.h.

Definition at line 546 of file MCAssembler.h.

Definition at line 554 of file MCAssembler.h.

Definition at line 550 of file MCAssembler.h.

typedef pointee_iterator<SectionListType::iterator> llvm::MCAssembler::iterator

Definition at line 539 of file MCAssembler.h.

Definition at line 535 of file MCAssembler.h.

typedef pointee_iterator<SymbolDataListType::iterator> llvm::MCAssembler::symbol_iterator

Definition at line 543 of file MCAssembler.h.

Definition at line 545 of file MCAssembler.h.

Definition at line 536 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 327 of file MCAssembler.cpp.

References llvm::MCAssembler::VersionMinInfoType::Major.

MCAssembler::~MCAssembler ( )

Definition at line 336 of file MCAssembler.cpp.

Member Function Documentation

void llvm::MCAssembler::addFileName ( StringRef  FileName)
inline
iterator llvm::MCAssembler::begin ( )
inline
const_iterator llvm::MCAssembler::begin ( ) const
inline

Definition at line 765 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 832 of file MCAssembler.h.

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

Definition at line 833 of file MCAssembler.h.

data_region_iterator llvm::MCAssembler::data_region_end ( )
inline

Definition at line 837 of file MCAssembler.h.

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

Definition at line 838 of file MCAssembler.h.

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

Definition at line 842 of file MCAssembler.h.

void MCAssembler::dump ( )

Definition at line 1249 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 768 of file MCAssembler.h.

void MCAssembler::Finish ( )
const MCSymbol * MCAssembler::getAtom ( const MCSymbol S) const

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

Definition at line 401 of file MCAssembler.cpp.

References llvm::MCContext::getAsmInfo(), llvm::MCFragment::getAtom(), getContext(), llvm::MCSymbol::getFragment(), llvm::MCFragment::getParent(), llvm::MCAsmInfo::isSectionAtomizableBySymbols(), and isSymbolLinkerVisible().

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

Definition at line 830 of file MCAssembler.h.

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

unsigned llvm::MCAssembler::getELFHeaderEFlags ( ) const
inline
MCCodeEmitter& llvm::MCAssembler::getEmitter ( ) const
inline
ArrayRef<std::string> llvm::MCAssembler::getFileNames ( )
inline

Definition at line 869 of file MCAssembler.h.

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

Definition at line 795 of file MCAssembler.h.

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

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

Definition at line 819 of file MCAssembler.h.

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

MCLOHContainer& llvm::MCAssembler::getLOHContainer ( )
inline

Definition at line 851 of file MCAssembler.h.

Referenced by getLOHContainer(), reset(), and llvm::MachObjectWriter::writeObject().

const MCLOHContainer& llvm::MCAssembler::getLOHContainer ( ) const
inline

Definition at line 852 of file MCAssembler.h.

References getLOHContainer().

bool llvm::MCAssembler::getRelaxAll ( ) const
inline
bool llvm::MCAssembler::getSubsectionsViaSymbols ( ) const
inline
const VersionMinInfoType& llvm::MCAssembler::getVersionMinInfo ( ) const
inline

MachO deployment target version information.

Definition at line 704 of file MCAssembler.h.

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

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

Definition at line 799 of file MCAssembler.h.

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

const_indirect_symbol_iterator llvm::MCAssembler::indirect_symbol_begin ( ) const
inline

Definition at line 802 of file MCAssembler.h.

indirect_symbol_iterator llvm::MCAssembler::indirect_symbol_end ( )
inline

Definition at line 806 of file MCAssembler.h.

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

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

Definition at line 809 of file MCAssembler.h.

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

Definition at line 813 of file MCAssembler.h.

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 386 of file MCAssembler.cpp.

References llvm::MCSymbol::isInSection(), llvm::MCSymbol::isTemporary(), and llvm::MCSymbol::isUsedInReloc().

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

bool MCAssembler::isThumbFunc ( const MCSymbol Func) const
bool llvm::MCAssembler::registerSection ( MCSection Section)
inline
void MCAssembler::registerSymbol ( const MCSymbol Symbol,
bool Created = nullptr 
)
void MCAssembler::reset ( )
void llvm::MCAssembler::setBundleAlignSize ( unsigned  Size)
inline

Definition at line 755 of file MCAssembler.h.

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

void llvm::MCAssembler::setELFHeaderEFlags ( unsigned  Flags)
inline
void llvm::MCAssembler::setIsThumbFunc ( const MCSymbol Func)
inline

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

Definition at line 697 of file MCAssembler.h.

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

Definition at line 749 of file MCAssembler.h.

Referenced by llvm::createELFStreamer().

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

Definition at line 746 of file MCAssembler.h.

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

void llvm::MCAssembler::setVersionMinInfo ( MCVersionMinType  Kind,
unsigned  Major,
unsigned  Minor,
unsigned  Update 
)
inline
size_t llvm::MCAssembler::size ( ) const
inline

Definition at line 770 of file MCAssembler.h.

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

symbol_iterator llvm::MCAssembler::symbol_begin ( )
inline

Definition at line 775 of file MCAssembler.h.

Referenced by dump(), and symbols().

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

Definition at line 776 of file MCAssembler.h.

symbol_iterator llvm::MCAssembler::symbol_end ( )
inline

Definition at line 778 of file MCAssembler.h.

Referenced by dump(), and symbols().

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

Definition at line 779 of file MCAssembler.h.

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

Definition at line 786 of file MCAssembler.h.

symbol_range llvm::MCAssembler::symbols ( )
inline
const_symbol_range llvm::MCAssembler::symbols ( ) const
inline

Definition at line 782 of file MCAssembler.h.

References llvm::make_range(), symbol_begin(), and symbol_end().

void MCAssembler::writeFragmentPadding ( const MCFragment F,
uint64_t  FSize,
MCObjectWriter OW 
) const

Write the necessary bundle padding to the given object writer.

Expects a fragment F containing instructions and its size FSize.

Definition at line 621 of file MCAssembler.cpp.

References llvm::MCFragment::alignToBundleEnd(), getBackend(), getBundleAlignSize(), llvm::MCFragment::getBundlePadding(), llvm::MCFragment::hasInstructions(), isBundlingEnabled(), and llvm::report_fatal_error().

Referenced by writeFragment().

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

Friends And Related Function Documentation

friend class MCAsmLayout
friend

Definition at line 532 of file MCAssembler.h.


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