LLVM
15.0.0git
|
#include "llvm/MC/MCELFStreamer.h"
Classes | |
struct | AttributeItem |
ELF object attributes section emission support. More... | |
Public Member Functions | |
MCELFStreamer (MCContext &Context, std::unique_ptr< MCAsmBackend > TAB, std::unique_ptr< MCObjectWriter > OW, std::unique_ptr< MCCodeEmitter > Emitter) | |
~MCELFStreamer () override=default | |
void | reset () override |
state management More... | |
![]() | |
void | reset () override |
state management More... | |
bool | isIntegratedAssemblerRequired () const override |
Object streamers require the integrated assembler. More... | |
void | emitFrames (MCAsmBackend *MAB) |
void | emitCFISections (bool EH, bool Debug) override |
MCFragment * | getCurrentFragment () const |
void | insert (MCFragment *F) |
MCDataFragment * | getOrCreateDataFragment (const MCSubtargetInfo *STI=nullptr) |
Get a data fragment to write into, creating a new one if the current fragment is not a data fragment. More... | |
void | visitUsedSymbol (const MCSymbol &Sym) override |
void | flushPendingLabels () |
Create a data fragment for any pending labels across all Sections and Subsections. More... | |
MCAssembler & | getAssembler () |
MCAssembler * | getAssemblerPtr () override |
void | emitLabel (MCSymbol *Symbol, SMLoc Loc=SMLoc()) override |
Emit a label for Symbol into the current section. More... | |
void | emitAssignment (MCSymbol *Symbol, const MCExpr *Value) override |
Emit an assignment of Value to Symbol . More... | |
void | emitConditionalAssignment (MCSymbol *Symbol, const MCExpr *Value) override |
Emit an assignment of Value to Symbol , but only if Value is also emitted. More... | |
void | emitValueImpl (const MCExpr *Value, unsigned Size, SMLoc Loc=SMLoc()) override |
Emit the expression Value into the output as a native integer of the given Size bytes. More... | |
void | emitULEB128Value (const MCExpr *Value) override |
void | emitSLEB128Value (const MCExpr *Value) override |
void | emitWeakReference (MCSymbol *Alias, const MCSymbol *Symbol) override |
Emit an weak reference from Alias to Symbol . More... | |
void | changeSection (MCSection *Section, const MCExpr *Subsection) override |
Update streamer for a new active section. More... | |
void | emitInstruction (const MCInst &Inst, const MCSubtargetInfo &STI) override |
Emit the given Instruction into the current section. More... | |
void | emitBundleAlignMode (unsigned AlignPow2) override |
Set the bundle alignment mode from now on in the section. More... | |
void | emitBundleLock (bool AlignToEnd) override |
The following instructions are a bundle-locked group. More... | |
void | emitBundleUnlock () override |
Ends a bundle-locked group. More... | |
void | emitBytes (StringRef Data) override |
Emit the bytes in Data into the output. More... | |
void | emitValueToAlignment (unsigned ByteAlignment, int64_t Value=0, unsigned ValueSize=1, unsigned MaxBytesToEmit=0) override |
Emit some number of copies of Value until the byte alignment ByteAlignment is reached. More... | |
void | emitCodeAlignment (unsigned ByteAlignment, const MCSubtargetInfo *STI, unsigned MaxBytesToEmit=0) override |
Emit nops until the byte alignment ByteAlignment is reached. More... | |
void | emitValueToOffset (const MCExpr *Offset, unsigned char Value, SMLoc Loc) override |
Emit some number of copies of Value until the byte offset Offset is reached. More... | |
void | emitDwarfLocDirective (unsigned FileNo, unsigned Line, unsigned Column, unsigned Flags, unsigned Isa, unsigned Discriminator, StringRef FileName) override |
This implements the DWARF2 '.loc fileno lineno ...' assembler directive. More... | |
void | emitDwarfAdvanceLineAddr (int64_t LineDelta, const MCSymbol *LastLabel, const MCSymbol *Label, unsigned PointerSize) override |
If targets does not support representing debug line section by .loc/.file directives in assembly output, we need to populate debug line section with raw debug line contents. More... | |
void | emitDwarfLineEndEntry (MCSection *Section, MCSymbol *LastLabel) override |
Emit the debug line end entry. More... | |
void | emitDwarfAdvanceFrameAddr (const MCSymbol *LastLabel, const MCSymbol *Label) |
void | emitCVLocDirective (unsigned FunctionId, unsigned FileNo, unsigned Line, unsigned Column, bool PrologueEnd, bool IsStmt, StringRef FileName, SMLoc Loc) override |
This implements the CodeView '.cv_loc' assembler directive. More... | |
void | emitCVLinetableDirective (unsigned FunctionId, const MCSymbol *Begin, const MCSymbol *End) override |
This implements the CodeView '.cv_linetable' assembler directive. More... | |
void | emitCVInlineLinetableDirective (unsigned PrimaryFunctionId, unsigned SourceFileId, unsigned SourceLineNum, const MCSymbol *FnStartSym, const MCSymbol *FnEndSym) override |
This implements the CodeView '.cv_inline_linetable' assembler directive. More... | |
void | emitCVDefRangeDirective (ArrayRef< std::pair< const MCSymbol *, const MCSymbol * >> Ranges, StringRef FixedSizePortion) override |
This implements the CodeView '.cv_def_range' assembler directive. More... | |
void | emitCVStringTableDirective () override |
This implements the CodeView '.cv_stringtable' assembler directive. More... | |
void | emitCVFileChecksumsDirective () override |
This implements the CodeView '.cv_filechecksums' assembler directive. More... | |
void | emitCVFileChecksumOffsetDirective (unsigned FileNo) override |
This implements the CodeView '.cv_filechecksumoffset' assembler directive. More... | |
void | emitDTPRel32Value (const MCExpr *Value) override |
Emit the expression Value into the output as a dtprel (32-bit DTP relative) value. More... | |
void | emitDTPRel64Value (const MCExpr *Value) override |
Emit the expression Value into the output as a dtprel (64-bit DTP relative) value. More... | |
void | emitTPRel32Value (const MCExpr *Value) override |
Emit the expression Value into the output as a tprel (32-bit TP relative) value. More... | |
void | emitTPRel64Value (const MCExpr *Value) override |
Emit the expression Value into the output as a tprel (64-bit TP relative) value. More... | |
void | emitGPRel32Value (const MCExpr *Value) override |
Emit the expression Value into the output as a gprel32 (32-bit GP relative) value. More... | |
void | emitGPRel64Value (const MCExpr *Value) override |
Emit the expression Value into the output as a gprel64 (64-bit GP relative) value. More... | |
Optional< std::pair< bool, std::string > > | emitRelocDirective (const MCExpr &Offset, StringRef Name, const MCExpr *Expr, SMLoc Loc, const MCSubtargetInfo &STI) override |
Record a relocation described by the .reloc directive. More... | |
void | emitFill (const MCExpr &NumBytes, uint64_t FillValue, SMLoc Loc=SMLoc()) override |
Emit Size bytes worth of the value specified by FillValue . More... | |
void | emitFill (const MCExpr &NumValues, int64_t Size, int64_t Expr, SMLoc Loc=SMLoc()) override |
Emit NumValues copies of Size bytes. More... | |
void | emitNops (int64_t NumBytes, int64_t ControlledNopLength, SMLoc Loc, const MCSubtargetInfo &STI) override |
void | emitFileDirective (StringRef Filename) override |
Switch to a new logical file. More... | |
void | emitFileDirective (StringRef Filename, StringRef CompilerVerion, StringRef TimeStamp, StringRef Description) override |
Emit ".file assembler diretive with additioal info. More... | |
void | emitAddrsig () override |
void | emitAddrsigSym (const MCSymbol *Sym) override |
void | finishImpl () override |
Streamer specific finalization. More... | |
void | emitAbsoluteSymbolDiff (const MCSymbol *Hi, const MCSymbol *Lo, unsigned Size) override |
Emit the absolute difference between two symbols if possible. More... | |
void | emitAbsoluteSymbolDiffAsULEB128 (const MCSymbol *Hi, const MCSymbol *Lo) override |
Emit the absolute difference between two symbols encoded with ULEB128. More... | |
bool | mayHaveInstructions (MCSection &Sec) const override |
void | emitPendingAssignments (MCSymbol *Symbol) |
Emits pending conditional assignments that depend on Symbol being emitted. More... | |
void | emitFill (uint64_t NumBytes, uint8_t FillValue) |
Emit NumBytes bytes worth of the value specified by FillValue. More... | |
virtual void | emitFill (const MCExpr &NumBytes, uint64_t FillValue, SMLoc Loc=SMLoc()) |
Emit Size bytes worth of the value specified by FillValue . More... | |
virtual void | emitFill (const MCExpr &NumValues, int64_t Size, int64_t Expr, SMLoc Loc=SMLoc()) |
Emit NumValues copies of Size bytes. More... | |
![]() | |
MCStreamer (const MCStreamer &)=delete | |
MCStreamer & | operator= (const MCStreamer &)=delete |
virtual | ~MCStreamer () |
void | visitUsedExpr (const MCExpr &Expr) |
void | setTargetStreamer (MCTargetStreamer *TS) |
void | setStartTokLocPtr (const SMLoc *Loc) |
SMLoc | getStartTokLoc () const |
MCContext & | getContext () const |
void | setUseAssemblerInfoForParsing (bool v) |
bool | getUseAssemblerInfoForParsing () |
MCTargetStreamer * | getTargetStreamer () |
void | setAllowAutoPadding (bool v) |
bool | getAllowAutoPadding () const |
WinEH::FrameInfo * | EnsureValidWinFrameInfo (SMLoc Loc) |
Retrieve the current frame info if one is available and it is not yet closed. More... | |
unsigned | getNumFrameInfos () |
ArrayRef< MCDwarfFrameInfo > | getDwarfFrameInfos () const |
bool | hasUnfinishedDwarfFrameInfo () |
unsigned | getNumWinFrameInfos () |
ArrayRef< std::unique_ptr< WinEH::FrameInfo > > | getWinFrameInfos () const |
void | generateCompactUnwindEncodings (MCAsmBackend *MAB) |
unsigned | emitDwarfFileDirective (unsigned FileNo, StringRef Directory, StringRef Filename, Optional< MD5::MD5Result > Checksum=None, Optional< StringRef > Source=None, unsigned CUID=0) |
Associate a filename with a specified logical file number. More... | |
virtual Expected< unsigned > | tryEmitDwarfFileDirective (unsigned FileNo, StringRef Directory, StringRef Filename, Optional< MD5::MD5Result > Checksum=None, Optional< StringRef > Source=None, unsigned CUID=0) |
Associate a filename with a specified logical file number. More... | |
virtual void | emitDwarfFile0Directive (StringRef Directory, StringRef Filename, Optional< MD5::MD5Result > Checksum, Optional< StringRef > Source, unsigned CUID=0) |
Specify the "root" file of the compilation, using the ".file 0" extension. More... | |
virtual void | emitCFIBKeyFrame () |
virtual void | emitCFIMTETaggedFrame () |
virtual bool | emitCVFileDirective (unsigned FileNo, StringRef Filename, ArrayRef< uint8_t > Checksum, unsigned ChecksumKind) |
Associate a filename with a specified logical file number, and also specify that file's checksum information. More... | |
virtual bool | emitCVFuncIdDirective (unsigned FunctionId) |
Introduces a function id for use with .cv_loc. More... | |
virtual bool | emitCVInlineSiteIdDirective (unsigned FunctionId, unsigned IAFunc, unsigned IAFile, unsigned IALine, unsigned IACol, SMLoc Loc) |
Introduces an inline call site id for use with .cv_loc. More... | |
virtual void | emitCVDefRangeDirective (ArrayRef< std::pair< const MCSymbol *, const MCSymbol * >> Ranges, codeview::DefRangeRegisterRelHeader DRHdr) |
virtual void | emitCVDefRangeDirective (ArrayRef< std::pair< const MCSymbol *, const MCSymbol * >> Ranges, codeview::DefRangeSubfieldRegisterHeader DRHdr) |
virtual void | emitCVDefRangeDirective (ArrayRef< std::pair< const MCSymbol *, const MCSymbol * >> Ranges, codeview::DefRangeRegisterHeader DRHdr) |
virtual void | emitCVDefRangeDirective (ArrayRef< std::pair< const MCSymbol *, const MCSymbol * >> Ranges, codeview::DefRangeFramePointerRelHeader DRHdr) |
virtual void | emitCVFPOData (const MCSymbol *ProcSym, SMLoc Loc={}) |
This implements the CodeView '.cv_fpo_data' assembler directive. More... | |
virtual MCSymbol * | getDwarfLineTableSymbol (unsigned CUID) |
void | emitCFIStartProc (bool IsSimple, SMLoc Loc=SMLoc()) |
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 | emitCFILLVMDefAspaceCfa (int64_t Register, int64_t Offset, int64_t AddressSpace) |
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 | emitCFIReturnColumn (int64_t Register) |
virtual void | emitCFIGnuArgsSize (int64_t Size) |
virtual void | emitCFISignalFrame () |
virtual void | emitCFIUndefined (int64_t Register) |
virtual void | emitCFIRegister (int64_t Register1, int64_t Register2) |
virtual void | emitCFIWindowSave () |
virtual void | emitCFINegateRAState () |
virtual void | emitWinCFIStartProc (const MCSymbol *Symbol, SMLoc Loc=SMLoc()) |
virtual void | emitWinCFIEndProc (SMLoc Loc=SMLoc()) |
virtual void | emitWinCFIFuncletOrFuncEnd (SMLoc Loc=SMLoc()) |
This is used on platforms, such as Windows on ARM64, that require function or funclet sizes to be emitted in .xdata before the End marker is emitted for the frame. More... | |
virtual void | emitWinCFIStartChained (SMLoc Loc=SMLoc()) |
virtual void | emitWinCFIEndChained (SMLoc Loc=SMLoc()) |
virtual void | emitWinCFIPushReg (MCRegister Register, SMLoc Loc=SMLoc()) |
virtual void | emitWinCFISetFrame (MCRegister Register, unsigned Offset, SMLoc Loc=SMLoc()) |
virtual void | emitWinCFIAllocStack (unsigned Size, SMLoc Loc=SMLoc()) |
virtual void | emitWinCFISaveReg (MCRegister Register, unsigned Offset, SMLoc Loc=SMLoc()) |
virtual void | emitWinCFISaveXMM (MCRegister Register, unsigned Offset, SMLoc Loc=SMLoc()) |
virtual void | emitWinCFIPushFrame (bool Code, SMLoc Loc=SMLoc()) |
virtual void | emitWinCFIEndProlog (SMLoc Loc=SMLoc()) |
virtual void | emitWinEHHandler (const MCSymbol *Sym, bool Unwind, bool Except, SMLoc Loc=SMLoc()) |
virtual void | emitWinEHHandlerData (SMLoc Loc=SMLoc()) |
MCSection * | getAssociatedPDataSection (const MCSection *TextSec) |
Get the .pdata section used for the given section. More... | |
MCSection * | getAssociatedXDataSection (const MCSection *TextSec) |
Get the .xdata section used for the given section. More... | |
virtual void | emitSyntaxDirective () |
virtual void | emitPseudoProbe (uint64_t Guid, uint64_t Index, uint64_t Type, uint64_t Attr, const MCPseudoProbeInlineStack &InlineStack) |
Emit the a pseudo probe into the current section. More... | |
void | emitRawText (const Twine &String) |
If this file is backed by a assembly streamer, this dumps the specified string in the output .s file. More... | |
void | finish (SMLoc EndLoc=SMLoc()) |
Finish emission of machine code. More... | |
void | maybeEmitDwarf64Mark () |
Emit a special value of 0xffffffff if producing 64-bit debugging info. More... | |
virtual void | emitDwarfUnitLength (uint64_t Length, const Twine &Comment) |
Emit a unit length field. More... | |
virtual MCSymbol * | emitDwarfUnitLength (const Twine &Prefix, const Twine &Comment) |
Emit a unit length field. More... | |
virtual void | emitDwarfLineStartLabel (MCSymbol *StartSym) |
Emit the debug line start label. More... | |
virtual void | doFinalizationAtSectionEnd (MCSection *Section) |
Do finalization for the streamer at the end of a section. More... | |
virtual bool | isVerboseAsm () const |
Return true if this streamer supports verbose assembly and if it is enabled. More... | |
virtual bool | hasRawTextSupport () const |
Return true if this asm streamer supports emitting unformatted text to the .s file with EmitRawText. More... | |
virtual void | AddComment (const Twine &T, bool EOL=true) |
Add a textual comment. More... | |
virtual raw_ostream & | getCommentOS () |
Return a raw_ostream that comments can be written to. More... | |
virtual void | emitRawComment (const Twine &T, bool TabPrefix=true) |
Print T and prefix it with the comment string (normally #) and optionally a tab. More... | |
virtual void | addExplicitComment (const Twine &T) |
Add explicit comment T. More... | |
virtual void | emitExplicitComments () |
Emit added explicit comments. More... | |
virtual void | addBlankLine () |
Emit a blank line to a .s file to pretty it up. More... | |
MCSectionSubPair | getCurrentSection () const |
Return the current section that the streamer is emitting code to. More... | |
MCSection * | getCurrentSectionOnly () const |
MCSectionSubPair | getPreviousSection () const |
Return the previous section that the streamer is emitting code to. More... | |
unsigned | getSymbolOrder (const MCSymbol *Sym) const |
Returns an index to represent the order a symbol was emitted in. More... | |
void | pushSection () |
Save the current and previous section on the section stack. More... | |
bool | popSection () |
Restore the current and previous section from the section stack. More... | |
bool | subSection (const MCExpr *Subsection) |
virtual void | switchSection (MCSection *Section, const MCExpr *Subsection=nullptr) |
Set the current section where code is being emitted to Section . More... | |
void | switchSectionNoChange (MCSection *Section, const MCExpr *Subsection=nullptr) |
Set the current section where code is being emitted to Section . More... | |
MCSymbol * | endSection (MCSection *Section) |
void | assignFragment (MCSymbol *Symbol, MCFragment *Fragment) |
Sets the symbol's section. More... | |
virtual StringRef | getMnemonic (MCInst &MI) |
Returns the mnemonic for MI , if the streamer has access to a instruction printer and returns an empty string otherwise. More... | |
virtual void | emitEHSymAttributes (const MCSymbol *Symbol, MCSymbol *EHSymbol) |
virtual void | emitLinkerOptions (ArrayRef< std::string > Kind) |
Emit the given list Options of strings as linker options into the output. More... | |
virtual void | emitDataRegion (MCDataRegionType Kind) |
Note in the output the specified region Kind . More... | |
virtual void | emitVersionMin (MCVersionMinType Type, unsigned Major, unsigned Minor, unsigned Update, VersionTuple SDKVersion) |
Specify the Mach-O minimum deployment target version. More... | |
virtual void | emitBuildVersion (unsigned Platform, unsigned Major, unsigned Minor, unsigned Update, VersionTuple SDKVersion) |
Emit/Specify Mach-O build version command. More... | |
virtual void | emitDarwinTargetVariantBuildVersion (unsigned Platform, unsigned Major, unsigned Minor, unsigned Update, VersionTuple SDKVersion) |
void | emitVersionForTarget (const Triple &Target, const VersionTuple &SDKVersion, const Triple *DarwinTargetVariantTriple, const VersionTuple &DarwinTargetVariantSDKVersion) |
virtual void | beginCOFFSymbolDef (const MCSymbol *Symbol) |
Start emitting COFF symbol definition. More... | |
virtual void | emitCOFFSymbolStorageClass (int StorageClass) |
Emit the storage class of the symbol. More... | |
virtual void | emitCOFFSymbolType (int Type) |
Emit the type of the symbol. More... | |
virtual void | endCOFFSymbolDef () |
Marks the end of the symbol definition. More... | |
virtual void | emitCOFFSafeSEH (MCSymbol const *Symbol) |
virtual void | emitCOFFSymbolIndex (MCSymbol const *Symbol) |
Emits the symbol table index of a Symbol into the current section. More... | |
virtual void | emitCOFFSectionIndex (MCSymbol const *Symbol) |
Emits a COFF section index. More... | |
virtual void | emitCOFFSecRel32 (MCSymbol const *Symbol, uint64_t Offset) |
Emits a COFF section relative relocation. More... | |
virtual void | emitCOFFImgRel32 (MCSymbol const *Symbol, int64_t Offset) |
Emits a COFF image relative relocation. More... | |
virtual void | emitXCOFFLocalCommonSymbol (MCSymbol *LabelSym, uint64_t Size, MCSymbol *CsectSym, unsigned ByteAlignment) |
Emits an lcomm directive with XCOFF csect information. More... | |
virtual void | emitXCOFFSymbolLinkageWithVisibility (MCSymbol *Symbol, MCSymbolAttr Linkage, MCSymbolAttr Visibility) |
Emit a symbol's linkage and visibility with a linkage directive for XCOFF. More... | |
virtual void | emitXCOFFRenameDirective (const MCSymbol *Name, StringRef Rename) |
Emit a XCOFF .rename directive which creates a synonym for an illegal or undesirable name. More... | |
virtual void | emitXCOFFRefDirective (StringRef Sym) |
Emit a XCOFF .ref directive which creates R_REF type entry in the relocation table for one or more symbols. More... | |
virtual void | emitLOHDirective (MCLOHType Kind, const MCLOHArgs &Args) |
Emit a Linker Optimization Hint (LOH) directive. More... | |
virtual void | emitBinaryData (StringRef Data) |
Functionally identical to EmitBytes. More... | |
void | emitValue (const MCExpr *Value, unsigned Size, SMLoc Loc=SMLoc()) |
virtual void | emitIntValue (uint64_t Value, unsigned Size) |
Special case of EmitValue that avoids the client having to pass in a MCExpr for constant integers. More... | |
virtual void | emitIntValue (APInt Value) |
virtual void | emitIntValueInHex (uint64_t Value, unsigned Size) |
Special case of EmitValue that avoids the client having to pass in a MCExpr for constant integers & prints in Hex format for certain modes. More... | |
void | emitInt8 (uint64_t Value) |
void | emitInt16 (uint64_t Value) |
void | emitInt32 (uint64_t Value) |
void | emitInt64 (uint64_t Value) |
virtual void | emitIntValueInHexWithPadding (uint64_t Value, unsigned Size) |
Special case of EmitValue that avoids the client having to pass in a MCExpr for constant integers & prints in Hex format for certain modes, pads the field with leading zeros to Size width. More... | |
void | emitULEB128IntValue (uint64_t Value, unsigned PadTo=0) |
Special case of EmitULEB128Value that avoids the client having to pass in a MCExpr for constant integers. More... | |
void | emitSLEB128IntValue (int64_t Value) |
Special case of EmitSLEB128Value that avoids the client having to pass in a MCExpr for constant integers. More... | |
void | emitSymbolValue (const MCSymbol *Sym, unsigned Size, bool IsSectionRelative=false) |
Special case of EmitValue that avoids the client having to pass in a MCExpr for MCSymbols. More... | |
void | emitFill (uint64_t NumBytes, uint8_t FillValue) |
Emit NumBytes bytes worth of the value specified by FillValue. More... | |
void | emitZeros (uint64_t NumBytes) |
Emit NumBytes worth of zeros. More... | |
MCStreamer Interface | |
SmallVector< AttributeItem, 64 > | Contents |
void | initSections (bool NoExecStack, const MCSubtargetInfo &STI) override |
Create the default sections and set the initial one. More... | |
void | changeSection (MCSection *Section, const MCExpr *Subsection) override |
Update streamer for a new active section. More... | |
void | emitLabel (MCSymbol *Symbol, SMLoc Loc=SMLoc()) override |
Emit a label for Symbol into the current section. More... | |
void | emitLabelAtPos (MCSymbol *Symbol, SMLoc Loc, MCFragment *F, uint64_t Offset) override |
void | emitAssemblerFlag (MCAssemblerFlag Flag) override |
Note in the output the specified Flag . More... | |
void | emitThumbFunc (MCSymbol *Func) override |
Note in the output that the specified Func is a Thumb mode function (ARM target only). More... | |
void | emitWeakReference (MCSymbol *Alias, const MCSymbol *Symbol) override |
Emit an weak reference from Alias to Symbol . More... | |
bool | emitSymbolAttribute (MCSymbol *Symbol, MCSymbolAttr Attribute) override |
Add the given Attribute to Symbol . More... | |
void | emitSymbolDesc (MCSymbol *Symbol, unsigned DescValue) override |
Set the DescValue for the Symbol . More... | |
void | emitCommonSymbol (MCSymbol *Symbol, uint64_t Size, unsigned ByteAlignment) override |
Emit a common symbol. More... | |
void | emitELFSize (MCSymbol *Symbol, const MCExpr *Value) override |
Emit an ELF .size directive. More... | |
void | emitELFSymverDirective (const MCSymbol *OriginalSym, StringRef Name, bool KeepOriginalSym) override |
Emit an ELF .symver directive. More... | |
void | emitLocalCommonSymbol (MCSymbol *Symbol, uint64_t Size, unsigned ByteAlignment) override |
Emit a local common (.lcomm) symbol. More... | |
void | emitZerofill (MCSection *Section, MCSymbol *Symbol=nullptr, uint64_t Size=0, unsigned ByteAlignment=0, SMLoc L=SMLoc()) override |
Emit the zerofill section and an optional symbol. More... | |
void | emitTBSSSymbol (MCSection *Section, MCSymbol *Symbol, uint64_t Size, unsigned ByteAlignment=0) override |
Emit a thread local bss (.tbss) symbol. More... | |
void | emitValueImpl (const MCExpr *Value, unsigned Size, SMLoc Loc=SMLoc()) override |
Emit the expression Value into the output as a native integer of the given Size bytes. More... | |
void | emitIdent (StringRef IdentString) override |
Emit the "identifiers" directive. More... | |
void | emitValueToAlignment (unsigned, int64_t, unsigned, unsigned) override |
Emit some number of copies of Value until the byte alignment ByteAlignment is reached. More... | |
void | emitCGProfileEntry (const MCSymbolRefExpr *From, const MCSymbolRefExpr *To, uint64_t Count) override |
void | finishImpl () override |
Streamer specific finalization. More... | |
void | emitBundleAlignMode (unsigned AlignPow2) override |
Set the bundle alignment mode from now on in the section. More... | |
void | emitBundleLock (bool AlignToEnd) override |
The following instructions are a bundle-locked group. More... | |
void | emitBundleUnlock () override |
Ends a bundle-locked group. More... | |
void | setAttributeItem (unsigned Attribute, unsigned Value, bool OverwriteExisting) |
void | setAttributeItem (unsigned Attribute, StringRef Value, bool OverwriteExisting) |
void | setAttributeItems (unsigned Attribute, unsigned IntValue, StringRef StringValue, bool OverwriteExisting) |
void | emitAttributesSection (StringRef Vendor, const Twine &Section, unsigned Type, MCSection *&AttributeSection) |
void | emitGNUAttribute (unsigned Tag, unsigned Value) override |
Emit a .gnu_attribute directive. More... | |
Additional Inherited Members | |
![]() | |
MCObjectStreamer (MCContext &Context, std::unique_ptr< MCAsmBackend > TAB, std::unique_ptr< MCObjectWriter > OW, std::unique_ptr< MCCodeEmitter > Emitter) | |
~MCObjectStreamer () | |
bool | changeSectionImpl (MCSection *Section, const MCExpr *Subsection) |
void | addPendingLabel (MCSymbol *label) |
Assign a label to the current Section and Subsection even though a fragment is not yet present. More... | |
void | flushPendingLabels (MCFragment *F, uint64_t FOffset=0) |
If any labels have been emitted but not assigned fragments in the current Section and Subsection, ensure that they get assigned, either to fragment F if possible or to a new data fragment. More... | |
![]() | |
MCStreamer (MCContext &Ctx) | |
WinEH::FrameInfo * | getCurrentWinFrameInfo () |
virtual void | emitWindowsUnwindTables (WinEH::FrameInfo *Frame) |
virtual void | emitWindowsUnwindTables () |
virtual void | emitRawTextImpl (StringRef String) |
EmitRawText - If this file is backed by an assembly streamer, this dumps the specified string in the output .s file. More... | |
bool | checkCVLocSection (unsigned FuncId, unsigned FileNo, SMLoc Loc) |
Returns true if the the .cv_loc directive is in the right section. More... | |
Definition at line 31 of file MCELFStreamer.h.
MCELFStreamer::MCELFStreamer | ( | MCContext & | Context, |
std::unique_ptr< MCAsmBackend > | TAB, | ||
std::unique_ptr< MCObjectWriter > | OW, | ||
std::unique_ptr< MCCodeEmitter > | Emitter | ||
) |
Definition at line 42 of file MCELFStreamer.cpp.
|
overridedefault |
Update streamer for a new active section.
This is called by popSection and switchSection, if the current section changes.
Reimplemented from llvm::MCStreamer.
Definition at line 147 of file MCELFStreamer.cpp.
References llvm::HexStyle::Asm, llvm::MCObjectStreamer::changeSectionImpl(), llvm::MCObjectStreamer::getAssembler(), llvm::MCStreamer::getCurrentSectionOnly(), llvm::report_fatal_error(), setSectionAlignmentForBundling(), and llvm::ELF::SHF_GNU_RETAIN.
|
overridevirtual |
Note in the output the specified Flag
.
Reimplemented from llvm::MCStreamer.
Definition at line 121 of file MCELFStreamer.cpp.
References llvm::MCObjectStreamer::getAssembler(), llvm::MCAssembler::getBackend(), llvm::MCAsmBackend::handleAssemblerFlag(), llvm_unreachable, llvm::MCAF_Code16, llvm::MCAF_Code32, llvm::MCAF_Code64, llvm::MCAF_SubsectionsViaSymbols, llvm::MCAF_SyntaxUnified, and llvm::MCAssembler::setSubsectionsViaSymbols().
|
inline |
Definition at line 114 of file MCELFStreamer.h.
References Contents.
|
overridevirtual |
Set the bundle alignment mode from now on in the section.
The argument is the power of 2 to which the alignment is set. The value 0 means turn the bundle alignment off.
Reimplemented from llvm::MCStreamer.
Definition at line 637 of file MCELFStreamer.cpp.
References assert(), llvm::MCObjectStreamer::getAssembler(), llvm::MCAssembler::getBundleAlignSize(), llvm::report_fatal_error(), and llvm::MCAssembler::setBundleAlignSize().
|
overridevirtual |
The following instructions are a bundle-locked group.
AlignToEnd | - If true, the bundle-locked group will be aligned to the end of a bundle. |
Reimplemented from llvm::MCStreamer.
Definition at line 647 of file MCELFStreamer.cpp.
References llvm::MCSection::BundleLocked, llvm::MCSection::BundleLockedAlignToEnd, DF, llvm::MCObjectStreamer::getAssembler(), llvm::MCStreamer::getCurrentSectionOnly(), llvm::mc::getRelaxAll(), llvm::report_fatal_error(), llvm::MCSection::setBundleGroupBeforeFirstInst(), and llvm::MCSection::setBundleLockState().
|
overridevirtual |
Ends a bundle-locked group.
Reimplemented from llvm::MCStreamer.
Definition at line 666 of file MCELFStreamer.cpp.
References assert(), llvm::MCSection::BundleLockedAlignToEnd, DF, llvm::MCObjectStreamer::getAssembler(), llvm::MCSection::getBundleLockState(), llvm::MCStreamer::getCurrentSectionOnly(), llvm::MCObjectStreamer::getOrCreateDataFragment(), llvm::mc::getRelaxAll(), llvm::MCSection::isBundleGroupBeforeFirstInst(), llvm::MCSection::NotBundleLocked, llvm::report_fatal_error(), llvm::MCEncodedFragment::setAlignToBundleEnd(), and llvm::MCSection::setBundleLockState().
|
overridevirtual |
Reimplemented from llvm::MCStreamer.
Definition at line 376 of file MCELFStreamer.cpp.
References llvm::MCAssembler::CGProfile, From, and llvm::MCObjectStreamer::getAssembler().
|
overridevirtual |
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 307 of file MCELFStreamer.cpp.
References llvm::LCOMM::ByteAlignment, llvm::MCConstantExpr::create(), emitLabel(), emitValueToAlignment(), llvm::MCStreamer::emitZeros(), llvm::MCObjectStreamer::getAssembler(), llvm::MCStreamer::getContext(), llvm::MCAssembler::getContext(), llvm::MCStreamer::getCurrentSection(), llvm::MCContext::getELFSection(), P, llvm::MCAssembler::registerSymbol(), llvm::report_fatal_error(), S, llvm::ELF::SHF_ALLOC, llvm::ELF::SHF_WRITE, llvm::ELF::SHT_NOBITS, llvm::ELF::STB_GLOBAL, llvm::ELF::STB_LOCAL, llvm::ELF::STT_OBJECT, llvm::MCStreamer::switchSection(), and llvm::ARMBuildAttrs::Symbol.
Referenced by emitLocalCommonSymbol().
Emit an ELF .size directive.
This corresponds to an assembler statement such as: .size symbol, expression
Reimplemented from llvm::MCStreamer.
Definition at line 338 of file MCELFStreamer.cpp.
References llvm::ARMBuildAttrs::Symbol.
|
overridevirtual |
Emit an ELF .symver directive.
This corresponds to an assembler statement such as: .symver _start, foo@SOME_VERSION
Reimplemented from llvm::MCStreamer.
Definition at line 342 of file MCELFStreamer.cpp.
References llvm::MCObjectStreamer::getAssembler(), llvm::MCStreamer::getStartTokLoc(), and llvm::MCAssembler::Symvers.
|
inlineoverridevirtual |
Emit a .gnu_attribute directive.
Reimplemented from llvm::MCStreamer.
Definition at line 130 of file MCELFStreamer.h.
References llvm::MCELFStreamer::AttributeItem::NumericAttribute.
|
overridevirtual |
Emit the "identifiers" directive.
This implements the '.ident "version foo"' assembler directive.
Reimplemented from llvm::MCStreamer.
Definition at line 382 of file MCELFStreamer.cpp.
References llvm::MCObjectStreamer::emitBytes(), llvm::MCStreamer::emitInt8(), llvm::MCObjectStreamer::getAssembler(), llvm::MCAssembler::getContext(), llvm::MCContext::getELFSection(), llvm::MCStreamer::popSection(), llvm::MCStreamer::pushSection(), llvm::ELF::SHF_MERGE, llvm::ELF::SHF_STRINGS, llvm::ELF::SHT_PROGBITS, and llvm::MCStreamer::switchSection().
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::MCStreamer.
Reimplemented in llvm::MipsELFStreamer, and llvm::PPCELFStreamer.
Definition at line 100 of file MCELFStreamer.cpp.
References llvm::MCObjectStreamer::emitLabel(), llvm::MCStreamer::getCurrentSectionOnly(), S, llvm::ELF::SHF_TLS, llvm::ELF::STT_TLS, and llvm::ARMBuildAttrs::Symbol.
Referenced by llvm::MipsELFStreamer::emitCFIEndProcImpl(), llvm::MipsELFStreamer::emitCFILabel(), llvm::MipsELFStreamer::emitCFIStartProcImpl(), emitCommonSymbol(), llvm::AMDGPUTargetELFStreamer::EmitHSAMetadata(), llvm::AMDGPUTargetELFStreamer::EmitISAVersion(), llvm::PPCELFStreamer::emitLabel(), llvm::MipsELFStreamer::emitLabel(), and llvm::HexagonMCELFStreamer::HexagonMCEmitCommonSymbol().
|
overridevirtual |
Reimplemented from llvm::MCObjectStreamer.
Definition at line 110 of file MCELFStreamer.cpp.
References llvm::MCObjectStreamer::emitLabelAtPos(), F, llvm::MCStreamer::getCurrentSectionOnly(), S, llvm::ELF::SHF_TLS, llvm::ELF::STT_TLS, and llvm::ARMBuildAttrs::Symbol.
|
overridevirtual |
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. |
Reimplemented from llvm::MCStreamer.
Definition at line 349 of file MCELFStreamer.cpp.
References llvm::LCOMM::ByteAlignment, emitCommonSymbol(), llvm::MCObjectStreamer::getAssembler(), llvm::MCAssembler::registerSymbol(), S, llvm::ELF::STB_LOCAL, and llvm::ARMBuildAttrs::Symbol.
|
overridevirtual |
Add the given Attribute
to Symbol
.
Implements llvm::MCStreamer.
Definition at line 193 of file MCELFStreamer.cpp.
References CombineSymbolTypes(), llvm::MCObjectStreamer::getAssembler(), llvm::MCStreamer::getContext(), llvm::MCStreamer::getStartTokLoc(), llvm::MCAssembler::getWriter(), llvm_unreachable, llvm::MCObjectWriter::markGnuAbi(), llvm::MCSA_AltEntry, llvm::MCSA_Cold, 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_Exported, llvm::MCSA_Extern, llvm::MCSA_Global, llvm::MCSA_Hidden, llvm::MCSA_IndirectSymbol, llvm::MCSA_Internal, llvm::MCSA_Invalid, llvm::MCSA_LazyReference, llvm::MCSA_LGlobal, 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::MCAssembler::registerSymbol(), llvm::MCContext::reportError(), llvm::MCContext::reportWarning(), S, llvm::ELF::STB_GLOBAL, llvm::ELF::STB_GNU_UNIQUE, 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, and llvm::ARMBuildAttrs::Symbol.
|
overridevirtual |
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. |
Reimplemented from llvm::MCStreamer.
Definition at line 721 of file MCELFStreamer.cpp.
References llvm_unreachable.
|
overridevirtual |
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. |
Reimplemented from llvm::MCStreamer.
Definition at line 731 of file MCELFStreamer.cpp.
References llvm_unreachable.
|
overridevirtual |
Note in the output that the specified Func
is a Thumb mode function (ARM target only).
Reimplemented from llvm::MCStreamer.
Definition at line 717 of file MCELFStreamer.cpp.
References llvm_unreachable.
|
overridevirtual |
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. |
Loc | - The location of the expression for error reporting. |
Reimplemented from llvm::MCStreamer.
Reimplemented in llvm::CSKYELFStreamer, and llvm::MipsELFStreamer.
Definition at line 358 of file MCELFStreamer.cpp.
References llvm::MCObjectStreamer::emitValueImpl(), and llvm::report_fatal_error().
Referenced by llvm::MipsELFStreamer::emitValueImpl(), and llvm::CSKYELFStreamer::emitValueImpl().
|
overridevirtual |
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::MCStreamer.
Definition at line 366 of file MCELFStreamer.cpp.
References llvm::LCOMM::ByteAlignment, llvm::MCObjectStreamer::emitValueToAlignment(), and llvm::report_fatal_error().
Referenced by emitCommonSymbol(), and llvm::HexagonMCELFStreamer::HexagonMCEmitCommonSymbol().
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::MCStreamer.
Definition at line 167 of file MCELFStreamer.cpp.
References llvm::MCSymbolRefExpr::create(), llvm::MCObjectStreamer::getAssembler(), llvm::MCStreamer::getContext(), llvm::MCAssembler::registerSymbol(), llvm::MCSymbol::setVariableValue(), llvm::ARMBuildAttrs::Symbol, and llvm::MCSymbolRefExpr::VK_WEAKREF.
|
overridevirtual |
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 725 of file MCELFStreamer.cpp.
References llvm_unreachable.
|
overridevirtual |
Streamer specific finalization.
Reimplemented from llvm::MCStreamer.
Definition at line 699 of file MCELFStreamer.cpp.
References llvm::MCObjectStreamer::emitFrames(), llvm::MCObjectStreamer::finishImpl(), llvm::MCObjectStreamer::getAssembler(), llvm::MCStreamer::getCurrentSectionOnly(), setSectionAlignmentForBundling(), and llvm::ELF::SHT_GNU_ATTRIBUTES.
|
overridevirtual |
Create the default sections and set the initial one.
Reimplemented from llvm::MCStreamer.
Definition at line 91 of file MCELFStreamer.cpp.
References llvm::MCObjectStreamer::emitCodeAlignment(), llvm::MCContext::getAsmInfo(), llvm::MCStreamer::getContext(), llvm::MCAsmInfo::getNonexecutableStackSection(), llvm::MCContext::getObjectFileInfo(), llvm::MCObjectFileInfo::getTextSection(), llvm::MCObjectFileInfo::getTextSectionAlignment(), and llvm::MCStreamer::switchSection().
|
inlineoverridevirtual |
state management
Reimplemented from llvm::MCStreamer.
Reimplemented in llvm::CSKYELFStreamer.
Definition at line 40 of file MCELFStreamer.h.
References llvm::MCObjectStreamer::reset().
Referenced by llvm::CSKYELFStreamer::reset().
void MCELFStreamer::setAttributeItem | ( | unsigned | Attribute, |
StringRef | Value, | ||
bool | OverwriteExisting | ||
) |
Definition at line 753 of file MCELFStreamer.cpp.
References Contents, and llvm::MCELFStreamer::AttributeItem::TextAttribute.
void MCELFStreamer::setAttributeItem | ( | unsigned | Attribute, |
unsigned | Value, | ||
bool | OverwriteExisting | ||
) |
Definition at line 736 of file MCELFStreamer.cpp.
References Contents, and llvm::MCELFStreamer::AttributeItem::NumericAttribute.
void MCELFStreamer::setAttributeItems | ( | unsigned | Attribute, |
unsigned | IntValue, | ||
StringRef | StringValue, | ||
bool | OverwriteExisting | ||
) |
Definition at line 770 of file MCELFStreamer.cpp.
References Contents, and llvm::MCELFStreamer::AttributeItem::NumericAndTextAttributes.
SmallVector<AttributeItem, 64> llvm::MCELFStreamer::Contents |
Definition at line 107 of file MCELFStreamer.h.
Referenced by emitAttributesSection(), setAttributeItem(), and setAttributeItems().