LLVM  15.0.0git
Public Member Functions | Protected Member Functions | List of all members
llvm::MCStreamer Class Referenceabstract

Streaming machine code generation interface. More...

#include "llvm/MC/MCStreamer.h"

Inheritance diagram for llvm::MCStreamer:
Inheritance graph
[legend]

Public Member Functions

 MCStreamer (const MCStreamer &)=delete
 
MCStreameroperator= (const MCStreamer &)=delete
 
virtual ~MCStreamer ()
 
void visitUsedExpr (const MCExpr &Expr)
 
virtual void visitUsedSymbol (const MCSymbol &Sym)
 
void setTargetStreamer (MCTargetStreamer *TS)
 
void setStartTokLocPtr (const SMLoc *Loc)
 
SMLoc getStartTokLoc () const
 
virtual void reset ()
 State management. More...
 
MCContextgetContext () const
 
virtual MCAssemblergetAssemblerPtr ()
 
void setUseAssemblerInfoForParsing (bool v)
 
bool getUseAssemblerInfoForParsing ()
 
MCTargetStreamergetTargetStreamer ()
 
void setAllowAutoPadding (bool v)
 
bool getAllowAutoPadding () const
 
virtual MCSymbolemitCFILabel ()
 When emitting an object file, create and emit a real label. More...
 
WinEH::FrameInfoEnsureValidWinFrameInfo (SMLoc Loc)
 Retrieve the current frame info if one is available and it is not yet closed. More...
 
unsigned getNumFrameInfos ()
 
ArrayRef< MCDwarfFrameInfogetDwarfFrameInfos () const
 
bool hasUnfinishedDwarfFrameInfo ()
 
unsigned getNumWinFrameInfos ()
 
ArrayRef< std::unique_ptr< WinEH::FrameInfo > > getWinFrameInfos () const
 
void generateCompactUnwindEncodings (MCAsmBackend *MAB)
 
virtual void emitFileDirective (StringRef Filename)
 Switch to a new logical file. More...
 
virtual void emitFileDirective (StringRef Filename, StringRef CompilerVerion, StringRef TimeStamp, StringRef Description)
 Emit ".file assembler diretive with additioal info. More...
 
virtual void emitIdent (StringRef IdentString)
 Emit the "identifiers" directive. More...
 
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 void emitDwarfLocDirective (unsigned FileNo, unsigned Line, unsigned Column, unsigned Flags, unsigned Isa, unsigned Discriminator, StringRef FileName)
 This implements the DWARF2 '.loc fileno lineno ...' assembler directive. More...
 
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 emitCVLocDirective (unsigned FunctionId, unsigned FileNo, unsigned Line, unsigned Column, bool PrologueEnd, bool IsStmt, StringRef FileName, SMLoc Loc)
 This implements the CodeView '.cv_loc' assembler directive. More...
 
virtual void emitCVLinetableDirective (unsigned FunctionId, const MCSymbol *FnStart, const MCSymbol *FnEnd)
 This implements the CodeView '.cv_linetable' assembler directive. More...
 
virtual void emitCVInlineLinetableDirective (unsigned PrimaryFunctionId, unsigned SourceFileId, unsigned SourceLineNum, const MCSymbol *FnStartSym, const MCSymbol *FnEndSym)
 This implements the CodeView '.cv_inline_linetable' assembler directive. More...
 
virtual void emitCVDefRangeDirective (ArrayRef< std::pair< const MCSymbol *, const MCSymbol * >> Ranges, StringRef FixedSizePortion)
 This implements the CodeView '.cv_def_range' assembler directive. 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 emitCVStringTableDirective ()
 This implements the CodeView '.cv_stringtable' assembler directive. More...
 
virtual void emitCVFileChecksumsDirective ()
 This implements the CodeView '.cv_filechecksums' assembler directive. More...
 
virtual void emitCVFileChecksumOffsetDirective (unsigned FileNo)
 This implements the CodeView '.cv_filechecksumoffset' assembler directive. More...
 
virtual void emitCVFPOData (const MCSymbol *ProcSym, SMLoc Loc={})
 This implements the CodeView '.cv_fpo_data' assembler directive. More...
 
virtual void emitAbsoluteSymbolDiff (const MCSymbol *Hi, const MCSymbol *Lo, unsigned Size)
 Emit the absolute difference between two symbols. More...
 
virtual void emitAbsoluteSymbolDiffAsULEB128 (const MCSymbol *Hi, const MCSymbol *Lo)
 Emit the absolute difference between two symbols encoded with ULEB128. More...
 
virtual MCSymbolgetDwarfLineTableSymbol (unsigned CUID)
 
virtual void emitCFISections (bool EH, bool Debug)
 
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())
 
virtual void emitCGProfileEntry (const MCSymbolRefExpr *From, const MCSymbolRefExpr *To, uint64_t Count)
 
MCSectiongetAssociatedPDataSection (const MCSection *TextSec)
 Get the .pdata section used for the given section. More...
 
MCSectiongetAssociatedXDataSection (const MCSection *TextSec)
 Get the .xdata section used for the given section. More...
 
virtual void emitSyntaxDirective ()
 
virtual Optional< std::pair< bool, std::string > > emitRelocDirective (const MCExpr &Offset, StringRef Name, const MCExpr *Expr, SMLoc Loc, const MCSubtargetInfo &STI)
 Record a relocation described by the .reloc directive. More...
 
virtual void emitAddrsig ()
 
virtual void emitAddrsigSym (const MCSymbol *Sym)
 
virtual void emitInstruction (const MCInst &Inst, const MCSubtargetInfo &STI)
 Emit the given Instruction into the current section. More...
 
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...
 
virtual void emitBundleAlignMode (unsigned AlignPow2)
 Set the bundle alignment mode from now on in the section. More...
 
virtual void emitBundleLock (bool AlignToEnd)
 The following instructions are a bundle-locked group. More...
 
virtual void emitBundleUnlock ()
 Ends a bundle-locked group. 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...
 
virtual void finishImpl ()
 Streamer specific finalization. More...
 
void finish (SMLoc EndLoc=SMLoc())
 Finish emission of machine code. More...
 
