class RecordStreamer
Declaration
class RecordStreamer : public MCStreamer { /* full declaration omitted */ };
Description
Streaming machine code generation interface. This interface is intended to provide a programmatic interface that is very similar to the level that an assembler .s file provides. It has callbacks to emit bytes, handle directives, etc. The implementation of this interface retains state to know what the current section is etc. There are multiple implementations of this interface: one for writing out a .s file, and implementations that write out .o files of various formats.
Declared at: llvm/lib/Object/RecordStreamer.h:24
Inherits from: MCStreamer
Member Variables
- private const llvm::Module& M
- private StringMap<llvm::RecordStreamer::State> Symbols
- private DenseMap<const llvm::MCSymbol*, std::vector<StringRef>> SymverAliasMap
Method Overview
- public RecordStreamer(llvm::MCContext & Context, const llvm::Module & M)
- public llvm::RecordStreamer::const_iterator begin()
- public void beginCOFFSymbolDef(const llvm::MCSymbol * Symbol)
- public void emitAssignment(llvm::MCSymbol * Symbol, const llvm::MCExpr * Value)
- public void emitCOFFSymbolStorageClass(int StorageClass)
- public void emitCOFFSymbolType(int Type)
- public void emitCommonSymbol(llvm::MCSymbol * Symbol, uint64_t Size, unsigned int ByteAlignment)
- public void emitELFSymverDirective(const llvm::MCSymbol * OriginalSym, llvm::StringRef Name, bool KeepOriginalSym)
- public void emitInstruction(const llvm::MCInst & Inst, const llvm::MCSubtargetInfo & STI)
- public void emitLabel(llvm::MCSymbol * Symbol, llvm::SMLoc Loc = llvm::SMLoc())
- public bool emitSymbolAttribute(llvm::MCSymbol * Symbol, llvm::MCSymbolAttr Attribute)
- public void emitZerofill(llvm::MCSection * Section, llvm::MCSymbol * Symbol, uint64_t Size, unsigned int ByteAlignment, llvm::SMLoc Loc = llvm::SMLoc())
- public llvm::RecordStreamer::const_iterator end()
- public void endCOFFSymbolDef()
- public void flushSymverDirectives()
- private llvm::RecordStreamer::State getSymbolState(const llvm::MCSymbol * Sym)
- private void markDefined(const llvm::MCSymbol & Symbol)
- private void markGlobal(const llvm::MCSymbol & Symbol, llvm::MCSymbolAttr Attribute)
- private void markUsed(const llvm::MCSymbol & Symbol)
- public iterator_range<llvm::RecordStreamer::const_symver_iterator> symverAliases()
- private void visitUsedSymbol(const llvm::MCSymbol & Sym)
Inherited from MCStreamer:
- public AddComment
- public EnsureValidWinFrameInfo
- public addBlankLine
- public addExplicitComment
- public assignFragment
- public beginCOFFSymbolDef
- public changeSection
- protected checkCVLocSection
- public doFinalizationAtSectionEnd
- public emitAbsoluteSymbolDiff
- public emitAbsoluteSymbolDiffAsULEB128
- public emitAddrsig
- public emitAddrsigSym
- public emitAssemblerFlag
- public emitAssignment
- public emitBinaryData
- public emitBuildVersion
- public emitBundleAlignMode
- public emitBundleLock
- public emitBundleUnlock
- public emitBytes
- public emitCFIAdjustCfaOffset
- public emitCFIBKeyFrame
- public emitCFIDefCfa
- public emitCFIDefCfaOffset
- public emitCFIDefCfaRegister
- public emitCFIEndProc
- protected emitCFIEndProcImpl
- public emitCFIEscape
- public emitCFIGnuArgsSize
- public emitCFILLVMDefAspaceCfa
- public emitCFILabel
- public emitCFILsda
- public emitCFIMTETaggedFrame
- public emitCFINegateRAState
- public emitCFIOffset
- public emitCFIPersonality
- public emitCFIRegister
- public emitCFIRelOffset
- public emitCFIRememberState
- public emitCFIRestore
- public emitCFIRestoreState
- public emitCFIReturnColumn
- public emitCFISameValue
- public emitCFISections
- public emitCFISignalFrame
- public emitCFIStartProc
- protected emitCFIStartProcImpl
- public emitCFIUndefined
- public emitCFIWindowSave
- public emitCGProfileEntry
- public emitCOFFImgRel32
- public emitCOFFSafeSEH
- public emitCOFFSecRel32
- public emitCOFFSectionIndex
- public emitCOFFSymbolIndex
- public emitCOFFSymbolStorageClass
- public emitCOFFSymbolType
- public emitCVDefRangeDirective
- public emitCVDefRangeDirective
- public emitCVDefRangeDirective
- public emitCVDefRangeDirective
- public emitCVDefRangeDirective
- public emitCVFPOData
- public emitCVFileChecksumOffsetDirective
- public emitCVFileChecksumsDirective
- public emitCVFileDirective
- public emitCVFuncIdDirective
- public emitCVInlineLinetableDirective
- public emitCVInlineSiteIdDirective
- public emitCVLinetableDirective
- public emitCVLocDirective
- public emitCVStringTableDirective
- public emitCodeAlignment
- public emitCommonSymbol
- public emitConditionalAssignment
- public emitDTPRel32Value
- public emitDTPRel64Value
- public emitDarwinTargetVariantBuildVersion
- public emitDataRegion
- public emitDwarfAdvanceLineAddr
- public emitDwarfFile0Directive
- public emitDwarfFileDirective
- public emitDwarfLineEndEntry
- public emitDwarfLineStartLabel
- public emitDwarfLocDirective
- public emitDwarfUnitLength
- public emitDwarfUnitLength
- public emitEHSymAttributes
- public emitELFSize
- public emitELFSymverDirective
- public emitExplicitComments
- public emitFileDirective
- public emitFileDirective
- public emitFill
- public emitFill
- public emitFill
- public emitGNUAttribute
- public emitGPRel32Value
- public emitGPRel64Value
- public emitIdent
- public emitInstruction
- public emitInt16
- public emitInt32
- public emitInt64
- public emitInt8
- public emitIntValue
- public emitIntValue
- public emitIntValueInHex
- public emitIntValueInHexWithPadding
- public emitLOHDirective
- public emitLabel
- public emitLinkerOptions
- public emitLocalCommonSymbol
- public emitNops
- public emitPseudoProbe
- public emitRawComment
- public emitRawText
- protected emitRawTextImpl
- public emitRelocDirective
- public emitSLEB128IntValue
- public emitSLEB128Value
- public emitSymbolAttribute
- public emitSymbolDesc
- public emitSymbolValue
- public emitSyntaxDirective
- public emitTBSSSymbol
- public emitTPRel32Value
- public emitTPRel64Value
- public emitThumbFunc
- public emitULEB128IntValue
- public emitULEB128Value
- public emitValue
- public emitValueImpl
- public emitValueToAlignment
- public emitValueToOffset
- public emitVersionForTarget
- public emitVersionMin
- public emitWeakReference
- public emitWinCFIAllocStack
- public emitWinCFIEndChained
- public emitWinCFIEndProc
- public emitWinCFIEndProlog
- public emitWinCFIFuncletOrFuncEnd
- public emitWinCFIPushFrame
- public emitWinCFIPushReg
- public emitWinCFISaveReg
- public emitWinCFISaveXMM
- public emitWinCFISetFrame
- public emitWinCFIStartChained
- public emitWinCFIStartProc
- public emitWinEHHandler
- public emitWinEHHandlerData
- protected emitWindowsUnwindTables
- protected emitWindowsUnwindTables
- public emitXCOFFLocalCommonSymbol
- public emitXCOFFRefDirective
- public emitXCOFFRenameDirective
- public emitXCOFFSymbolLinkageWithVisibility
- public emitZerofill
- public emitZeros
- public endCOFFSymbolDef
- public endSection
- public finish
- public finishImpl
- public generateCompactUnwindEncodings
- public getAllowAutoPadding
- public getAssemblerPtr
- public getAssociatedPDataSection
- public getAssociatedXDataSection
- public getCommentOS
- public getContext
- public getCurrentSection
- public getCurrentSectionOnly
- protected getCurrentWinFrameInfo
- public getDwarfFrameInfos
- public getDwarfLineTableSymbol
- public getMnemonic
- public getNumFrameInfos
- public getNumWinFrameInfos
- public getPreviousSection
- public getStartTokLoc
- public getSymbolOrder
- public getTargetStreamer
- public getUseAssemblerInfoForParsing
- public getWinFrameInfos
- public hasRawTextSupport
- public hasUnfinishedDwarfFrameInfo
- public initSections
- public isIntegratedAssemblerRequired
- public isVerboseAsm
- public mayHaveInstructions
- public maybeEmitDwarf64Mark
- public popSection
- public pushSection
- public reset
- public setAllowAutoPadding
- public setStartTokLocPtr
- public setTargetStreamer
- public setUseAssemblerInfoForParsing
- public subSection
- public switchSection
- public switchSectionNoChange
- public tryEmitDwarfFileDirective
- public visitUsedExpr
- public visitUsedSymbol
Methods
¶RecordStreamer(llvm::MCContext& Context,
const llvm::Module& M)
RecordStreamer(llvm::MCContext& Context,
const llvm::Module& M)
Declared at: llvm/lib/Object/RecordStreamer.h:46
Parameters
- llvm::MCContext& Context
- const llvm::Module& M
¶llvm::RecordStreamer::const_iterator begin()
llvm::RecordStreamer::const_iterator begin()
Declared at: llvm/lib/Object/RecordStreamer.h:75
¶void beginCOFFSymbolDef(
const llvm::MCSymbol* Symbol)
void beginCOFFSymbolDef(
const llvm::MCSymbol* Symbol)
Description
Start emitting COFF symbol definition
Declared at: llvm/lib/Object/RecordStreamer.h:60
Parameters
- const llvm::MCSymbol* Symbol
- - The symbol to have its External & Type fields set.
¶void emitAssignment(llvm::MCSymbol* Symbol,
const llvm::MCExpr* Value)
void emitAssignment(llvm::MCSymbol* Symbol,
const llvm::MCExpr* Value)
Description
Emit an assignment of \p Value to \p 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.
Declared at: llvm/lib/Object/RecordStreamer.h:50
Parameters
- llvm::MCSymbol* Symbol
- - The symbol being assigned to.
- const llvm::MCExpr* Value
- - The value for the symbol.
¶void emitCOFFSymbolStorageClass(int StorageClass)
void emitCOFFSymbolStorageClass(int StorageClass)
Description
Emit the storage class of the symbol.
Declared at: llvm/lib/Object/RecordStreamer.h:61
Parameters
- int StorageClass
- - The storage class the symbol should have.
¶void emitCOFFSymbolType(int Type)
void emitCOFFSymbolType(int Type)
Description
Emit the type of the symbol.
Declared at: llvm/lib/Object/RecordStreamer.h:62
Parameters
- int Type
- - A COFF type identifier (see COFF::SymbolType in X86COFF.h)
¶void emitCommonSymbol(llvm::MCSymbol* Symbol,
uint64_t Size,
unsigned int ByteAlignment)
void emitCommonSymbol(llvm::MCSymbol* Symbol,
uint64_t Size,
unsigned int ByteAlignment)
Description
Emit a common symbol.
Declared at: llvm/lib/Object/RecordStreamer.h:54
Parameters
- llvm::MCSymbol* Symbol
- - The common symbol to emit.
- uint64_t Size
- - The size of the common symbol.
- unsigned int ByteAlignment
- - The alignment of the symbol if non-zero. This must be a power of 2.
¶void emitELFSymverDirective(
const llvm::MCSymbol* OriginalSym,
llvm::StringRef Name,
bool KeepOriginalSym)
void emitELFSymverDirective(
const llvm::MCSymbol* OriginalSym,
llvm::StringRef Name,
bool KeepOriginalSym)
Description
Record .symver aliases for later processing.
Declared at: llvm/lib/Object/RecordStreamer.h:66
Parameters
- const llvm::MCSymbol* OriginalSym
- llvm::StringRef Name
- bool KeepOriginalSym
¶void emitInstruction(
const llvm::MCInst& Inst,
const llvm::MCSubtargetInfo& STI)
void emitInstruction(
const llvm::MCInst& Inst,
const llvm::MCSubtargetInfo& STI)
Description
Emit the given \p Instruction into the current section.
Declared at: llvm/lib/Object/RecordStreamer.h:48
Parameters
- const llvm::MCInst& Inst
- const llvm::MCSubtargetInfo& STI
¶void emitLabel(llvm::MCSymbol* Symbol,
llvm::SMLoc Loc = llvm::SMLoc())
void emitLabel(llvm::MCSymbol* Symbol,
llvm::SMLoc Loc = llvm::SMLoc())
Description
Emit a label for \p Symbol into the current section. This corresponds to an assembler statement such as: foo:
Declared at: llvm/lib/Object/RecordStreamer.h:49
Parameters
- llvm::MCSymbol* 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.
- llvm::SMLoc Loc = llvm::SMLoc()
¶bool emitSymbolAttribute(
llvm::MCSymbol* Symbol,
llvm::MCSymbolAttr Attribute)
bool emitSymbolAttribute(
llvm::MCSymbol* Symbol,
llvm::MCSymbolAttr Attribute)
Description
Add the given \p Attribute to \p Symbol.
Declared at: llvm/lib/Object/RecordStreamer.h:51
Parameters
- llvm::MCSymbol* Symbol
- llvm::MCSymbolAttr Attribute
¶void emitZerofill(llvm::MCSection* Section,
llvm::MCSymbol* Symbol,
uint64_t Size,
unsigned int ByteAlignment,
llvm::SMLoc Loc = llvm::SMLoc())
void emitZerofill(llvm::MCSection* Section,
llvm::MCSymbol* Symbol,
uint64_t Size,
unsigned int ByteAlignment,
llvm::SMLoc Loc = llvm::SMLoc())
Description
Emit the zerofill section and an optional symbol.
Declared at: llvm/lib/Object/RecordStreamer.h:52
Parameters
- llvm::MCSection* Section
- - The zerofill section to create and or to put the symbol
- llvm::MCSymbol* Symbol
- - The zerofill symbol to emit, if non-NULL.
- uint64_t Size
- - The size of the zerofill symbol.
- unsigned int ByteAlignment
- - The alignment of the zerofill symbol if non-zero. This must be a power of 2 on some targets.
- llvm::SMLoc Loc = llvm::SMLoc()
¶llvm::RecordStreamer::const_iterator end()
llvm::RecordStreamer::const_iterator end()
Declared at: llvm/lib/Object/RecordStreamer.h:76
¶void endCOFFSymbolDef()
void endCOFFSymbolDef()
Description
Marks the end of the symbol definition.
Declared at: llvm/lib/Object/RecordStreamer.h:63
¶void flushSymverDirectives()
void flushSymverDirectives()
Declared at: llvm/lib/Object/RecordStreamer.h:71
¶llvm::RecordStreamer::State getSymbolState(
const llvm::MCSymbol* Sym)
llvm::RecordStreamer::State getSymbolState(
const llvm::MCSymbol* Sym)
Description
Get the state recorded for the given symbol.
Declared at: llvm/lib/Object/RecordStreamer.h:38
Parameters
- const llvm::MCSymbol* Sym
¶void markDefined(const llvm::MCSymbol& Symbol)
void markDefined(const llvm::MCSymbol& Symbol)
Declared at: llvm/lib/Object/RecordStreamer.h:40
Parameters
- const llvm::MCSymbol& Symbol
¶void markGlobal(const llvm::MCSymbol& Symbol,
llvm::MCSymbolAttr Attribute)
void markGlobal(const llvm::MCSymbol& Symbol,
llvm::MCSymbolAttr Attribute)
Declared at: llvm/lib/Object/RecordStreamer.h:41
Parameters
- const llvm::MCSymbol& Symbol
- llvm::MCSymbolAttr Attribute
¶void markUsed(const llvm::MCSymbol& Symbol)
void markUsed(const llvm::MCSymbol& Symbol)
Declared at: llvm/lib/Object/RecordStreamer.h:42
Parameters
- const llvm::MCSymbol& Symbol
¶iterator_range<
llvm::RecordStreamer::const_symver_iterator>
symverAliases()
iterator_range<
llvm::RecordStreamer::const_symver_iterator>
symverAliases()
Declared at: llvm/lib/Object/RecordStreamer.h:80
¶void visitUsedSymbol(const llvm::MCSymbol& Sym)
void visitUsedSymbol(const llvm::MCSymbol& Sym)
Declared at: llvm/lib/Object/RecordStreamer.h:43
Parameters
- const llvm::MCSymbol& Sym