class MCWasmStreamer

Declaration

class MCWasmStreamer : public MCObjectStreamer { /* full declaration omitted */ };

Description

Streaming object file generation interface. This class provides an implementation of the MCStreamer interface which is suitable for use with the assembler backend. Specific object file formats are expected to subclass this interface to implement directives specific to that file format or custom semantics expected by the object writer implementation.

Declared at: llvm/include/llvm/MC/MCWasmStreamer.h:23

Inherits from: MCObjectStreamer

Member Variables

private bool SeenIdent

Method Overview

  • public MCWasmStreamer(llvm::MCContext & Context, std::unique_ptr<MCAsmBackend> TAB, std::unique_ptr<MCObjectWriter> OW, std::unique_ptr<MCCodeEmitter> Emitter)
  • public void changeSection(llvm::MCSection * Section, const llvm::MCExpr * Subsection)
  • public void emitAssemblerFlag(llvm::MCAssemblerFlag Flag)
  • public void emitCommonSymbol(llvm::MCSymbol * Symbol, uint64_t Size, unsigned int ByteAlignment)
  • public void emitELFSize(llvm::MCSymbol * Symbol, const llvm::MCExpr * Value)
  • public void emitIdent(llvm::StringRef IdentString)
  • private void emitInstToData(const llvm::MCInst & Inst, const llvm::MCSubtargetInfo &)
  • private void emitInstToFragment(const llvm::MCInst & Inst, const llvm::MCSubtargetInfo &)
  • public void emitLabel(llvm::MCSymbol * Symbol, llvm::SMLoc Loc = llvm::SMLoc())
  • public void emitLabelAtPos(llvm::MCSymbol * Symbol, llvm::SMLoc Loc, llvm::MCFragment * F, uint64_t Offset)
  • public void emitLocalCommonSymbol(llvm::MCSymbol * Symbol, uint64_t Size, unsigned int ByteAlignment)
  • public bool emitSymbolAttribute(llvm::MCSymbol * Symbol, llvm::MCSymbolAttr Attribute)
  • public void emitSymbolDesc(llvm::MCSymbol * Symbol, unsigned int DescValue)
  • public void emitTBSSSymbol(llvm::MCSection * Section, llvm::MCSymbol * Symbol, uint64_t Size, unsigned int ByteAlignment = 0)
  • public void emitThumbFunc(llvm::MCSymbol * Func)
  • public void emitWeakReference(llvm::MCSymbol * Alias, const llvm::MCSymbol * Symbol)
  • public void emitZerofill(llvm::MCSection * Section, llvm::MCSymbol * Symbol = nullptr, uint64_t Size = 0, unsigned int ByteAlignment = 0, llvm::SMLoc Loc = llvm::SMLoc())
  • public void finishImpl()
  • private void fixSymbolsInTLSFixups(const llvm::MCExpr * expr)
  • private void mergeFragment(llvm::MCDataFragment *, llvm::MCDataFragment *)
  • public void reset()
  • public ~MCWasmStreamer()

Inherited from MCObjectStreamer:

Inherited from MCStreamer:

Methods

MCWasmStreamer(
    llvm::MCContext& Context,
    std::unique_ptr<MCAsmBackend> TAB,
    std::unique_ptr<MCObjectWriter> OW,
    std::unique_ptr<MCCodeEmitter> Emitter)

Declared at: llvm/include/llvm/MC/MCWasmStreamer.h:25

Parameters

llvm::MCContext& Context
std::unique_ptr<MCAsmBackend> TAB
std::unique_ptr<MCObjectWriter> OW
std::unique_ptr<MCCodeEmitter> Emitter

void changeSection(llvm::MCSection* Section,
                   const llvm::MCExpr* Subsection)

Description