virtual bool mayHaveInstructions (MCSection &Sec) const
 
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 MCSymbolemitDwarfUnitLength (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 emitDwarfLineEndEntry (MCSection *Section, MCSymbol *LastLabel)
 Emit the debug line end entry. More...
 
virtual void emitDwarfAdvanceLineAddr (int64_t LineDelta, const MCSymbol *LastLabel, const MCSymbol *Label, unsigned PointerSize)
 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...
 
virtual void doFinalizationAtSectionEnd (MCSection *Section)
 Do finalization for the streamer at the end of a section. More...
 
Assembly File Formatting.
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 bool isIntegratedAssemblerRequired () const
 Is the integrated assembler required for this streamer to function correctly? More...
 
virtual void AddComment (const Twine &T, bool EOL=true)
 Add a textual comment. More...
 
virtual raw_ostreamgetCommentOS ()
 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...
 
Symbol & Section Management
MCSectionSubPair getCurrentSection () const
 Return the current section that the streamer is emitting code to. More...
 
MCSectiongetCurrentSectionOnly () 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...
 
virtual void changeSection (MCSection *, const MCExpr *)
 Update streamer for a new active section. 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...
 
virtual void initSections (bool NoExecStack, const MCSubtargetInfo &STI)
 Create the default sections and set the initial one. More...
 
MCSymbolendSection (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 emitLabel (MCSymbol *Symbol, SMLoc Loc=SMLoc())
 Emit a label for Symbol into the current section. More...
 
virtual void emitEHSymAttributes (const MCSymbol *Symbol, MCSymbol *EHSymbol)
 
virtual void emitAssemblerFlag (MCAssemblerFlag Flag)
 Note in the output the specified Flag. More...
 
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 emitThumbFunc (MCSymbol *Func)
 Note in the output that the specified Func is a Thumb mode function (ARM target only). More...
 
virtual void emitAssignment (MCSymbol *Symbol, const MCExpr *Value)
 Emit an assignment of Value to Symbol. More...
 
virtual void emitConditionalAssignment (MCSymbol *Symbol, const MCExpr *Value)
 Emit an assignment of Value to Symbol, but only if Value is also emitted. More...
 
virtual void emitWeakReference (MCSymbol *Alias, const MCSymbol *Symbol)
 Emit an weak reference from Alias to Symbol. More...
 
virtual bool emitSymbolAttribute (MCSymbol *Symbol, MCSymbolAttr Attribute)=0
 Add the given Attribute to Symbol. More...
 
virtual void emitSymbolDesc (MCSymbol *Symbol, unsigned DescValue)
 Set the DescValue for the Symbol. More...
 
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 emitELFSize (MCSymbol *Symbol, const MCExpr *Value)
 Emit an ELF .size directive. More...
 
virtual void emitELFSymverDirective (const MCSymbol *OriginalSym, StringRef Name, bool KeepOriginalSym)
 Emit an ELF .symver directive. More...
 
virtual void emitLOHDirective (MCLOHType Kind, const MCLOHArgs &Args)
 Emit a Linker Optimization Hint (LOH) directive. More...
 
virtual void emitGNUAttribute (unsigned Tag, unsigned Value)
 Emit a .gnu_attribute directive. More...
 
virtual void emitCommonSymbol (MCSymbol *Symbol, uint64_t Size, unsigned ByteAlignment)=0
 Emit a common symbol. More...
 
virtual void emitLocalCommonSymbol (MCSymbol *Symbol, uint64_t Size, unsigned ByteAlignment)
 Emit a local common (.lcomm) symbol. More...
 
virtual void emitZerofill (MCSection *Section, MCSymbol *Symbol=nullptr, uint64_t Size=0, unsigned ByteAlignment=0, SMLoc Loc=SMLoc())=0
 Emit the zerofill section and an optional symbol. More...
 
virtual void emitTBSSSymbol (MCSection *Section, MCSymbol *Symbol, uint64_t Size, unsigned ByteAlignment=0)
 Emit a thread local bss (.tbss) symbol. More...
 
Generating Data
virtual void emitBytes (StringRef Data)
 Emit the bytes in Data into the output. More...
 
virtual void emitBinaryData (StringRef Data)
 Functionally identical to EmitBytes. More...
 
virtual void emitValueImpl (const MCExpr *Value, unsigned Size, SMLoc Loc=SMLoc())
 Emit the expression Value into the output as a native integer of the given Size bytes. 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...
 
virtual void emitULEB128Value (const MCExpr *Value)
 
virtual void emitSLEB128Value (const MCExpr *Value)
 
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...
 
virtual void emitDTPRel64Value (const MCExpr *Value)
 Emit the expression Value into the output as a dtprel (64-bit DTP relative) value. More...
 
virtual void emitDTPRel32Value (const MCExpr *Value)
 Emit the expression Value into the output as a dtprel (32-bit DTP relative) value. More...
 
virtual void emitTPRel64Value (const MCExpr *Value)
 Emit the expression Value into the output as a tprel (64-bit TP relative) value. More...
 
virtual void emitTPRel32Value (const MCExpr *Value)
 Emit the expression Value into the output as a tprel (32-bit TP relative) value. More...
 
virtual void emitGPRel64Value (const MCExpr *Value)
 Emit the expression Value into the output as a gprel64 (64-bit GP relative) value. More...
 
virtual void emitGPRel32Value (const MCExpr *Value)
 Emit the expression Value into the output as a gprel32 (32-bit GP relative) value. 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...
 
virtual void emitNops (int64_t NumBytes, int64_t ControlledNopLength, SMLoc Loc, const MCSubtargetInfo &STI)
 
void emitZeros (uint64_t NumBytes)
 Emit NumBytes worth of zeros. More...
 
virtual void emitValueToAlignment (unsigned ByteAlignment, int64_t Value=0, unsigned ValueSize=1, unsigned MaxBytesToEmit=0)
 Emit some number of copies of Value until the byte alignment ByteAlignment is reached. More...
 
virtual void emitCodeAlignment (unsigned ByteAlignment, const MCSubtargetInfo *STI, unsigned MaxBytesToEmit=0)
 Emit nops until the byte alignment ByteAlignment is reached. More...
 
virtual void emitValueToOffset (const MCExpr *Offset, unsigned char Value, SMLoc Loc)
 Emit some number of copies of Value until the byte offset Offset is reached. More...
 

Protected Member Functions

 MCStreamer (MCContext &Ctx)
 
virtual void emitCFIStartProcImpl (MCDwarfFrameInfo &Frame)
 
virtual void emitCFIEndProcImpl (MCDwarfFrameInfo &CurFrame)
 
WinEH::FrameInfogetCurrentWinFrameInfo ()
 
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...
 

Detailed Description

Streaming machine code generation interface.

This interface is intended to provide a programmatic interface that is very similar to the level that an assembler .s file provides. It has callbacks to emit bytes, handle directives, etc. The implementation of this interface retains state to know what the current section is etc.

There are multiple implementations of this interface: one for writing out a .s file, and implementations that write out .o files of various formats.

Definition at line 212 of file MCStreamer.h.

Constructor & Destructor Documentation

◆ MCStreamer() [1/2]

MCStreamer::MCStreamer ( MCContext Ctx)
protected

Definition at line 94 of file MCStreamer.cpp.

◆ MCStreamer() [2/2]

llvm::MCStreamer::MCStreamer ( const MCStreamer )
delete

◆ ~MCStreamer()

MCStreamer::~MCStreamer ( )
virtualdefault

Member Function Documentation

◆ addBlankLine()

virtual void llvm::MCStreamer::addBlankLine ( )
inlinevirtual

◆ AddComment()

virtual void llvm::MCStreamer::AddComment ( const Twine T,
bool  EOL = true 
)
inlinevirtual

Add a textual comment.

Typically for comments that can be emitted to the generated .s file if applicable as a QoI issue to make the output of the compiler more readable. This only affects the MCAsmStreamer, and only when verbose assembly output is enabled.

If the comment includes embedded
's, they will each get the comment prefix as appropriate. The added comment should not end with a
. By default, each comment is terminated with an end of line, i.e. the EOL param is set to true by default. If one prefers not to end the comment with a new line then the EOL param should be passed with a false value.

Definition at line 355 of file MCStreamer.h.

Referenced by addConstantComments(), emitDwarfUnitLength(), emitGenDwarfRanges(), llvm::CodeViewContext::emitLineTableForFunction(), llvm::BTFTypeBase::emitType(), llvm::BTFTypeInt::emitType(), llvm::BTFTypeStruct::emitType(), llvm::BTFTypeEnum64::emitType(), and maybeEmitDwarf64Mark().

◆ addExplicitComment()

void MCStreamer::addExplicitComment ( const Twine T)
virtual

Add explicit comment T.

T is required to be a valid comment in the output and does not need to be escaped.

Definition at line 123 of file MCStreamer.cpp.

◆ assignFragment()

void MCStreamer::assignFragment ( MCSymbol Symbol,
MCFragment Fragment 
)

Sets the symbol's section.

Each emitted symbol will be tracked in the ordering table, so we can sort on them later.

Definition at line 414 of file MCStreamer.cpp.

References assert(), llvm::DenseMapBase< DerivedT, KeyT, ValueT, KeyInfoT, BucketT >::size(), and llvm::ARMBuildAttrs::Symbol.

◆ beginCOFFSymbolDef()

void MCStreamer::beginCOFFSymbolDef ( const MCSymbol Symbol)
virtual

Start emitting COFF symbol definition.

Parameters
Symbol- The symbol to have its External & Type fields set.

Reimplemented in llvm::MCWinCOFFStreamer, and llvm::RecordStreamer.

Definition at line 1154 of file MCStreamer.cpp.

References llvm_unreachable.

◆ changeSection()

void MCStreamer::changeSection ( MCSection ,
const MCExpr  
)
virtual

Update streamer for a new active section.

This is called by popSection and switchSection, if the current section changes.

Reimplemented in llvm::MCObjectStreamer, llvm::MCELFStreamer, and llvm::MCWasmStreamer.

Definition at line 1200 of file MCStreamer.cpp.

Referenced by popSection(), and switchSection().

◆ checkCVLocSection()

bool MCStreamer::checkCVLocSection ( unsigned  FuncId,
unsigned  FileNo,
SMLoc  Loc 
)
protected

◆ doFinalizationAtSectionEnd()

virtual void llvm::MCStreamer::doFinalizationAtSectionEnd ( MCSection Section)
inlinevirtual

Do finalization for the streamer at the end of a section.

Definition at line 1154 of file MCStreamer.h.

◆ emitAbsoluteSymbolDiff()

void MCStreamer::emitAbsoluteSymbolDiff ( const MCSymbol Hi,
const MCSymbol Lo,
unsigned  Size 
)
virtual

◆ emitAbsoluteSymbolDiffAsULEB128()

void MCStreamer::emitAbsoluteSymbolDiffAsULEB128 ( const MCSymbol Hi,
const MCSymbol Lo 
)
virtual

Emit the absolute difference between two symbols encoded with ULEB128.

Reimplemented in llvm::MCObjectStreamer.

Definition at line 1141 of file MCStreamer.cpp.

References Context, llvm::MCSymbolRefExpr::create(), llvm::MCBinaryExpr::createSub(), emitULEB128Value(), llvm::MipsISD::Hi, and llvm::MipsISD::Lo.

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

◆ emitAddrsig()

virtual void llvm::MCStreamer::emitAddrsig ( )
inlinevirtual

Reimplemented in llvm::MCObjectStreamer.

Definition at line 1089 of file MCStreamer.h.

◆ emitAddrsigSym()

virtual void llvm::MCStreamer::emitAddrsigSym ( const MCSymbol Sym)
inlinevirtual

Reimplemented in llvm::MCObjectStreamer.

Definition at line 1090 of file MCStreamer.h.

◆ emitAssemblerFlag()

void MCStreamer::emitAssemblerFlag ( MCAssemblerFlag  Flag)
virtual

Note in the output the specified Flag.

Reimplemented in llvm::MCELFStreamer, llvm::MCWasmStreamer, and llvm::MCWinCOFFStreamer.

Definition at line 1151 of file MCStreamer.cpp.

◆ emitAssignment()

void MCStreamer::emitAssignment ( MCSymbol Symbol,
const MCExpr Value 
)
virtual

Emit an assignment of Value to Symbol.

This corresponds to an assembler statement such as: symbol = value

The assignment generates no code, but has the side effect of binding the value in the current context. For the assembly streamer, this prints the binding into the .s file.

Parameters
Symbol- The symbol being assigned to.
Value- The value for the symbol.

Reimplemented in llvm::MCObjectStreamer, and llvm::RecordStreamer.

Definition at line 1051 of file MCStreamer.cpp.

References llvm::MCTargetStreamer::emitAssignment(), getTargetStreamer(), llvm::ARMBuildAttrs::Symbol, and visitUsedExpr().

Referenced by emitAbsoluteSymbolDiff(), llvm::RecordStreamer::emitAssignment(), llvm::MCObjectStreamer::emitAssignment(), llvm::RecordStreamer::flushSymverDirectives(), forceExpAbs(), and llvm::MCContext::setSymbolValue().

◆ emitBinaryData()

void MCStreamer::emitBinaryData ( StringRef  Data)
virtual

Functionally identical to EmitBytes.

When emitting textual assembly, this method uses .byte directives instead of .ascii or .asciz for readability.

Definition at line 1203 of file MCStreamer.cpp.

References llvm::Data, and emitBytes().

Referenced by llvm::AsmPrinter::XRayFunctionEntry::emit(), emitOneV5FileEntry(), and llvm::MCDwarfLineStr::emitSection().

◆ emitBuildVersion()

virtual void llvm::MCStreamer::emitBuildVersion ( unsigned  Platform,
unsigned  Major,
unsigned  Minor,
unsigned  Update,
VersionTuple  SDKVersion 
)
inlinevirtual

Emit/Specify Mach-O build version command.

Platform should be one of MachO::PlatformType.

Definition at line 508 of file MCStreamer.h.

Referenced by emitVersionForTarget().

◆ emitBundleAlignMode()

void MCStreamer::emitBundleAlignMode ( unsigned  AlignPow2)
virtual

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 in llvm::MCObjectStreamer, and llvm::MCELFStreamer.

Definition at line 1220 of file MCStreamer.cpp.

◆ emitBundleLock()

void MCStreamer::emitBundleLock ( bool  AlignToEnd)
virtual

The following instructions are a bundle-locked group.

Parameters
AlignToEnd- If true, the bundle-locked group will be aligned to the end of a bundle.

Reimplemented in llvm::MCObjectStreamer, and llvm::MCELFStreamer.

Definition at line 1221 of file MCStreamer.cpp.

◆ emitBundleUnlock()

void MCStreamer::emitBundleUnlock ( )
virtual

Ends a bundle-locked group.

Reimplemented in llvm::MCObjectStreamer, and llvm::MCELFStreamer.

Definition at line 1223 of file MCStreamer.cpp.

◆ emitBytes()

void MCStreamer::emitBytes ( StringRef  Data)
virtual

◆ emitCFIAdjustCfaOffset()

void MCStreamer::emitCFIAdjustCfaOffset ( int64_t  Adjustment)
virtual

◆ emitCFIBKeyFrame()

void MCStreamer::emitCFIBKeyFrame ( )
virtual

Definition at line 248 of file MCStreamer.cpp.

References llvm::MCDwarfFrameInfo::IsBKeyFrame.

◆ emitCFIDefCfa()

void MCStreamer::emitCFIDefCfa ( int64_t  Register,
int64_t  Offset 
)
virtual

◆ emitCFIDefCfaOffset()

void MCStreamer::emitCFIDefCfaOffset ( int64_t  Offset)
virtual

◆ emitCFIDefCfaRegister()

void MCStreamer::emitCFIDefCfaRegister ( int64_t  Register)
virtual

◆ emitCFIEndProc()

void MCStreamer::emitCFIEndProc ( )

Definition at line 473 of file MCStreamer.cpp.

References emitCFIEndProcImpl().

◆ emitCFIEndProcImpl()

void MCStreamer::emitCFIEndProcImpl ( MCDwarfFrameInfo CurFrame)
protectedvirtual

Reimplemented in llvm::MipsELFStreamer.

Definition at line 480 of file MCStreamer.cpp.

References llvm::MCDwarfFrameInfo::End.

Referenced by emitCFIEndProc().

◆ emitCFIEscape()

void MCStreamer::emitCFIEscape ( StringRef  Values)
virtual

◆ emitCFIGnuArgsSize()

void MCStreamer::emitCFIGnuArgsSize ( int64_t  Size)
virtual

◆ emitCFILabel()

MCSymbol * MCStreamer::emitCFILabel ( )
virtual

◆ emitCFILLVMDefAspaceCfa()

void MCStreamer::emitCFILLVMDefAspaceCfa ( int64_t  Register,
int64_t  Offset,
int64_t  AddressSpace 
)
virtual

◆ emitCFILsda()

void MCStreamer::emitCFILsda ( const MCSymbol Sym,
unsigned  Encoding 
)
virtual

◆ emitCFIMTETaggedFrame()

void MCStreamer::emitCFIMTETaggedFrame ( )
virtual

Definition at line 255 of file MCStreamer.cpp.

References llvm::MCDwarfFrameInfo::IsMTETaggedFrame.

◆ emitCFINegateRAState()

void MCStreamer::emitCFINegateRAState ( )
virtual

◆ emitCFIOffset()

void MCStreamer::emitCFIOffset ( int64_t  Register,
int64_t  Offset 
)
virtual

◆ emitCFIPersonality()

void MCStreamer::emitCFIPersonality ( const MCSymbol Sym,
unsigned  Encoding 
)
virtual

◆ emitCFIRegister()

void MCStreamer::emitCFIRegister ( int64_t  Register1,
int64_t  Register2 
)
virtual

◆ emitCFIRelOffset()

void MCStreamer::emitCFIRelOffset ( int64_t  Register,
int64_t  Offset 
)
virtual

◆ emitCFIRememberState()

void MCStreamer::emitCFIRememberState ( )
virtual

◆ emitCFIRestore()

void MCStreamer::emitCFIRestore ( int64_t  Register)
virtual

◆ emitCFIRestoreState()

void MCStreamer::emitCFIRestoreState ( )
virtual

◆ emitCFIReturnColumn()

void MCStreamer::emitCFIReturnColumn ( int64_t  Register)
virtual

Definition at line 687 of file MCStreamer.cpp.

References llvm::MCDwarfFrameInfo::RAReg, and Register.

◆ emitCFISameValue()

void MCStreamer::emitCFISameValue ( int64_t  Register)
virtual

◆ emitCFISections()

void MCStreamer::emitCFISections ( bool  EH,
bool  Debug 
)
virtual

Reimplemented in llvm::MCObjectStreamer.

Definition at line 445 of file MCStreamer.cpp.

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

◆ emitCFISignalFrame()

void MCStreamer::emitCFISignalFrame ( )
virtual

Definition at line 641 of file MCStreamer.cpp.

References llvm::MCDwarfFrameInfo::IsSignalFrame.

◆ emitCFIStartProc()

void MCStreamer::emitCFIStartProc ( bool  IsSimple,
SMLoc  Loc = SMLoc() 
)

◆ emitCFIStartProcImpl()

void MCStreamer::emitCFIStartProcImpl ( MCDwarfFrameInfo Frame)
protectedvirtual

Reimplemented in llvm::MipsELFStreamer.

Definition at line 470 of file MCStreamer.cpp.

Referenced by emitCFIStartProc().

◆ emitCFIUndefined()

void MCStreamer::emitCFIUndefined ( int64_t  Register)
virtual

◆ emitCFIWindowSave()

void MCStreamer::emitCFIWindowSave ( )
virtual

◆ emitCGProfileEntry()

void MCStreamer::emitCGProfileEntry ( const MCSymbolRefExpr From,
const MCSymbolRefExpr To,
uint64_t  Count 
)
virtual

◆ emitCodeAlignment()

void MCStreamer::emitCodeAlignment ( unsigned  ByteAlignment,
const MCSubtargetInfo STI,
unsigned  MaxBytesToEmit = 0 
)
virtual

Emit nops until the byte alignment ByteAlignment is reached.

This used to align code where the alignment bytes may be executed. This can emit different bytes for different sizes to optimize execution.

Parameters
ByteAlignment- The alignment to reach. This must be a power of two on some targets.
STI- The MCSubtargetInfo in operation when padding is emitted.
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 in llvm::MCObjectStreamer.

Definition at line 1215 of file MCStreamer.cpp.

Referenced by llvm::MipsTargetELFStreamer::finish(), and smallData().

◆ emitCOFFImgRel32()

void MCStreamer::emitCOFFImgRel32 ( MCSymbol const Symbol,
int64_t  Offset 
)
virtual

Emits a COFF image relative relocation.

Parameters
Symbol- Symbol the image relative relocation should point to.

Reimplemented in llvm::MCWinCOFFStreamer.

Definition at line 979 of file MCStreamer.cpp.

◆ emitCOFFSafeSEH()

void MCStreamer::emitCOFFSafeSEH ( MCSymbol const Symbol)
virtual

Reimplemented in llvm::MCWinCOFFStreamer.

Definition at line 971 of file MCStreamer.cpp.

◆ emitCOFFSecRel32()

void MCStreamer::emitCOFFSecRel32 ( MCSymbol const Symbol,
uint64_t  Offset 
)
virtual

Emits a COFF section relative relocation.

Parameters
Symbol- Symbol the section relative relocation should point to.

Reimplemented in llvm::MCWinCOFFStreamer.

Definition at line 977 of file MCStreamer.cpp.

Referenced by llvm::CodeViewContext::emitLineTableForFunction(), and emitSymbolValue().

◆ emitCOFFSectionIndex()

void MCStreamer::emitCOFFSectionIndex ( MCSymbol const Symbol)
virtual

Emits a COFF section index.

Parameters
Symbol- Symbol the section number relocation should point to.

Reimplemented in llvm::MCWinCOFFStreamer.

Definition at line 975 of file MCStreamer.cpp.

Referenced by llvm::CodeViewContext::emitLineTableForFunction().

◆ emitCOFFSymbolIndex()

void MCStreamer::emitCOFFSymbolIndex ( MCSymbol const Symbol)
virtual

Emits the symbol table index of a Symbol into the current section.

Reimplemented in llvm::MCWinCOFFStreamer.

Definition at line 973 of file MCStreamer.cpp.

◆ emitCOFFSymbolStorageClass()

void MCStreamer::emitCOFFSymbolStorageClass ( int  StorageClass)
virtual

Emit the storage class of the symbol.

Parameters
StorageClass- The storage class the symbol should have.

Reimplemented in llvm::RecordStreamer, and llvm::MCWinCOFFStreamer.

Definition at line 1164 of file MCStreamer.cpp.

References llvm_unreachable.

◆ emitCOFFSymbolType()

void MCStreamer::emitCOFFSymbolType ( int  Type)
virtual

Emit the type of the symbol.

Parameters
Type- A COFF type identifier (see COFF::SymbolType in X86COFF.h)

Reimplemented in llvm::RecordStreamer, and llvm::MCWinCOFFStreamer.

Definition at line 1167 of file MCStreamer.cpp.

References llvm_unreachable.

◆ emitCommonSymbol()

virtual void llvm::MCStreamer::emitCommonSymbol ( MCSymbol Symbol,
uint64_t  Size,
unsigned  ByteAlignment 
)
pure virtual

Emit a common symbol.

Parameters
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.

Implemented in llvm::MCELFStreamer, llvm::MCWinCOFFStreamer, llvm::RecordStreamer, llvm::MCWasmStreamer, llvm::MCSPIRVStreamer, llvm::MCXCOFFStreamer, and llvm::MCDXContainerStreamer.

◆ emitConditionalAssignment()

void MCStreamer::emitConditionalAssignment ( MCSymbol Symbol,
const MCExpr Value 
)
virtual

Emit an assignment of Value to Symbol, but only if Value is also emitted.

Reimplemented in llvm::MCObjectStreamer.

Definition at line 442 of file MCStreamer.cpp.

◆ emitCVDefRangeDirective() [1/5]

void MCStreamer::emitCVDefRangeDirective ( ArrayRef< std::pair< const MCSymbol *, const MCSymbol * >>  Ranges,
codeview::DefRangeFramePointerRelHeader  DRHdr 
)
virtual

Definition at line 397 of file MCStreamer.cpp.

References copyBytesForDefRange(), and emitCVDefRangeDirective().

◆ emitCVDefRangeDirective() [2/5]

void MCStreamer::emitCVDefRangeDirective ( ArrayRef< std::pair< const MCSymbol *, const MCSymbol * >>  Ranges,
codeview::DefRangeRegisterHeader  DRHdr 
)
virtual

Definition at line 389 of file MCStreamer.cpp.

References copyBytesForDefRange(), and emitCVDefRangeDirective().

◆ emitCVDefRangeDirective() [3/5]

void MCStreamer::emitCVDefRangeDirective ( ArrayRef< std::pair< const MCSymbol *, const MCSymbol * >>  Ranges,
codeview::DefRangeRegisterRelHeader  DRHdr 
)
virtual

Definition at line 372 of file MCStreamer.cpp.

References copyBytesForDefRange(), and emitCVDefRangeDirective().

◆ emitCVDefRangeDirective() [4/5]

void MCStreamer::emitCVDefRangeDirective ( ArrayRef< std::pair< const MCSymbol *, const MCSymbol * >>  Ranges,
codeview::DefRangeSubfieldRegisterHeader  DRHdr 
)
virtual

Definition at line 380 of file MCStreamer.cpp.

References copyBytesForDefRange(), and emitCVDefRangeDirective().

◆ emitCVDefRangeDirective() [5/5]

void MCStreamer::emitCVDefRangeDirective ( ArrayRef< std::pair< const MCSymbol *, const MCSymbol * >>  Ranges,
StringRef  FixedSizePortion 
)
virtual

This implements the CodeView '.cv_def_range' assembler directive.

Reimplemented in llvm::MCObjectStreamer.

Definition at line 368 of file MCStreamer.cpp.

Referenced by llvm::MCObjectStreamer::emitCVDefRangeDirective(), and emitCVDefRangeDirective().

◆ emitCVFileChecksumOffsetDirective()

virtual void llvm::MCStreamer::emitCVFileChecksumOffsetDirective ( unsigned  FileNo)
inlinevirtual

This implements the CodeView '.cv_filechecksumoffset' assembler directive.

Reimplemented in llvm::MCObjectStreamer.

Definition at line 1003 of file MCStreamer.h.

◆ emitCVFileChecksumsDirective()

virtual void llvm::MCStreamer::emitCVFileChecksumsDirective ( )
inlinevirtual

This implements the CodeView '.cv_filechecksums' assembler directive.

Reimplemented in llvm::MCObjectStreamer.

Definition at line 999 of file MCStreamer.h.

◆ emitCVFileDirective()

bool MCStreamer::emitCVFileDirective ( unsigned  FileNo,
StringRef  Filename,
ArrayRef< uint8_t >  Checksum,
unsigned  ChecksumKind 
)
virtual

Associate a filename with a specified logical file number, and also specify that file's checksum information.

This implements the '.cv_file 4 "foo.c"' assembler directive. Returns true on success.

Definition at line 294 of file MCStreamer.cpp.

References llvm::CodeViewContext::addFile(), llvm::lltok::ChecksumKind, getContext(), and llvm::MCContext::getCVContext().

◆ emitCVFPOData()

virtual void llvm::MCStreamer::emitCVFPOData ( const MCSymbol ProcSym,
SMLoc  Loc = {} 
)
inlinevirtual

This implements the CodeView '.cv_fpo_data' assembler directive.

Definition at line 1006 of file MCStreamer.h.

◆ emitCVFuncIdDirective()

bool MCStreamer::emitCVFuncIdDirective ( unsigned  FunctionId)
virtual

Introduces a function id for use with .cv_loc.

Definition at line 301 of file MCStreamer.cpp.

References getContext(), llvm::MCContext::getCVContext(), and llvm::CodeViewContext::recordFunctionId().

Referenced by llvm::CodeViewDebug::beginFunctionImpl().

◆ emitCVInlineLinetableDirective()

void MCStreamer::emitCVInlineLinetableDirective ( unsigned  PrimaryFunctionId,
unsigned  SourceFileId,
unsigned  SourceLineNum,
const MCSymbol FnStartSym,
const MCSymbol FnEndSym 
)
virtual

This implements the CodeView '.cv_inline_linetable' assembler directive.

Reimplemented in llvm::MCObjectStreamer.

Definition at line 350 of file MCStreamer.cpp.

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

◆ emitCVInlineSiteIdDirective()

bool MCStreamer::emitCVInlineSiteIdDirective ( unsigned  FunctionId,
unsigned  IAFunc,
unsigned  IAFile,
unsigned  IALine,
unsigned  IACol,
SMLoc  Loc 
)
virtual

Introduces an inline call site id for use with .cv_loc.

Includes extra information for inline line table generation.

Definition at line 305 of file MCStreamer.cpp.

References getContext(), llvm::MCContext::getCVContext(), llvm::CodeViewContext::recordInlinedCallSiteId(), and llvm::MCContext::reportError().

◆ emitCVLinetableDirective()

void MCStreamer::emitCVLinetableDirective ( unsigned  FunctionId,
const MCSymbol FnStart,
const MCSymbol FnEnd 
)
virtual

This implements the CodeView '.cv_linetable' assembler directive.

Reimplemented in llvm::MCObjectStreamer.

Definition at line 346 of file MCStreamer.cpp.

◆ emitCVLocDirective()

void MCStreamer::emitCVLocDirective ( unsigned  FunctionId,
unsigned  FileNo,
unsigned  Line,
unsigned  Column,
bool  PrologueEnd,
bool  IsStmt,
StringRef  FileName,
SMLoc  Loc 
)
virtual

This implements the CodeView '.cv_loc' assembler directive.

Reimplemented in llvm::MCObjectStreamer.

Definition at line 319 of file MCStreamer.cpp.

◆ emitCVStringTableDirective()

virtual void llvm::MCStreamer::emitCVStringTableDirective ( )
inlinevirtual

This implements the CodeView '.cv_stringtable' assembler directive.

Reimplemented in llvm::MCObjectStreamer.

Definition at line 996 of file MCStreamer.h.

◆ emitDarwinTargetVariantBuildVersion()

virtual void llvm::MCStreamer::emitDarwinTargetVariantBuildVersion ( unsigned  Platform,
unsigned  Major,
unsigned  Minor,
unsigned  Update,
VersionTuple  SDKVersion 
)
inlinevirtual

Definition at line 512 of file MCStreamer.h.

Referenced by emitVersionForTarget().

◆ emitDataRegion()

virtual void llvm::MCStreamer::emitDataRegion ( MCDataRegionType  Kind)
inlinevirtual

Note in the output the specified region Kind.

Definition at line 499 of file MCStreamer.h.

Referenced by llvm::ConstantPool::emitEntries().

◆ emitDTPRel32Value()

void MCStreamer::emitDTPRel32Value ( const MCExpr Value)
virtual

Emit the expression Value into the output as a dtprel (32-bit DTP relative) value.

This is used to implement assembler directives such as .dtprelword on targets that support them.

Reimplemented in llvm::MCObjectStreamer.

Definition at line 197 of file MCStreamer.cpp.

References llvm::report_fatal_error().

◆ emitDTPRel64Value()

void MCStreamer::emitDTPRel64Value ( const MCExpr Value)
virtual

Emit the expression Value into the output as a dtprel (64-bit DTP relative) value.

This is used to implement assembler directives such as .dtpreldword on targets that support them.

Reimplemented in llvm::MCObjectStreamer.

Definition at line 193 of file MCStreamer.cpp.

References llvm::report_fatal_error().

◆ emitDwarfAdvanceLineAddr()

virtual void llvm::MCStreamer::emitDwarfAdvanceLineAddr ( int64_t  LineDelta,
const MCSymbol LastLabel,
const MCSymbol Label,
unsigned  PointerSize 
)
inlinevirtual

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.

Reimplemented in llvm::MCObjectStreamer.

Definition at line 1148 of file MCStreamer.h.

Referenced by llvm::MCDwarfLineTable::emitOne().

◆ emitDwarfFile0Directive()

void MCStreamer::emitDwarfFile0Directive ( StringRef  Directory,
StringRef  Filename,
Optional< MD5::MD5Result Checksum,
Optional< StringRef Source,
unsigned  CUID = 0 
)
virtual

Specify the "root" file of the compilation, using the ".file 0" extension.

Definition at line 239 of file MCStreamer.cpp.

References getContext(), llvm::MCContext::setMCLineTableRootFile(), and llvm::Sched::Source.

◆ emitDwarfFileDirective()

unsigned llvm::MCStreamer::emitDwarfFileDirective ( unsigned  FileNo,
StringRef  Directory,
StringRef  Filename,
Optional< MD5::MD5Result Checksum = None,
Optional< StringRef Source = None,
unsigned  CUID = 0 
)
inline

Associate a filename with a specified logical file number.

This implements the DWARF2 '.file 4 "foo.c"' assembler directive.

Definition at line 902 of file MCStreamer.h.

References llvm::cantFail(), llvm::Sched::Source, and tryEmitDwarfFileDirective().

◆ emitDwarfLineEndEntry()

virtual void llvm::MCStreamer::emitDwarfLineEndEntry ( MCSection Section,
MCSymbol LastLabel 
)
inlinevirtual

Emit the debug line end entry.

Reimplemented in llvm::MCObjectStreamer.

Definition at line 1143 of file MCStreamer.h.

Referenced by llvm::MCDwarfLineTable::emitOne().

◆ emitDwarfLineStartLabel()

void MCStreamer::emitDwarfLineStartLabel ( MCSymbol StartSym)
virtual

Emit the debug line start label.

Definition at line 1046 of file MCStreamer.cpp.

References emitLabel().

Referenced by llvm::MCDwarfLineTableHeader::Emit().

◆ emitDwarfLocDirective()

void MCStreamer::emitDwarfLocDirective ( unsigned  FileNo,
unsigned  Line,
unsigned  Column,
unsigned  Flags,
unsigned  Isa,
unsigned  Discriminator,
StringRef  FileName 
)
virtual

This implements the DWARF2 '.loc fileno lineno ...' assembler directive.

Reimplemented in llvm::MCObjectStreamer.

Definition at line 262 of file MCStreamer.cpp.

References getContext(), and llvm::MCContext::setCurrentDwarfLoc().

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

◆ emitDwarfUnitLength() [1/2]

MCSymbol * MCStreamer::emitDwarfUnitLength ( const Twine Prefix,
const Twine Comment 
)
virtual

Emit a unit length field.

The actual format, DWARF32 or DWARF64, is chosen according to the settings. Return the end symbol generated inside, the caller needs to emit it.

Definition at line 1031 of file MCStreamer.cpp.

References AddComment(), Context, emitAbsoluteSymbolDiff(), emitLabel(), llvm::dwarf::getDwarfOffsetByteSize(), llvm::MipsISD::Hi, llvm::MipsISD::Lo, maybeEmitDwarf64Mark(), and llvm::cl::Prefix.

◆ emitDwarfUnitLength() [2/2]

void MCStreamer::emitDwarfUnitLength ( uint64_t  Length,
const Twine Comment 
)
virtual

Emit a unit length field.

The actual format, DWARF32 or DWARF64, is chosen according to the settings.

Definition at line 1023 of file MCStreamer.cpp.

References AddComment(), assert(), Context, llvm::dwarf::DW_LENGTH_lo_reserved, llvm::dwarf::DWARF64, emitIntValue(), llvm::dwarf::getDwarfOffsetByteSize(), and maybeEmitDwarf64Mark().

Referenced by llvm::MCDwarfLineTableHeader::Emit().

◆ emitEHSymAttributes()

void MCStreamer::emitEHSymAttributes ( const MCSymbol Symbol,
MCSymbol EHSymbol 
)
virtual

Definition at line 406 of file MCStreamer.cpp.

◆ emitELFSize()

void MCStreamer::emitELFSize ( MCSymbol Symbol,
const MCExpr Value 
)
virtual

Emit an ELF .size directive.

This corresponds to an assembler statement such as: .size symbol, expression

Reimplemented in llvm::MCELFStreamer, and llvm::MCWasmStreamer.

Definition at line 1193 of file MCStreamer.cpp.

Referenced by llvm::TargetLoweringObjectFileELF::emitPersonalityValue().

◆ emitELFSymverDirective()

void MCStreamer::emitELFSymverDirective ( const MCSymbol OriginalSym,
StringRef  Name,
bool  KeepOriginalSym 
)
virtual

Emit an ELF .symver directive.

This corresponds to an assembler statement such as: .symver _start, foo@SOME_VERSION

Reimplemented in llvm::RecordStreamer, and llvm::MCELFStreamer.

Definition at line 1194 of file MCStreamer.cpp.

◆ emitExplicitComments()

void MCStreamer::emitExplicitComments ( )
virtual

Emit added explicit comments.

Definition at line 124 of file MCStreamer.cpp.

◆ emitFileDirective() [1/2]

void MCStreamer::emitFileDirective ( StringRef  Filename)
virtual

Switch to a new logical file.

This is used to implement the '.file "foo.c"' assembler directive.

Reimplemented in llvm::MCObjectStreamer.

Definition at line 1160 of file MCStreamer.cpp.

◆ emitFileDirective() [2/2]

void MCStreamer::emitFileDirective ( StringRef  Filename,
StringRef  CompilerVerion,
StringRef  TimeStamp,
StringRef  Description 
)
virtual

Emit ".file assembler diretive with additioal info.

Reimplemented in llvm::MCObjectStreamer.

Definition at line 1161 of file MCStreamer.cpp.

◆ emitFill() [1/3]

void MCStreamer::emitFill ( const MCExpr NumBytes,
uint64_t  FillValue,
SMLoc  Loc = SMLoc() 
)
virtual

Emit Size bytes worth of the value specified by FillValue.

This is used to implement assembler directives such as .space or .skip.

Parameters
NumBytes- The number of bytes to emit.
FillValue- The value to use when filling bytes.
Loc- The location of the expression for error reporting.

Reimplemented in llvm::MCObjectStreamer, and llvm::CSKYELFStreamer.

Definition at line 1209 of file MCStreamer.cpp.

◆ emitFill() [2/3]

void MCStreamer::emitFill ( const MCExpr NumValues,
int64_t  Size,
int64_t  Expr,
SMLoc  Loc = SMLoc() 
)
virtual

Emit NumValues copies of Size bytes.

Each Size bytes is taken from the lowest order 4 bytes of Expr expression.

This is used to implement assembler directives such as .fill.

Parameters
NumValues- The number of copies of Size bytes to emit.
Size- The size (in bytes) of each repeated value.
Expr- The expression from which Size bytes are used.

Reimplemented in llvm::MCObjectStreamer.

Definition at line 1210 of file MCStreamer.cpp.

◆ emitFill() [3/3]

void MCStreamer::emitFill ( uint64_t  NumBytes,
uint8_t  FillValue 
)

Emit NumBytes bytes worth of the value specified by FillValue.

This implements directives such as '.space'.

Definition at line 219 of file MCStreamer.cpp.

References llvm::MCConstantExpr::create(), and getContext().

Referenced by emitGenDwarfRanges(), and emitZeros().

◆ emitGNUAttribute()

virtual void llvm::MCStreamer::emitGNUAttribute ( unsigned  Tag,
unsigned  Value 
)
inlinevirtual

Emit a .gnu_attribute directive.

Reimplemented in llvm::MCELFStreamer.

Definition at line 655 of file MCStreamer.h.

◆ emitGPRel32Value()

void MCStreamer::emitGPRel32Value ( const MCExpr Value)
virtual

Emit the expression Value into the output as a gprel32 (32-bit GP relative) value.

This is used to implement assembler directives such as .gprel32 on targets that support them.

Reimplemented in llvm::MCObjectStreamer.

Definition at line 213 of file MCStreamer.cpp.

References llvm::report_fatal_error().

◆ emitGPRel64Value()

void MCStreamer::emitGPRel64Value ( const MCExpr Value)
virtual

Emit the expression Value into the output as a gprel64 (64-bit GP relative) value.

This is used to implement assembler directives such as .gpdword on targets that support them.

Reimplemented in llvm::MCObjectStreamer.

Definition at line 209 of file MCStreamer.cpp.

References llvm::report_fatal_error().

◆ emitIdent()

virtual void llvm::MCStreamer::emitIdent ( StringRef  IdentString)
inlinevirtual

Emit the "identifiers" directive.

This implements the '.ident "version foo"' assembler directive.

Reimplemented in llvm::MCELFStreamer, llvm::MCWasmStreamer, and llvm::MCWinCOFFStreamer.

Definition at line 898 of file MCStreamer.h.

◆ emitInstruction()

void MCStreamer::emitInstruction ( const MCInst Inst,
const MCSubtargetInfo STI 
)
virtual

◆ emitInt16()

void llvm::MCStreamer::emitInt16 ( uint64_t  Value)
inline

◆ emitInt32()

void llvm::MCStreamer::emitInt32 ( uint64_t  Value)
inline

◆ emitInt64()

void llvm::MCStreamer::emitInt64 ( uint64_t  Value)
inline

◆ emitInt8()

void llvm::MCStreamer::emitInt8 ( uint64_t  Value)
inline

◆ emitIntValue() [1/2]

void MCStreamer::emitIntValue ( APInt  Value)
virtual

◆ emitIntValue() [2/2]

void MCStreamer::emitIntValue ( uint64_t  Value,
unsigned  Size 
)
virtual

◆ emitIntValueInHex()

virtual void llvm::MCStreamer::emitIntValueInHex ( uint64_t  Value,
unsigned  Size 
)
inlinevirtual

Special case of EmitValue that avoids the client having to pass in a MCExpr for constant integers & prints in Hex format for certain modes.

Definition at line 732 of file MCStreamer.h.

References emitIntValue().

◆ emitIntValueInHexWithPadding()

virtual void llvm::MCStreamer::emitIntValueInHexWithPadding ( uint64_t  Value,
unsigned  Size 
)
inlinevirtual

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.

Definition at line 744 of file MCStreamer.h.

References emitIntValue().

◆ emitLabel()

void MCStreamer::emitLabel ( MCSymbol Symbol,
SMLoc  Loc = SMLoc() 
)
virtual

Emit a label for Symbol into the current section.

This corresponds to an assembler statement such as: foo:

Parameters
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 in llvm::MCObjectStreamer, llvm::MCELFStreamer, llvm::RecordStreamer, llvm::MipsELFStreamer, llvm::MCWasmStreamer, llvm::MCWinCOFFStreamer, and llvm::PPCELFStreamer.

Definition at line 423 of file MCStreamer.cpp.

References assert(), llvm::MCTargetStreamer::emitLabel(), getContext(), getCurrentSectionOnly(), getTargetStreamer(), llvm::MCContext::reportError(), and llvm::ARMBuildAttrs::Symbol.

Referenced by ARM64EmitUnwindInfo(), ARMEmitUnwindInfo(), llvm::BTFDebug::beginInstruction(), llvm::MCDwarfLineTableHeader::Emit(), llvm::MCDwarfDwoLineTable::Emit(), llvm::MCGenDwarfInfo::Emit(), llvm::AMDGPUTargetELFStreamer::EmitAmdhsaKernelDescriptor(), llvm::SystemZTargetStreamer::emitConstantPools(), llvm::MCDwarfLineTable::emitCU(), llvm::MipsTargetELFStreamer::emitDirectiveEnd(), emitDirectiveRelocJalr(), emitDwarfLineStartLabel(), emitDwarfUnitLength(), EmitGenDwarfInfo(), emitGenDwarfRanges(), llvm::RecordStreamer::emitLabel(), llvm::MCObjectStreamer::emitLabel(), llvm::MCObjectStreamer::emitLabelAtPos(), llvm::DwarfStreamer::emitLineTableForUnit(), llvm::TargetLoweringObjectFileELF::emitModuleMetadata(), llvm::TargetLoweringObjectFileMachO::emitModuleMetadata(), llvm::TargetLoweringObjectFileCOFF::emitModuleMetadata(), emitNonLazySymbolPointer(), EmitNop(), llvm::TargetLoweringObjectFileELF::emitPersonalityValue(), emitPseudoProbe(), EmitUnwindInfo(), endSection(), llvm::MCAsmInfo::getExprForFDESymbol(), llvm::AArch64MCAsmInfoDarwin::getExprForPersonalitySymbol(), llvm::AArch64_MachoTargetObjectFile::getIndirectSymViaGOTPCRel(), llvm::AArch64_MachoTargetObjectFile::getTTypeGlobalReference(), llvm::TargetLoweringObjectFile::getTTypeReference(), llvm::MCDwarfLineEntry::make(), llvm::MCGenDwarfLabelEntry::Make(), llvm::FaultMaps::serializeToFaultMapSection(), llvm::StackMaps::serializeToStackMapSection(), smallData(), and switchSection().

◆ emitLinkerOptions()

virtual void llvm::MCStreamer::emitLinkerOptions ( ArrayRef< std::string >  Kind)
inlinevirtual

Emit the given list Options of strings as linker options into the output.

Definition at line 496 of file MCStreamer.h.

Referenced by llvm::TargetLoweringObjectFileMachO::emitModuleMetadata().

◆ emitLocalCommonSymbol()

void MCStreamer::emitLocalCommonSymbol ( MCSymbol Symbol,
uint64_t  Size,
unsigned  ByteAlignment 
)
virtual

Emit a local common (.lcomm) symbol.

Parameters
Symbol- The common symbol to emit.
Size- The size of the common symbol.
ByteAlignment- The alignment of the common symbol in bytes.

Reimplemented in llvm::MCELFStreamer, llvm::MCWinCOFFStreamer, and llvm::MCWasmStreamer.

Definition at line 1196 of file MCStreamer.cpp.

◆ emitLOHDirective()

virtual void llvm::MCStreamer::emitLOHDirective ( MCLOHType  Kind,
const MCLOHArgs Args 
)
inlinevirtual

Emit a Linker Optimization Hint (LOH) directive.

Parameters
Args- Arguments of the LOH.

Definition at line 652 of file MCStreamer.h.

◆ emitNops()

void llvm::MCStreamer::emitNops ( int64_t  NumBytes,
int64_t  ControlledNopLength,
llvm::SMLoc  Loc,
const MCSubtargetInfo STI 
)
virtual

Reimplemented in llvm::MCObjectStreamer.

Definition at line 223 of file MCStreamer.cpp.

◆ emitPseudoProbe()

void MCStreamer::emitPseudoProbe ( uint64_t  Guid,
uint64_t  Index,
uint64_t  Type,
uint64_t  Attr,
const MCPseudoProbeInlineStack InlineStack 
)
virtual

Emit the a pseudo probe into the current section.

Definition at line 1103 of file MCStreamer.cpp.

References Context, emitLabel(), getContext(), and getCurrentSectionOnly().

◆ emitRawComment()

void MCStreamer::emitRawComment ( const Twine T,
bool  TabPrefix = true 
)
virtual

Print T and prefix it with the comment string (normally #) and optionally a tab.

This prints the comment immediately, not at the end of the current line. It is basically a safe version of EmitRawText: since it only prints comments, the object streamer ignores it instead of asserting.

Definition at line 121 of file MCStreamer.cpp.

Referenced by NoAutoPaddingScope::changeAndComment().

◆ emitRawText()

void MCStreamer::emitRawText ( const Twine String)

If this file is backed by a assembly streamer, this dumps the specified string in the output .s file.

This capability is indicated by the hasRawTextSupport() predicate. By default this aborts.

Definition at line 993 of file MCStreamer.cpp.

References emitRawTextImpl(), and T.

Referenced by llvm::NVPTXTargetStreamer::closeLastSection(), llvm::MCTargetStreamer::emitDwarfFileDirective(), llvm::MCTargetStreamer::emitRawBytes(), llvm::MCTargetStreamer::emitValue(), and llvm::NVPTXTargetStreamer::outputDwarfFileDirectives().

◆ emitRawTextImpl()

void MCStreamer::emitRawTextImpl ( StringRef  String)
protectedvirtual

EmitRawText - If this file is backed by an assembly streamer, this dumps the specified string in the output .s file.

This capability is indicated by the hasRawTextSupport() predicate.

Definition at line 984 of file MCStreamer.cpp.

References llvm::report_fatal_error().

Referenced by emitRawText().

◆ emitRelocDirective()

virtual Optional<std::pair<bool, std::string> > llvm::MCStreamer::emitRelocDirective ( const MCExpr Offset,
StringRef  Name,
const MCExpr Expr,
SMLoc  Loc,
const MCSubtargetInfo STI 
)
inlinevirtual

Record a relocation described by the .reloc directive.

Return None if succeeded. Otherwise, return a pair (Name is invalid, error message).

Reimplemented in llvm::MCObjectStreamer.

Definition at line 1084 of file MCStreamer.h.

References llvm::None.

Referenced by emitDirectiveRelocJalr().

◆ emitSLEB128IntValue()

void MCStreamer::emitSLEB128IntValue ( int64_t  Value)

Special case of EmitSLEB128Value that avoids the client having to pass in a MCExpr for constant integers.

EmitSLEB128IntValue - Special case of EmitSLEB128Value that avoids the client having to pass in a MCExpr for constant integers.

Definition at line 171 of file MCStreamer.cpp.

References emitBytes(), llvm::encodeSLEB128(), and llvm::raw_svector_ostream::str().

Referenced by llvm::MCPseudoProbe::emit(), llvm::DwarfStreamer::emitLineTableForUnit(), and llvm::MCObjectStreamer::emitSLEB128Value().

◆ emitSLEB128Value()

void MCStreamer::emitSLEB128Value ( const MCExpr Value)
virtual

Reimplemented in llvm::MCObjectStreamer.

Definition at line 1208 of file MCStreamer.cpp.

◆ emitSymbolAttribute()

virtual bool llvm::MCStreamer::emitSymbolAttribute ( MCSymbol Symbol,
MCSymbolAttr  Attribute 
)
pure virtual

◆ emitSymbolDesc()

void MCStreamer::emitSymbolDesc ( MCSymbol Symbol,
unsigned  DescValue 
)
virtual

Set the DescValue for the Symbol.

Parameters
Symbol- The symbol to have its n_desc field set.
DescValue- The value to set into the n_desc field.

Reimplemented in llvm::MCELFStreamer, llvm::MCWasmStreamer, and llvm::MCWinCOFFStreamer.

Definition at line 1153 of file MCStreamer.cpp.

◆ emitSymbolValue()

void MCStreamer::emitSymbolValue ( const MCSymbol Sym,
unsigned  Size,
bool  IsSectionRelative = false 
)

◆ emitSyntaxDirective()

void MCStreamer::emitSyntaxDirective ( )
virtual

Definition at line 858 of file MCStreamer.cpp.

◆ emitTBSSSymbol()

void MCStreamer::emitTBSSSymbol ( MCSection Section,
MCSymbol Symbol,
uint64_t  Size,
unsigned  ByteAlignment = 0 
)
virtual

Emit a thread local bss (.tbss) symbol.

Parameters
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 in llvm::MCELFStreamer, llvm::MCWasmStreamer, and llvm::MCWinCOFFStreamer.

Definition at line 1198 of file MCStreamer.cpp.

◆ emitThumbFunc()

void MCStreamer::emitThumbFunc ( MCSymbol Func)
virtual

Note in the output that the specified Func is a Thumb mode function (ARM target only).

Reimplemented in llvm::MCELFStreamer, llvm::MCWasmStreamer, and llvm::MCWinCOFFStreamer.

Definition at line 1152 of file MCStreamer.cpp.

◆ emitTPRel32Value()

void MCStreamer::emitTPRel32Value ( const MCExpr Value)
virtual

Emit the expression Value into the output as a tprel (32-bit TP relative) value.

This is used to implement assembler directives such as .tprelword on targets that support them.

Reimplemented in llvm::MCObjectStreamer.

Definition at line 205 of file MCStreamer.cpp.

References llvm::report_fatal_error().

◆ emitTPRel64Value()

void MCStreamer::emitTPRel64Value ( const MCExpr Value)
virtual

Emit the expression Value into the output as a tprel (64-bit TP relative) value.

This is used to implement assembler directives such as .tpreldword on targets that support them.

Reimplemented in llvm::MCObjectStreamer.

Definition at line 201 of file MCStreamer.cpp.

References llvm::report_fatal_error().

◆ emitULEB128IntValue()

void MCStreamer::emitULEB128IntValue ( uint64_t  Value,
unsigned  PadTo = 0 
)

◆ emitULEB128Value()

void MCStreamer::emitULEB128Value ( const MCExpr Value)
virtual

Reimplemented in llvm::MCObjectStreamer.

Definition at line 1207 of file MCStreamer.cpp.

Referenced by emitAbsoluteSymbolDiffAsULEB128(), and emitGenDwarfRanges().

◆ emitValue()

void MCStreamer::emitValue ( const MCExpr Value,
unsigned  Size,
SMLoc  Loc = SMLoc() 
)

◆ emitValueImpl()

void MCStreamer::emitValueImpl ( const MCExpr Value,
unsigned  Size,
SMLoc  Loc = SMLoc() 
)
virtual

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.

Parameters
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 in llvm::MCObjectStreamer, llvm::MCELFStreamer, llvm::CSKYELFStreamer, and llvm::MipsELFStreamer.

Definition at line 1204 of file MCStreamer.cpp.

References visitUsedExpr().

Referenced by llvm::MipsTargetELFStreamer::emitDirectiveEnd(), emitSymbolValue(), emitValue(), and llvm::MCObjectStreamer::emitValueImpl().

◆ emitValueToAlignment()

void MCStreamer::emitValueToAlignment ( unsigned  ByteAlignment,
int64_t  Value = 0,
unsigned  ValueSize = 1,
unsigned  MaxBytesToEmit = 0 
)
virtual

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.

Parameters
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 in llvm::MCELFStreamer, and llvm::MCObjectStreamer.

Definition at line 1212 of file MCStreamer.cpp.

Referenced by ARM64EmitUnwindInfo(), ARMEmitRuntimeFunction(), ARMEmitUnwindInfo(), llvm::AMDGPUTargetELFStreamer::EmitCodeEnd(), llvm::AArch64TargetStreamer::emitNoteSection(), llvm::TargetLoweringObjectFileELF::emitPersonalityValue(), EmitRuntimeFunction(), EmitUnwindInfo(), and llvm::MipsTargetELFStreamer::finish().

◆ emitValueToOffset()

void MCStreamer::emitValueToOffset ( const MCExpr Offset,
unsigned char  Value,
SMLoc  Loc 
)
virtual

Emit some number of copies of Value until the byte offset Offset is reached.

This is used to implement assembler directives such as .org.

Parameters
Offset- The offset to reach. This may be an expression, but the expression must be associated with the current section.
Value- The value to use when filling bytes.

Reimplemented in llvm::MCObjectStreamer.

Definition at line 1218 of file MCStreamer.cpp.

Referenced by llvm::MCParserUtils::parseAssignmentExpression().

◆ emitVersionForTarget()

void MCStreamer::emitVersionForTarget ( const Triple Target,
const VersionTuple SDKVersion,
const Triple DarwinTargetVariantTriple,
const VersionTuple DarwinTargetVariantSDKVersion 
)

◆ emitVersionMin()

virtual void llvm::MCStreamer::emitVersionMin ( MCVersionMinType  Type,
unsigned  Major,
unsigned  Minor,
unsigned  Update,
VersionTuple  SDKVersion 
)
inlinevirtual

Specify the Mach-O minimum deployment target version.

Definition at line 502 of file MCStreamer.h.

Referenced by emitVersionForTarget().

◆ emitWeakReference()

void MCStreamer::emitWeakReference ( MCSymbol Alias,
const MCSymbol Symbol 
)
virtual

Emit an weak reference from Alias to Symbol.

This corresponds to an assembler statement such as: .weakref alias, symbol

Parameters
Alias- The alias that is being created.
Symbol- The symbol being aliased.

Reimplemented in llvm::MCObjectStreamer, llvm::MCWinCOFFStreamer, llvm::MCELFStreamer, and llvm::MCWasmStreamer.

Definition at line 1201 of file MCStreamer.cpp.

◆ emitWinCFIAllocStack()

void MCStreamer::emitWinCFIAllocStack ( unsigned  Size,
SMLoc  Loc = SMLoc() 
)
virtual

◆ emitWinCFIEndChained()

void MCStreamer::emitWinCFIEndChained ( SMLoc  Loc = SMLoc())
virtual

◆ emitWinCFIEndProc()

void MCStreamer::emitWinCFIEndProc ( SMLoc  Loc = SMLoc())
virtual

◆ emitWinCFIEndProlog()

void MCStreamer::emitWinCFIEndProlog ( SMLoc  Loc = SMLoc())
virtual

◆ emitWinCFIFuncletOrFuncEnd()

void MCStreamer::emitWinCFIFuncletOrFuncEnd ( SMLoc  Loc = SMLoc())
virtual

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.

We cannot use the End marker, as it is not set at the point of emitting .xdata, in order to indicate that the frame is active.

Definition at line 745 of file MCStreamer.cpp.

References llvm::WinEH::FrameInfo::ChainedParent, emitCFILabel(), EnsureValidWinFrameInfo(), llvm::WinEH::FrameInfo::FuncletOrFuncEnd, getContext(), and llvm::MCContext::reportError().

◆ emitWinCFIPushFrame()

void MCStreamer::emitWinCFIPushFrame ( bool  Code,
SMLoc  Loc = SMLoc() 
)
virtual

◆ emitWinCFIPushReg()

void MCStreamer::emitWinCFIPushReg ( MCRegister  Register,
SMLoc  Loc = SMLoc() 
)
virtual

◆ emitWinCFISaveReg()

void MCStreamer::emitWinCFISaveReg ( MCRegister  Register,
unsigned  Offset,
SMLoc  Loc = SMLoc() 
)
virtual

◆ emitWinCFISaveXMM()

void MCStreamer::emitWinCFISaveXMM ( MCRegister  Register,
unsigned  Offset,
SMLoc  Loc = SMLoc() 
)
virtual

◆ emitWinCFISetFrame()

void MCStreamer::emitWinCFISetFrame ( MCRegister  Register,
unsigned  Offset,
SMLoc  Loc = SMLoc() 
)
virtual

◆ emitWinCFIStartChained()

void MCStreamer::emitWinCFIStartChained ( SMLoc  Loc = SMLoc())
virtual

◆ emitWinCFIStartProc()

void MCStreamer::emitWinCFIStartProc ( const MCSymbol Symbol,
SMLoc  Loc = SMLoc() 
)
virtual

◆ emitWindowsUnwindTables() [1/2]

void MCStreamer::emitWindowsUnwindTables ( )
protectedvirtual

Definition at line 998 of file MCStreamer.cpp.

Referenced by emitWinCFIEndProc().

◆ emitWindowsUnwindTables() [2/2]

void MCStreamer::emitWindowsUnwindTables ( WinEH::FrameInfo Frame)
protectedvirtual

Definition at line 1000 of file MCStreamer.cpp.

◆ emitWinEHHandler()

void MCStreamer::emitWinEHHandler ( const MCSymbol Sym,
bool  Unwind,
bool  Except,
SMLoc  Loc = SMLoc() 
)
virtual

◆ emitWinEHHandlerData()

void MCStreamer::emitWinEHHandlerData ( SMLoc  Loc = SMLoc())
virtual

◆ emitXCOFFLocalCommonSymbol()

void MCStreamer::emitXCOFFLocalCommonSymbol ( MCSymbol LabelSym,
uint64_t  Size,
MCSymbol CsectSym,
unsigned  ByteAlignment 
)
virtual

Emits an lcomm directive with XCOFF csect information.

Parameters
LabelSym- Label on the block of storage.
Size- The size of the block of storage.
CsectSym- Csect name for the block of storage.
ByteAlignment- The alignment of the symbol in bytes. Must be a power of 2.

Reimplemented in llvm::MCXCOFFStreamer.

Definition at line 1170 of file MCStreamer.cpp.

References llvm_unreachable.

◆ emitXCOFFRefDirective()

void MCStreamer::emitXCOFFRefDirective ( StringRef  Sym)
virtual

Emit a XCOFF .ref directive which creates R_REF type entry in the relocation table for one or more symbols.

Parameters
Sym- The symbol on the .ref directive.

Reimplemented in llvm::MCXCOFFStreamer.

Definition at line 1189 of file MCStreamer.cpp.

References llvm_unreachable.

◆ emitXCOFFRenameDirective()

void MCStreamer::emitXCOFFRenameDirective ( const MCSymbol Name,
StringRef  Rename 
)
virtual

Emit a XCOFF .rename directive which creates a synonym for an illegal or undesirable name.

Parameters
Name- The name used internally in the assembly for references to the symbol.
Rename- The value to which the Name parameter is changed at the end of assembly.

Reimplemented in llvm::MCXCOFFStreamer.

Definition at line 1183 of file MCStreamer.cpp.

References llvm_unreachable.

◆ emitXCOFFSymbolLinkageWithVisibility()

void MCStreamer::emitXCOFFSymbolLinkageWithVisibility ( MCSymbol Symbol,
MCSymbolAttr  Linkage,
MCSymbolAttr  Visibility 
)
virtual

Emit a symbol's linkage and visibility with a linkage directive for XCOFF.

Parameters
Symbol- The symbol to emit.
Linkage- The linkage of the symbol to emit.
Visibility- The visibility of the symbol to emit or MCSA_Invalid if the symbol does not have an explicit visibility.

Reimplemented in llvm::MCXCOFFStreamer.

Definition at line 1176 of file MCStreamer.cpp.

References llvm_unreachable.

◆ emitZerofill()

virtual void llvm::MCStreamer::emitZerofill ( MCSection Section,
MCSymbol Symbol = nullptr,
uint64_t  Size = 0,
unsigned  ByteAlignment = 0,
SMLoc  Loc = SMLoc() 
)
pure virtual

Emit the zerofill section and an optional symbol.

Parameters
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.

Implemented in llvm::MCWasmStreamer, llvm::MCSPIRVStreamer, llvm::MCXCOFFStreamer, llvm::MCELFStreamer, llvm::MCWinCOFFStreamer, llvm::RecordStreamer, and llvm::MCDXContainerStreamer.

◆ emitZeros()

void MCStreamer::emitZeros ( uint64_t  NumBytes)

Emit NumBytes worth of zeros.

The implementation in this class just redirects to emitFill.

This function properly handles data in virtual sections.

Definition at line 227 of file MCStreamer.cpp.

References emitFill().

Referenced by llvm::AsmPrinter::XRayFunctionEntry::emit(), llvm::MCXCOFFStreamer::emitCommonSymbol(), llvm::MCELFStreamer::emitCommonSymbol(), llvm::MCWinCOFFStreamer::emitLocalCommonSymbol(), and llvm::HexagonMCELFStreamer::HexagonMCEmitCommonSymbol().

◆ endCOFFSymbolDef()

void MCStreamer::endCOFFSymbolDef ( )
virtual

Marks the end of the symbol definition.

Reimplemented in llvm::RecordStreamer, and llvm::MCWinCOFFStreamer.

Definition at line 1157 of file MCStreamer.cpp.

References llvm_unreachable.

◆ endSection()

MCSymbol * MCStreamer::endSection ( MCSection Section)

◆ EnsureValidWinFrameInfo()

WinEH::FrameInfo * MCStreamer::EnsureValidWinFrameInfo ( SMLoc  Loc)

◆ finish()

void MCStreamer::finish ( SMLoc  EndLoc = SMLoc())

Finish emission of machine code.

Definition at line 1002 of file MCStreamer.cpp.

References llvm::MCTargetStreamer::finish(), finishImpl(), getContext(), getTargetStreamer(), and llvm::MCContext::reportError().

Referenced by llvm::DwarfStreamer::finish().

◆ finishImpl()

void MCStreamer::finishImpl ( )
virtual

Streamer specific finalization.

Reimplemented in llvm::MCObjectStreamer, llvm::MCELFStreamer, llvm::MCWinCOFFStreamer, and llvm::MCWasmStreamer.

Definition at line 1222 of file MCStreamer.cpp.

Referenced by finish().

◆ generateCompactUnwindEncodings()

void MCStreamer::generateCompactUnwindEncodings ( MCAsmBackend MAB)

◆ getAllowAutoPadding()

bool llvm::MCStreamer::getAllowAutoPadding ( ) const
inline

Definition at line 305 of file MCStreamer.h.

Referenced by NoAutoPaddingScope::changeAndComment().

◆ getAssemblerPtr()

virtual MCAssembler* llvm::MCStreamer::getAssemblerPtr ( )
inlinevirtual

Reimplemented in llvm::MCObjectStreamer.

Definition at line 295 of file MCStreamer.h.

◆ getAssociatedPDataSection()

MCSection * MCStreamer::getAssociatedPDataSection ( const MCSection TextSec)

Get the .pdata section used for the given section.

Typically the given section is either the main .text section or some other COMDAT .text section, but it may be any section containing code.

Definition at line 846 of file MCStreamer.cpp.

References getContext(), and getWinCFISection().

Referenced by llvm::Win64EH::UnwindEmitter::Emit(), llvm::Win64EH::ARMUnwindEmitter::Emit(), and llvm::Win64EH::ARM64UnwindEmitter::Emit().

◆ getAssociatedXDataSection()

MCSection * MCStreamer::getAssociatedXDataSection ( const MCSection TextSec)

◆ getCommentOS()

raw_ostream & MCStreamer::getCommentOS ( )
virtual

Return a raw_ostream that comments can be written to.

Unlike AddComment, you are required to terminate comments with
if you use this method.

Definition at line 111 of file MCStreamer.cpp.

References llvm::nulls().

◆ getContext()

MCContext& llvm::MCStreamer::getContext ( ) const
inline

Definition at line 293 of file MCStreamer.h.

References Context.

Referenced by llvm::CSKYConstantPool::addEntry(), llvm::AssemblerConstantPools::addEntry(), llvm::CodeViewContext::addFile(), ARM64EmitUnwindInfo(), ARMEmitRuntimeFunction(), ARMEmitUnwindInfo(), llvm::BTFDebug::beginInstruction(), buildSymbolDiff(), llvm::NVPTXTargetStreamer::changeSection(), llvm::MCTargetStreamer::changeSection(), llvm::MCObjectStreamer::changeSectionImpl(), checkCVLocSection(), llvm::MCPseudoProbe::emit(), llvm::MCDwarfLineTableHeader::Emit(), llvm::MCPseudoProbeSection::emit(), llvm::MCPseudoProbeTable::emit(), llvm::MCDwarfLineTable::emit(), llvm::MCDwarfLineAddr::Emit(), llvm::MCGenDwarfInfo::Emit(), llvm::MCDwarfFrameEmitter::Emit(), EmitAbsDifference(), llvm::MCObjectStreamer::emitAbsoluteSymbolDiff(), llvm::MCObjectStreamer::emitAbsoluteSymbolDiffAsULEB128(), llvm::MCDwarfFrameEmitter::EmitAdvanceLoc(), llvm::AMDGPUTargetELFStreamer::EmitAmdhsaKernelDescriptor(), llvm::MipsELFStreamer::emitCFIEndProcImpl(), llvm::MipsELFStreamer::emitCFILabel(), emitCFIStartProc(), llvm::MipsELFStreamer::emitCFIStartProcImpl(), llvm::MCWinCOFFStreamer::emitCOFFImgRel32(), llvm::MCWinCOFFStreamer::emitCOFFSafeSEH(), llvm::MCWinCOFFStreamer::emitCOFFSecRel32(), llvm::MCWinCOFFStreamer::emitCOFFSectionIndex(), llvm::MCWinCOFFStreamer::emitCommonSymbol(), llvm::MCELFStreamer::emitCommonSymbol(), llvm::SystemZTargetStreamer::emitConstantPools(), llvm::MCObjectStreamer::emitCVDefRangeDirective(), llvm::MCObjectStreamer::emitCVFileChecksumOffsetDirective(), llvm::MCObjectStreamer::emitCVFileChecksumsDirective(), emitCVFileDirective(), emitCVFuncIdDirective(), llvm::MCObjectStreamer::emitCVInlineLinetableDirective(), emitCVInlineSiteIdDirective(), llvm::MCObjectStreamer::emitCVLocDirective(), llvm::MCObjectStreamer::emitCVStringTableDirective(), emitDwarfFile0Directive(), llvm::MCObjectStreamer::emitDwarfLineEndEntry(), emitDwarfLocDirective(), emitFDESymbol(), llvm::CodeViewContext::emitFileChecksumOffset(), llvm::CodeViewContext::emitFileChecksums(), llvm::MCObjectStreamer::emitFill(), emitFill(), EmitGenDwarfAbbrev(), EmitGenDwarfAranges(), EmitGenDwarfInfo(), emitGenDwarfRanges(), llvm::ARMTargetStreamer::emitInst(), llvm::MipsELFStreamer::emitInstruction(), llvm::MCObjectStreamer::emitInstruction(), emitLabel(), llvm::CodeViewContext::emitLineTableForFunction(), llvm::MCWinCOFFStreamer::emitLocalCommonSymbol(), emitNonLazySymbolPointer(), llvm::AArch64TargetStreamer::emitNoteSection(), llvm::MCDwarfLineTable::emitOne(), EmitPersonality(), emitPseudoProbe(), llvm::NVPTXTargetStreamer::emitRawBytes(), llvm::MCTargetStreamer::emitRawBytes(), llvm::MCDwarfLineStr::emitRef(), llvm::MCObjectStreamer::emitRelocDirective(), EmitRuntimeFunction(), llvm::MCDwarfLineStr::emitSection(), llvm::CodeViewContext::emitStringTable(), llvm::MCELFStreamer::emitSymbolAttribute(), EmitSymbolRefWithOfs(), emitSymbolValue(), EmitUnwindInfo(), llvm::MCTargetStreamer::emitValue(), llvm::AVRMCELFStreamer::emitValueForModiferKind(), llvm::MCObjectStreamer::emitValueImpl(), llvm::MCWasmStreamer::emitWeakReference(), llvm::MCELFStreamer::emitWeakReference(), llvm::MCWinCOFFStreamer::emitWeakReference(), emitWinCFIAllocStack(), emitWinCFIEndChained(), emitWinCFIEndProc(), emitWinCFIFuncletOrFuncEnd(), emitWinCFIPushFrame(), emitWinCFISaveReg(), emitWinCFISaveXMM(), emitWinCFISetFrame(), emitWinCFIStartProc(), emitWinEHHandler(), emitWinEHHandlerData(), EnsureValidWinFrameInfo(), finish(), llvm::MCObjectStreamer::finishImpl(), llvm::RecordStreamer::flushSymverDirectives(), forceExpAbs(), getAssociatedPDataSection(), getAssociatedXDataSection(), llvm::AMDGPUTargetStreamer::getContext(), getDataAlignmentFactor(), getDwarfLineTableSymbol(), llvm::RISCVMCAsmInfo::getExprForFDESymbol(), llvm::SparcELFMCAsmInfo::getExprForFDESymbol(), llvm::MCAsmInfo::getExprForFDESymbol(), llvm::AArch64MCAsmInfoDarwin::getExprForPersonalitySymbol(), llvm::SparcELFMCAsmInfo::getExprForPersonalitySymbol(), llvm::X86_64MCAsmInfoDarwin::getExprForPersonalitySymbol(), GetOptionalAbsDifference(), getSizeForEncoding(), GetSubDivExpr(), llvm::HexagonMCELFStreamer::HexagonMCEmitCommonSymbol(), llvm::MCWinCOFFStreamer::initSections(), llvm::MCELFStreamer::initSections(), initSections(), llvm::MCDwarfLineEntry::make(), llvm::MCGenDwarfLabelEntry::Make(), llvm::MSP430TargetELFStreamer::MSP430TargetELFStreamer(), smallData(), tryEmitDwarfFileDirective(), and llvm::write().

◆ getCurrentSection()

MCSectionSubPair llvm::MCStreamer::getCurrentSection ( ) const
inline

Return the current section that the streamer is emitting code to.

Definition at line 384 of file MCStreamer.h.

Referenced by llvm::MCELFStreamer::emitCommonSymbol(), getCurrentSectionOnly(), llvm::HexagonMCELFStreamer::HexagonMCEmitCommonSymbol(), and pushSection().

◆ getCurrentSectionOnly()

MCSection* llvm::MCStreamer::getCurrentSectionOnly ( ) const
inline

◆ getCurrentWinFrameInfo()

WinEH::FrameInfo* llvm::MCStreamer::getCurrentWinFrameInfo ( )
inlineprotected

Definition at line 259 of file MCStreamer.h.

◆ getDwarfFrameInfos()

ArrayRef< MCDwarfFrameInfo > MCStreamer::getDwarfFrameInfos ( ) const

Definition at line 117 of file MCStreamer.cpp.

Referenced by llvm::MCDwarfFrameEmitter::Emit().

◆ getDwarfLineTableSymbol()

MCSymbol * MCStreamer::getDwarfLineTableSymbol ( unsigned  CUID)
virtual

◆ getMnemonic()

virtual StringRef llvm::MCStreamer::getMnemonic ( MCInst MI)
inlinevirtual

Returns the mnemonic for MI, if the streamer has access to a instruction printer and returns an empty string otherwise.

Definition at line 475 of file MCStreamer.h.

◆ getNumFrameInfos()

unsigned MCStreamer::getNumFrameInfos ( )

Definition at line 116 of file MCStreamer.cpp.

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

◆ getNumWinFrameInfos()

unsigned llvm::MCStreamer::getNumWinFrameInfos ( )
inline

Definition at line 320 of file MCStreamer.h.

◆ getPreviousSection()

MCSectionSubPair llvm::MCStreamer::getPreviousSection ( ) const
inline

Return the previous section that the streamer is emitting code to.

Definition at line 392 of file MCStreamer.h.

Referenced by pushSection().

◆ getStartTokLoc()

SMLoc llvm::MCStreamer::getStartTokLoc ( ) const
inline

◆ getSymbolOrder()

unsigned llvm::MCStreamer::getSymbolOrder ( const MCSymbol Sym) const
inline

Returns an index to represent the order a symbol was emitted in.

(zero if we did not emit that symbol)

Definition at line 400 of file MCStreamer.h.

References llvm::DenseMapBase< DerivedT, KeyT, ValueT, KeyInfoT, BucketT >::lookup().

◆ getTargetStreamer()

MCTargetStreamer* llvm::MCStreamer::getTargetStreamer ( )
inline

◆ getUseAssemblerInfoForParsing()

bool llvm::MCStreamer::getUseAssemblerInfoForParsing ( )
inline

Definition at line 298 of file MCStreamer.h.

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

◆ getWinFrameInfos()

ArrayRef<std::unique_ptr<WinEH::FrameInfo> > llvm::MCStreamer::getWinFrameInfos ( ) const
inline

◆ hasRawTextSupport()

virtual bool llvm::MCStreamer::hasRawTextSupport ( ) const
inlinevirtual

Return true if this asm streamer supports emitting unformatted text to the .s file with EmitRawText.

Definition at line 336 of file MCStreamer.h.

◆ hasUnfinishedDwarfFrameInfo()

bool MCStreamer::hasUnfinishedDwarfFrameInfo ( )

Definition at line 280 of file MCStreamer.cpp.

Referenced by emitCFIStartProc().

◆ initSections()

void MCStreamer::initSections ( bool  NoExecStack,
const MCSubtargetInfo STI 
)
virtual

Create the default sections and set the initial one.

Reimplemented in llvm::MCELFStreamer, and llvm::MCWinCOFFStreamer.

Definition at line 410 of file MCStreamer.cpp.

References getContext(), and switchSection().

◆ isIntegratedAssemblerRequired()

virtual bool llvm::MCStreamer::isIntegratedAssemblerRequired ( ) const
inlinevirtual

Is the integrated assembler required for this streamer to function correctly?

Reimplemented in llvm::MCObjectStreamer.

Definition at line 340 of file MCStreamer.h.

◆ isVerboseAsm()

virtual bool llvm::MCStreamer::isVerboseAsm ( ) const
inlinevirtual

Return true if this streamer supports verbose assembly and if it is enabled.

Definition at line 332 of file MCStreamer.h.

◆ maybeEmitDwarf64Mark()

void MCStreamer::maybeEmitDwarf64Mark ( )

Emit a special value of 0xffffffff if producing 64-bit debugging info.

Definition at line 1016 of file MCStreamer.cpp.

References AddComment(), Context, llvm::dwarf::DW_LENGTH_DWARF64, llvm::dwarf::DWARF64, and emitInt32().

Referenced by emitDwarfUnitLength().

◆ mayHaveInstructions()

virtual bool llvm::MCStreamer::mayHaveInstructions ( MCSection Sec) const
inlinevirtual

Reimplemented in llvm::MCObjectStreamer.

Definition at line 1124 of file MCStreamer.h.

Referenced by llvm::MCContext::finalizeDwarfSections().

◆ operator=()

MCStreamer& llvm::MCStreamer::operator= ( const MCStreamer )
delete

◆ popSection()

bool llvm::MCStreamer::popSection ( )
inline

◆ pushSection()

void llvm::MCStreamer::pushSection ( )
inline

◆ reset()

void MCStreamer::reset ( )
virtual

◆ setAllowAutoPadding()

void llvm::MCStreamer::setAllowAutoPadding ( bool  v)
inline

◆ setStartTokLocPtr()

void llvm::MCStreamer::setStartTokLocPtr ( const SMLoc Loc)
inline

Definition at line 284 of file MCStreamer.h.

◆ setTargetStreamer()

void llvm::MCStreamer::setTargetStreamer ( MCTargetStreamer TS)
inline

Definition at line 280 of file MCStreamer.h.

◆ setUseAssemblerInfoForParsing()

void llvm::MCStreamer::setUseAssemblerInfoForParsing ( bool  v)
inline

Definition at line 297 of file MCStreamer.h.

◆ subSection()

bool llvm::MCStreamer::subSection ( const MCExpr Subsection)
inline

Definition at line 435 of file MCStreamer.h.

References switchSection().

◆ switchSection()

void MCStreamer::switchSection ( MCSection Section,
const MCExpr Subsection = nullptr 
)
virtual

Set the current section where code is being emitted to Section.

This is required to update CurSection.

This corresponds to assembler directives like .section, .text, etc.

Reimplemented in llvm::MipsELFStreamer.

Definition at line 1225 of file MCStreamer.cpp.

References assert(), changeSection(), emitLabel(), llvm::MCSymbol::isInSection(), and llvm::ARMBuildAttrs::Section.

Referenced by addAllTypesFromDWP(), addAllTypesFromTypesSection(), llvm::Win64EH::UnwindEmitter::Emit(), llvm::Win64EH::ARMUnwindEmitter::Emit(), llvm::Win64EH::ARM64UnwindEmitter::Emit(), llvm::MCPseudoProbeSection::emit(), llvm::MCDwarfDwoLineTable::Emit(), llvm::MCDwarfLineTable::emit(), llvm::MCGenDwarfInfo::Emit(), llvm::MCDwarfFrameEmitter::Emit(), llvm::DwarfStreamer::emitAbbrevs(), llvm::DwarfStreamer::emitCIE(), llvm::MCWinCOFFStreamer::emitCommonSymbol(), llvm::MCELFStreamer::emitCommonSymbol(), emitConstantPool(), llvm::SystemZTargetStreamer::emitConstantPools(), llvm::DwarfStreamer::emitDIE(), llvm::MipsTargetELFStreamer::emitDirectiveEnd(), llvm::MCObjectStreamer::emitDwarfLineEndEntry(), llvm::DwarfStreamer::emitFDE(), EmitGenDwarfAbbrev(), EmitGenDwarfAranges(), EmitGenDwarfInfo(), emitGenDwarfRanges(), llvm::MCELFStreamer::emitIdent(), llvm::DwarfStreamer::emitLineTableForUnit(), llvm::MCWinCOFFStreamer::emitLocalCommonSymbol(), llvm::DwarfStreamer::emitLocationsForUnit(), llvm::MipsTargetELFStreamer::emitMipsAbiFlags(), llvm::TargetLoweringObjectFileELF::emitModuleMetadata(), llvm::TargetLoweringObjectFileMachO::emitModuleMetadata(), llvm::TargetLoweringObjectFileCOFF::emitModuleMetadata(), emitNonLazyStubs(), llvm::AArch64TargetStreamer::emitNoteSection(), llvm::TargetLoweringObjectFileELF::emitPersonalityValue(), llvm::MCDwarfLineStr::emitSection(), llvm::DwarfStreamer::emitSectionContents(), llvm::DwarfStreamer::emitSwiftAST(), llvm::DwarfStreamer::emitSwiftReflectionSection(), llvm::Win64EH::UnwindEmitter::EmitUnwindInfo(), llvm::Win64EH::ARMUnwindEmitter::EmitUnwindInfo(), llvm::Win64EH::ARM64UnwindEmitter::EmitUnwindInfo(), emitWinCFIEndProc(), endSection(), llvm::MipsTargetELFStreamer::finish(), llvm::DWPStringPool::getOffset(), llvm::HexagonMCELFStreamer::HexagonMCEmitCommonSymbol(), llvm::MCWinCOFFStreamer::initSections(), llvm::MCELFStreamer::initSections(), initSections(), llvm::MSP430TargetELFStreamer::MSP430TargetELFStreamer(), llvm::FaultMaps::serializeToFaultMapSection(), llvm::StackMaps::serializeToStackMapSection(), smallData(), subSection(), llvm::MipsELFStreamer::switchSection(), llvm::DwarfStreamer::switchToDebugInfoSection(), llvm::DwarfStreamer::translateLineTable(), and llvm::writeIndex().

◆ switchSectionNoChange()

void llvm::MCStreamer::switchSectionNoChange ( MCSection Section,
const MCExpr Subsection = nullptr 
)
inline

Set the current section where code is being emitted to Section.

This is required to update CurSection. This version does not call changeSection.

Definition at line 453 of file MCStreamer.h.

References assert().

◆ tryEmitDwarfFileDirective()

Expected< unsigned > MCStreamer::tryEmitDwarfFileDirective ( unsigned  FileNo,
StringRef  Directory,
StringRef  Filename,
Optional< MD5::MD5Result Checksum = None,
Optional< StringRef Source = None,
unsigned  CUID = 0 
)
virtual

Associate a filename with a specified logical file number.

Also associate a directory, optional checksum, and optional source text with the logical file. This implements the DWARF2 '.file 4 "dir/foo.c"' assembler directive, and the DWARF5 '.file 4 "dir/foo.c" md5 "..." source "..."' assembler directive.

Definition at line 230 of file MCStreamer.cpp.

References getContext(), llvm::MCContext::getDwarfFile(), and llvm::Sched::Source.

Referenced by emitDwarfFileDirective().

◆ visitUsedExpr()

void MCStreamer::visitUsedExpr ( const MCExpr Expr)

◆ visitUsedSymbol()

void MCStreamer::visitUsedSymbol ( const MCSymbol Sym)
virtual

Reimplemented in llvm::MCObjectStreamer.

Definition at line 1067 of file MCStreamer.cpp.

Referenced by visitUsedExpr().


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