43 for (
unsigned i = 0, e = EF->
getFixups().size(); i != e; ++i) {
62 const MCExpr *Subsection) {
64 auto *SectionWasm = cast<MCSectionWasm>(
Section);
65 const MCSymbol *Grp = SectionWasm->getGroup();
84 auto *
Symbol = cast<MCSymbolWasm>(S);
110 Symbol->setExternal(
true);
114 Symbol->setExternal(
true);
139 cast<MCSymbolWasm>(
Symbol)->setSize(Value);
154 unsigned MaxBytesToEmit) {
164 void MCWasmStreamer::EmitInstToFragment(
const MCInst &Inst,
169 void MCWasmStreamer::EmitInstToData(
const MCInst &Inst,
182 for (
unsigned i = 0, e = Fixups.
size(); i != e; ++i) {
197 std::unique_ptr<MCAsmBackend> &&MAB,
198 std::unique_ptr<MCObjectWriter> &&OW,
199 std::unique_ptr<MCCodeEmitter> &&CE,
202 new MCWasmStreamer(Context, std::move(MAB), std::move(OW), std::move(CE));
Instances of this class represent a uniqued identifier for a section in the current translation unit...
static const MCSymbolRefExpr * create(const MCSymbol *Symbol, MCContext &Ctx)
This class represents lattice values for constants.
.type _foo, STT_OBJECT # aka
MCSymbol - Instances of this class represent a symbol name in the MC file, and MCSymbols are created ...
virtual void EmitInstToFragment(const MCInst &Inst, const MCSubtargetInfo &)
Emit an instruction to a special fragment, because this instruction can change its size during relaxa...
A raw_ostream that writes to an SmallVector or SmallString.
void registerSymbol(const MCSymbol &Symbol, bool *Created=nullptr)
MCContext & getContext() const
MCCodeEmitter & getEmitter() const
void EmitIdent(StringRef IdentString) override
Emit the "identifiers" directive.
virtual void encodeInstruction(const MCInst &Inst, raw_ostream &OS, SmallVectorImpl< MCFixup > &Fixups, const MCSubtargetInfo &STI) const =0
EncodeInstruction - Encode the given Inst to bytes on the output stream OS.
void setRelaxAll(bool Value)
~MCWasmStreamer() override
Base class for the full range of assembler expressions which are needed for parsing.
void flushPendingLabels()
Create a dummy fragment to assign any pending labels.
Context object for machine code objects.
bool EmitSymbolAttribute(MCSymbol *Symbol, MCSymbolAttr Attribute) override
Add the given Attribute to Symbol.
void ChangeSection(MCSection *Section, const MCExpr *Subsection) override
Update streamer for a new active section.
void EmitTBSSSymbol(MCSection *Section, MCSymbol *Symbol, uint64_t Size, unsigned ByteAlignment=0) override
Emit a thread local bss (.tbss) symbol.
static Error getOffset(const SymbolRef &Sym, SectionRef Sec, uint64_t &Result)
SmallVectorImpl< char > & getContents()
Instances of this class represent a single low-level machine instruction.
void EmitSymbolDesc(MCSymbol *Symbol, unsigned DescValue) override
Set the DescValue for the Symbol.
Flag
These should be considered private to the implementation of the MCInstrDesc class.
Streaming machine code generation interface.
.weak_def_can_be_hidden (MachO)
LLVM_ATTRIBUTE_ALWAYS_INLINE iterator begin()
MCAssembler & getAssembler()
void setHasInstructions(const MCSubtargetInfo &STI)
Record that the fragment contains instructions with the MCSubtargetInfo in effect when the instructio...
SmallVectorImpl< MCFixup > & getFixups()
void EmitWeakReference(MCSymbol *Alias, const MCSymbol *Symbol) override
Emit an weak reference from Alias to Symbol.
void EmitFrames(MCAsmBackend *MAB)
void EmitThumbFunc(MCSymbol *Func) override
Note in the output that the specified Func is a Thumb mode function (ARM target only).
#define llvm_unreachable(msg)
Marks that the current location is not supposed to be reachable.
void EmitValueToAlignment(unsigned ByteAlignment, int64_t Value=0, unsigned ValueSize=1, unsigned MaxBytesToEmit=0) override
Emit some number of copies of Value until the byte alignment ByteAlignment is reached.
void EmitLocalCommonSymbol(MCSymbol *Symbol, uint64_t Size, unsigned ByteAlignment) override
Emit a local common (.lcomm) symbol.
void EmitAssemblerFlag(MCAssemblerFlag Flag) override
Note in the output the specified Flag.
void ChangeSection(MCSection *Section, const MCExpr *Subsection) override
Update streamer for a new active section.
MCAsmBackend & getBackend() const
void FinishImpl() override
Streamer specific finalization.
This is a 'vector' (really, a variable-sized array), optimized for the case when the array is small...
MCSymbol * getBeginSymbol()
void setVariableValue(const MCExpr *Value)
void EmitZerofill(MCSection *Section, MCSymbol *Symbol=nullptr, uint64_t Size=0, unsigned ByteAlignment=0, SMLoc Loc=SMLoc()) override
Emit the zerofill section and an optional symbol.
const MCSubtargetInfo * getSubtargetInfo() const
Retrieve the MCSubTargetInfo in effect when the instruction was encoded.
void EmitCommonSymbol(MCSymbol *Symbol, uint64_t Size, unsigned ByteAlignment) override
Emit a common symbol.
void append(in_iter in_start, in_iter in_end)
Add the specified range to the end of the SmallVector.
MCDataFragment * getOrCreateDataFragment(const MCSubtargetInfo *STI=nullptr)
Get a data fragment to write into, creating a new one if the current fragment is not a data fragment...
virtual void handleAssemblerFlag(MCAssemblerFlag Flag)
Handle any target-specific assembler flags. By default, do nothing.
LLVM_ATTRIBUTE_ALWAYS_INLINE iterator end()
void FinishImpl() override
Streamer specific finalization.
.type _foo, STT_FUNC # aka
Generic base class for all target subtargets.
MCWasmStreamer(MCContext &Context, std::unique_ptr< MCAsmBackend > TAB, std::unique_ptr< MCObjectWriter > OW, std::unique_ptr< MCCodeEmitter > Emitter)
void EmitValueImpl(const MCExpr *Value, unsigned Size, SMLoc Loc=SMLoc()) override
Emit the expression Value into the output as a native integer of the given Size bytes.
void EmitValueImpl(const MCExpr *Value, unsigned Size, SMLoc Loc=SMLoc()) override
Emit the expression Value into the output as a native integer of the given Size bytes.
void EmitValueToAlignment(unsigned, int64_t, unsigned, unsigned) override
Emit some number of copies of Value until the byte alignment ByteAlignment is reached.
Fragment for data and encoded instructions.
assert(ImpDefSCC.getReg()==AMDGPU::SCC &&ImpDefSCC.isDef())
void emitELFSize(MCSymbol *Symbol, const MCExpr *Value) override
Emit an ELF .size directive.
LLVM Value Representation.
MCStreamer * createWasmStreamer(MCContext &Ctx, std::unique_ptr< MCAsmBackend > &&TAB, std::unique_ptr< MCObjectWriter > &&OW, std::unique_ptr< MCCodeEmitter > &&CE, bool RelaxAll)
StringRef - Represent a constant reference to a string, i.e.
Represents a location in source code.