37 explicit WebAssemblyAsmBackend(
bool Is64Bit,
bool IsEmscripten)
39 IsEmscripten(IsEmscripten) {}
52 std::unique_ptr<MCObjectTargetWriter>
60WebAssemblyAsmBackend::getFixupKindInfo(
MCFixupKind Kind)
const {
66 {
"fixup_sleb128_i32", 0, 5 * 8, 0},
67 {
"fixup_sleb128_i64", 0, 10 * 8, 0},
68 {
"fixup_uleb128_i32", 0, 5 * 8, 0},
69 {
"fixup_uleb128_i64", 0, 10 * 8, 0},
88void WebAssemblyAsmBackend::applyFixup(
const MCAssembler &Asm,
95 assert(
Info.Flags == 0 &&
"WebAssembly does not use MCFixupKindInfo flags");
97 unsigned NumBytes =
alignTo(
Info.TargetSize, 8) / 8;
105 assert(
Offset + NumBytes <= Data.size() &&
"Invalid fixup offset!");
109 for (
unsigned I = 0;
I != NumBytes; ++
I)
113std::unique_ptr<MCObjectTargetWriter>
114WebAssemblyAsmBackend::createObjectTargetWriter()
const {
121 return new WebAssemblyAsmBackend(TT.isArch64Bit(), TT.isOSEmscripten());
Analysis containing CSE Info
PowerPC TLS Dynamic Call Fixup
assert(ImpDefSCC.getReg()==AMDGPU::SCC &&ImpDefSCC.isDef())
This file provides WebAssembly-specific target descriptions.
Generic interface to target specific assembler backends.
virtual bool writeNopData(raw_ostream &OS, uint64_t Count, const MCSubtargetInfo *STI) const =0
Write an (optimal) nop sequence of Count bytes to the given output.
virtual std::unique_ptr< MCObjectTargetWriter > createObjectTargetWriter() const =0
virtual unsigned getNumFixupKinds() const =0
Get the number of target specific fixup kinds.
virtual const MCFixupKindInfo & getFixupKindInfo(MCFixupKind Kind) const
Get information on a fixup kind.
virtual void applyFixup(const MCAssembler &Asm, const MCFixup &Fixup, const MCValue &Target, MutableArrayRef< char > Data, uint64_t Value, bool IsResolved, const MCSubtargetInfo *STI) const =0
Apply the Value for given Fixup into the provided data fragment, at the offset specified by the fixup...
Encode information on a single operation to perform on a byte sequence (e.g., an encoded instruction)...
Generic base class for all target subtargets.
This represents an "assembler immediate".
MutableArrayRef - Represent a mutable reference to an array (0 or more elements consecutively in memo...
Target - Wrapper for Target specific information.
Triple - Helper class for working with autoconf configuration names.
LLVM Value Representation.
This class implements an extremely fast bulk output stream that can only output to a stream.
static const unsigned Nop
Instruction opcodes emitted via means other than CodeGen.
This is an optimization pass for GlobalISel generic memory operations.
MCAsmBackend * createWebAssemblyAsmBackend(const Triple &TT)
std::unique_ptr< MCObjectTargetWriter > createWebAssemblyWasmObjectWriter(bool Is64Bit, bool IsEmscripten)
MCFixupKind
Extensible enumeration to represent the type of a fixup.
uint64_t alignTo(uint64_t Size, Align A)
Returns a multiple of A needed to store Size bytes.
Target independent information on a fixup kind.