30 class WebAssemblyAsmBackend final :
public MCAsmBackend {
34 explicit WebAssemblyAsmBackend(
bool Is64Bit)
36 ~WebAssemblyAsmBackend()
override {}
38 void applyFixup(
const MCFixup &Fixup,
char *Data,
unsigned DataSize,
39 uint64_t
Value,
bool IsPCRel)
const override;
44 bool fixupNeedsRelaxation(
const MCFixup &Fixup, uint64_t
Value,
50 unsigned getNumFixupKinds()
const override {
56 bool mayNeedRelaxation(
const MCInst &Inst)
const override {
return false; }
59 MCInst &Res)
const override {}
61 bool writeNopData(uint64_t Count,
MCObjectWriter *OW)
const override;
64 bool WebAssemblyAsmBackend::writeNopData(uint64_t Count,
69 for (uint64_t
i = 0;
i < Count; ++
i)
75 void WebAssemblyAsmBackend::applyFixup(
const MCFixup &Fixup,
char *Data,
76 unsigned DataSize, uint64_t
Value,
79 assert(Info.
Flags == 0 &&
"WebAssembly does not use MCFixupKindInfo flags");
89 assert(Offset + NumBytes <= DataSize &&
"Invalid fixup offset!");
93 for (
unsigned i = 0;
i != NumBytes; ++
i)
94 Data[Offset +
i] |= uint8_t((Value >> (
i * 8)) & 0xff);
104 return new WebAssemblyAsmBackend(TT.
isArch64Bit());
Defines the object file and target independent interfaces used by the assembler backend to write nati...
void write8(uint8_t Value)
unsigned TargetOffset
The bit offset to write the relocation into.
Encode information on a single operation to perform on a byte sequence (e.g., an encoded instruction)...
Encapsulates the layout of an assembly file at a particular point in time.
bool isArch64Bit() const
Test whether the architecture is 64-bit.
uint32_t getOffset() const
Instances of this class represent a single low-level machine instruction.
A relaxable fragment holds on to its MCInst, since it may need to be relaxed during the assembler lay...
This file provides WebAssembly-specific target descriptions.
MCFixupKind getKind() const
Triple - Helper class for working with autoconf configuration names.
unsigned TargetSize
The number of bits written by this fixup.
MCAsmBackend * createWebAssemblyAsmBackend(const Triple &TT)
MCObjectWriter * createWebAssemblyELFObjectWriter(raw_pwrite_stream &OS, bool Is64Bit, uint8_t OSABI)
MCSubtargetInfo - Generic base class for all target subtargets.
Target independent information on a fixup kind.
An abstract base class for streams implementations that also support a pwrite operation.
assert(ImpDefSCC.getReg()==AMDGPU::SCC &&ImpDefSCC.isDef())
LLVM Value Representation.
Generic interface to target specific assembler backends.
static const unsigned Nop
Instruction opcodes emitted via means other than CodeGen.
unsigned Flags
Flags describing additional information on this fixup kind.