LLVM: llvm::WebAssembly Namespace Reference (original) (raw)

Enumerations
enum Tag { CPP_EXCEPTION = 0 , C_LONGJMP = 1 }
enum Fixups { fixup_sleb128_i32 = FirstTargetFixupKind , fixup_sleb128_i64, fixup_uleb128_i32, fixup_uleb128_i64, LastTargetFixupKind, NumTargetFixupKinds = LastTargetFixupKind - FirstTargetFixupKind }
enum Specifier { S_None, S_FUNCINDEX, S_GOT, S_GOT_TLS, S_MBREL, S_TBREL, S_TLSREL, S_TYPEINDEX }
enum OperandType { OPERAND_BASIC_BLOCK = MCOI::OPERAND_FIRST_TARGET , OPERAND_LOCAL, OPERAND_GLOBAL, OPERAND_I32IMM, OPERAND_I64IMM, OPERAND_F32IMM, OPERAND_F64IMM, OPERAND_VEC_I8IMM, OPERAND_VEC_I16IMM, OPERAND_VEC_I32IMM, OPERAND_VEC_I64IMM, OPERAND_FUNCTION32, OPERAND_OFFSET32, OPERAND_OFFSET64, OPERAND_P2ALIGN, OPERAND_SIGNATURE, OPERAND_TYPEINDEX, OPERAND_TAG, OPERAND_BRLIST, OPERAND_TABLE, OPERAND_CATCH_LIST }
enum class BlockType : unsigned { Invalid = 0x00 , Void = 0x40 , I32 = unsigned(wasm::ValType::I32) , I64 = unsigned(wasm::ValType::I64) , F32 = unsigned(wasm::ValType::F32) , F64 = unsigned(wasm::ValType::F64) , V128 = unsigned(wasm::ValType::V128) , Externref = unsigned(wasm::ValType::EXTERNREF) , Funcref = unsigned(wasm::ValType::FUNCREF) , Exnref = unsigned(wasm::ValType::EXNREF) , Multivalue = 0xffff }
Used as immediate MachineOperands for block signatures. More...
enum WasmAddressSpace : unsigned { WASM_ADDRESS_SPACE_DEFAULT = 0 , WASM_ADDRESS_SPACE_VAR = 1 , WASM_ADDRESS_SPACE_EXTERNREF = 10 , WASM_ADDRESS_SPACE_FUNCREF = 20 }
enum TargetIndex { TI_LOCAL, TI_GLOBAL_FIXED, TI_OPERAND_STACK, TI_GLOBAL_RELOC, TI_LOCAL_INDIRECT }
Functions
unsigned GetDefaultP2AlignAny (unsigned Opc)
Return the default p2align value for a load or store with the given opcode.
unsigned GetDefaultP2Align (unsigned Opc)
bool isConst (unsigned Opc)
bool isScalarConst (unsigned Opc)
bool isArgument (unsigned Opc)
bool isCopy (unsigned Opc)
bool isTee (unsigned Opc)
bool isCallDirect (unsigned Opc)
bool isCallIndirect (unsigned Opc)
bool isBrTable (unsigned Opc)
bool isMarker (unsigned Opc)
bool isEndMarker (unsigned Opc)
bool isTry (unsigned Opc)
bool isCatch (unsigned Opc)
bool isCatchAll (unsigned Opc)
bool isLocalGet (unsigned Opc)
bool isLocalSet (unsigned Opc)
bool isLocalTee (unsigned Opc)
unsigned getWARegStackId (MCRegister Reg)
bool isRefType (wasm::ValType Type)
const char * anyTypeToString (unsigned Type)
const char * typeToString (wasm::ValType Type)
std::string typeListToString (ArrayRef< wasm::ValType > List)
std::string signatureToString (const wasm::WasmSignature *Sig)
wasm::ValType regClassToValType (unsigned RC)
std::optional< wasm::ValType > parseType (StringRef Type)
BlockType parseBlockType (StringRef Type)
int getStackOpcode (unsigned short Opcode)
int getRegisterOpcode (unsigned short Opcode)
int getWasm64Opcode (unsigned short Opcode)
bool isDefaultAddressSpace (unsigned AS)
bool isWasmVarAddressSpace (unsigned AS)
bool isValidAddressSpace (unsigned AS)
bool isWebAssemblyExternrefType (const Type *Ty)
Return true if this is a WebAssembly Externref Type.
bool isWebAssemblyFuncrefType (const Type *Ty)
Return true if this is a WebAssembly Funcref Type.
bool isWebAssemblyReferenceType (const Type *Ty)
Return true if this is a WebAssembly Reference Type.
bool isWebAssemblyTableType (const Type *Ty)
Return true if the table represents a WebAssembly table type.
MVT parseMVT (StringRef Type)
wasm::ValType toValType (MVT Type)
void wasmSymbolSetType (MCSymbolWasm *Sym, const Type *GlobalVT, ArrayRef< MVT > VTs)
Sets a Wasm Symbol Type.
FastISel * createFastISel (FunctionLoweringInfo &funcInfo, const TargetLibraryInfo *libInfo)
void getLibcallSignature (const WebAssemblySubtarget &Subtarget, RTLIB::Libcall LC, SmallVectorImpl< wasm::ValType > &Rets, SmallVectorImpl< wasm::ValType > &Params)
void getLibcallSignature (const WebAssemblySubtarget &Subtarget, StringRef Name, SmallVectorImpl< wasm::ValType > &Rets, SmallVectorImpl< wasm::ValType > &Params)
bool isChild (const MachineInstr &MI, const WebAssemblyFunctionInfo &MFI)
Test whether MI is a child of some other node in an expression tree.
bool mayThrow (const MachineInstr &MI)
const MachineOperand & getCalleeOp (const MachineInstr &MI)
Returns the operand number of a callee, assuming the argument is a call instruction.
MCSymbolWasm * getOrCreateFunctionTableSymbol (MCContext &Ctx, const WebAssemblySubtarget *Subtarget)
Returns the __indirect_function_table, for use in call_indirect and in function bitcasts.
MCSymbolWasm * getOrCreateFuncrefCallTableSymbol (MCContext &Ctx, const WebAssemblySubtarget *Subtarget)
Returns the __funcref_call_table, for use in funcref calls when lowered to table.set + call_indirect.
MachineInstr * findCatch (MachineBasicBlock *EHPad)
Find a catch instruction from an EH pad.
unsigned getCopyOpcodeForRegClass (const TargetRegisterClass *RC)
Returns the appropriate copy opcode for the given register class.
bool canLowerMultivalueReturn (const WebAssemblySubtarget *Subtarget)
Returns true if multivalue returns of a function can be lowered directly, i.e., not indirectly via a pointer parameter that points to the value in memory.
bool canLowerReturn (size_t ResultSize, const WebAssemblySubtarget *Subtarget)
Returns true if the function's return value(s) can be lowered directly, i.e., not indirectly via a pointer parameter that points to the value in memory.
Variables
static const unsigned Nop = 0x01
Instruction opcodes emitted via means other than CodeGen.
static const unsigned End = 0x0b
static const unsigned UnusedReg = -1u
cl::opt< bool > WasmEnableEmEH
cl::opt< bool > WasmEnableEmSjLj
cl::opt< bool > WasmEnableEH
cl::opt< bool > WasmEnableSjLj
cl::opt< bool > WasmUseLegacyEH
const char *const ClangCallTerminateFn
const char *const CxaBeginCatchFn = "__cxa_begin_catch"
const char *const CxaRethrowFn = "__cxa_rethrow"
const char *const StdTerminateFn = "_ZSt9terminatev"
const char *const PersonalityWrapperFn

