37 explicit WebAssemblyAsmBackend(
bool Is64Bit,
bool IsEmscripten)
39 IsEmscripten(IsEmscripten) {}
52 std::unique_ptr<MCObjectTargetWriter>
67WebAssemblyAsmBackend::getFixupKindInfo(
MCFixupKind Kind)
const {
73 {
"fixup_sleb128_i32", 0, 5 * 8, 0},
74 {
"fixup_sleb128_i64", 0, 10 * 8, 0},
75 {
"fixup_uleb128_i32", 0, 5 * 8, 0},
76 {
"fixup_uleb128_i64", 0, 10 * 8, 0},
95void WebAssemblyAsmBackend::applyFixup(
const MCAssembler &Asm,
102 assert(
Info.Flags == 0 &&
"WebAssembly does not use MCFixupKindInfo flags");
104 unsigned NumBytes =
alignTo(
Info.TargetSize, 8) / 8;
116 for (
unsigned I = 0;
I != NumBytes; ++
I)
120std::unique_ptr<MCObjectTargetWriter>
121WebAssemblyAsmBackend::createObjectTargetWriter()
const {
128 return new WebAssemblyAsmBackend(TT.isArch64Bit(), TT.isOSEmscripten());
Analysis containing CSE Info
static RegisterPass< DebugifyFunctionPass > DF("debugify-function", "Attach debug info to a function")
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 bool fixupNeedsRelaxation(const MCFixup &Fixup, uint64_t Value, const MCRelaxableFragment *DF, const MCAsmLayout &Layout) const =0
Simple predicate for targets where !Resolved implies requiring relaxation.
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...
Encapsulates the layout of an assembly file at a particular point in time.
Encode information on a single operation to perform on a byte sequence (e.g., an encoded instruction)...
A relaxable fragment holds on to its MCInst, since it may need to be relaxed during the assembler lay...
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.