LLVM 20.0.0git
|
Streaming machine code generation interface. More...
#include "llvm/MC/MCStreamer.h"
Public Member Functions | |
MCStreamer (const MCStreamer &)=delete | |
MCStreamer & | operator= (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. | |
MCContext & | getContext () const |
virtual MCAssembler * | getAssemblerPtr () |
void | setUseAssemblerInfoForParsing (bool v) |
bool | getUseAssemblerInfoForParsing () |
MCTargetStreamer * | getTargetStreamer () |
void | setAllowAutoPadding (bool v) |
bool | getAllowAutoPadding () const |
virtual MCSymbol * | emitCFILabel () |
When emitting an object file, create and emit a real label. | |
WinEH::FrameInfo * | EnsureValidWinFrameInfo (SMLoc Loc) |
Retrieve the current frame info if one is available and it is not yet closed. | |
unsigned | getNumFrameInfos () |
ArrayRef< MCDwarfFrameInfo > | getDwarfFrameInfos () 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. | |
virtual void | emitFileDirective (StringRef Filename, StringRef CompilerVersion, StringRef TimeStamp, StringRef Description) |
Emit ".file assembler diretive with additioal info. | |
virtual void | emitIdent (StringRef IdentString) |
Emit the "identifiers" directive. | |
unsigned | emitDwarfFileDirective (unsigned FileNo, StringRef Directory, StringRef Filename, std::optional< MD5::MD5Result > Checksum=std::nullopt, std::optional< StringRef > Source=std::nullopt, unsigned CUID=0) |
Associate a filename with a specified logical file number. | |
virtual Expected< unsigned > | tryEmitDwarfFileDirective (unsigned FileNo, StringRef Directory, StringRef Filename, std::optional< MD5::MD5Result > Checksum=std::nullopt, std::optional< StringRef > Source=std::nullopt, unsigned CUID=0) |
Associate a filename with a specified logical file number. | |
virtual void | emitDwarfFile0Directive (StringRef Directory, StringRef Filename, std::optional< MD5::MD5Result > Checksum, std::optional< StringRef > Source, unsigned CUID=0) |
Specify the "root" file of the compilation, using the ".file 0" extension. | |
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. | |
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. | |
virtual bool | emitCVFuncIdDirective (unsigned FunctionId) |
Introduces a function id for use with .cv_loc. | |
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. | |
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. | |
virtual void | emitCVLinetableDirective (unsigned FunctionId, const MCSymbol *FnStart, const MCSymbol *FnEnd) |
This implements the CodeView '.cv_linetable' assembler directive. | |
virtual void | emitCVInlineLinetableDirective (unsigned PrimaryFunctionId, unsigned SourceFileId, unsigned SourceLineNum, const MCSymbol *FnStartSym, const MCSymbol *FnEndSym) |
This implements the CodeView '.cv_inline_linetable' assembler directive. | |
virtual void | emitCVDefRangeDirective (ArrayRef< std::pair< const MCSymbol *, const MCSymbol * > > Ranges, StringRef FixedSizePortion) |
This implements the CodeView '.cv_def_range' assembler directive. | |
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. | |
virtual void | emitCVFileChecksumsDirective () |
This implements the CodeView '.cv_filechecksums' assembler directive. | |
virtual void | emitCVFileChecksumOffsetDirective (unsigned FileNo) |
This implements the CodeView '.cv_filechecksumoffset' assembler directive. | |
virtual void | emitCVFPOData (const MCSymbol *ProcSym, SMLoc Loc={}) |
This implements the CodeView '.cv_fpo_data' assembler directive. | |
virtual void | emitAbsoluteSymbolDiff (const MCSymbol *Hi, const MCSymbol *Lo, unsigned Size) |
Emit the absolute difference between two symbols. | |
virtual void | emitAbsoluteSymbolDiffAsULEB128 (const MCSymbol *Hi, const MCSymbol *Lo) |
Emit the absolute difference between two symbols encoded with ULEB128. | |
virtual MCSymbol * | getDwarfLineTableSymbol (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, SMLoc Loc={}) |
virtual void | emitCFIDefCfaOffset (int64_t Offset, SMLoc Loc={}) |
virtual void | emitCFIDefCfaRegister (int64_t Register, SMLoc Loc={}) |
virtual void | emitCFILLVMDefAspaceCfa (int64_t Register, int64_t Offset, int64_t AddressSpace, SMLoc Loc={}) |
virtual void | emitCFIOffset (int64_t Register, int64_t Offset, SMLoc Loc={}) |
virtual void | emitCFIPersonality (const MCSymbol *Sym, unsigned Encoding) |
virtual void | emitCFILsda (const MCSymbol *Sym, unsigned Encoding) |
virtual void | emitCFIRememberState (SMLoc Loc) |
virtual void | emitCFIRestoreState (SMLoc Loc) |
virtual void | emitCFISameValue (int64_t Register, SMLoc Loc={}) |
virtual void | emitCFIRestore (int64_t Register, SMLoc Loc={}) |
virtual void | emitCFIRelOffset (int64_t Register, int64_t Offset, SMLoc Loc) |
virtual void | emitCFIAdjustCfaOffset (int64_t Adjustment, SMLoc Loc={}) |
virtual void | emitCFIEscape (StringRef Values, SMLoc Loc={}) |
virtual void | emitCFIReturnColumn (int64_t Register) |
virtual void | emitCFIGnuArgsSize (int64_t Size, SMLoc Loc={}) |
virtual void | emitCFISignalFrame () |
virtual void | emitCFIUndefined (int64_t Register, SMLoc Loc={}) |
virtual void | emitCFIRegister (int64_t Register1, int64_t Register2, SMLoc Loc={}) |
virtual void | emitCFIWindowSave (SMLoc Loc={}) |
virtual void | emitCFINegateRAState (SMLoc Loc={}) |
virtual void | emitCFILabelDirective (SMLoc Loc, StringRef Name) |
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. | |
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) |
MCSection * | getAssociatedPDataSection (const MCSection *TextSec) |
Get the .pdata section used for the given section. | |
MCSection * | getAssociatedXDataSection (const MCSection *TextSec) |
Get the .xdata section used for the given section. | |
virtual void | emitSyntaxDirective () |
virtual std::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. | |
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. | |
virtual void | emitPseudoProbe (uint64_t Guid, uint64_t Index, uint64_t Type, uint64_t Attr, uint64_t Discriminator, const MCPseudoProbeInlineStack &InlineStack, MCSymbol *FnSym) |
Emit the a pseudo probe into the current section. | |
virtual void | emitBundleAlignMode (Align Alignment) |
Set the bundle alignment mode from now on in the section. | |
virtual void | emitBundleLock (bool AlignToEnd) |
The following instructions are a bundle-locked group. | |
virtual void | emitBundleUnlock () |
Ends a bundle-locked group. | |
void | emitRawText (const Twine &String) |
If this file is backed by a assembly streamer, this dumps the specified string in the output .s file. | |
virtual void | finishImpl () |
Streamer specific finalization. | |
void | finish (SMLoc EndLoc=SMLoc()) |
Finish emission of machine code. | |
virtual bool | mayHaveInstructions (MCSection &Sec) const |
void | maybeEmitDwarf64Mark () |
Emit a special value of 0xffffffff if producing 64-bit debugging info. | |
virtual void | emitDwarfUnitLength (uint64_t Length, const Twine &Comment) |
Emit a unit length field. | |
virtual MCSymbol * | emitDwarfUnitLength (const Twine &Prefix, const Twine &Comment) |
Emit a unit length field. | |
virtual void | emitDwarfLineStartLabel (MCSymbol *StartSym) |
Emit the debug line start label. | |
virtual void | emitDwarfLineEndEntry (MCSection *Section, MCSymbol *LastLabel) |
Emit the debug line end entry. | |
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. | |
virtual void | doFinalizationAtSectionEnd (MCSection *Section) |
Do finalization for the streamer at the end of a section. | |
Assembly File Formatting. | |
virtual bool | isVerboseAsm () const |
Return true if this streamer supports verbose assembly and if it is enabled. | |
virtual bool | hasRawTextSupport () const |
Return true if this asm streamer supports emitting unformatted text to the .s file with EmitRawText. | |
virtual bool | isIntegratedAssemblerRequired () const |
Is the integrated assembler required for this streamer to function correctly? | |
virtual void | AddComment (const Twine &T, bool EOL=true) |
Add a textual comment. | |
virtual raw_ostream & | getCommentOS () |
Return a raw_ostream that comments can be written to. | |
virtual void | emitRawComment (const Twine &T, bool TabPrefix=true) |
Print T and prefix it with the comment string (normally #) and optionally a tab. | |
virtual void | addExplicitComment (const Twine &T) |
Add explicit comment T. | |
virtual void | emitExplicitComments () |
Emit added explicit comments. | |
virtual void | addBlankLine () |
Emit a blank line to a .s file to pretty it up. | |
Symbol & Section Management | |
MCSectionSubPair | getCurrentSection () const |
Return the current section that the streamer is emitting code to. | |
MCSection * | getCurrentSectionOnly () const |
MCSectionSubPair | getPreviousSection () const |
Return the previous section that the streamer is emitting code to. | |
MCFragment * | getCurrentFragment () const |
void | pushSection () |
Save the current and previous section on the section stack. | |
bool | popSection () |
Restore the current and previous section from the section stack. | |
virtual void | switchSection (MCSection *Section, uint32_t Subsec=0) |
Set the current section where code is being emitted to Section . | |
bool | switchSection (MCSection *Section, const MCExpr *) |
virtual void | switchSectionNoPrint (MCSection *Section) |
Similar to switchSection, but does not print the section directive. | |
virtual void | initSections (bool NoExecStack, const MCSubtargetInfo &STI) |
Create the default sections and set the initial one. | |
MCSymbol * | endSection (MCSection *Section) |
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. | |
virtual void | emitLabel (MCSymbol *Symbol, SMLoc Loc=SMLoc()) |
Emit a label for Symbol into the current section. | |
virtual void | emitEHSymAttributes (const MCSymbol *Symbol, MCSymbol *EHSymbol) |
virtual void | emitAssemblerFlag (MCAssemblerFlag Flag) |
Note in the output the specified Flag . | |
virtual void | emitLinkerOptions (ArrayRef< std::string > Kind) |
Emit the given list Options of strings as linker options into the output. | |
virtual void | emitDataRegion (MCDataRegionType Kind) |
Note in the output the specified region Kind . | |
virtual void | emitVersionMin (MCVersionMinType Type, unsigned Major, unsigned Minor, unsigned Update, VersionTuple SDKVersion) |
Specify the Mach-O minimum deployment target version. | |
virtual void | emitBuildVersion (unsigned Platform, unsigned Major, unsigned Minor, unsigned Update, VersionTuple SDKVersion) |
Emit/Specify Mach-O build version command. | |
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). | |
virtual void | emitAssignment (MCSymbol *Symbol, const MCExpr *Value) |
Emit an assignment of Value to Symbol . | |
virtual void | emitConditionalAssignment (MCSymbol *Symbol, const MCExpr *Value) |
Emit an assignment of Value to Symbol , but only if Value is also emitted. | |
virtual void | emitWeakReference (MCSymbol *Alias, const MCSymbol *Symbol) |
Emit an weak reference from Alias to Symbol . | |
virtual bool | emitSymbolAttribute (MCSymbol *Symbol, MCSymbolAttr Attribute)=0 |
Add the given Attribute to Symbol . | |
virtual void | emitSymbolDesc (MCSymbol *Symbol, unsigned DescValue) |
Set the DescValue for the Symbol . | |
virtual void | beginCOFFSymbolDef (const MCSymbol *Symbol) |
Start emitting COFF symbol definition. | |
virtual void | emitCOFFSymbolStorageClass (int StorageClass) |
Emit the storage class of the symbol. | |
virtual void | emitCOFFSymbolType (int Type) |
Emit the type of the symbol. | |
virtual void | endCOFFSymbolDef () |
Marks the end of the symbol definition. | |
virtual void | emitCOFFSafeSEH (MCSymbol const *Symbol) |
virtual void | emitCOFFSymbolIndex (MCSymbol const *Symbol) |
Emits the symbol table index of a Symbol into the current section. | |
virtual void | emitCOFFSectionIndex (MCSymbol const *Symbol) |
Emits a COFF section index. | |
virtual void | emitCOFFSecRel32 (MCSymbol const *Symbol, uint64_t Offset) |
Emits a COFF section relative relocation. | |
virtual void | emitCOFFImgRel32 (MCSymbol const *Symbol, int64_t Offset) |
Emits a COFF image relative relocation. | |
virtual void | emitXCOFFLocalCommonSymbol (MCSymbol *LabelSym, uint64_t Size, MCSymbol *CsectSym, Align Alignment) |
Emits an lcomm directive with XCOFF csect information. | |
virtual void | emitXCOFFSymbolLinkageWithVisibility (MCSymbol *Symbol, MCSymbolAttr Linkage, MCSymbolAttr Visibility) |
Emit a symbol's linkage and visibility with a linkage directive for XCOFF. | |
virtual void | emitXCOFFRenameDirective (const MCSymbol *Name, StringRef Rename) |
Emit a XCOFF .rename directive which creates a synonym for an illegal or undesirable name. | |
virtual void | emitXCOFFExceptDirective (const MCSymbol *Symbol, const MCSymbol *Trap, unsigned Lang, unsigned Reason, unsigned FunctionSize, bool hasDebug) |
Emit an XCOFF .except directive which adds information about a trap instruction to the object file exception section. | |
virtual void | emitXCOFFRefDirective (const MCSymbol *Symbol) |
Emit a XCOFF .ref directive which creates R_REF type entry in the relocation table for one or more symbols. | |
virtual void | emitXCOFFCInfoSym (StringRef Name, StringRef Metadata) |
Emit a C_INFO symbol with XCOFF embedded metadata to the .info section. | |
virtual void | emitELFSize (MCSymbol *Symbol, const MCExpr *Value) |
Emit an ELF .size directive. | |
virtual void | emitELFSymverDirective (const MCSymbol *OriginalSym, StringRef Name, bool KeepOriginalSym) |
Emit an ELF .symver directive. | |
virtual void | emitLOHDirective (MCLOHType Kind, const MCLOHArgs &Args) |
Emit a Linker Optimization Hint (LOH) directive. | |
virtual void | emitGNUAttribute (unsigned Tag, unsigned Value) |
Emit a .gnu_attribute directive. | |
virtual void | emitCommonSymbol (MCSymbol *Symbol, uint64_t Size, Align ByteAlignment)=0 |
Emit a common symbol. | |
virtual void | emitLocalCommonSymbol (MCSymbol *Symbol, uint64_t Size, Align ByteAlignment) |
Emit a local common (.lcomm) symbol. | |
virtual void | emitZerofill (MCSection *Section, MCSymbol *Symbol=nullptr, uint64_t Size=0, Align ByteAlignment=Align(1), SMLoc Loc=SMLoc())=0 |
Emit the zerofill section and an optional symbol. | |
virtual void | emitTBSSSymbol (MCSection *Section, MCSymbol *Symbol, uint64_t Size, Align ByteAlignment=Align(1)) |
Emit a thread local bss (.tbss) symbol. | |
Generating Data | |
virtual void | emitBytes (StringRef Data) |
Emit the bytes in Data into the output. | |
virtual void | emitBinaryData (StringRef Data) |
Functionally identical to EmitBytes. | |
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. | |
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. | |
virtual void | emitIntValue (const 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. | |
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. | |
virtual void | emitULEB128Value (const MCExpr *Value) |
virtual void | emitSLEB128Value (const MCExpr *Value) |
unsigned | emitULEB128IntValue (uint64_t Value, unsigned PadTo=0) |
Special case of EmitULEB128Value that avoids the client having to pass in a MCExpr for constant integers. | |
unsigned | emitSLEB128IntValue (int64_t Value) |
Special case of EmitSLEB128Value that avoids the client having to pass in a MCExpr for constant integers. | |
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. | |
virtual void | emitDTPRel64Value (const MCExpr *Value) |
Emit the expression Value into the output as a dtprel (64-bit DTP relative) value. | |
virtual void | emitDTPRel32Value (const MCExpr *Value) |
Emit the expression Value into the output as a dtprel (32-bit DTP relative) value. | |
virtual void | emitTPRel64Value (const MCExpr *Value) |
Emit the expression Value into the output as a tprel (64-bit TP relative) value. | |
virtual void | emitTPRel32Value (const MCExpr *Value) |
Emit the expression Value into the output as a tprel (32-bit TP relative) value. | |
virtual void | emitGPRel64Value (const MCExpr *Value) |
Emit the expression Value into the output as a gprel64 (64-bit GP relative) value. | |
virtual void | emitGPRel32Value (const MCExpr *Value) |
Emit the expression Value into the output as a gprel32 (32-bit GP relative) value. | |
void | emitFill (uint64_t NumBytes, uint8_t FillValue) |
Emit NumBytes bytes worth of the value specified by FillValue. | |
virtual void | emitFill (const MCExpr &NumBytes, uint64_t FillValue, SMLoc Loc=SMLoc()) |
Emit Size bytes worth of the value specified by FillValue . | |
virtual void | emitFill (const MCExpr &NumValues, int64_t Size, int64_t Expr, SMLoc Loc=SMLoc()) |
Emit NumValues copies of Size bytes. | |
virtual void | emitNops (int64_t NumBytes, int64_t ControlledNopLength, SMLoc Loc, const MCSubtargetInfo &STI) |
void | emitZeros (uint64_t NumBytes) |
Emit NumBytes worth of zeros. | |
virtual void | emitValueToAlignment (Align Alignment, int64_t Value=0, unsigned ValueSize=1, unsigned MaxBytesToEmit=0) |
Emit some number of copies of Value until the byte alignment ByteAlignment is reached. | |
virtual void | emitCodeAlignment (Align Alignment, const MCSubtargetInfo *STI, unsigned MaxBytesToEmit=0) |
Emit nops until the byte alignment ByteAlignment is reached. | |
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. | |
Protected Member Functions | |
MCStreamer (MCContext &Ctx) | |
virtual void | changeSection (MCSection *, uint32_t) |
This is called by popSection and switchSection, if the current section changes. | |
virtual void | emitCFIStartProcImpl (MCDwarfFrameInfo &Frame) |
virtual void | emitCFIEndProcImpl (MCDwarfFrameInfo &CurFrame) |
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. | |
bool | checkCVLocSection (unsigned FuncId, unsigned FileNo, SMLoc Loc) |
Returns true if the .cv_loc directive is in the right section. | |
Protected Attributes | |
MCFragment * | CurFrag = nullptr |
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 213 of file MCStreamer.h.
|
protected |
Definition at line 93 of file MCStreamer.cpp.
References llvm::SmallVectorTemplateBase< T, bool >::push_back().
|
delete |
|
virtualdefault |
|
inlinevirtual |
Emit a blank line to a .s file to pretty it up.
Definition at line 385 of file MCStreamer.h.
Referenced by llvm::TargetLoweringObjectFileELF::emitModuleMetadata(), llvm::TargetLoweringObjectFileMachO::emitModuleMetadata(), llvm::TargetLoweringObjectFileCOFF::emitModuleMetadata(), and emitNonLazyStubs().
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 364 of file MCStreamer.h.
Referenced by addConstantComments(), emitDwarfUnitLength(), emitGenDwarfRanges(), llvm::mcdwarf::emitListsTableHeaderStart(), llvm::CodeViewDebug::endModule(), maybeEmitDwarf64Mark(), printBroadcast(), printExtend(), printZeroExtend(), and printZeroUpperMove().
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 122 of file MCStreamer.cpp.
Start emitting COFF symbol definition.
Symbol | - The symbol to have its External & Type fields set. |
Reimplemented in llvm::RecordStreamer, and llvm::MCWinCOFFStreamer.
Definition at line 1160 of file MCStreamer.cpp.
References llvm_unreachable.
This is called by popSection and switchSection, if the current section changes.
Reimplemented in llvm::MCWasmStreamer, llvm::RISCVELFStreamer, llvm::MCELFStreamer, llvm::MCObjectStreamer, and llvm::MCWinCOFFStreamer.
Definition at line 1218 of file MCStreamer.cpp.
References CurFrag.
Referenced by popSection(), and switchSection().
Returns true if the .cv_loc directive is in the right section.
Definition at line 324 of file MCStreamer.cpp.
References FuncId, getContext(), getCurrentSectionOnly(), llvm::MCContext::getCVContext(), llvm::CodeViewContext::getCVFunctionInfo(), llvm::MCContext::reportError(), and llvm::MCCVFunctionInfo::Section.
Referenced by llvm::MCObjectStreamer::emitCVLocDirective().
|
inlinevirtual |
Do finalization for the streamer at the end of a section.
Definition at line 1133 of file MCStreamer.h.
|
virtual |
Emit the absolute difference between two symbols.
Hi
is greater than the offset Lo
. Reimplemented in llvm::MCObjectStreamer.
Definition at line 1128 of file MCStreamer.cpp.
References llvm::MCSymbolRefExpr::create(), llvm::MCBinaryExpr::createSub(), llvm::MCContext::createTempSymbol(), llvm::MCAsmInfo::doesSetDirectiveSuppressReloc(), emitAssignment(), emitSymbolValue(), emitValue(), llvm::MCContext::getAsmInfo(), llvm::Hi, llvm::Lo, and Size.
Referenced by llvm::MCDwarfLineTableHeader::Emit(), llvm::MCObjectStreamer::emitAbsoluteSymbolDiff(), emitDwarfUnitLength(), and llvm::mcdwarf::emitListsTableHeaderStart().
|
virtual |
Emit the absolute difference between two symbols encoded with ULEB128.
Reimplemented in llvm::MCObjectStreamer.
Definition at line 1147 of file MCStreamer.cpp.
References llvm::MCSymbolRefExpr::create(), llvm::MCBinaryExpr::createSub(), emitULEB128Value(), llvm::Hi, and llvm::Lo.
Referenced by llvm::MCObjectStreamer::emitAbsoluteSymbolDiffAsULEB128().
|
inlinevirtual |
Reimplemented in llvm::MCObjectStreamer.
Definition at line 1068 of file MCStreamer.h.
Reimplemented in llvm::MCObjectStreamer.
Definition at line 1069 of file MCStreamer.h.
|
virtual |
Note in the output the specified Flag
.
Reimplemented in llvm::MCELFStreamer, llvm::MCWasmStreamer, and llvm::MCWinCOFFStreamer.
Definition at line 1157 of file MCStreamer.cpp.
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.
Symbol | - The symbol being assigned to. |
Value | - The value for the symbol. |
Reimplemented in llvm::MCObjectStreamer, and llvm::RecordStreamer.
Definition at line 1056 of file MCStreamer.cpp.
References llvm::MCTargetStreamer::emitAssignment(), getTargetStreamer(), and visitUsedExpr().
Referenced by emitAbsoluteSymbolDiff(), llvm::MCObjectStreamer::emitAssignment(), llvm::RecordStreamer::emitAssignment(), llvm::RecordStreamer::flushSymverDirectives(), and llvm::MCContext::setSymbolValue().
|
virtual |
Functionally identical to EmitBytes.
When emitting textual assembly, this method uses .byte directives instead of .ascii or .asciz for readability.
Definition at line 1223 of file MCStreamer.cpp.
References llvm::Data, and emitBytes().
Referenced by llvm::AsmPrinter::XRayFunctionEntry::emit(), emitOneV5FileEntry(), and llvm::MCDwarfLineStr::emitSection().
|
inlinevirtual |
Emit/Specify Mach-O build version command.
Platform
should be one of MachO::PlatformType.
Definition at line 477 of file MCStreamer.h.
Referenced by emitVersionForTarget().
|
virtual |
Set the bundle alignment mode from now on in the section.
The value 1 means turn the bundle alignment off.
Reimplemented in llvm::MCELFStreamer, and llvm::MCObjectStreamer.
Definition at line 1239 of file MCStreamer.cpp.
|
virtual |
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 in llvm::MCELFStreamer, and llvm::MCObjectStreamer.
Definition at line 1240 of file MCStreamer.cpp.
|
virtual |
Ends a bundle-locked group.
Reimplemented in llvm::MCELFStreamer, and llvm::MCObjectStreamer.
Definition at line 1242 of file MCStreamer.cpp.
|
virtual |
Emit the bytes in Data
into the output.
This is used to implement assembler directives such as .byte, .ascii, etc.
Reimplemented in llvm::MCObjectStreamer, llvm::CSKYELFStreamer, and llvm::RISCVELFStreamer.
Definition at line 1222 of file MCStreamer.cpp.
Referenced by addAllTypesFromDWP(), addAllTypesFromTypesSection(), llvm::MCDwarfLineAddr::Emit(), emitBinaryData(), llvm::dwarf_linker::classic::DwarfStreamer::emitCIE(), llvm::dwarf_linker::classic::DwarfStreamer::emitFDE(), EmitGenDwarfInfo(), llvm::AArch64TargetStreamer::emitInst(), llvm::ARMTargetStreamer::emitInst(), emitIntValue(), llvm::TargetLoweringObjectFileELF::emitModuleMetadata(), llvm::AArch64TargetStreamer::emitNoteSection(), emitOneV5FileEntry(), llvm::dwarf_linker::classic::DwarfStreamer::emitSectionContents(), emitSLEB128IntValue(), llvm::dwarf_linker::classic::DwarfStreamer::emitSwiftAST(), llvm::dwarf_linker::classic::DwarfStreamer::emitSwiftReflectionSection(), emitULEB128IntValue(), llvm::DWPStringPool::getOffset(), llvm::handleSection(), llvm::MSP430TargetELFStreamer::MSP430TargetELFStreamer(), llvm::write(), and llvm::writeStringsAndOffsets().
|
virtual |
Definition at line 507 of file MCStreamer.cpp.
References llvm::MCCFIInstruction::createAdjustCfaOffset(), emitCFILabel(), and llvm::MCDwarfFrameInfo::Instructions.
|
virtual |
Definition at line 248 of file MCStreamer.cpp.
References llvm::MCDwarfFrameInfo::IsBKeyFrame.
|
virtual |
Definition at line 486 of file MCStreamer.cpp.
References llvm::MCCFIInstruction::cfiDefCfa(), llvm::MCDwarfFrameInfo::CurrentCfaRegister, emitCFILabel(), llvm::MCDwarfFrameInfo::Instructions, and llvm::Offset.
|
virtual |
Definition at line 497 of file MCStreamer.cpp.
References llvm::MCCFIInstruction::cfiDefCfaOffset(), emitCFILabel(), llvm::MCDwarfFrameInfo::Instructions, and llvm::Offset.
|
virtual |
Definition at line 517 of file MCStreamer.cpp.
References llvm::MCCFIInstruction::createDefCfaRegister(), llvm::MCDwarfFrameInfo::CurrentCfaRegister, emitCFILabel(), and llvm::MCDwarfFrameInfo::Instructions.
void MCStreamer::emitCFIEndProc | ( | ) |
Definition at line 466 of file MCStreamer.cpp.
References emitCFIEndProcImpl().
|
protectedvirtual |
Reimplemented in llvm::MipsELFStreamer.
Definition at line 474 of file MCStreamer.cpp.
References llvm::MCDwarfFrameInfo::End.
Referenced by emitCFIEndProc().
Definition at line 618 of file MCStreamer.cpp.
References llvm::MCCFIInstruction::createEscape(), emitCFILabel(), and llvm::MCDwarfFrameInfo::Instructions.
|
virtual |
Definition at line 628 of file MCStreamer.cpp.
References llvm::MCCFIInstruction::createGnuArgsSize(), emitCFILabel(), llvm::MCDwarfFrameInfo::Instructions, and Size.
|
virtual |
When emitting an object file, create and emit a real label.
When emitting textual assembly, this should do nothing to avoid polluting our output.
Reimplemented in llvm::MipsELFStreamer.
Definition at line 480 of file MCStreamer.cpp.
Referenced by emitCFIAdjustCfaOffset(), emitCFIDefCfa(), emitCFIDefCfaOffset(), emitCFIDefCfaRegister(), emitCFIEscape(), emitCFIGnuArgsSize(), emitCFILabelDirective(), emitCFILLVMDefAspaceCfa(), emitCFINegateRAState(), emitCFIOffset(), emitCFIRegister(), emitCFIRelOffset(), emitCFIRememberState(), emitCFIRestore(), emitCFIRestoreState(), emitCFISameValue(), emitCFIUndefined(), emitCFIWindowSave(), llvm::Win64EH::ARMUnwindEmitter::EmitUnwindInfo(), llvm::Win64EH::ARM64UnwindEmitter::EmitUnwindInfo(), emitWinCFIAllocStack(), emitWinCFIEndChained(), emitWinCFIEndProc(), emitWinCFIEndProlog(), emitWinCFIFuncletOrFuncEnd(), emitWinCFIPushFrame(), emitWinCFIPushReg(), emitWinCFISaveReg(), emitWinCFISaveXMM(), emitWinCFISetFrame(), emitWinCFIStartChained(), and emitWinCFIStartProc().
Definition at line 692 of file MCStreamer.cpp.
References llvm::MCCFIInstruction::createLabel(), emitCFILabel(), F, getContext(), llvm::MCContext::getOrCreateSymbol(), Name, and Sym.
|
virtual |
Definition at line 528 of file MCStreamer.cpp.
References llvm::MCCFIInstruction::createLLVMDefAspaceCfa(), llvm::MCDwarfFrameInfo::CurrentCfaRegister, emitCFILabel(), llvm::MCDwarfFrameInfo::Instructions, and llvm::Offset.
Definition at line 569 of file MCStreamer.cpp.
References llvm::MCDwarfFrameInfo::Lsda, llvm::MCDwarfFrameInfo::LsdaEncoding, and Sym.
|
virtual |
Definition at line 255 of file MCStreamer.cpp.
References llvm::MCDwarfFrameInfo::IsMTETaggedFrame.
|
virtual |
Definition at line 675 of file MCStreamer.cpp.
References llvm::MCCFIInstruction::createNegateRAState(), emitCFILabel(), and llvm::MCDwarfFrameInfo::Instructions.
|
virtual |
Definition at line 540 of file MCStreamer.cpp.
References llvm::MCCFIInstruction::createOffset(), emitCFILabel(), llvm::MCDwarfFrameInfo::Instructions, and llvm::Offset.
Definition at line 560 of file MCStreamer.cpp.
References llvm::MCDwarfFrameInfo::Personality, llvm::MCDwarfFrameInfo::PersonalityEncoding, and Sym.
|
virtual |
Definition at line 655 of file MCStreamer.cpp.
References llvm::MCCFIInstruction::createRegister(), emitCFILabel(), and llvm::MCDwarfFrameInfo::Instructions.
|
virtual |
Definition at line 550 of file MCStreamer.cpp.
References llvm::MCCFIInstruction::createRelOffset(), emitCFILabel(), llvm::MCDwarfFrameInfo::Instructions, and llvm::Offset.
|
virtual |
Definition at line 577 of file MCStreamer.cpp.
References llvm::MCCFIInstruction::createRememberState(), emitCFILabel(), and llvm::MCDwarfFrameInfo::Instructions.
|
virtual |
Definition at line 608 of file MCStreamer.cpp.
References llvm::MCCFIInstruction::createRestore(), emitCFILabel(), and llvm::MCDwarfFrameInfo::Instructions.
|
virtual |
Definition at line 587 of file MCStreamer.cpp.
References llvm::MCCFIInstruction::createRestoreState(), emitCFILabel(), and llvm::MCDwarfFrameInfo::Instructions.
|
virtual |
Definition at line 685 of file MCStreamer.cpp.
References llvm::MCDwarfFrameInfo::RAReg.
|
virtual |
Definition at line 598 of file MCStreamer.cpp.
References llvm::MCCFIInstruction::createSameValue(), emitCFILabel(), and llvm::MCDwarfFrameInfo::Instructions.
Reimplemented in llvm::MCObjectStreamer.
Definition at line 436 of file MCStreamer.cpp.
Referenced by llvm::MCObjectStreamer::emitCFISections().
|
virtual |
Definition at line 638 of file MCStreamer.cpp.
References llvm::MCDwarfFrameInfo::IsSignalFrame.
Definition at line 438 of file MCStreamer.cpp.
References llvm::MCDwarfFrameInfo::CurrentCfaRegister, emitCFIStartProcImpl(), llvm::MCContext::getAsmInfo(), getContext(), getCurrentSectionOnly(), llvm::MCAsmInfo::getInitialFrameState(), llvm::MCDwarfFrameInfo::IsSimple, llvm::MCCFIInstruction::OpDefCfa, llvm::MCCFIInstruction::OpDefCfaRegister, llvm::MCCFIInstruction::OpLLVMDefAspaceCfa, and llvm::MCContext::reportError().
|
protectedvirtual |
Reimplemented in llvm::MipsELFStreamer.
Definition at line 463 of file MCStreamer.cpp.
Referenced by emitCFIStartProc().
|
virtual |
Definition at line 645 of file MCStreamer.cpp.
References llvm::MCCFIInstruction::createUndefined(), emitCFILabel(), and llvm::MCDwarfFrameInfo::Instructions.
|
virtual |
Definition at line 666 of file MCStreamer.cpp.
References llvm::MCCFIInstruction::createWindowSave(), emitCFILabel(), and llvm::MCDwarfFrameInfo::Instructions.
|
virtual |
Reimplemented in llvm::MCELFStreamer, and llvm::MCWinCOFFStreamer.
Definition at line 813 of file MCStreamer.cpp.
Referenced by llvm::TargetLoweringObjectFile::emitCGProfileMetadata(), and llvm::MCAsmParserExtension::ParseDirectiveCGProfile().
|
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.
Alignment | - The alignment to reach. |
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 1235 of file MCStreamer.cpp.
Referenced by llvm::CSKYConstantPool::emitAll(), and smallData().
Emits a COFF image relative relocation.
Symbol | - Symbol the image relative relocation should point to. |
Reimplemented in llvm::MCWinCOFFStreamer.
Definition at line 984 of file MCStreamer.cpp.
Reimplemented in llvm::MCWinCOFFStreamer.
Definition at line 976 of file MCStreamer.cpp.
Emits a COFF section relative relocation.
Symbol | - Symbol the section relative relocation should point to. |
Reimplemented in llvm::MCWinCOFFStreamer.
Definition at line 982 of file MCStreamer.cpp.
Referenced by llvm::MCDwarfLineStr::emitRef(), and emitSymbolValue().
Emits a COFF section index.
Symbol | - Symbol the section number relocation should point to. |
Reimplemented in llvm::MCWinCOFFStreamer.
Definition at line 980 of file MCStreamer.cpp.
Emits the symbol table index of a Symbol into the current section.
Reimplemented in llvm::MCWinCOFFStreamer.
Definition at line 978 of file MCStreamer.cpp.
|
virtual |
Emit the storage class of the symbol.
StorageClass | - The storage class the symbol should have. |
Reimplemented in llvm::MCWinCOFFStreamer, and llvm::RecordStreamer.
Definition at line 1171 of file MCStreamer.cpp.
References llvm_unreachable.
|
virtual |
Emit the type of the symbol.
Reimplemented in llvm::MCWinCOFFStreamer, and llvm::RecordStreamer.
Definition at line 1174 of file MCStreamer.cpp.
References llvm_unreachable.
|
pure virtual |
Emit a common symbol.
Symbol | - The common symbol to emit. |
Size | - The size of the common symbol. |
ByteAlignment | - The alignment of the symbol. |
Implemented in llvm::MCDXContainerStreamer, llvm::MCELFStreamer, llvm::MCGOFFStreamer, llvm::MCSPIRVStreamer, llvm::MCWasmStreamer, llvm::MCWinCOFFStreamer, llvm::MCXCOFFStreamer, and llvm::RecordStreamer.
Emit an assignment of Value
to Symbol
, but only if Value
is also emitted.
Reimplemented in llvm::MCObjectStreamer.
Definition at line 433 of file MCStreamer.cpp.
|
virtual |
Definition at line 397 of file MCStreamer.cpp.
References copyBytesForDefRange(), and emitCVDefRangeDirective().
|
virtual |
Definition at line 389 of file MCStreamer.cpp.
References copyBytesForDefRange(), and emitCVDefRangeDirective().
|
virtual |
Definition at line 372 of file MCStreamer.cpp.
References copyBytesForDefRange(), and emitCVDefRangeDirective().
|
virtual |
Definition at line 380 of file MCStreamer.cpp.
References copyBytesForDefRange(), and emitCVDefRangeDirective().
|
virtual |
This implements the CodeView '.cv_def_range' assembler directive.
Reimplemented in llvm::MCObjectStreamer.
Definition at line 368 of file MCStreamer.cpp.
Referenced by emitCVDefRangeDirective(), and llvm::MCObjectStreamer::emitCVDefRangeDirective().
|
inlinevirtual |
This implements the CodeView '.cv_filechecksumoffset' assembler directive.
Reimplemented in llvm::MCObjectStreamer.
Definition at line 980 of file MCStreamer.h.
|
inlinevirtual |
This implements the CodeView '.cv_filechecksums' assembler directive.
Reimplemented in llvm::MCObjectStreamer.
Definition at line 976 of file MCStreamer.h.
Referenced by llvm::CodeViewDebug::endModule().
|
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(), getContext(), and llvm::MCContext::getCVContext().
|
inlinevirtual |
This implements the CodeView '.cv_fpo_data' assembler directive.
Definition at line 983 of file MCStreamer.h.
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().
|
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().
|
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().
|
virtual |
This implements the CodeView '.cv_linetable' assembler directive.
Reimplemented in llvm::MCObjectStreamer.
Definition at line 346 of file MCStreamer.cpp.
Referenced by llvm::MCObjectStreamer::emitCVLinetableDirective().
|
virtual |
This implements the CodeView '.cv_loc' assembler directive.
Reimplemented in llvm::MCObjectStreamer.
Definition at line 319 of file MCStreamer.cpp.
|
inlinevirtual |
This implements the CodeView '.cv_stringtable' assembler directive.
Reimplemented in llvm::MCObjectStreamer.
Definition at line 973 of file MCStreamer.h.
Referenced by llvm::CodeViewDebug::endModule().
|
inlinevirtual |
Definition at line 481 of file MCStreamer.h.
Referenced by emitVersionForTarget().
|
inlinevirtual |
Note in the output the specified region Kind
.
Definition at line 468 of file MCStreamer.h.
Referenced by llvm::CSKYConstantPool::emitAll(), and llvm::ConstantPool::emitEntries().
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 198 of file MCStreamer.cpp.
References llvm::report_fatal_error().
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 194 of file MCStreamer.cpp.
References llvm::report_fatal_error().
|
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 1127 of file MCStreamer.h.
Referenced by llvm::MCDwarfLineTable::emitOne().
|
virtual |
Specify the "root" file of the compilation, using the ".file 0" extension.
Definition at line 239 of file MCStreamer.cpp.
References getContext(), and llvm::MCContext::setMCLineTableRootFile().
|
inline |
Associate a filename with a specified logical file number.
This implements the DWARF2 '.file 4 "foo.c"' assembler directive.
Definition at line 880 of file MCStreamer.h.
References llvm::cantFail(), and tryEmitDwarfFileDirective().
|
inlinevirtual |
Emit the debug line end entry.
Reimplemented in llvm::MCObjectStreamer.
Definition at line 1122 of file MCStreamer.h.
Referenced by llvm::MCDwarfLineTable::emitOne().
|
virtual |
Emit the debug line start label.
Definition at line 1051 of file MCStreamer.cpp.
References emitLabel().
Referenced by llvm::MCDwarfLineTableHeader::Emit().
|
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().
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 1036 of file MCStreamer.cpp.
References AddComment(), llvm::MCContext::createTempSymbol(), emitAbsoluteSymbolDiff(), emitLabel(), llvm::MCContext::getDwarfFormat(), llvm::dwarf::getDwarfOffsetByteSize(), llvm::Hi, llvm::Lo, and maybeEmitDwarf64Mark().
Emit a unit length field.
The actual format, DWARF32 or DWARF64, is chosen according to the settings.
Definition at line 1028 of file MCStreamer.cpp.
References AddComment(), assert(), llvm::dwarf::DW_LENGTH_lo_reserved, llvm::dwarf::DWARF64, emitIntValue(), llvm::MCContext::getDwarfFormat(), llvm::dwarf::getDwarfOffsetByteSize(), llvm::Length, and maybeEmitDwarf64Mark().
Referenced by llvm::MCDwarfLineTableHeader::Emit().
Definition at line 406 of file MCStreamer.cpp.
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 1211 of file MCStreamer.cpp.
Referenced by llvm::TargetLoweringObjectFileELF::emitPersonalityValue().
|
virtual |
Emit an ELF .symver directive.
This corresponds to an assembler statement such as: .symver _start, foo@SOME_VERSION
Reimplemented in llvm::MCELFStreamer, and llvm::RecordStreamer.
Definition at line 1212 of file MCStreamer.cpp.
|
virtual |
Emit added explicit comments.
Definition at line 123 of file MCStreamer.cpp.
|
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 1166 of file MCStreamer.cpp.
|
virtual |
Emit ".file assembler diretive with additioal info.
Reimplemented in llvm::MCObjectStreamer.
Definition at line 1167 of file MCStreamer.cpp.
|
virtual |
Emit Size
bytes worth of the value specified by FillValue
.
This is used to implement assembler directives such as .space or .skip.
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::CSKYELFStreamer, llvm::RISCVELFStreamer, llvm::MCObjectStreamer, and llvm::MCObjectStreamer.
Definition at line 1229 of file MCStreamer.cpp.
|
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.
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, and llvm::MCObjectStreamer.
Definition at line 1230 of file MCStreamer.cpp.
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 220 of file MCStreamer.cpp.
References llvm::MCConstantExpr::create(), emitFill(), and getContext().
Referenced by emitFill(), emitGenDwarfRanges(), and emitZeros().
Emit a .gnu_attribute directive.
Reimplemented in llvm::MCELFStreamer.
Definition at line 639 of file MCStreamer.h.
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 214 of file MCStreamer.cpp.
References llvm::report_fatal_error().
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 210 of file MCStreamer.cpp.
References llvm::report_fatal_error().
|
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 876 of file MCStreamer.h.
|
virtual |
Emit the given Instruction
into the current section.
Reimplemented in llvm::MCObjectStreamer, llvm::CSKYELFStreamer, llvm::HexagonMCELFStreamer, llvm::MipsELFStreamer, llvm::PPCELFStreamer, llvm::PPCXCOFFStreamer, and llvm::RISCVELFStreamer.
Definition at line 1101 of file MCStreamer.cpp.
References llvm::MCOperand::getExpr(), llvm::MCInst::getNumOperands(), llvm::MCInst::getOperand(), llvm::MCOperand::isExpr(), and visitUsedExpr().
Referenced by EmitBinary(), emitBinary(), emitBSIC(), EmitCall(), llvm::SystemZTargetStreamer::emitConstantPools(), llvm::MipsTargetStreamer::emitII(), emitLEASLrri(), emitLEASLzzi(), emitLEAzii(), emitLEAzzi(), EmitNop(), llvm::MipsTargetStreamer::emitR(), EmitRDPC(), llvm::MipsTargetStreamer::emitRRIII(), llvm::MipsTargetStreamer::emitRRRX(), llvm::MipsTargetStreamer::emitRRX(), llvm::MipsTargetStreamer::emitRX(), EmitSETHI(), emitSIC(), and llvm::AsmPrinter::EmitToStreamer().
|
inline |
Definition at line 718 of file MCStreamer.h.
References emitIntValue().
Referenced by llvm::MCDwarfLineTableHeader::Emit(), llvm::dwarf_linker::classic::DwarfStreamer::emitDwarfDebugLocListHeader(), llvm::dwarf_linker::classic::DwarfStreamer::emitDwarfDebugRangeListHeader(), EmitGenDwarfAranges(), EmitGenDwarfInfo(), llvm::mcdwarf::emitListsTableHeaderStart(), llvm::MipsRegInfoRecord::EmitMipsOptionRecord(), llvm::dwarf_linker::classic::DwarfStreamer::emitStringOffsets(), EmitUnwindCode(), and EmitUnwindInfo().
|
inline |
Definition at line 719 of file MCStreamer.h.
References emitIntValue().
Referenced by ARM64EmitRuntimeFunction(), ARM64EmitUnwindInfoForSegment(), ARMEmitRuntimeFunction(), ARMEmitUnwindInfo(), llvm::dwarf_linker::classic::DwarfStreamer::emitDwarfDebugLocListHeader(), llvm::dwarf_linker::classic::DwarfStreamer::emitDwarfDebugRangeListHeader(), EmitGenDwarfAranges(), EmitGenDwarfInfo(), emitGenDwarfRanges(), llvm::dwarf_linker::classic::DwarfStreamer::emitLineTableForUnit(), llvm::mcdwarf::emitListsTableHeaderStart(), llvm::MipsRegInfoRecord::EmitMipsOptionRecord(), llvm::TargetLoweringObjectFileELF::emitModuleMetadata(), llvm::TargetLoweringObjectFileMachO::emitModuleMetadata(), llvm::TargetLoweringObjectFileCOFF::emitModuleMetadata(), EmitUnwindInfo(), maybeEmitDwarf64Mark(), and llvm::MSP430TargetELFStreamer::MSP430TargetELFStreamer().
|
inline |
Definition at line 720 of file MCStreamer.h.
References emitIntValue().
Referenced by llvm::MCPseudoProbeInlineTree::emit(), llvm::MCPseudoProbe::emit(), and llvm::TargetLoweringObjectFileELF::emitModuleMetadata().
|
inline |
Definition at line 717 of file MCStreamer.h.
References emitIntValue().
Referenced by ARM64EmitUnwindCode(), ARM64EmitUnwindInfoForSegment(), ARMEmitUnwindCode(), ARMEmitUnwindInfo(), llvm::MCPseudoProbe::emit(), llvm::MCDwarfLineTableHeader::Emit(), llvm::AMDGPUTargetELFStreamer::EmitAmdhsaKernelDescriptor(), llvm::dwarf_linker::classic::DwarfStreamer::emitDwarfDebugLocListHeader(), llvm::dwarf_linker::classic::DwarfStreamer::emitDwarfDebugRangeListHeader(), emitEncodingByte(), EmitGenDwarfAbbrev(), EmitGenDwarfAranges(), EmitGenDwarfInfo(), emitGenDwarfRanges(), llvm::MCELFStreamer::emitIdent(), llvm::mcdwarf::emitListsTableHeaderStart(), llvm::MipsRegInfoRecord::EmitMipsOptionRecord(), llvm::TargetLoweringObjectFileELF::emitModuleMetadata(), llvm::MCDwarfLineTable::emitOne(), EmitUnwindCode(), EmitUnwindInfo(), and llvm::MSP430TargetELFStreamer::MSP430TargetELFStreamer().
Definition at line 143 of file MCStreamer.cpp.
References llvm::SmallVectorTemplateCommon< T, typename >::data(), emitBytes(), emitIntValue(), llvm::MCContext::getAsmInfo(), llvm::MCAsmInfo::isLittleEndian(), llvm::sys::IsLittleEndianHost, llvm::SmallVectorImpl< T >::resize(), Size, llvm::StoreIntToMemory(), and llvm::SmallString< InternalLen >::str().
Special case of EmitValue that avoids the client having to pass in a MCExpr for constant integers.
EmitIntValue - Special case of EmitValue that avoids the client having to pass in a MCExpr for constant integers.
Reimplemented in llvm::MipsELFStreamer.
Definition at line 133 of file MCStreamer.cpp.
References assert(), llvm::big, llvm::support::endian::byte_swap(), emitBytes(), llvm::MCContext::getAsmInfo(), llvm::isIntN(), llvm::MCAsmInfo::isLittleEndian(), llvm::isUIntN(), llvm::little, and Size.
Referenced by llvm::MCObjectStreamer::emitAbsoluteSymbolDiff(), llvm::dwarf_linker::classic::DwarfStreamer::emitDwarfDebugArangesTable(), emitDwarfUnitLength(), llvm::dwarf_linker::classic::DwarfStreamer::emitFDE(), llvm::MCObjectStreamer::emitFill(), EmitGenDwarfAranges(), EmitGenDwarfInfo(), emitGenDwarfRanges(), emitInt16(), emitInt32(), emitInt64(), emitInt8(), emitIntValue(), llvm::MipsELFStreamer::emitIntValue(), emitIntValueInHex(), emitIntValueInHexWithPadding(), emitNonLazySymbolPointer(), llvm::AArch64TargetStreamer::emitNoteSection(), llvm::MCDwarfLineStr::emitRef(), llvm::MCObjectStreamer::emitValueImpl(), llvm::WebAssemblyTargetStreamer::emitValueType(), smallData(), llvm::writeIndex(), llvm::writeIndexTable(), and llvm::writeNewOffsetsTo().
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 713 of file MCStreamer.h.
References emitIntValue(), and 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 725 of file MCStreamer.h.
References emitIntValue(), and Size.
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 in llvm::MCELFStreamer, llvm::MCObjectStreamer, llvm::MCWasmStreamer, llvm::MCWinCOFFStreamer, llvm::RecordStreamer, llvm::MipsELFStreamer, and llvm::PPCELFStreamer.
Definition at line 414 of file MCStreamer.cpp.
References assert(), llvm::MCTargetStreamer::emitLabel(), getContext(), getCurrentSectionOnly(), getTargetStreamer(), and llvm::MCContext::reportError().
Referenced by ARM64EmitUnwindInfoForSegment(), ARMEmitUnwindInfo(), llvm::MCDwarfDwoLineTable::Emit(), llvm::MCGenDwarfInfo::Emit(), llvm::MCDwarfLineTableHeader::Emit(), llvm::CSKYConstantPool::emitAll(), llvm::AMDGPUTargetELFStreamer::EmitAmdhsaKernelDescriptor(), emitAuthenticatedPointer(), llvm::SystemZTargetStreamer::emitConstantPools(), llvm::MCDwarfLineTable::emitCU(), emitDirectiveRelocJalr(), emitDwarfLineStartLabel(), emitDwarfUnitLength(), llvm::ConstantPool::emitEntries(), EmitGenDwarfInfo(), emitGenDwarfRanges(), llvm::MCObjectStreamer::emitLabel(), llvm::RecordStreamer::emitLabel(), llvm::MCObjectStreamer::emitLabelAtPos(), llvm::mcdwarf::emitListsTableHeaderStart(), llvm::XtensaTargetELFStreamer::emitLiteral(), 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(), smallData(), and switchSection().
|
inlinevirtual |
Emit the given list Options
of strings as linker options into the output.
Definition at line 465 of file MCStreamer.h.
Referenced by llvm::TargetLoweringObjectFileMachO::emitModuleMetadata().
|
virtual |
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 in llvm::MCELFStreamer, llvm::MCWasmStreamer, and llvm::MCWinCOFFStreamer.
Definition at line 1214 of file MCStreamer.cpp.
|
inlinevirtual |
Emit a Linker Optimization Hint (LOH) directive.
Args | - Arguments of the LOH. |
Definition at line 636 of file MCStreamer.h.
|
virtual |
Reimplemented in llvm::MCObjectStreamer.
Definition at line 225 of file MCStreamer.cpp.
|
virtual |
Emit the a pseudo probe into the current section.
Definition at line 1108 of file MCStreamer.cpp.
References llvm::MCPseudoProbeSections::addPseudoProbe(), llvm::MCContext::createTempSymbol(), emitLabel(), getContext(), llvm::MCContext::getMCPseudoProbeTable(), llvm::MCPseudoProbeTable::getProbeSections(), and llvm::Guid.
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 120 of file MCStreamer.cpp.
Referenced by NoAutoPaddingScope::changeAndComment().
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 998 of file MCStreamer.cpp.
References emitRawTextImpl().
Referenced by llvm::NVPTXTargetStreamer::closeLastSection(), llvm::MCTargetStreamer::emitDwarfFileDirective(), llvm::MCTargetStreamer::emitRawBytes(), llvm::NVPTXTargetStreamer::emitRawBytes(), llvm::MCTargetStreamer::emitValue(), and llvm::NVPTXTargetStreamer::outputDwarfFileDirectives().
|
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 989 of file MCStreamer.cpp.
References llvm::report_fatal_error().
Referenced by emitRawText().
|
inlinevirtual |
Record a relocation described by the .reloc directive.
Return std::nullopt if succeeded. Otherwise, return a pair (Name is invalid, error message).
Reimplemented in llvm::MCObjectStreamer.
Definition at line 1063 of file MCStreamer.h.
Referenced by emitDirectiveRelocJalr().
unsigned 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(), llvm::SmallVectorBase< Size_T >::size(), and llvm::raw_svector_ostream::str().
Referenced by llvm::MCPseudoProbe::emit(), and llvm::MCObjectStreamer::emitSLEB128Value().
Reimplemented in llvm::MCObjectStreamer.
Definition at line 1228 of file MCStreamer.cpp.
|
pure virtual |
Add the given Attribute
to Symbol
.
Implemented in llvm::MCDXContainerStreamer, llvm::MCELFStreamer, llvm::MCGOFFStreamer, llvm::MCSPIRVStreamer, llvm::MCWasmStreamer, llvm::MCWinCOFFStreamer, llvm::MCXCOFFStreamer, and llvm::RecordStreamer.
Referenced by emitNonLazySymbolPointer(), llvm::TargetLoweringObjectFileELF::emitPersonalityValue(), and smallData().
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 in llvm::MCELFStreamer, llvm::MCWasmStreamer, and llvm::MCWinCOFFStreamer.
Definition at line 1159 of file MCStreamer.cpp.
void MCStreamer::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.
Definition at line 183 of file MCStreamer.cpp.
References assert(), llvm::MCSymbolRefExpr::create(), emitCOFFSecRel32(), emitValueImpl(), getContext(), Size, and Sym.
Referenced by emitAbsoluteSymbolDiff(), EmitGenDwarfAranges(), EmitGenDwarfInfo(), and llvm::TargetLoweringObjectFileELF::emitPersonalityValue().
|
virtual |
Definition at line 863 of file MCStreamer.cpp.
|
virtual |
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. |
Reimplemented in llvm::MCWinCOFFStreamer, llvm::MCELFStreamer, and llvm::MCWasmStreamer.
Definition at line 1216 of file MCStreamer.cpp.
|
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 1158 of file MCStreamer.cpp.
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 206 of file MCStreamer.cpp.
References llvm::report_fatal_error().
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 202 of file MCStreamer.cpp.
References llvm::report_fatal_error().
Special case of EmitULEB128Value that avoids the client having to pass in a MCExpr for constant integers.
EmitULEB128IntValue - Special case of EmitULEB128Value that avoids the client having to pass in a MCExpr for constant integers.
Definition at line 161 of file MCStreamer.cpp.
References emitBytes(), llvm::encodeULEB128(), llvm::SmallVectorBase< Size_T >::size(), and llvm::raw_svector_ostream::str().
Referenced by llvm::MCPseudoProbeInlineTree::emit(), llvm::MCPseudoProbe::emit(), EmitAbbrev(), llvm::MCObjectStreamer::emitAbsoluteSymbolDiffAsULEB128(), EmitGenDwarfAbbrev(), EmitGenDwarfInfo(), llvm::WebAssemblyTargetWasmStreamer::emitLocal(), llvm::TargetLoweringObjectFileELF::emitModuleMetadata(), llvm::MCDwarfLineTable::emitOne(), emitOneV5FileEntry(), and llvm::MCObjectStreamer::emitULEB128Value().
Reimplemented in llvm::MCObjectStreamer.
Definition at line 1227 of file MCStreamer.cpp.
Referenced by emitAbsoluteSymbolDiffAsULEB128(), and emitGenDwarfRanges().
Definition at line 179 of file MCStreamer.cpp.
References emitValueImpl(), and Size.
Referenced by ARM64EmitRuntimeFunction(), ARM64EmitUnwindInfoForSegment(), ARMEmitRuntimeFunction(), ARMEmitUnwindInfo(), EmitAbsDifference(), emitAbsoluteSymbolDiff(), llvm::CSKYConstantPool::emitAll(), llvm::AMDGPUTargetELFStreamer::EmitAmdhsaKernelDescriptor(), emitAuthenticatedPointer(), llvm::ConstantPool::emitEntries(), emitFDESymbol(), EmitGenDwarfAranges(), EmitGenDwarfInfo(), emitGenDwarfRanges(), llvm::XtensaTargetELFStreamer::emitLiteral(), emitNonLazySymbolPointer(), EmitPersonality(), llvm::MCDwarfLineStr::emitRef(), EmitRuntimeFunction(), EmitSymbolRefWithOfs(), EmitUnwindInfo(), llvm::AVRMCELFStreamer::emitValueForModiferKind(), and smallData().
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 in llvm::CSKYELFStreamer, llvm::MipsELFStreamer, llvm::RISCVELFStreamer, llvm::MCELFStreamer, and llvm::MCObjectStreamer.
Definition at line 1224 of file MCStreamer.cpp.
References visitUsedExpr().
Referenced by emitSymbolValue(), emitValue(), and llvm::MCObjectStreamer::emitValueImpl().
|
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.
Alignment | - The alignment to reach. |
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::MCObjectStreamer, and llvm::MCELFStreamer.
Definition at line 1232 of file MCStreamer.cpp.
Referenced by ARM64EmitRuntimeFunction(), ARM64EmitUnwindInfoForSegment(), ARMEmitRuntimeFunction(), ARMEmitUnwindInfo(), llvm::ConstantPool::emitEntries(), llvm::AArch64TargetStreamer::emitNoteSection(), llvm::TargetLoweringObjectFileELF::emitPersonalityValue(), EmitRuntimeFunction(), and EmitUnwindInfo().
|
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.
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 1237 of file MCStreamer.cpp.
Referenced by llvm::MCParserUtils::parseAssignmentExpression().
void MCStreamer::emitVersionForTarget | ( | const Triple & | Target, |
const VersionTuple & | SDKVersion, | ||
const Triple * | DarwinTargetVariantTriple, | ||
const VersionTuple & | DarwinTargetVariantSDKVersion | ||
) |
Definition at line 1394 of file MCStreamer.cpp.
References assert(), llvm::Triple::Darwin, llvm::Triple::DriverKit, emitBuildVersion(), emitDarwinTargetVariantBuildVersion(), emitVersionForTarget(), emitVersionMin(), getMachoBuildVersionPlatformType(), getMachoBuildVersionSupportedOS(), getMachoVersionMinLoadCommandType(), llvm::Triple::IOS, llvm::Triple::isMacOSX(), llvm_unreachable, llvm::Triple::MacOSX, targetVersionOrMinimumSupportedOSVersion(), llvm::Triple::TvOS, llvm::Version, llvm::Triple::WatchOS, and llvm::Triple::XROS.
Referenced by emitVersionForTarget().
|
inlinevirtual |
Specify the Mach-O minimum deployment target version.
Definition at line 471 of file MCStreamer.h.
Referenced by emitVersionForTarget().
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 in llvm::MCELFStreamer, llvm::MCObjectStreamer, llvm::MCWasmStreamer, and llvm::MCWinCOFFStreamer.
Definition at line 1221 of file MCStreamer.cpp.
Definition at line 903 of file MCStreamer.cpp.
References llvm::Win64EH::Instruction::Alloc(), emitCFILabel(), EnsureValidWinFrameInfo(), getContext(), llvm::WinEH::FrameInfo::Instructions, llvm::MCContext::reportError(), and Size.
Definition at line 774 of file MCStreamer.cpp.
References llvm::WinEH::FrameInfo::ChainedParent, emitCFILabel(), llvm::WinEH::FrameInfo::End, EnsureValidWinFrameInfo(), getContext(), and llvm::MCContext::reportError().
Definition at line 732 of file MCStreamer.cpp.
References llvm::WinEH::FrameInfo::ChainedParent, emitCFILabel(), emitWindowsUnwindTables(), llvm::WinEH::FrameInfo::End, EnsureValidWinFrameInfo(), llvm::WinEH::FrameInfo::FuncletOrFuncEnd, llvm::get(), getContext(), I, llvm::MCContext::reportError(), switchSection(), and llvm::WinEH::FrameInfo::TextSection.
Definition at line 966 of file MCStreamer.cpp.
References emitCFILabel(), EnsureValidWinFrameInfo(), and llvm::WinEH::FrameInfo::PrologEnd.
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 750 of file MCStreamer.cpp.
References llvm::WinEH::FrameInfo::ChainedParent, emitCFILabel(), EnsureValidWinFrameInfo(), llvm::WinEH::FrameInfo::FuncletOrFuncEnd, getContext(), and llvm::MCContext::reportError().
Definition at line 952 of file MCStreamer.cpp.
References emitCFILabel(), EnsureValidWinFrameInfo(), getContext(), llvm::WinEH::FrameInfo::Instructions, llvm::Win64EH::Instruction::PushMachFrame(), and llvm::MCContext::reportError().
|
virtual |
Definition at line 869 of file MCStreamer.cpp.
References emitCFILabel(), encodeSEHRegNum(), EnsureValidWinFrameInfo(), llvm::WinEH::FrameInfo::Instructions, and llvm::Win64EH::Instruction::PushNonVol().
|
virtual |
Definition at line 920 of file MCStreamer.cpp.
References emitCFILabel(), encodeSEHRegNum(), EnsureValidWinFrameInfo(), getContext(), llvm::WinEH::FrameInfo::Instructions, llvm::Offset, llvm::MCContext::reportError(), and llvm::Win64EH::Instruction::SaveNonVol().
|
virtual |
Definition at line 937 of file MCStreamer.cpp.
References emitCFILabel(), encodeSEHRegNum(), EnsureValidWinFrameInfo(), getContext(), llvm::WinEH::FrameInfo::Instructions, llvm::Offset, llvm::MCContext::reportError(), and llvm::Win64EH::Instruction::SaveXMM().
|
virtual |
Definition at line 881 of file MCStreamer.cpp.
References emitCFILabel(), encodeSEHRegNum(), EnsureValidWinFrameInfo(), getContext(), llvm::WinEH::FrameInfo::Instructions, llvm::WinEH::FrameInfo::LastFrameInst, llvm::Offset, llvm::MCContext::reportError(), and llvm::Win64EH::Instruction::SetFPReg().
Definition at line 761 of file MCStreamer.cpp.
References emitCFILabel(), EnsureValidWinFrameInfo(), llvm::WinEH::FrameInfo::Function, getCurrentSectionOnly(), and llvm::WinEH::FrameInfo::TextSection.
Definition at line 714 of file MCStreamer.cpp.
References emitCFILabel(), llvm::WinEH::FrameInfo::End, llvm::MCContext::getAsmInfo(), getContext(), getCurrentSectionOnly(), llvm::MCContext::reportError(), llvm::WinEH::FrameInfo::TextSection, and llvm::MCAsmInfo::usesWindowsCFI().
|
protectedvirtual |
Definition at line 1003 of file MCStreamer.cpp.
Referenced by emitWinCFIEndProc().
|
protectedvirtual |
Definition at line 1005 of file MCStreamer.cpp.
|
virtual |
Definition at line 788 of file MCStreamer.cpp.
Reimplemented in llvm::MCWinCOFFStreamer.
Definition at line 805 of file MCStreamer.cpp.
References llvm::WinEH::FrameInfo::ChainedParent, and EnsureValidWinFrameInfo().
Emit a C_INFO symbol with XCOFF embedded metadata to the .info section.
Name | - The embedded metadata name |
Metadata | - The embedded metadata |
Reimplemented in llvm::MCXCOFFStreamer.
Definition at line 1206 of file MCStreamer.cpp.
References llvm_unreachable.
|
virtual |
Emit an XCOFF .except directive which adds information about a trap instruction to the object file exception section.
Symbol | - The function containing the trap. |
Lang | - The language code for the exception entry. |
Reason | - The reason code for the exception entry. |
Reimplemented in llvm::MCXCOFFStreamer.
Definition at line 1197 of file MCStreamer.cpp.
References llvm::report_fatal_error().
|
virtual |
Emits an lcomm directive with XCOFF csect information.
LabelSym | - Label on the block of storage. |
Size | - The size of the block of storage. |
CsectSym | - Csect name for the block of storage. |
Alignment | - The alignment of the symbol in bytes. |
Reimplemented in llvm::MCXCOFFStreamer.
Definition at line 1177 of file MCStreamer.cpp.
References llvm_unreachable.
Emit a XCOFF .ref directive which creates R_REF type entry in the relocation table for one or more symbols.
Sym | - The symbol on the .ref directive. |
Reimplemented in llvm::MCXCOFFStreamer.
Definition at line 1193 of file MCStreamer.cpp.
References llvm_unreachable.
Emit a XCOFF .rename directive which creates a synonym for an illegal or undesirable name.
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 1190 of file MCStreamer.cpp.
|
virtual |
Emit a symbol's linkage and visibility with a linkage directive for XCOFF.
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 1183 of file MCStreamer.cpp.
References llvm_unreachable.
|
pure virtual |
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. |
Implemented in llvm::MCDXContainerStreamer, llvm::MCWinCOFFStreamer, llvm::RecordStreamer, llvm::MCELFStreamer, llvm::MCGOFFStreamer, llvm::MCSPIRVStreamer, llvm::MCWasmStreamer, and llvm::MCXCOFFStreamer.
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 229 of file MCStreamer.cpp.
References emitFill().
Referenced by llvm::AsmPrinter::XRayFunctionEntry::emit(), llvm::MCELFStreamer::emitCommonSymbol(), llvm::MCXCOFFStreamer::emitCommonSymbol(), llvm::MCWinCOFFStreamer::emitLocalCommonSymbol(), and llvm::HexagonMCELFStreamer::HexagonMCEmitCommonSymbol().
|
virtual |
Marks the end of the symbol definition.
Reimplemented in llvm::MCWinCOFFStreamer, and llvm::RecordStreamer.
Definition at line 1163 of file MCStreamer.cpp.
References llvm_unreachable.
Definition at line 1298 of file MCStreamer.cpp.
References emitLabel(), switchSection(), and Sym.
Referenced by llvm::MCObjectStreamer::emitDwarfLineEndEntry(), and llvm::AArch64TargetStreamer::emitNoteSection().
WinEH::FrameInfo * MCStreamer::EnsureValidWinFrameInfo | ( | SMLoc | Loc | ) |
Retrieve the current frame info if one is available and it is not yet closed.
Otherwise, issue an error and return null.
Definition at line 699 of file MCStreamer.cpp.
References llvm::WinEH::FrameInfo::End, llvm::MCContext::getAsmInfo(), getContext(), llvm::MCContext::reportError(), and llvm::MCAsmInfo::usesWindowsCFI().
Referenced by emitWinCFIAllocStack(), emitWinCFIEndChained(), emitWinCFIEndProc(), emitWinCFIEndProlog(), emitWinCFIFuncletOrFuncEnd(), emitWinCFIPushFrame(), emitWinCFIPushReg(), emitWinCFISaveReg(), emitWinCFISaveXMM(), emitWinCFISetFrame(), emitWinCFIStartChained(), and emitWinEHHandlerData().
Finish emission of machine code.
Definition at line 1007 of file MCStreamer.cpp.
References llvm::MCTargetStreamer::finish(), finishImpl(), getContext(), getTargetStreamer(), and llvm::MCContext::reportError().
Referenced by llvm::dwarf_linker::parallel::DwarfEmitterImpl::finish(), and llvm::dwarf_linker::classic::DwarfStreamer::finish().
|
virtual |
Streamer specific finalization.
Reimplemented in llvm::MCELFStreamer, llvm::MCObjectStreamer, llvm::MCWasmStreamer, and llvm::MCWinCOFFStreamer.
Definition at line 1241 of file MCStreamer.cpp.
Referenced by finish().
void MCStreamer::generateCompactUnwindEncodings | ( | MCAsmBackend * | MAB | ) |
Definition at line 125 of file MCStreamer.cpp.
References llvm::MCAsmBackend::generateCompactUnwindEncoding().
Referenced by llvm::MCDwarfFrameEmitter::Emit().
|
inline |
Definition at line 314 of file MCStreamer.h.
Referenced by NoAutoPaddingScope::changeAndComment().
|
inlinevirtual |
Reimplemented in llvm::MCObjectStreamer.
Definition at line 304 of file MCStreamer.h.
Referenced by switchSection().
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 851 of file MCStreamer.cpp.
References getContext(), and getWinCFISection().
Referenced by llvm::Win64EH::UnwindEmitter::Emit(), llvm::Win64EH::ARMUnwindEmitter::Emit(), and llvm::Win64EH::ARM64UnwindEmitter::Emit().
Get the .xdata section used for the given section.
Definition at line 857 of file MCStreamer.cpp.
References getContext(), and getWinCFISection().
Referenced by llvm::Win64EH::UnwindEmitter::Emit(), llvm::Win64EH::ARMUnwindEmitter::Emit(), llvm::Win64EH::ARM64UnwindEmitter::Emit(), llvm::Win64EH::UnwindEmitter::EmitUnwindInfo(), llvm::Win64EH::ARMUnwindEmitter::EmitUnwindInfo(), and llvm::Win64EH::ARM64UnwindEmitter::EmitUnwindInfo().
|
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 110 of file MCStreamer.cpp.
References llvm::nulls().
|
inline |
Definition at line 300 of file MCStreamer.h.
Referenced by llvm::AssemblerConstantPools::addEntry(), llvm::CSKYConstantPool::addEntry(), ARM64EmitRuntimeFunction(), ARM64EmitUnwindInfo(), ARM64EmitUnwindInfoForSegment(), ARMEmitRuntimeFunction(), ARMEmitUnwindInfo(), buildSymbolDiff(), llvm::MCTargetStreamer::changeSection(), llvm::NVPTXTargetStreamer::changeSection(), llvm::MCObjectStreamer::changeSectionImpl(), checkARM64Instructions(), checkARMInstructions(), checkCVLocSection(), llvm::MCDwarfFrameEmitter::Emit(), llvm::MCPseudoProbeSections::emit(), llvm::MCPseudoProbeTable::emit(), llvm::MCPseudoProbe::emit(), llvm::MCGenDwarfInfo::Emit(), llvm::MCDwarfLineTable::emit(), llvm::MCDwarfLineTableHeader::Emit(), llvm::MCDwarfLineAddr::Emit(), EmitAbsDifference(), llvm::MCObjectStreamer::emitAbsoluteSymbolDiff(), llvm::MCObjectStreamer::emitAbsoluteSymbolDiffAsULEB128(), llvm::CSKYConstantPool::emitAll(), llvm::AMDGPUTargetELFStreamer::EmitAmdhsaKernelDescriptor(), llvm::MipsELFStreamer::emitCFIEndProcImpl(), llvm::MipsELFStreamer::emitCFILabel(), emitCFILabelDirective(), emitCFIStartProc(), llvm::MipsELFStreamer::emitCFIStartProcImpl(), llvm::MCWinCOFFStreamer::emitCOFFImgRel32(), llvm::MCWinCOFFStreamer::emitCOFFSafeSEH(), llvm::MCWinCOFFStreamer::emitCOFFSecRel32(), llvm::MCWinCOFFStreamer::emitCOFFSectionIndex(), llvm::MCWinCOFFStreamer::emitCOFFSymbolIndex(), llvm::MCELFStreamer::emitCommonSymbol(), llvm::MCWinCOFFStreamer::emitCommonSymbol(), llvm::SystemZTargetStreamer::emitConstantPools(), llvm::MCObjectStreamer::emitCVDefRangeDirective(), llvm::MCObjectStreamer::emitCVFileChecksumOffsetDirective(), llvm::MCObjectStreamer::emitCVFileChecksumsDirective(), emitCVFileDirective(), emitCVFuncIdDirective(), llvm::MCObjectStreamer::emitCVInlineLinetableDirective(), emitCVInlineSiteIdDirective(), llvm::MCObjectStreamer::emitCVLinetableDirective(), llvm::MCObjectStreamer::emitCVLocDirective(), llvm::MCObjectStreamer::emitCVStringTableDirective(), llvm::MCObjectStreamer::emitDwarfAdvanceFrameAddr(), llvm::MCObjectStreamer::emitDwarfAdvanceLineAddr(), emitDwarfFile0Directive(), llvm::MCObjectStreamer::emitDwarfLineEndEntry(), emitDwarfLocDirective(), emitFDESymbol(), llvm::MCObjectStreamer::emitFill(), emitFill(), llvm::AMDGPUAsmPrinter::emitFunctionBodyEnd(), EmitGenDwarfAbbrev(), EmitGenDwarfAranges(), EmitGenDwarfInfo(), emitGenDwarfRanges(), llvm::ARMTargetStreamer::emitInst(), llvm::MCObjectStreamer::emitInstruction(), llvm::MipsELFStreamer::emitInstruction(), llvm::MCObjectStreamer::emitInstToFragment(), emitLabel(), llvm::mcdwarf::emitListsTableHeaderStart(), llvm::XtensaTargetELFStreamer::emitLiteral(), llvm::MCWinCOFFStreamer::emitLocalCommonSymbol(), emitNonLazySymbolPointer(), llvm::MCObjectStreamer::emitNops(), llvm::AArch64TargetStreamer::emitNoteSection(), llvm::MCDwarfLineTable::emitOne(), EmitPersonality(), emitPseudoProbe(), llvm::MCTargetStreamer::emitRawBytes(), llvm::NVPTXTargetStreamer::emitRawBytes(), llvm::MCDwarfLineStr::emitRef(), llvm::MCObjectStreamer::emitRelocDirective(), EmitRuntimeFunction(), llvm::MCDwarfLineStr::emitSection(), llvm::MCObjectStreamer::emitSLEB128Value(), llvm::MCELFStreamer::emitSymbolAttribute(), EmitSymbolRefWithOfs(), emitSymbolValue(), llvm::MCObjectStreamer::emitULEB128Value(), EmitUnwindInfo(), llvm::MCTargetStreamer::emitValue(), llvm::AVRMCELFStreamer::emitValueForModiferKind(), llvm::MCObjectStreamer::emitValueImpl(), llvm::MCObjectStreamer::emitValueToAlignment(), llvm::MCObjectStreamer::emitValueToOffset(), llvm::MCELFStreamer::emitWeakReference(), llvm::MCWasmStreamer::emitWeakReference(), llvm::MCWinCOFFStreamer::emitWeakReference(), emitWinCFIAllocStack(), emitWinCFIEndChained(), emitWinCFIEndProc(), emitWinCFIFuncletOrFuncEnd(), emitWinCFIPushFrame(), emitWinCFISaveReg(), emitWinCFISaveXMM(), emitWinCFISetFrame(), emitWinCFIStartProc(), llvm::MCXCOFFStreamer::emitXCOFFRefDirective(), EnsureValidWinFrameInfo(), finish(), llvm::MCObjectStreamer::finishImpl(), llvm::RecordStreamer::flushSymverDirectives(), getAssociatedPDataSection(), getAssociatedXDataSection(), llvm::AMDGPUTargetStreamer::getContext(), getDataAlignmentFactor(), getDwarfLineTableSymbol(), llvm::MCAsmInfo::getExprForFDESymbol(), llvm::RISCVMCAsmInfo::getExprForFDESymbol(), llvm::SparcELFMCAsmInfo::getExprForFDESymbol(), llvm::AArch64MCAsmInfoDarwin::getExprForPersonalitySymbol(), llvm::SparcELFMCAsmInfo::getExprForPersonalitySymbol(), llvm::X86_64MCAsmInfoDarwin::getExprForPersonalitySymbol(), GetOptionalAbsDifference(), llvm::MCObjectStreamer::getOrCreateDataFragment(), getSizeForEncoding(), GetSubDivExpr(), llvm::HexagonMCELFStreamer::HexagonMCEmitCommonSymbol(), initSections(), llvm::MCELFStreamer::initSections(), llvm::MCWinCOFFStreamer::initSections(), llvm::MCDwarfLineEntry::make(), llvm::MCGenDwarfLabelEntry::Make(), llvm::MSP430TargetELFStreamer::MSP430TargetELFStreamer(), llvm::MCObjectStreamer::reset(), smallData(), llvm::XtensaTargetELFStreamer::startLiteralSection(), switchSection(), tryEmitDwarfFileDirective(), and llvm::write().
|
inline |
Definition at line 409 of file MCStreamer.h.
References assert(), CurFrag, getCurrentSection(), and llvm::MCFragment::getParent().
Referenced by llvm::MCELFStreamer::changeSection(), llvm::MCObjectStreamer::emitCodeAlignment(), llvm::MCELFStreamer::finishImpl(), and llvm::MCObjectStreamer::getOrCreateDataFragment().
|
inline |
Return the current section that the streamer is emitting code to.
Definition at line 393 of file MCStreamer.h.
References llvm::SmallVectorTemplateCommon< T, typename >::back(), and llvm::SmallVectorBase< Size_T >::empty().
Referenced by llvm::MCELFStreamer::emitCommonSymbol(), getCurrentFragment(), llvm::HexagonMCELFStreamer::HexagonMCEmitCommonSymbol(), and pushSection().
|
inline |
Definition at line 398 of file MCStreamer.h.
References CurFrag, and llvm::MCFragment::getParent().
Referenced by llvm::AssemblerConstantPools::addEntry(), llvm::CSKYConstantPool::addEntry(), checkCVLocSection(), llvm::AssemblerConstantPools::clearCacheForCurrentSection(), llvm::MCELFStreamer::emitBundleLock(), llvm::MCELFStreamer::emitBundleUnlock(), llvm::MCObjectStreamer::emitBytes(), emitCFIStartProc(), llvm::MCWinCOFFStreamer::emitCOFFSymbolIndex(), llvm::MCObjectStreamer::emitDwarfLocDirective(), llvm::MCObjectStreamer::emitFill(), llvm::AssemblerConstantPools::emitForCurrentSection(), llvm::MCObjectStreamer::emitInstruction(), emitLabel(), llvm::MCELFStreamer::emitLabel(), llvm::MCWasmStreamer::emitLabel(), llvm::MCObjectStreamer::emitLabelAtPos(), llvm::MCELFStreamer::emitLabelAtPos(), llvm::MCWasmStreamer::emitLabelAtPos(), llvm::XtensaTargetELFStreamer::emitLiteral(), llvm::MCObjectStreamer::emitNops(), llvm::AArch64TargetStreamer::emitNoteSection(), llvm::MCObjectStreamer::emitValueImpl(), llvm::MCObjectStreamer::emitValueToAlignment(), emitWinCFIStartChained(), emitWinCFIStartProc(), and llvm::MCGenDwarfLabelEntry::Make().
|
inlineprotected |
Definition at line 266 of file MCStreamer.h.
ArrayRef< MCDwarfFrameInfo > MCStreamer::getDwarfFrameInfos | ( | ) | const |
Definition at line 116 of file MCStreamer.cpp.
Referenced by llvm::MCDwarfFrameEmitter::Emit().
Definition at line 270 of file MCStreamer.cpp.
References llvm::MCContext::getAsmInfo(), getContext(), llvm::MCDwarfLineTable::getLabel(), llvm::MCContext::getMCDwarfLineTable(), llvm::MCContext::getOrCreateSymbol(), llvm::MCAsmInfo::getPrivateGlobalPrefix(), and llvm::MCDwarfLineTable::setLabel().
Referenced by llvm::MCGenDwarfInfo::Emit().
Returns the mnemonic for MI
, if the streamer has access to a instruction printer and returns an empty string otherwise.
Definition at line 444 of file MCStreamer.h.
unsigned MCStreamer::getNumFrameInfos | ( | ) |
Definition at line 115 of file MCStreamer.cpp.
Referenced by llvm::MCObjectStreamer::emitFrames().
|
inline |
Definition at line 329 of file MCStreamer.h.
|
inline |
Return the previous section that the streamer is emitting code to.
Definition at line 403 of file MCStreamer.h.
References llvm::SmallVectorTemplateCommon< T, typename >::back(), and llvm::SmallVectorBase< Size_T >::empty().
Referenced by llvm::RISCVELFStreamer::changeSection(), and pushSection().
|
inline |
Definition at line 292 of file MCStreamer.h.
Referenced by llvm::MCELFStreamer::emitELFSymverDirective(), and llvm::MCELFStreamer::emitSymbolAttribute().
|
inline |
Definition at line 309 of file MCStreamer.h.
Referenced by llvm::MipsELFStreamer::createPendingLabelRelocs(), emitAssignment(), emitLabel(), llvm::MipsRegInfoRecord::EmitMipsOptionRecord(), and finish().
|
inline |
Definition at line 307 of file MCStreamer.h.
Referenced by llvm::MCObjectStreamer::getAssemblerPtr().
|
inline |
Definition at line 330 of file MCStreamer.h.
Referenced by llvm::Win64EH::UnwindEmitter::Emit(), llvm::Win64EH::ARMUnwindEmitter::Emit(), and llvm::Win64EH::ARM64UnwindEmitter::Emit().
|
inlinevirtual |
Return true if this asm streamer supports emitting unformatted text to the .s file with EmitRawText.
Definition at line 345 of file MCStreamer.h.
bool MCStreamer::hasUnfinishedDwarfFrameInfo | ( | ) |
Definition at line 280 of file MCStreamer.cpp.
|
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().
|
inlinevirtual |
Is the integrated assembler required for this streamer to function correctly?
Reimplemented in llvm::MCObjectStreamer.
Definition at line 349 of file MCStreamer.h.
|
inlinevirtual |
Return true if this streamer supports verbose assembly and if it is enabled.
Definition at line 341 of file MCStreamer.h.
void MCStreamer::maybeEmitDwarf64Mark | ( | ) |
Emit a special value of 0xffffffff if producing 64-bit debugging info.
Definition at line 1021 of file MCStreamer.cpp.
References AddComment(), llvm::dwarf::DW_LENGTH_DWARF64, llvm::dwarf::DWARF64, emitInt32(), and llvm::MCContext::getDwarfFormat().
Referenced by emitDwarfUnitLength().
Reimplemented in llvm::MCObjectStreamer.
Definition at line 1103 of file MCStreamer.h.
Referenced by llvm::MCContext::finalizeDwarfSections().
|
delete |
bool MCStreamer::popSection | ( | ) |
Restore the current and previous section from the section stack.
Calls changeSection as needed.
Returns false if the stack was empty.
Definition at line 1244 of file MCStreamer.cpp.
References changeSection(), llvm::SmallVectorTemplateCommon< T, typename >::end(), I, llvm::SmallVectorTemplateBase< T, bool >::pop_back(), and llvm::SmallVectorBase< Size_T >::size().
Referenced by llvm::MCWinCOFFStreamer::emitCommonSymbol(), llvm::MCELFStreamer::emitIdent(), llvm::XtensaTargetELFStreamer::emitLiteral(), llvm::MCWinCOFFStreamer::emitLocalCommonSymbol(), and llvm::MipsRegInfoRecord::EmitMipsOptionRecord().
|
inline |
Save the current and previous section on the section stack.
Definition at line 416 of file MCStreamer.h.
References getCurrentSection(), getPreviousSection(), and llvm::SmallVectorTemplateBase< T, bool >::push_back().
Referenced by llvm::MCWinCOFFStreamer::emitCommonSymbol(), llvm::MCELFStreamer::emitIdent(), llvm::XtensaTargetELFStreamer::emitLiteral(), llvm::MCWinCOFFStreamer::emitLocalCommonSymbol(), and llvm::MipsRegInfoRecord::EmitMipsOptionRecord().
|
virtual |
State management.
Reimplemented in llvm::MCELFStreamer, llvm::MCObjectStreamer, llvm::MCWasmStreamer, llvm::MCWinCOFFStreamer, and llvm::CSKYELFStreamer.
Definition at line 101 of file MCStreamer.cpp.
References llvm::SmallVectorImpl< T >::clear(), CurFrag, and llvm::SmallVectorTemplateBase< T, bool >::push_back().
Referenced by llvm::LLVMTargetMachine::createMCStreamer(), and llvm::MCObjectStreamer::reset().
|
inline |
Definition at line 313 of file MCStreamer.h.
Referenced by NoAutoPaddingScope::changeAndComment(), and llvm::MCObjectStreamer::MCObjectStreamer().
Definition at line 291 of file MCStreamer.h.
|
inline |
Definition at line 287 of file MCStreamer.h.
Referenced by llvm::MCTargetStreamer::MCTargetStreamer().
|
inline |
Definition at line 306 of file MCStreamer.h.
Definition at line 1273 of file MCStreamer.cpp.
References getAssemblerPtr(), getContext(), llvm::MCExpr::getLoc(), llvm::MCContext::reportError(), and switchSection().
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 1259 of file MCStreamer.cpp.
References assert(), llvm::SmallVectorTemplateCommon< T, typename >::back(), changeSection(), emitLabel(), and Sym.
Referenced by addAllTypesFromDWP(), addAllTypesFromTypesSection(), llvm::MCDwarfFrameEmitter::Emit(), llvm::MCPseudoProbeSections::emit(), llvm::MCDwarfDwoLineTable::Emit(), llvm::Win64EH::UnwindEmitter::Emit(), llvm::Win64EH::ARMUnwindEmitter::Emit(), llvm::Win64EH::ARM64UnwindEmitter::Emit(), llvm::MCGenDwarfInfo::Emit(), llvm::MCDwarfLineTable::emit(), llvm::dwarf_linker::parallel::DwarfEmitterImpl::emitAbbrevs(), llvm::dwarf_linker::classic::DwarfStreamer::emitAbbrevs(), llvm::CSKYConstantPool::emitAll(), llvm::dwarf_linker::classic::DwarfStreamer::emitCIE(), llvm::MCELFStreamer::emitCommonSymbol(), llvm::MCWinCOFFStreamer::emitCommonSymbol(), llvm::dwarf_linker::parallel::DwarfEmitterImpl::emitCompileUnitHeader(), emitConstantPool(), llvm::SystemZTargetStreamer::emitConstantPools(), llvm::dwarf_linker::parallel::DwarfEmitterImpl::emitDIE(), llvm::dwarf_linker::classic::DwarfStreamer::emitDIE(), llvm::dwarf_linker::classic::DwarfStreamer::emitDwarfDebugAddrsFooter(), llvm::dwarf_linker::classic::DwarfStreamer::emitDwarfDebugAddrsHeader(), llvm::dwarf_linker::classic::DwarfStreamer::emitDwarfDebugArangesTable(), llvm::dwarf_linker::classic::DwarfStreamer::emitDwarfDebugLocListFooter(), llvm::dwarf_linker::classic::DwarfStreamer::emitDwarfDebugLocListHeader(), llvm::dwarf_linker::classic::DwarfStreamer::emitDwarfDebugRangeListFooter(), llvm::dwarf_linker::classic::DwarfStreamer::emitDwarfDebugRangeListHeader(), llvm::MCObjectStreamer::emitDwarfLineEndEntry(), llvm::dwarf_linker::classic::DwarfStreamer::emitFDE(), EmitGenDwarfAbbrev(), EmitGenDwarfAranges(), EmitGenDwarfInfo(), emitGenDwarfRanges(), llvm::MCELFStreamer::emitIdent(), llvm::dwarf_linker::classic::DwarfStreamer::emitLineTableForUnit(), llvm::XtensaTargetELFStreamer::emitLiteral(), llvm::MCWinCOFFStreamer::emitLocalCommonSymbol(), llvm::dwarf_linker::classic::DwarfStreamer::emitMacroTables(), llvm::TargetLoweringObjectFileELF::emitModuleMetadata(), llvm::TargetLoweringObjectFileMachO::emitModuleMetadata(), llvm::TargetLoweringObjectFileCOFF::emitModuleMetadata(), emitNonLazyStubs(), llvm::AArch64TargetStreamer::emitNoteSection(), llvm::TargetLoweringObjectFileELF::emitPersonalityValue(), llvm::MCDwarfLineStr::emitSection(), llvm::dwarf_linker::classic::DwarfStreamer::emitSectionContents(), llvm::dwarf_linker::classic::DwarfStreamer::emitSwiftAST(), llvm::dwarf_linker::classic::DwarfStreamer::emitSwiftReflectionSection(), llvm::Win64EH::UnwindEmitter::EmitUnwindInfo(), llvm::Win64EH::ARMUnwindEmitter::EmitUnwindInfo(), llvm::Win64EH::ARM64UnwindEmitter::EmitUnwindInfo(), emitWinCFIEndProc(), endSection(), llvm::MipsTargetELFStreamer::finish(), llvm::MCWinCOFFStreamer::finishImpl(), llvm::DWPStringPool::getOffset(), llvm::handleSection(), llvm::HexagonMCELFStreamer::HexagonMCEmitCommonSymbol(), initSections(), llvm::MCELFStreamer::initSections(), llvm::MCWinCOFFStreamer::initSections(), llvm::MSP430TargetELFStreamer::MSP430TargetELFStreamer(), smallData(), switchSection(), llvm::MipsELFStreamer::switchSection(), llvm::dwarf_linker::classic::DwarfStreamer::switchToDebugInfoSection(), llvm::write(), llvm::writeIndex(), and llvm::writeStringsAndOffsets().
|
virtual |
Similar to switchSection, but does not print the section directive.
Reimplemented in llvm::MCObjectStreamer.
Definition at line 1292 of file MCStreamer.cpp.
References llvm::SmallVectorTemplateCommon< T, typename >::back(), and CurFrag.
Referenced by llvm::MCObjectStreamer::switchSectionNoPrint().
|
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 231 of file MCStreamer.cpp.
References getContext(), and llvm::MCContext::getDwarfFile().
Referenced by emitDwarfFileDirective().
Definition at line 1075 of file MCStreamer.cpp.
References llvm::MCExpr::Binary, llvm::MCExpr::Constant, llvm::MCExpr::getKind(), llvm::MCBinaryExpr::getLHS(), llvm::MCBinaryExpr::getRHS(), llvm::MCExpr::SymbolRef, llvm::MCExpr::Target, llvm::MCExpr::Unary, visitUsedExpr(), and visitUsedSymbol().
Referenced by emitAssignment(), emitInstruction(), llvm::MCObjectStreamer::emitRelocDirective(), llvm::HexagonMCELFStreamer::EmitSymbol(), emitValueImpl(), visitUsedExpr(), llvm::AArch64MCExpr::visitUsedExpr(), llvm::AArch64AuthMCExpr::visitUsedExpr(), llvm::AMDGPUMCExpr::visitUsedExpr(), llvm::ARMMCExpr::visitUsedExpr(), llvm::AVRMCExpr::visitUsedExpr(), llvm::CSKYMCExpr::visitUsedExpr(), llvm::HexagonMCExpr::visitUsedExpr(), llvm::LanaiMCExpr::visitUsedExpr(), llvm::LoongArchMCExpr::visitUsedExpr(), llvm::MipsMCExpr::visitUsedExpr(), llvm::PPCMCExpr::visitUsedExpr(), llvm::RISCVMCExpr::visitUsedExpr(), llvm::SparcMCExpr::visitUsedExpr(), llvm::SystemZMCExpr::visitUsedExpr(), llvm::VEMCExpr::visitUsedExpr(), and llvm::XtensaMCExpr::visitUsedExpr().
Reimplemented in llvm::MCObjectStreamer.
Definition at line 1072 of file MCStreamer.cpp.
Referenced by visitUsedExpr().
|
protected |
Definition at line 255 of file MCStreamer.h.
Referenced by changeSection(), llvm::MCObjectStreamer::changeSectionImpl(), getCurrentFragment(), getCurrentSectionOnly(), llvm::MCObjectStreamer::insert(), reset(), and switchSectionNoPrint().