BlockType

Used as immediate MachineOperands for block signatures.

Enumerator
Invalid
Void
I32
I64
F32
F64
V128
Externref
Funcref
Exnref
Multivalue

Definition at line 25 of file WebAssemblyMCTypeUtilities.h.

Fixups

Enumerator
fixup_sleb128_i32
fixup_sleb128_i64
fixup_uleb128_i32
fixup_uleb128_i64
LastTargetFixupKind
NumTargetFixupKinds

Definition at line 16 of file WebAssemblyFixupKinds.h.

OperandType

Enumerator
OPERAND_BASIC_BLOCK Basic block label in a branch construct.
OPERAND_LOCAL Local index.
OPERAND_GLOBAL Global index.
OPERAND_I32IMM 32-bit integer immediates.
OPERAND_I64IMM 64-bit integer immediates.
OPERAND_F32IMM 32-bit floating-point immediates.
OPERAND_F64IMM 64-bit floating-point immediates.
OPERAND_VEC_I8IMM 8-bit vector lane immediate
OPERAND_VEC_I16IMM 16-bit vector lane immediate
OPERAND_VEC_I32IMM 32-bit vector lane immediate
OPERAND_VEC_I64IMM 64-bit vector lane immediate
OPERAND_FUNCTION32 32-bit unsigned function indices.
OPERAND_OFFSET32 32-bit unsigned memory offsets.
OPERAND_OFFSET64 64-bit unsigned memory offsets.
OPERAND_P2ALIGN p2align immediate for load and store address alignment.
OPERAND_SIGNATURE signature immediate for block/loop.
OPERAND_TYPEINDEX type signature immediate for call_indirect.
OPERAND_TAG Tag index.
OPERAND_BRLIST A list of branch targets for br_list.
OPERAND_TABLE 32-bit unsigned table number.
OPERAND_CATCH_LIST A list of catch clauses for try_table.

