92 if (!Globals.
empty()) {
93 OS <<
"\t.globalvar \t";
102 if (!
G.InitialModule.empty())
103 OS <<
'=' <<
G.InitialModule <<
':' <<
G.InitialName;
105 OS <<
'=' <<
G.InitialValue;
112 OS <<
"\t.stack_pointer\t" << Index <<
'\n';
119 OS <<
"\t.functype\t" << Symbol->
getName();
126 for (
auto Ty : Params)
132 OS <<
"\t.import_global\t" << name <<
'\n';
136 OS <<
"\t.indidx \t" << *Value <<
'\n';
188 cast<MCSymbolWasm>(
Symbol)->setParams(std::move(Params));
197 cast<MCSymbolWasm>(
Symbol)->setReturns(std::move(Returns));
206 ++Grouped.
back().second;
210 for (
auto Pair : Grouped) {
227 if (
G.InitialModule.empty()) {
267 for (
MVT Ty : Params)
271 for (
MVT Ty : Results)
274 WasmSym->
setParams(std::move(ValParams));
void push_back(const T &Elt)
MCSectionWasm * getWasmSection(const Twine &Section, unsigned Type, unsigned Flags)
const char * TypeToString(MVT Ty)
void emitLocal(ArrayRef< MVT > Types) override
.local
void EmitSLEB128IntValue(int64_t Value)
Special case of EmitSLEB128Value that avoids the client having to pass in a MCExpr for constant integ...
void emitIndirectFunctionType(MCSymbol *Symbol, SmallVectorImpl< MVT > &Params, SmallVectorImpl< MVT > &Results) override
.functype
MCSymbol - Instances of this class represent a symbol name in the MC file, and MCSymbols are created ...
This class prints an WebAssembly MCInst to wasm file syntax.
virtual void EmitBytes(StringRef Data)
Emit the bytes in Data into the output.
Target specific streamer interface.
Function Alias Analysis Results
void setParams(SmallVectorImpl< wasm::ValType > &&Pars)
void PushSection()
Save the current and previous section on the section stack.
void emitGlobalImport(StringRef name) override
.import_global
void emitLocal(ArrayRef< MVT > Types) override
.local
void emitParam(MCSymbol *Symbol, ArrayRef< MVT > Types) override
.param
void emitIndirectFunctionType(MCSymbol *Symbol, SmallVectorImpl< MVT > &Params, SmallVectorImpl< MVT > &Results) override
.functype
This class consists of common code factored out of the SmallVector class to reduce code duplication b...
Base class for the full range of assembler expressions which are needed for parsing.
void emitGlobal(ArrayRef< wasm::Global > Globals) override
.globalvar
MCContext & getContext() const
LLVM_NODISCARD bool empty() const
void emitIndIdx(const MCExpr *Value) override
.indidx
void emitGlobalImport(StringRef name) override
.import_global
WebAssemblyTargetELFStreamer(MCStreamer &S)
ArrayRef - Represent a constant reference to an array (0 or more elements consecutively in memory)...
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...
size_t size() const
size - Get the array size.
wasm::ValType toValType(const MVT &Ty)
void emitGlobal(ArrayRef< wasm::Global > Globals) override
.globalvar
WebAssembly-specific streamer interface, to implement support WebAssembly-specific assembly directive...
void emitGlobal(ArrayRef< wasm::Global > Globals) override
.globalvar
void emitValueType(wasm::ValType Type)
Streaming machine code generation interface.
The instances of the Type class are immutable: once they are created, they are never changed...
void emitIndIdx(const MCExpr *Value) override
.indidx
virtual void SwitchSection(MCSection *Section, const MCExpr *Subsection=nullptr)
Set the current section where code is being emitted to Section.
This file provides WebAssembly-specific target descriptions.
static void PrintTypes(formatted_raw_ostream &OS, ArrayRef< MVT > Types)
void emitIndIdx(const MCExpr *Value) override
.indidx
void setReturns(SmallVectorImpl< wasm::ValType > &&Rets)
void emitStackPointer(uint32_t Index) override
.stack_pointer
static const unsigned End
void emitResult(MCSymbol *Symbol, ArrayRef< MVT > Types) override
.result
void emitEndFunc() override
.endfunc
bool empty() const
empty - Check if the array is empty.
WebAssemblyTargetAsmStreamer(MCStreamer &S, formatted_raw_ostream &OS)
This file declares WebAssembly-specific target streamer classes.
void setIsFunction(bool isFunc)
void emitEndFunc() override
.endfunc
llvm_unreachable("Unknown RegBank!")
void emitStackPointer(uint32_t Index) override
.stack_pointer
void emitParam(MCSymbol *Symbol, ArrayRef< MVT > Types) override
.param
StringRef getName() const
getName - Get the symbol name.
void emitIndirectFunctionType(MCSymbol *Symbol, SmallVectorImpl< MVT > &Params, SmallVectorImpl< MVT > &Results) override
.functype
LLVM_ATTRIBUTE_ALWAYS_INLINE size_type size() const
WebAssemblyTargetStreamer(MCStreamer &S)
void emitParam(MCSymbol *Symbol, ArrayRef< MVT > Types) override
.param
void EmitULEB128IntValue(uint64_t Value, unsigned Padding=0)
Special case of EmitULEB128Value that avoids the client having to pass in a MCExpr for constant integ...
void emitEndFunc() override
.endfunc
void emitLocal(ArrayRef< MVT > Types) override
.local
void emitGlobalImport(StringRef name) override
.import_global
assert(ImpDefSCC.getReg()==AMDGPU::SCC &&ImpDefSCC.isDef())
void emitResult(MCSymbol *Symbol, ArrayRef< MVT > Types) override
.result
bool PopSection()
Restore the current and previous section from the section stack.
LLVM Value Representation.
void emitResult(MCSymbol *Symbol, ArrayRef< MVT > Types) override
.result
void emitStackPointer(uint32_t Index) override
.stack_pointer
StringRef - Represent a constant reference to a string, i.e.
WebAssemblyTargetWasmStreamer(MCStreamer &S)