LLVM API Documentation
#include <MCELFStreamer.h>
Public Member Functions | |
MCELFStreamer (MCContext &Context, MCTargetStreamer *TargetStreamer, MCAsmBackend &TAB, raw_ostream &OS, MCCodeEmitter *Emitter) | |
MCELFStreamer (MCContext &Context, MCTargetStreamer *TargetStreamer, MCAsmBackend &TAB, raw_ostream &OS, MCCodeEmitter *Emitter, MCAssembler *Assembler) | |
virtual | ~MCELFStreamer () |
![]() | |
virtual void | reset () |
state management More... | |
MCAssembler & | getAssembler () |
virtual void | EmitAssignment (MCSymbol *Symbol, const MCExpr *Value) |
virtual void | EmitULEB128Value (const MCExpr *Value) |
virtual void | EmitSLEB128Value (const MCExpr *Value) |
virtual void | EmitInstruction (const MCInst &Inst) |
virtual void | EmitBytes (StringRef Data) |
virtual void | EmitCodeAlignment (unsigned ByteAlignment, unsigned MaxBytesToEmit=0) |
virtual bool | EmitValueToOffset (const MCExpr *Offset, unsigned char Value) |
virtual void | EmitDwarfLocDirective (unsigned FileNo, unsigned Line, unsigned Column, unsigned Flags, unsigned Isa, unsigned Discriminator, StringRef FileName) |
EmitDwarfLocDirective - This implements the DWARF2. More... | |
virtual void | EmitDwarfAdvanceLineAddr (int64_t LineDelta, const MCSymbol *LastLabel, const MCSymbol *Label, unsigned PointerSize) |
virtual void | EmitDwarfAdvanceFrameAddr (const MCSymbol *LastLabel, const MCSymbol *Label) |
virtual void | EmitGPRel32Value (const MCExpr *Value) |
virtual void | EmitGPRel64Value (const MCExpr *Value) |
virtual void | EmitFill (uint64_t NumBytes, uint8_t FillValue) |
virtual void | EmitZeros (uint64_t NumBytes) |
Emit NumBytes worth of zeros. This function properly handles data in virtual sections. More... | |
![]() | |
virtual | ~MCStreamer () |
MCContext & | getContext () const |
MCTargetStreamer & | getTargetStreamer () |
unsigned | getNumFrameInfos () |
const MCDwarfFrameInfo & | getFrameInfo (unsigned i) |
ArrayRef< MCDwarfFrameInfo > | getFrameInfos () const |
unsigned | getNumW64UnwindInfos () |
MCWin64EHUnwindInfo & | getW64UnwindInfo (unsigned i) |
void | generateCompactUnwindEncodings (MCAsmBackend *MAB) |
virtual bool | EmitDwarfFileDirective (unsigned FileNo, StringRef Directory, StringRef Filename, unsigned CUID=0) |
void | EmitDwarfSetLineAddr (int64_t LineDelta, const MCSymbol *Label, int PointerSize) |
virtual void | EmitCompactUnwindEncoding (uint32_t CompactUnwindEncoding) |
virtual void | EmitCFISections (bool EH, bool Debug) |
void | EmitCFIStartProc () |
void | EmitCFIEndProc () |
virtual void | EmitCFIDefCfa (int64_t Register, int64_t Offset) |
virtual void | EmitCFIDefCfaOffset (int64_t Offset) |
virtual void | EmitCFIDefCfaRegister (int64_t Register) |
virtual void | EmitCFIOffset (int64_t Register, int64_t Offset) |
virtual void | EmitCFIPersonality (const MCSymbol *Sym, unsigned Encoding) |
virtual void | EmitCFILsda (const MCSymbol *Sym, unsigned Encoding) |
virtual void | EmitCFIRememberState () |
virtual void | EmitCFIRestoreState () |
virtual void | EmitCFISameValue (int64_t Register) |
virtual void | EmitCFIRestore (int64_t Register) |
virtual void | EmitCFIRelOffset (int64_t Register, int64_t Offset) |
virtual void | EmitCFIAdjustCfaOffset (int64_t Adjustment) |
virtual void | EmitCFIEscape (StringRef Values) |
virtual void | EmitCFISignalFrame () |
virtual void | EmitCFIUndefined (int64_t Register) |
virtual void | EmitCFIRegister (int64_t Register1, int64_t Register2) |
virtual void | EmitCFIWindowSave () |
virtual void | EmitWin64EHStartProc (const MCSymbol *Symbol) |
virtual void | EmitWin64EHEndProc () |
virtual void | EmitWin64EHStartChained () |
virtual void | EmitWin64EHEndChained () |
virtual void | EmitWin64EHHandler (const MCSymbol *Sym, bool Unwind, bool Except) |
virtual void | EmitWin64EHHandlerData () |
virtual void | EmitWin64EHPushReg (unsigned Register) |
virtual void | EmitWin64EHSetFrame (unsigned Register, unsigned Offset) |
virtual void | EmitWin64EHAllocStack (unsigned Size) |
virtual void | EmitWin64EHSaveReg (unsigned Register, unsigned Offset) |
virtual void | EmitWin64EHSaveXMM (unsigned Register, unsigned Offset) |
virtual void | EmitWin64EHPushFrame (bool Code) |
virtual void | EmitWin64EHEndProlog () |
void | EmitRawText (const Twine &String) |
void | Finish () |
Finish - Finish emission of machine code. More... | |
virtual bool | isVerboseAsm () const |
virtual bool | hasRawTextSupport () const |
virtual void | AddComment (const Twine &T) |
virtual raw_ostream & | GetCommentOS () |
virtual void | AddBlankLine () |
AddBlankLine - Emit a blank line to a .s file to pretty it up. More... | |
MCSectionSubPair | getCurrentSection () const |
MCSectionSubPair | getPreviousSection () const |
unsigned | GetSymbolOrder (const MCSymbol *Sym) const |
void | PushSection () |
bool | PopSection () |
bool | SubSection (const MCExpr *Subsection) |
void | SwitchSection (const MCSection *Section, const MCExpr *Subsection=0) |
void | SwitchSectionNoChange (const MCSection *Section, const MCExpr *Subsection=0) |
void | InitStreamer () |
Initialize the streamer. More... | |
void | setAutoInitSections (bool AutoInitSections) |
Tell this MCStreamer to call InitSections upon initialization. More... | |
void | AssignSection (MCSymbol *Symbol, const MCSection *Section) |
virtual void | EmitEHSymAttributes (const MCSymbol *Symbol, MCSymbol *EHSymbol) |
virtual void | EmitLinkerOptions (ArrayRef< std::string > Kind) |
virtual void | EmitDataRegion (MCDataRegionType Kind) |
EmitDataRegion - Note in the output the specified region Kind . More... | |
virtual void | EmitCOFFSecRel32 (MCSymbol const *Symbol) |
void | EmitValue (const MCExpr *Value, unsigned Size) |
virtual void | EmitIntValue (uint64_t Value, unsigned Size) |
void | EmitAbsValue (const MCExpr *Value, unsigned Size) |
void | EmitULEB128IntValue (uint64_t Value, unsigned Padding=0) |
void | EmitSLEB128IntValue (int64_t Value) |
void | EmitSymbolValue (const MCSymbol *Sym, unsigned Size) |
MCStreamer Interface | |
virtual void | InitSections () |
InitSections - Create the default sections and set the initial one. More... | |
virtual void | InitToTextSection () |
InitToTextSection - Create a text section and switch the streamer to it. More... | |
virtual void | ChangeSection (const MCSection *Section, const MCExpr *Subsection) |
virtual void | EmitLabel (MCSymbol *Symbol) |
virtual void | EmitDebugLabel (MCSymbol *Symbol) |
virtual void | EmitAssemblerFlag (MCAssemblerFlag Flag) |
EmitAssemblerFlag - Note in the output the specified Flag . More... | |
virtual void | EmitThumbFunc (MCSymbol *Func) |
virtual void | EmitWeakReference (MCSymbol *Alias, const MCSymbol *Symbol) |
virtual bool | EmitSymbolAttribute (MCSymbol *Symbol, MCSymbolAttr Attribute) |
EmitSymbolAttribute - Add the given Attribute to Symbol . More... | |
virtual void | EmitSymbolDesc (MCSymbol *Symbol, unsigned DescValue) |
virtual void | EmitCommonSymbol (MCSymbol *Symbol, uint64_t Size, unsigned ByteAlignment) |
virtual void | BeginCOFFSymbolDef (const MCSymbol *Symbol) |
virtual void | EmitCOFFSymbolStorageClass (int StorageClass) |
virtual void | EmitCOFFSymbolType (int Type) |
virtual void | EndCOFFSymbolDef () |
EndCOFFSymbolDef - Marks the end of the symbol definition. More... | |
virtual MCSymbolData & | getOrCreateSymbolData (MCSymbol *Symbol) |
getOrCreateSymbolData - Get symbol data for given symbol. More... | |
virtual void | EmitELFSize (MCSymbol *Symbol, const MCExpr *Value) |
virtual void | EmitLocalCommonSymbol (MCSymbol *Symbol, uint64_t Size, unsigned ByteAlignment) |
virtual void | EmitZerofill (const MCSection *Section, MCSymbol *Symbol=0, uint64_t Size=0, unsigned ByteAlignment=0) |
virtual void | EmitTBSSSymbol (const MCSection *Section, MCSymbol *Symbol, uint64_t Size, unsigned ByteAlignment=0) |
virtual void | EmitValueImpl (const MCExpr *Value, unsigned Size) |
virtual void | EmitFileDirective (StringRef Filename) |
virtual void | EmitIdent (StringRef IdentString) |
virtual void | EmitValueToAlignment (unsigned, int64_t, unsigned, unsigned) |
virtual void | Flush () |
Flush - Causes any cached state to be written out. More... | |
virtual void | FinishImpl () |
FinishImpl - Streamer specific finalization. More... | |
Definition at line 30 of file MCELFStreamer.h.
|
inline |
Definition at line 32 of file MCELFStreamer.h.
|
inline |
Definition at line 37 of file MCELFStreamer.h.
|
virtual |
Definition at line 66 of file MCELFStreamer.cpp.
|
virtual |
BeginCOFFSymbolDef - Start emitting COFF symbol definition
Symbol | - The symbol to have its External & Type fields set. |
Implements llvm::MCStreamer.
Definition at line 597 of file MCELFStreamer.cpp.
References llvm_unreachable.
ChangeSection - Update streamer for a new active section.
This is called by PopSection and SwitchSection, if the current section changes.
Reimplemented from llvm::MCObjectStreamer.
Definition at line 112 of file MCELFStreamer.cpp.
References llvm::MCObjectStreamer::ChangeSection(), llvm::MCObjectStreamer::getAssembler(), llvm::MCObjectStreamer::getCurrentSectionData(), llvm::MCAssembler::getOrCreateSymbolData(), llvm::MCSectionData::isBundleLocked(), llvm::report_fatal_error(), and llvm::ARMBuildAttrs::Section.
|
virtual |
EmitAssemblerFlag - Note in the output the specified Flag
.
Implements llvm::MCStreamer.
Definition at line 98 of file MCELFStreamer.cpp.
References llvm::MCObjectStreamer::getAssembler(), llvm_unreachable, llvm::MCAF_Code16, llvm::MCAF_Code32, llvm::MCAF_Code64, llvm::MCAF_SubsectionsViaSymbols, llvm::MCAF_SyntaxUnified, and llvm::MCAssembler::setSubsectionsViaSymbols().
|
virtual |
EmitCOFFSymbolStorageClass - Emit the storage class of the symbol.
StorageClass | - The storage class the symbol should have. |
Implements llvm::MCStreamer.
Definition at line 601 of file MCELFStreamer.cpp.
References llvm_unreachable.
|
virtual |
EmitCOFFSymbolType - Emit the type of the symbol.
Implements llvm::MCStreamer.
Definition at line 605 of file MCELFStreamer.cpp.
References llvm_unreachable.
|
virtual |
EmitCommonSymbol - Emit a common symbol.
Symbol | - The common symbol to emit. |
Size | - The size of the common symbol. |
ByteAlignment | - The alignment of the symbol if non-zero. This must be a power of 2. |
Implements llvm::MCStreamer.
Definition at line 258 of file MCELFStreamer.cpp.
References llvm::MCStreamer::AssignSection(), llvm::MCConstantExpr::Create(), llvm::ELF_STB_Local, llvm::MCObjectStreamer::getAssembler(), llvm::MCELF::GetBinding(), llvm::SectionKind::getBSS(), llvm::MCStreamer::getContext(), llvm::MCAssembler::getContext(), llvm::MCContext::getELFSection(), llvm::MCAssembler::getOrCreateSymbolData(), llvm::MCELF::SetBinding(), llvm::MCSymbolData::setCommon(), llvm::MCSymbolData::setExternal(), llvm::MCSymbolData::setSize(), llvm::MCELF::SetType(), llvm::ELF::STB_GLOBAL, and llvm::ELF::STT_OBJECT.
Referenced by EmitLocalCommonSymbol().
|
virtual |
Reimplemented from llvm::MCObjectStreamer.
Definition at line 94 of file MCELFStreamer.cpp.
References EmitLabel().
EmitELFSize - Emit an ELF .size directive.
This corresponds to an assembler statement such as: .size symbol, expression
Implements llvm::MCStreamer.
Definition at line 287 of file MCELFStreamer.cpp.
References llvm::MCObjectStreamer::getAssembler(), llvm::MCAssembler::getOrCreateSymbolData(), and llvm::MCSymbolData::setSize().
|
virtual |
EmitFileDirective - Switch to a new logical file. This is used to implement the '.file "foo.c"' assembler directive.
Implements llvm::MCStreamer.
Definition at line 322 of file MCELFStreamer.cpp.
References llvm::MCAssembler::addFileName(), and llvm::MCObjectStreamer::getAssembler().
|
virtual |
Emit the "identifiers" directive. This implements the '.ident "version foo"' assembler directive.
Reimplemented from llvm::MCStreamer.
Definition at line 326 of file MCELFStreamer.cpp.
References llvm::MCObjectStreamer::EmitBytes(), llvm::MCStreamer::EmitIntValue(), llvm::MCObjectStreamer::getAssembler(), llvm::MCAssembler::getContext(), llvm::MCContext::getELFSection(), llvm::SectionKind::getReadOnly(), llvm::MCStreamer::PopSection(), llvm::MCStreamer::PushSection(), and llvm::MCStreamer::SwitchSection().
|
virtual |
EmitLabel - Emit a label for Symbol
into the current section.
This corresponds to an assembler statement such as: foo:
Symbol | - The symbol to emit. A given symbol should only be emitted as a label once, and symbols emitted as a label should never be used in an assignment. |
Reimplemented from llvm::MCObjectStreamer.
Definition at line 82 of file MCELFStreamer.cpp.
References llvm::MCObjectStreamer::EmitLabel(), llvm::MCObjectStreamer::getAssembler(), llvm::MCSectionELF::getFlags(), llvm::MCSymbol::getSection(), llvm::MCAssembler::getSymbolData(), llvm::MCSymbol::isUndefined(), llvm::MCELF::SetType(), and llvm::ELF::STT_TLS.
Referenced by EmitDebugLabel().
|
virtual |
EmitLocalCommonSymbol - Emit a local common (.lcomm) symbol.
Symbol | - The common symbol to emit. |
Size | - The size of the common symbol. |
ByteAlignment | - The alignment of the common symbol in bytes. |
Implements llvm::MCStreamer.
Definition at line 292 of file MCELFStreamer.cpp.
References EmitCommonSymbol(), llvm::MCObjectStreamer::getAssembler(), llvm::MCAssembler::getOrCreateSymbolData(), llvm::MCELF::SetBinding(), llvm::MCSymbolData::setExternal(), and llvm::ELF::STB_LOCAL.
|
virtual |
EmitSymbolAttribute - Add the given Attribute
to Symbol
.
Implements llvm::MCStreamer.
Definition at line 151 of file MCELFStreamer.cpp.
References CombineSymbolTypes(), llvm::MCObjectStreamer::getAssembler(), llvm::MCObjectStreamer::getCurrentSectionData(), llvm::MCAssembler::getIndirectSymbols(), llvm::MCAssembler::getOrCreateSymbolData(), llvm::MCELF::GetType(), llvm::MCSA_ELF_TypeCommon, llvm::MCSA_ELF_TypeFunction, llvm::MCSA_ELF_TypeGnuUniqueObject, llvm::MCSA_ELF_TypeIndFunction, llvm::MCSA_ELF_TypeNoType, llvm::MCSA_ELF_TypeObject, llvm::MCSA_ELF_TypeTLS, llvm::MCSA_Global, llvm::MCSA_Hidden, llvm::MCSA_IndirectSymbol, llvm::MCSA_Internal, llvm::MCSA_Invalid, llvm::MCSA_LazyReference, llvm::MCSA_Local, llvm::MCSA_NoDeadStrip, llvm::MCSA_PrivateExtern, llvm::MCSA_Protected, llvm::MCSA_Reference, llvm::MCSA_SymbolResolver, llvm::MCSA_Weak, llvm::MCSA_WeakDefAutoPrivate, llvm::MCSA_WeakDefinition, llvm::MCSA_WeakReference, llvm::IndirectSymbolData::SectionData, llvm::MCELF::SetBinding(), llvm::MCSymbolData::setExternal(), llvm::MCELF::SetType(), llvm::MCELF::SetVisibility(), llvm::ELF::STB_GLOBAL, llvm::ELF::STB_LOCAL, llvm::ELF::STB_WEAK, llvm::ELF::STT_FUNC, llvm::ELF::STT_GNU_IFUNC, llvm::ELF::STT_NOTYPE, llvm::ELF::STT_OBJECT, llvm::ELF::STT_TLS, llvm::ELF::STV_HIDDEN, llvm::ELF::STV_INTERNAL, llvm::ELF::STV_PROTECTED, llvm::ARMBuildAttrs::Symbol, and llvm::IndirectSymbolData::Symbol.
EmitSymbolDesc - Set the DescValue
for the Symbol
.
Symbol | - The symbol to have its n_desc field set. |
DescValue | - The value to set into the n_desc field. |
Implements llvm::MCStreamer.
Definition at line 593 of file MCELFStreamer.cpp.
References llvm_unreachable.
|
virtual |
EmitTBSSSymbol - Emit a thread local bss (.tbss) symbol.
Section | - The thread local common section. |
Symbol | - The thread local common symbol to emit. |
Size | - The size of the symbol. |
ByteAlignment | - The alignment of the thread local common symbol if non-zero. This must be a power of 2 on some targets. |
Implements llvm::MCStreamer.
Definition at line 618 of file MCELFStreamer.cpp.
References llvm_unreachable.
|
virtual |
EmitThumbFunc - Note in the output that the specified Func
is a Thumb mode function (ARM target only).
Implements llvm::MCStreamer.
Definition at line 585 of file MCELFStreamer.cpp.
References llvm_unreachable.
EmitValue - Emit the expression Value
into the output as a native integer of the given Size
bytes.
This is used to implement assembler directives such as .word, .quad, etc.
Value | - The value to emit. |
Size | - The size of the integer (in bytes) to emit. This must match a native machine width. |
Reimplemented from llvm::MCObjectStreamer.
Definition at line 302 of file MCELFStreamer.cpp.
References llvm::MCObjectStreamer::EmitValueImpl(), llvm::MCObjectStreamer::getCurrentSectionData(), and llvm::report_fatal_error().
|
virtual |
EmitValueToAlignment - Emit some number of copies of Value
until the byte alignment ByteAlignment
is reached.
If the number of bytes need to emit for the alignment is not a multiple of ValueSize
, then the contents of the emitted fill bytes is undefined.
This used to implement the .align assembler directive.
ByteAlignment | - The alignment to reach. This must be a power of two on some targets. |
Value | - The value to use when filling bytes. |
ValueSize | - The size of the integer (in bytes) to emit for Value . This must match a native machine width. |
MaxBytesToEmit | - The maximum numbers of bytes to emit, or 0. If the alignment cannot be reached in this many bytes, no bytes are emitted. |
Reimplemented from llvm::MCObjectStreamer.
Definition at line 309 of file MCELFStreamer.cpp.
References llvm::MCObjectStreamer::EmitValueToAlignment(), llvm::MCObjectStreamer::getCurrentSectionData(), and llvm::report_fatal_error().
EmitWeakReference - Emit an weak reference from Alias
to Symbol
.
This corresponds to an assembler statement such as: .weakref alias, symbol
Alias | - The alias that is being created. |
Symbol | - The symbol being aliased. |
Reimplemented from llvm::MCObjectStreamer.
Definition at line 123 of file MCELFStreamer.cpp.
References llvm::MCSymbolRefExpr::Create(), llvm::ELF_Other_Weakref, llvm::MCObjectStreamer::getAssembler(), llvm::MCStreamer::getContext(), llvm::MCSymbolData::getFlags(), llvm::MCAssembler::getOrCreateSymbolData(), llvm::MCSymbolData::setFlags(), and llvm::MCSymbol::setVariableValue().
|
virtual |
EmitZerofill - Emit the zerofill section and an optional symbol.
Section | - The zerofill section to create and or to put the symbol |
Symbol | - The zerofill symbol to emit, if non-NULL. |
Size | - The size of the zerofill symbol. |
ByteAlignment | - The alignment of the zerofill symbol if non-zero. This must be a power of 2 on some targets. |
Implements llvm::MCStreamer.
Definition at line 613 of file MCELFStreamer.cpp.
References llvm_unreachable.
|
virtual |
EndCOFFSymbolDef - Marks the end of the symbol definition.
Implements llvm::MCStreamer.
Definition at line 609 of file MCELFStreamer.cpp.
References llvm_unreachable.
|
virtual |
FinishImpl - Streamer specific finalization.
Reimplemented from llvm::MCObjectStreamer.
Definition at line 564 of file MCELFStreamer.cpp.
References llvm::MCStreamer::EmitFrames(), llvm::MCObjectStreamer::FinishImpl(), and Flush().
|
virtual |
Flush - Causes any cached state to be written out.
Reimplemented from llvm::MCStreamer.
Definition at line 540 of file MCELFStreamer.cpp.
References llvm::LCOMM::ByteAlignment, llvm::MCSectionData::getAlignment(), llvm::MCObjectStreamer::getAssembler(), llvm::MCAssembler::getOrCreateSectionData(), llvm::MCSymbol::getSection(), llvm::MCSymbolData::getSymbol(), llvm::MCSectionData::setAlignment(), llvm::MCSymbolData::setFragment(), and llvm::ARMBuildAttrs::Symbol.
Referenced by FinishImpl().
|
virtual |
getOrCreateSymbolData - Get symbol data for given symbol.
Reimplemented from llvm::MCStreamer.
Definition at line 589 of file MCELFStreamer.cpp.
References llvm::MCObjectStreamer::getAssembler(), and llvm::MCAssembler::getOrCreateSymbolData().
Referenced by llvm::MipsTargetELFStreamer::emitMipsHackSTOCG().
|
virtual |
InitSections - Create the default sections and set the initial one.
Implements llvm::MCStreamer.
Definition at line 73 of file MCELFStreamer.cpp.
|
virtual |
InitToTextSection - Create a text section and switch the streamer to it.
Implements llvm::MCStreamer.
Definition at line 69 of file MCELFStreamer.cpp.