Definition at line 42 of file WebAssemblyMCTargetDesc.h.

Specifier

Enumerator
S_None
S_FUNCINDEX
S_GOT
S_GOT_TLS
S_MBREL
S_TBREL
S_TLSREL
S_TYPEINDEX

Definition at line 31 of file WebAssemblyMCAsmInfo.h.

Tag

TargetIndex

Enumerator
TI_LOCAL
TI_GLOBAL_FIXED
TI_OPERAND_STACK
TI_GLOBAL_RELOC
TI_LOCAL_INDIRECT

Definition at line 93 of file WebAssembly.h.

WasmAddressSpace

Enumerator
WASM_ADDRESS_SPACE_DEFAULT
WASM_ADDRESS_SPACE_VAR
WASM_ADDRESS_SPACE_EXTERNREF
WASM_ADDRESS_SPACE_FUNCREF

Definition at line 20 of file WasmAddressSpaces.h.

anyTypeToString()

Definition at line 51 of file WebAssemblyMCTypeUtilities.cpp.

References llvm::wasm::WASM_TYPE_EXNREF, llvm::wasm::WASM_TYPE_EXTERNREF, llvm::wasm::WASM_TYPE_F32, llvm::wasm::WASM_TYPE_F64, llvm::wasm::WASM_TYPE_FUNC, llvm::wasm::WASM_TYPE_FUNCREF, llvm::wasm::WASM_TYPE_I32, llvm::wasm::WASM_TYPE_I64, llvm::wasm::WASM_TYPE_NORESULT, and llvm::wasm::WASM_TYPE_V128.

Referenced by llvm::WebAssemblyInstPrinter::printWebAssemblySignatureOperand(), and typeToString().

canLowerMultivalueReturn()

canLowerReturn()

createFastISel()

findCatch()

getCalleeOp()

getCopyOpcodeForRegClass()

GetDefaultP2Align()

GetDefaultP2AlignAny()

getLibcallSignature() [1/2]

Definition at line 555 of file WebAssemblyRuntimeLibcallSignatures.cpp.

References assert(), canLowerMultivalueReturn(), llvm::SmallVectorTemplateCommon< T, typename >::empty(), llvm::wasm::F32, llvm::wasm::F64, llvm::WebAssemblySubtarget::hasAddr64(), llvm::wasm::I32, llvm::wasm::I64, llvm_unreachable, llvm::SmallVectorTemplateBase< T, bool >::push_back(), and unsupported().

Referenced by getLibcallSignature(), and llvm::WebAssemblyAsmPrinter::getOrCreateWasmSymbol().

getLibcallSignature() [2/2]

getOrCreateFuncrefCallTableSymbol()

getOrCreateFunctionTableSymbol()

getRegisterOpcode()

int llvm::WebAssembly::getRegisterOpcode ( unsigned short Opcode )

getStackOpcode()

int llvm::WebAssembly::getStackOpcode ( unsigned short Opcode )

getWARegStackId()

getWasm64Opcode()

int llvm::WebAssembly::getWasm64Opcode ( unsigned short Opcode )

