LLVM  14.0.0git
MCWasmStreamer.cpp
Go to the documentation of this file.
1 //===- lib/MC/MCWasmStreamer.cpp - Wasm Object Output ---------------------===//
2 //
3 // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
4 // See https://llvm.org/LICENSE.txt for license information.
5 // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
6 //
7 //===----------------------------------------------------------------------===//
8 //
9 // This file assembles .s files and emits Wasm .o object files.
10 //
11 //===----------------------------------------------------------------------===//
12 
13 #include "llvm/MC/MCWasmStreamer.h"
14 #include "llvm/ADT/STLExtras.h"
15 #include "llvm/ADT/SmallPtrSet.h"
16 #include "llvm/MC/MCAsmBackend.h"
17 #include "llvm/MC/MCAsmLayout.h"
18 #include "llvm/MC/MCAssembler.h"
19 #include "llvm/MC/MCCodeEmitter.h"
20 #include "llvm/MC/MCContext.h"
21 #include "llvm/MC/MCExpr.h"
22 #include "llvm/MC/MCInst.h"
24 #include "llvm/MC/MCSection.h"
25 #include "llvm/MC/MCSectionWasm.h"
26 #include "llvm/MC/MCSymbol.h"
27 #include "llvm/MC/MCSymbolWasm.h"
28 #include "llvm/MC/MCValue.h"
29 #include "llvm/MC/TargetRegistry.h"
30 #include "llvm/Support/Casting.h"
31 #include "llvm/Support/Debug.h"
34 
35 using namespace llvm;
36 
37 MCWasmStreamer::~MCWasmStreamer() = default; // anchor.
38 
39 void MCWasmStreamer::mergeFragment(MCDataFragment *DF, MCDataFragment *EF) {
40  flushPendingLabels(DF, DF->getContents().size());
41 
42  for (unsigned I = 0, E = EF->getFixups().size(); I != E; ++I) {
43  EF->getFixups()[I].setOffset(EF->getFixups()[I].getOffset() +
44  DF->getContents().size());
45  DF->getFixups().push_back(EF->getFixups()[I]);
46  }
47  if (DF->getSubtargetInfo() == nullptr && EF->getSubtargetInfo())
48  DF->setHasInstructions(*EF->getSubtargetInfo());
49  DF->getContents().append(EF->getContents().begin(), EF->getContents().end());
50 }
51 
53  auto *Symbol = cast<MCSymbolWasm>(S);
55 
56  const MCSectionWasm &Section =
57  static_cast<const MCSectionWasm &>(*getCurrentSectionOnly());
58  if (Section.getSegmentFlags() & wasm::WASM_SEG_FLAG_TLS)
59  Symbol->setTLS();
60 }
61 
63  uint64_t Offset) {
64  auto *Symbol = cast<MCSymbolWasm>(S);
66 
67  const MCSectionWasm &Section =
68  static_cast<const MCSectionWasm &>(*getCurrentSectionOnly());
69  if (Section.getSegmentFlags() & wasm::WASM_SEG_FLAG_TLS)
70  Symbol->setTLS();
71 }
72 
74  // Let the target do whatever target specific stuff it needs to do.
76 
77  // Do any generic stuff we need to do.
78  llvm_unreachable("invalid assembler flag!");
79 }
80 
82  const MCExpr *Subsection) {
84  auto *SectionWasm = cast<MCSectionWasm>(Section);
85  const MCSymbol *Grp = SectionWasm->getGroup();
86  if (Grp)
87  Asm.registerSymbol(*Grp);
88 
89  this->MCObjectStreamer::changeSection(Section, Subsection);
90  Asm.registerSymbol(*Section->getBeginSymbol());
91 }
92 
94  const MCSymbol *Symbol) {
98  Alias->setVariableValue(Value);
99 }
100 
102  assert(Attribute != MCSA_IndirectSymbol && "indirect symbols not supported");
103 
104  auto *Symbol = cast<MCSymbolWasm>(S);
105 
106  // Adding a symbol attribute always introduces the symbol; note that an
107  // important side effect of calling registerSymbol here is to register the
108  // symbol with the assembler.
110 
111  switch (Attribute) {
112  case MCSA_LazyReference:
113  case MCSA_Reference:
114  case MCSA_SymbolResolver:
115  case MCSA_PrivateExtern:
116  case MCSA_WeakDefinition:
118  case MCSA_Invalid:
119  case MCSA_IndirectSymbol:
120  case MCSA_Protected:
121  return false;
122 
123  case MCSA_Hidden:
124  Symbol->setHidden(true);
125  break;
126 
127  case MCSA_Weak:
128  case MCSA_WeakReference:
129  Symbol->setWeak(true);
130  Symbol->setExternal(true);
131  break;
132 
133  case MCSA_Global:
134  Symbol->setExternal(true);
135  break;
136 
139  break;
140 
141  case MCSA_ELF_TypeTLS:
142  Symbol->setTLS();
143  break;
144 
145  case MCSA_ELF_TypeObject:
146  case MCSA_Cold:
147  break;
148 
149  case MCSA_NoDeadStrip:
150  Symbol->setNoStrip();
151  break;
152 
153  default:
154  // unrecognized directive
155  llvm_unreachable("unexpected MCSymbolAttr");
156  return false;
157  }
158 
159  return true;
160 }
161 
163  unsigned ByteAlignment) {
164  llvm_unreachable("Common symbols are not yet implemented for Wasm");
165 }
166 
168  cast<MCSymbolWasm>(Symbol)->setSize(Value);
169 }
170 
172  unsigned ByteAlignment) {
173  llvm_unreachable("Local common symbols are not yet implemented for Wasm");
174 }
175 
177  // TODO(sbc): Add the ident section once we support mergable strings
178  // sections in the object format
179 }
180 
181 void MCWasmStreamer::emitInstToFragment(const MCInst &Inst,
182  const MCSubtargetInfo &STI) {
183  this->MCObjectStreamer::emitInstToFragment(Inst, STI);
184  MCRelaxableFragment &F = *cast<MCRelaxableFragment>(getCurrentFragment());
185 
186  for (auto &Fixup : F.getFixups())
187  fixSymbolsInTLSFixups(Fixup.getValue());
188 }
189 
190 void MCWasmStreamer::emitInstToData(const MCInst &Inst,
191  const MCSubtargetInfo &STI) {
192  MCAssembler &Assembler = getAssembler();
194  SmallString<256> Code;
195  raw_svector_ostream VecOS(Code);
196  Assembler.getEmitter().encodeInstruction(Inst, VecOS, Fixups, STI);
197 
198  for (auto &Fixup : Fixups)
199  fixSymbolsInTLSFixups(Fixup.getValue());
200 
201  // Append the encoded instruction to the current data fragment (or create a
202  // new such fragment if the current fragment is not a data fragment).
204 
205  // Add the fixups and data.
206  for (unsigned I = 0, E = Fixups.size(); I != E; ++I) {
207  Fixups[I].setOffset(Fixups[I].getOffset() + DF->getContents().size());
208  DF->getFixups().push_back(Fixups[I]);
209  }
210  DF->setHasInstructions(STI);
211  DF->getContents().append(Code.begin(), Code.end());
212 }
213 
215  emitFrames(nullptr);
216 
218 }
219 
220 void MCWasmStreamer::fixSymbolsInTLSFixups(const MCExpr *expr) {
221  switch (expr->getKind()) {
222  case MCExpr::Target:
223  case MCExpr::Constant:
224  break;
225 
226  case MCExpr::Binary: {
227  const MCBinaryExpr *be = cast<MCBinaryExpr>(expr);
228  fixSymbolsInTLSFixups(be->getLHS());
229  fixSymbolsInTLSFixups(be->getRHS());
230  break;
231  }
232 
233  case MCExpr::SymbolRef: {
234  const MCSymbolRefExpr &symRef = *cast<MCSymbolRefExpr>(expr);
235  switch (symRef.getKind()) {
239  cast<MCSymbolWasm>(symRef.getSymbol()).setTLS();
240  break;
241  default:
242  break;
243  }
244  break;
245  }
246 
247  case MCExpr::Unary:
248  fixSymbolsInTLSFixups(cast<MCUnaryExpr>(expr)->getSubExpr());
249  break;
250  }
251 }
252 
254  llvm_unreachable("Generic Wasm doesn't support this directive");
255 }
256 
257 void MCWasmStreamer::emitSymbolDesc(MCSymbol *Symbol, unsigned DescValue) {
258  llvm_unreachable("Wasm doesn't support this directive");
259 }
260 
262  uint64_t Size, unsigned ByteAlignment,
263  SMLoc Loc) {
264  llvm_unreachable("Wasm doesn't support this directive");
265 }
266 
268  uint64_t Size, unsigned ByteAlignment) {
269  llvm_unreachable("Wasm doesn't support this directive");
270 }
271 
273  std::unique_ptr<MCAsmBackend> &&MAB,
274  std::unique_ptr<MCObjectWriter> &&OW,
275  std::unique_ptr<MCCodeEmitter> &&CE,
276  bool RelaxAll) {
277  MCWasmStreamer *S =
278  new MCWasmStreamer(Context, std::move(MAB), std::move(OW), std::move(CE));
279  if (RelaxAll)
280  S->getAssembler().setRelaxAll(true);
281  return S;
282 }
llvm::Check::Size
@ Size
Definition: FileCheck.h:73
llvm::MCAssembler::getBackend
MCAsmBackend & getBackend() const
Definition: MCAssembler.h:300
llvm::MCSymbolRefExpr::getKind
VariantKind getKind() const
Definition: MCExpr.h:400
llvm::MCWasmStreamer::emitZerofill
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.
Definition: MCWasmStreamer.cpp:261
llvm
This file implements support for optimizing divisions by a constant.
Definition: AllocatorList.h:23
llvm::MCRelaxableFragment
A relaxable fragment holds on to its MCInst, since it may need to be relaxed during the assembler lay...
Definition: MCFragment.h:271
llvm::MCSymbol
MCSymbol - Instances of this class represent a symbol name in the MC file, and MCSymbols are created ...
Definition: MCSymbol.h:41
llvm::MCObjectStreamer::emitLabel
void emitLabel(MCSymbol *Symbol, SMLoc Loc=SMLoc()) override
Emit a label for Symbol into the current section.
Definition: MCObjectStreamer.cpp:264
MCWasmStreamer.h
llvm::MCAssembler::registerSymbol
void registerSymbol(const MCSymbol &Symbol, bool *Created=nullptr)
Definition: MCAssembler.cpp:463
llvm::MCContext
Context object for machine code objects.
Definition: MCContext.h:72
llvm::Attribute
Definition: Attributes.h:52
llvm::MCSA_ELF_TypeObject
@ MCSA_ELF_TypeObject
.type _foo, STT_OBJECT # aka @object
Definition: MCDirectives.h:25
MCCodeEmitter.h
llvm::MCSA_Invalid
@ MCSA_Invalid
Not a valid directive.
Definition: MCDirectives.h:19
llvm::SmallVector
This is a 'vector' (really, a variable-sized array), optimized for the case when the array is small.
Definition: SmallVector.h:1168
llvm::tgtok::Code
@ Code
Definition: TGLexer.h:50
llvm::MCAsmBackend::handleAssemblerFlag
virtual void handleAssemblerFlag(MCAssemblerFlag Flag)
Handle any target-specific assembler flags. By default, do nothing.
Definition: MCAsmBackend.h:205
ErrorHandling.h
MCAssembler.h
llvm::MCObjectStreamer::emitLabelAtPos
virtual void emitLabelAtPos(MCSymbol *Symbol, SMLoc Loc, MCFragment *F, uint64_t Offset)
Definition: MCObjectStreamer.cpp:288
llvm::MCWasmStreamer::emitAssemblerFlag
void emitAssemblerFlag(MCAssemblerFlag Flag) override
Note in the output the specified Flag.
Definition: MCWasmStreamer.cpp:73
Offset
uint64_t Offset
Definition: ELFObjHandler.cpp:81
STLExtras.h
llvm::MCInst
Instances of this class represent a single low-level machine instruction.
Definition: MCInst.h:184
llvm::MCObjectStreamer::changeSection
void changeSection(MCSection *Section, const MCExpr *Subsection) override
Update streamer for a new active section.
Definition: MCObjectStreamer.cpp:329
llvm::MCEncodedFragmentWithFixups::getFixups
SmallVectorImpl< MCFixup > & getFixups()
Definition: MCFragment.h:223
llvm::MCAssemblerFlag
MCAssemblerFlag
Definition: MCDirectives.h:50
llvm::MCSymbol::setVariableValue
void setVariableValue(const MCExpr *Value)
Definition: MCSymbol.cpp:48
llvm::MCBinaryExpr
Binary assembler expressions.
Definition: MCExpr.h:480
llvm::getOffset
static Error getOffset(const SymbolRef &Sym, SectionRef Sec, uint64_t &Result)
Definition: RuntimeDyld.cpp:170
llvm::MCWasmStreamer::emitELFSize
void emitELFSize(MCSymbol *Symbol, const MCExpr *Value) override
Emit an ELF .size directive.
Definition: MCWasmStreamer.cpp:167
F
#define F(x, y, z)
Definition: MD5.cpp:56
llvm::MCSymbolAttr
MCSymbolAttr
Definition: MCDirectives.h:18
llvm::MCSA_Cold
@ MCSA_Cold
.cold (MachO)
Definition: MCDirectives.h:22
Context
LLVMContext & Context
Definition: NVVMIntrRange.cpp:66
llvm::ARMBuildAttrs::Section
@ Section
Legacy Tags.
Definition: ARMBuildAttributes.h:78
llvm::MCSA_NoDeadStrip
@ MCSA_NoDeadStrip
.no_dead_strip (MachO)
Definition: MCDirectives.h:38
MCObjectStreamer.h
llvm::MCFragment
Definition: MCFragment.h:31
llvm::MCStreamer
Streaming machine code generation interface.
Definition: MCStreamer.h:199
llvm::MCWasmStreamer::changeSection
void changeSection(MCSection *Section, const MCExpr *Subsection) override
Update streamer for a new active section.
Definition: MCWasmStreamer.cpp:81
MCAsmBackend.h
llvm::SMLoc
Represents a location in source code.
Definition: SMLoc.h:23
E
static GCRegistry::Add< CoreCLRGC > E("coreclr", "CoreCLR-compatible GC")
llvm::MCSectionWasm
This represents a section on wasm.
Definition: MCSectionWasm.h:26
llvm::MCExpr::Target
@ Target
Target specific expression.
Definition: MCExpr.h:42
MCSymbolWasm.h
llvm::MCSA_Protected
@ MCSA_Protected
.protected (ELF)
Definition: MCDirectives.h:42
MCContext.h
MCSymbol.h
llvm::MCSA_LazyReference
@ MCSA_LazyReference
.lazy_reference (MachO)
Definition: MCDirectives.h:36
MCInst.h
llvm::MCWasmStreamer::emitLabel
void emitLabel(MCSymbol *Symbol, SMLoc Loc=SMLoc()) override
Emit a label for Symbol into the current section.
Definition: MCWasmStreamer.cpp:52
llvm::AArch64::Fixups
Fixups
Definition: AArch64FixupKinds.h:17
llvm::MCSA_Reference
@ MCSA_Reference
.reference (MachO)
Definition: MCDirectives.h:43
llvm::MCID::Flag
Flag
These should be considered private to the implementation of the MCInstrDesc class.
Definition: MCInstrDesc.h:146
be
Common register allocation spilling lr str ldr sxth r3 ldr mla r4 can be
Definition: README.txt:14
llvm::MCSymbolRefExpr::getSymbol
const MCSymbol & getSymbol() const
Definition: MCExpr.h:398
llvm::wasm::WASM_SYMBOL_TYPE_FUNCTION
@ WASM_SYMBOL_TYPE_FUNCTION
Definition: Wasm.h:369
llvm::MCSA_Hidden
@ MCSA_Hidden
.hidden (ELF)
Definition: MCDirectives.h:33
SmallPtrSet.h
llvm::MCExpr::getKind
ExprKind getKind() const
Definition: MCExpr.h:81
llvm::MCWasmStreamer
Definition: MCWasmStreamer.h:23
llvm::MCObjectStreamer::getCurrentFragment
MCFragment * getCurrentFragment() const
Definition: MCObjectStreamer.cpp:179
llvm::MCStreamer::getCurrentSectionOnly
MCSection * getCurrentSectionOnly() const
Definition: MCStreamer.h:376
llvm::MCExpr::Binary
@ Binary
Binary expressions.
Definition: MCExpr.h:38
DF
static RegisterPass< DebugifyFunctionPass > DF("debugify-function", "Attach debug info to a function")
llvm::wasm::WASM_SEG_FLAG_TLS
@ WASM_SEG_FLAG_TLS
Definition: Wasm.h:379
llvm::SmallString< 256 >
llvm::MCSA_WeakDefAutoPrivate
@ MCSA_WeakDefAutoPrivate
.weak_def_can_be_hidden (MachO)
Definition: MCDirectives.h:47
llvm::createWasmStreamer
MCStreamer * createWasmStreamer(MCContext &Ctx, std::unique_ptr< MCAsmBackend > &&TAB, std::unique_ptr< MCObjectWriter > &&OW, std::unique_ptr< MCCodeEmitter > &&CE, bool RelaxAll)
Definition: MCWasmStreamer.cpp:272
llvm::MCAssembler
Definition: MCAssembler.h:60
llvm::MCWasmStreamer::emitCommonSymbol
void emitCommonSymbol(MCSymbol *Symbol, uint64_t Size, unsigned ByteAlignment) override
Emit a common symbol.
Definition: MCWasmStreamer.cpp:162
llvm::MCAssembler::getEmitter
MCCodeEmitter & getEmitter() const
Definition: MCAssembler.h:302
llvm::MCSymbolRefExpr::VK_WASM_GOT_TLS
@ VK_WASM_GOT_TLS
Definition: MCExpr.h:331
uint64_t
llvm::MCSA_WeakReference
@ MCSA_WeakReference
.weak_reference (MachO)
Definition: MCDirectives.h:46
llvm::MCSymbolRefExpr::VK_WASM_TLSREL
@ VK_WASM_TLSREL
Definition: MCExpr.h:328
move
compiles ldr LCPI1_0 ldr ldr mov lsr tst moveq r1 ldr LCPI1_1 and r0 bx lr It would be better to do something like to fold the shift into the conditional move
Definition: README.txt:546
I
#define I(x, y, z)
Definition: MD5.cpp:59
llvm::MCWasmStreamer::~MCWasmStreamer
~MCWasmStreamer() override
assert
assert(ImpDefSCC.getReg()==AMDGPU::SCC &&ImpDefSCC.isDef())
llvm::MCWasmStreamer::emitWeakReference
void emitWeakReference(MCSymbol *Alias, const MCSymbol *Symbol) override
Emit an weak reference from Alias to Symbol.
Definition: MCWasmStreamer.cpp:93
llvm::MCSymbolRefExpr
Represent a reference to a symbol from inside an expression.
Definition: MCExpr.h:192
MCSection.h
llvm::MCObjectStreamer::getAssembler
MCAssembler & getAssembler()
Definition: MCObjectStreamer.h:112
llvm::MCObjectStreamer::getOrCreateDataFragment
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.
Definition: MCObjectStreamer.cpp:203
Fixup
PowerPC TLS Dynamic Call Fixup
Definition: PPCTLSDynamicCall.cpp:235
llvm::StringRef
StringRef - Represent a constant reference to a string, i.e.
Definition: StringRef.h:58
llvm_unreachable
#define llvm_unreachable(msg)
Marks that the current location is not supposed to be reachable.
Definition: ErrorHandling.h:134
llvm::MCSection
Instances of this class represent a uniqued identifier for a section in the current translation unit.
Definition: MCSection.h:39
S
add sub stmia L5 ldr r0 bl L_printf $stub Instead of a and a wouldn t it be better to do three moves *Return an aggregate type is even return S
Definition: README.txt:210
llvm::MCSA_ELF_TypeTLS
@ MCSA_ELF_TypeTLS
.type _foo, STT_TLS # aka @tls_object
Definition: MCDirectives.h:26
llvm::MCObjectStreamer::emitInstToFragment
virtual void emitInstToFragment(const MCInst &Inst, const MCSubtargetInfo &)
Emit an instruction to a special fragment, because this instruction can change its size during relaxa...
Definition: MCObjectStreamer.cpp:414
llvm::MCWasmStreamer::emitIdent
void emitIdent(StringRef IdentString) override
Emit the "identifiers" directive.
Definition: MCWasmStreamer.cpp:176
llvm::MCSA_IndirectSymbol
@ MCSA_IndirectSymbol
.indirect_symbol (MachO)
Definition: MCDirectives.h:34
llvm::MCSymbolRefExpr::VK_WEAKREF
@ VK_WEAKREF
Definition: MCExpr.h:224
llvm::MCWasmStreamer::emitSymbolAttribute
bool emitSymbolAttribute(MCSymbol *Symbol, MCSymbolAttr Attribute) override
Add the given Attribute to Symbol.
Definition: MCWasmStreamer.cpp:101
MCAsmLayout.h
llvm::MCSA_SymbolResolver
@ MCSA_SymbolResolver
.symbol_resolver (MachO)
Definition: MCDirectives.h:39
llvm::MCWasmStreamer::emitTBSSSymbol
void emitTBSSSymbol(MCSection *Section, MCSymbol *Symbol, uint64_t Size, unsigned ByteAlignment=0) override
Emit a thread local bss (.tbss) symbol.
Definition: MCWasmStreamer.cpp:267
llvm::MCEncodedFragment::getSubtargetInfo
const MCSubtargetInfo * getSubtargetInfo() const
Retrieve the MCSubTargetInfo in effect when the instruction was encoded.
Definition: MCFragment.h:173
Casting.h
llvm::MCSymbolRefExpr::create
static const MCSymbolRefExpr * create(const MCSymbol *Symbol, MCContext &Ctx)
Definition: MCExpr.h:385
llvm::MCWasmStreamer::emitLabelAtPos
void emitLabelAtPos(MCSymbol *Symbol, SMLoc Loc, MCFragment *F, uint64_t Offset) override
Definition: MCWasmStreamer.cpp:62
llvm::MCSA_Global
@ MCSA_Global
.type _foo, @gnu_unique_object
Definition: MCDirectives.h:30
MCValue.h
llvm::MCSA_WeakDefinition
@ MCSA_WeakDefinition
.weak_definition (MachO)
Definition: MCDirectives.h:45
llvm::LCOMM::ByteAlignment
@ ByteAlignment
Definition: MCAsmInfo.h:50
llvm::MCSA_ELF_TypeFunction
@ MCSA_ELF_TypeFunction
.type _foo, STT_FUNC # aka @function
Definition: MCDirectives.h:23
llvm::ARMBuildAttrs::Symbol
@ Symbol
Definition: ARMBuildAttributes.h:79
llvm::MCSA_Weak
@ MCSA_Weak
.weak
Definition: MCDirectives.h:44
llvm::MCObjectStreamer::flushPendingLabels
void flushPendingLabels()
Create a data fragment for any pending labels across all Sections and Subsections.
Definition: MCObjectStreamer.cpp:92
llvm::MCWasmStreamer::finishImpl
void finishImpl() override
Streamer specific finalization.
Definition: MCWasmStreamer.cpp:214
llvm::MCWasmStreamer::emitSymbolDesc
void emitSymbolDesc(MCSymbol *Symbol, unsigned DescValue) override
Set the DescValue for the Symbol.
Definition: MCWasmStreamer.cpp:257
llvm::MCStreamer::getContext
MCContext & getContext() const
Definition: MCStreamer.h:280
llvm::MCExpr::SymbolRef
@ SymbolRef
References to labels and assigned expressions.
Definition: MCExpr.h:40
llvm::MCWasmStreamer::emitLocalCommonSymbol
void emitLocalCommonSymbol(MCSymbol *Symbol, uint64_t Size, unsigned ByteAlignment) override
Emit a local common (.lcomm) symbol.
Definition: MCWasmStreamer.cpp:171
llvm::MCExpr::Unary
@ Unary
Unary expressions.
Definition: MCExpr.h:41
llvm::MCExpr::Constant
@ Constant
Constant expressions.
Definition: MCExpr.h:39
llvm::MCWasmStreamer::emitThumbFunc
void emitThumbFunc(MCSymbol *Func) override
Note in the output that the specified Func is a Thumb mode function (ARM target only).
Definition: MCWasmStreamer.cpp:253
llvm::raw_svector_ostream
A raw_ostream that writes to an SmallVector or SmallString.
Definition: raw_ostream.h:658
llvm::MCSA_PrivateExtern
@ MCSA_PrivateExtern
.private_extern (MachO)
Definition: MCDirectives.h:41
llvm::HexStyle::Asm
@ Asm
0ffh
Definition: MCInstPrinter.h:34
llvm::MCObjectStreamer::finishImpl
void finishImpl() override
Streamer specific finalization.
Definition: MCObjectStreamer.cpp:870
llvm::MCObjectStreamer::emitFrames
void emitFrames(MCAsmBackend *MAB)
Definition: MCObjectStreamer.cpp:168
raw_ostream.h
llvm::MCDataFragment
Fragment for data and encoded instructions.
Definition: MCFragment.h:242
TargetRegistry.h
MCExpr.h
llvm::MCSubtargetInfo
Generic base class for all target subtargets.
Definition: MCSubtargetInfo.h:75
llvm::Value
LLVM Value Representation.
Definition: Value.h:74
llvm::MCExpr
Base class for the full range of assembler expressions which are needed for parsing.
Definition: MCExpr.h:35
Debug.h
llvm::MCEncodedFragmentWithContents::getContents
SmallVectorImpl< char > & getContents()
Definition: MCFragment.h:197
MCSectionWasm.h
llvm::MCCodeEmitter::encodeInstruction
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.