@ {

Declared at: llvm/include/llvm/MC/MCWasmStreamer.h:43

Parameters

llvm::MCSection* Section
const llvm::MCExpr* Subsection

void emitAssemblerFlag(llvm::MCAssemblerFlag Flag)

Description

Note in the output the specified \p Flag.

Declared at: llvm/include/llvm/MC/MCWasmStreamer.h:47

Parameters

llvm::MCAssemblerFlag Flag

void emitCommonSymbol(llvm::MCSymbol* Symbol,
                      uint64_t Size,
                      unsigned int ByteAlignment)

Description

Emit a common symbol.

Declared at: llvm/include/llvm/MC/MCWasmStreamer.h:52

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 emitELFSize(llvm::MCSymbol* Symbol,
                 const llvm::MCExpr* Value)

Description

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

Declared at: llvm/include/llvm/MC/MCWasmStreamer.h:55

Parameters

llvm::MCSymbol* Symbol
const llvm::MCExpr* Value

void emitIdent(llvm::StringRef IdentString)

Description

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

Declared at: llvm/include/llvm/MC/MCWasmStreamer.h:66

Parameters

llvm::StringRef IdentString

void emitInstToData(const llvm::MCInst& Inst,
                    const llvm::MCSubtargetInfo&)

Declared at: llvm/include/llvm/MC/MCWasmStreamer.h:72

Parameters

const llvm::MCInst& Inst
const llvm::MCSubtargetInfo&

void emitInstToFragment(
    const llvm::MCInst& Inst,
    const llvm::MCSubtargetInfo&)

Description

Emit an instruction to a special fragment, because this instruction can change its size during relaxation.

Declared at: llvm/include/llvm/MC/MCWasmStreamer.h:71

Parameters

const llvm::MCInst& Inst
const llvm::MCSubtargetInfo&

void emitLabel(llvm::MCSymbol* Symbol,
               llvm::SMLoc Loc = llvm::SMLoc())

Description

@ {

Declared at: llvm/include/llvm/MC/MCWasmStreamer.h:44

Parameters

llvm::MCSymbol* Symbol
llvm::SMLoc Loc = llvm::SMLoc()

void emitLabelAtPos(llvm::MCSymbol* Symbol,
                    llvm::SMLoc Loc,
                    llvm::MCFragment* F,
                    uint64_t Offset)

Declared at: llvm/include/llvm/MC/MCWasmStreamer.h:45

Parameters

llvm::MCSymbol* Symbol
llvm::SMLoc Loc
llvm::MCFragment* F
uint64_t Offset

void emitLocalCommonSymbol(
    llvm::MCSymbol* Symbol,
    uint64_t Size,
    unsigned int ByteAlignment)

Description

Emit a local common (.lcomm) symbol.

Declared at: llvm/include/llvm/MC/MCWasmStreamer.h:57

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 common symbol in bytes.

bool emitSymbolAttribute(
    llvm::MCSymbol* Symbol,
    llvm::MCSymbolAttr Attribute)

Description

Add the given \p Attribute to \p Symbol.

Declared at: llvm/include/llvm/MC/MCWasmStreamer.h:50

Parameters

llvm::MCSymbol* Symbol
llvm::MCSymbolAttr Attribute

void emitSymbolDesc(llvm::MCSymbol* Symbol,
                    unsigned int DescValue)

Description

Set the \p DescValue for the \p Symbol.

Declared at: llvm/include/llvm/MC/MCWasmStreamer.h:51

Parameters

llvm::MCSymbol* Symbol
- The symbol to have its n_desc field set.
unsigned int DescValue
- The value to set into the n_desc field.

void emitTBSSSymbol(
    llvm::MCSection* Section,
    llvm::MCSymbol* Symbol,
    uint64_t Size,
    unsigned int ByteAlignment = 0)

Description

Emit a thread local bss (.tbss) symbol.

Declared at: llvm/include/llvm/MC/MCWasmStreamer.h:63

Parameters

llvm::MCSection* Section
- The thread local common section.
llvm::MCSymbol* Symbol
- The thread local common symbol to emit.
uint64_t Size
- The size of the symbol.
unsigned int ByteAlignment = 0
- The alignment of the thread local common symbol if non-zero. This must be a power of 2 on some targets.

void emitThumbFunc(llvm::MCSymbol* Func)

Description

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

Declared at: llvm/include/llvm/MC/MCWasmStreamer.h:48

Parameters

llvm::MCSymbol* Func

void emitWeakReference(
    llvm::MCSymbol* Alias,
    const llvm::MCSymbol* Symbol)

Description

Emit an weak reference from \p Alias to \p Symbol. This corresponds to an assembler statement such as: .weakref alias, symbol

Declared at: llvm/include/llvm/MC/MCWasmStreamer.h:49

Parameters

llvm::MCSymbol* Alias
- The alias that is being created.
const llvm::MCSymbol* Symbol
- The symbol being aliased.

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

Description

Emit the zerofill section and an optional symbol.

Declared at: llvm/include/llvm/MC/MCWasmStreamer.h:60

Parameters

llvm::MCSection* Section
- The zerofill section to create and or to put the symbol
llvm::MCSymbol* Symbol = nullptr
- The zerofill symbol to emit, if non-NULL.
uint64_t Size = 0
- The size of the zerofill symbol.
unsigned int ByteAlignment = 0
- The alignment of the zerofill symbol if non-zero. This must be a power of 2 on some targets.
llvm::SMLoc Loc = llvm::SMLoc()

void finishImpl()

Description

Streamer specific finalization.

Declared at: llvm/include/llvm/MC/MCWasmStreamer.h:68

void fixSymbolsInTLSFixups(
    const llvm::MCExpr* expr)

Declared at: llvm/include/llvm/MC/MCWasmStreamer.h:74

Parameters

const llvm::MCExpr* expr

void mergeFragment(llvm::MCDataFragment*,
                   llvm::MCDataFragment*)

Description

Merge the content of the fragment \p EF into the fragment \p DF.

Declared at: llvm/include/llvm/MC/MCWasmStreamer.h:77

Parameters

llvm::MCDataFragment*
llvm::MCDataFragment*

void reset()

Description

state management

Declared at: llvm/include/llvm/MC/MCWasmStreamer.h:35

~MCWasmStreamer()

Declared at: llvm/include/llvm/MC/MCWasmStreamer.h:32