isArgument()

isBrTable()

isCallDirect()

isCallIndirect()

bool llvm::WebAssembly::isCallIndirect ( unsigned Opc) inline

isCatch()

isCatchAll()

isChild()

isConst()

isCopy()

isDefaultAddressSpace()

bool llvm::WebAssembly::isDefaultAddressSpace ( unsigned AS) inline

isEndMarker()

isLocalGet()

isLocalSet()

isLocalTee()

isMarker()

isRefType()

isScalarConst()

bool llvm::WebAssembly::isScalarConst ( unsigned Opc) inline

isTee()

isTry()

isValidAddressSpace()

bool llvm::WebAssembly::isValidAddressSpace ( unsigned AS) inline

isWasmVarAddressSpace()

bool llvm::WebAssembly::isWasmVarAddressSpace ( unsigned AS) inline

isWebAssemblyExternrefType()

bool llvm::WebAssembly::isWebAssemblyExternrefType ( const Type * Ty) inline

isWebAssemblyFuncrefType()

bool llvm::WebAssembly::isWebAssemblyFuncrefType ( const Type * Ty) inline

isWebAssemblyReferenceType()

bool llvm::WebAssembly::isWebAssemblyReferenceType ( const Type * Ty) inline

isWebAssemblyTableType()

bool llvm::WebAssembly::isWebAssemblyTableType ( const Type * Ty) inline

mayThrow()

Definition at line 41 of file WebAssemblyUtilities.cpp.

References assert(), CxaBeginCatchFn, llvm::dyn_cast(), F, getCalleeOp(), llvm::MachineOperand::getGlobal(), llvm::MachineOperand::getSymbolName(), isCallIndirect(), llvm::MachineOperand::isGlobal(), llvm::MachineOperand::isSymbol(), MI, PersonalityWrapperFn, and StdTerminateFn.

parseBlockType()

Definition at line 34 of file WebAssemblyMCTypeUtilities.cpp.

References llvm::StringSwitch< T, R >::Case(), llvm::StringSwitch< T, R >::Default(), Exnref, Externref, F32, F64, Funcref, I32, I64, Invalid, V128, and Void.

parseMVT()

parseType()

Definition at line 20 of file WebAssemblyMCTypeUtilities.cpp.

References llvm::StringSwitch< T, R >::Case(), llvm::StringSwitch< T, R >::Cases(), llvm::StringSwitch< T, R >::Default(), llvm::wasm::EXNREF, llvm::wasm::EXTERNREF, llvm::wasm::F32, llvm::wasm::F64, llvm::wasm::FUNCREF, llvm::wasm::I32, llvm::wasm::I64, and llvm::wasm::V128.

regClassToValType()

signatureToString()

toValType()

typeListToString()

typeToString()

wasmSymbolSetType()

Sets a Wasm Symbol Type.

Definition at line 69 of file WebAssemblyTypeUtilities.cpp.

References assert(), llvm::wasm::EXTERNREF, llvm::wasm::FUNCREF, llvm::Type::getArrayElementType(), llvm::MCSymbolWasm::getType(), isWebAssemblyExternrefType(), isWebAssemblyFuncrefType(), isWebAssemblyTableType(), llvm::report_fatal_error(), llvm::MCSymbolWasm::setGlobalType(), llvm::MCSymbolWasm::setTableType(), llvm::MCSymbolWasm::setType(), llvm::ArrayRef< T >::size(), toValType(), llvm::wasm::WASM_SYMBOL_TYPE_GLOBAL, and llvm::wasm::WASM_SYMBOL_TYPE_TABLE.

Referenced by llvm::WebAssemblyAsmPrinter::emitGlobalVariable().

ClangCallTerminateFn

CxaBeginCatchFn

const char *const llvm::WebAssembly::CxaBeginCatchFn = "__cxa_begin_catch" extern

CxaRethrowFn

End

Nop

PersonalityWrapperFn

StdTerminateFn

const char *const llvm::WebAssembly::StdTerminateFn = "_ZSt9terminatev" extern

UnusedReg

WasmEnableEH

WasmEnableEmEH

WasmEnableEmSjLj

WasmEnableSjLj

WasmUseLegacyEH