33 explicit WebAssemblyWasmObjectWriter(
bool Is64Bit);
37 const MCFixup &Fixup)
const override;
41 WebAssemblyWasmObjectWriter::WebAssemblyWasmObjectWriter(
bool Is64Bit)
46 if (
auto SyExp = dyn_cast<MCSymbolRefExpr>(Expr))
47 return cast<MCSymbolWasm>(SyExp->getSymbol()).isFunction();
49 if (
auto BinOp = dyn_cast<MCBinaryExpr>(Expr))
52 if (
auto UnOp = dyn_cast<MCUnaryExpr>(Expr))
70 switch (
unsigned(Fixup.
getKind())) {
72 return wasm::R_WEBASSEMBLY_GLOBAL_INDEX_LEB;
75 return wasm::R_WEBASSEMBLY_TABLE_INDEX_SLEB;
76 return wasm::R_WEBASSEMBLY_GLOBAL_ADDR_SLEB;
81 return wasm::R_WEBASSEMBLY_TYPE_INDEX_LEB;
83 return wasm::R_WEBASSEMBLY_FUNCTION_INDEX_LEB;
84 return wasm::R_WEBASSEMBLY_GLOBAL_ADDR_LEB;
87 return wasm::R_WEBASSEMBLY_TABLE_INDEX_I32;
88 return wasm::R_WEBASSEMBLY_GLOBAL_ADDR_I32;
MCObjectWriter * createWasmObjectWriter(MCWasmObjectTargetWriter *MOTW, raw_pwrite_stream &OS)
Construct a new Wasm writer instance.
MCObjectWriter * createWebAssemblyWasmObjectWriter(raw_pwrite_stream &OS, bool Is64Bit)
This represents an "assembler immediate".
Defines the object file and target independent interfaces used by the assembler backend to write nati...
static bool IsFunctionType(const MCValue &Target)
Encode information on a single operation to perform on a byte sequence (e.g., an encoded instruction)...
Base class for the full range of assembler expressions which are needed for parsing.
Represent a reference to a symbol from inside an expression.
static unsigned getRelocType(const MCValue &Target, const MCFixupKind FixupKind, const bool IsPCRel)
Translates generic PPC fixup kind to Mach-O/PPC relocation type enum.
const MCExpr * getValue() const
This file provides WebAssembly-specific target descriptions.
MCFixupKind getKind() const
const MCSymbolRefExpr * getSymA() const
Target - Wrapper for Target specific information.
llvm_unreachable("Unknown RegBank!")
An abstract base class for streams implementations that also support a pwrite operation.
VariantKind getKind() const
static bool IsFunctionExpr(const MCExpr *Expr)