LLVM  16.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/SmallString.h"
15 #include "llvm/ADT/SmallVector.h"
16 #include "llvm/MC/MCAsmBackend.h"
17 #include "llvm/MC/MCAssembler.h"
18 #include "llvm/MC/MCCodeEmitter.h"
19 #include "llvm/MC/MCExpr.h"
20 #include "llvm/MC/MCFixup.h"
21 #include "llvm/MC/MCFragment.h"
23 #include "llvm/MC/MCSection.h"
24 #include "llvm/MC/MCSectionWasm.h"
25 #include "llvm/MC/MCSymbol.h"
26 #include "llvm/MC/MCSymbolWasm.h"
27 #include "llvm/MC/TargetRegistry.h"
28 #include "llvm/Support/Casting.h"
31 
32 namespace llvm {
33 class MCContext;
34 class MCStreamer;
35 class MCSubtargetInfo;
36 } // namespace llvm
37 
38 using namespace llvm;
39 
40 MCWasmStreamer::~MCWasmStreamer() = default; // anchor.
41 
42 void MCWasmStreamer::mergeFragment(MCDataFragment *DF, MCDataFragment *EF) {
43  flushPendingLabels(DF, DF->getContents().size());
44 
45  for (unsigned I = 0, E = EF->getFixups().size(); I != E; ++I) {
46  EF->getFixups()[I].setOffset(EF->getFixups()[I].getOffset() +
47  DF->getContents().size());
48  DF->getFixups().push_back(EF->getFixups()[I]);
49  }
50  if (DF->getSubtargetInfo() == nullptr && EF->getSubtargetInfo())
51  DF->setHasInstructions(*EF->getSubtargetInfo());
52  DF->getContents().append(EF->getContents().begin(), EF->getContents().end());
53 }
54 
56  auto *Symbol = cast<MCSymbolWasm>(S);
58 
59  const MCSectionWasm &Section =
60  static_cast<const MCSectionWasm &>(*getCurrentSectionOnly());
61  if (Section.getSegmentFlags() & wasm::WASM_SEG_FLAG_TLS)
62  Symbol->setTLS();
63 }
64 
66  uint64_t Offset) {
67  auto *Symbol = cast<MCSymbolWasm>(S);
69 
70  const MCSectionWasm &Section =
71  static_cast<const MCSectionWasm &>(*getCurrentSectionOnly());
72  if (Section.getSegmentFlags() & wasm::WASM_SEG_FLAG_TLS)
73  Symbol->setTLS();
74 }
75 
77  // Let the target do whatever target specific stuff it needs to do.
79 
80  // Do any generic stuff we need to do.
81  llvm_unreachable("invalid assembler flag!");
82 }
83 
85  const MCExpr *Subsection) {
87  auto *SectionWasm = cast<MCSectionWasm>(Section);
88  const MCSymbol *Grp = SectionWasm->getGroup();
89  if (Grp)
90  Asm.registerSymbol(*Grp);
91 
92  this->MCObjectStreamer::changeSection(Section, Subsection);
93  Asm.registerSymbol(*Section->getBeginSymbol());
94 }
95 
97  const MCSymbol *Symbol) {
101  Alias->setVariableValue(Value);
102 }
103 
105  assert(Attribute != MCSA_IndirectSymbol && "indirect symbols not supported");
106 
107  auto *Symbol = cast<MCSymbolWasm>(S);
108 
109  // Adding a symbol attribute always introduces the symbol; note that an
110  // important side effect of calling registerSymbol here is to register the
111  // symbol with the assembler.
113 
114  switch (Attribute) {
115  case MCSA_LazyReference:
116  case MCSA_Reference:
117  case MCSA_SymbolResolver:
118  case MCSA_PrivateExtern:
119  case MCSA_WeakDefinition:
121  case MCSA_Invalid:
122  case MCSA_IndirectSymbol:
123  case MCSA_Protected:
124  case MCSA_Exported:
125  return false;
126 
127  case MCSA_Hidden:
128  Symbol->setHidden(true);
129  break;
130 
131  case MCSA_Weak:
132  case MCSA_WeakReference:
133  Symbol->setWeak(true);
134  Symbol->setExternal(true);
135  break;
136 
137  case MCSA_Global:
138  Symbol->setExternal(true);
139  break;
140 
143  break;
144 
145  case MCSA_ELF_TypeTLS:
146  Symbol->setTLS();
147  break;
148 
149  case MCSA_ELF_TypeObject:
150  case MCSA_Cold:
151  break;
152 
153  case MCSA_NoDeadStrip:
154  Symbol->setNoStrip();
155  break;
156 
157  default:
158  // unrecognized directive
159  llvm_unreachable("unexpected MCSymbolAttr");
160  return false;
161  }
162 
163  return true;
164 }
165 
167  unsigned ByteAlignment) {
168  llvm_unreachable("Common symbols are not yet implemented for Wasm");
169 }
170 
172  cast<MCSymbolWasm>(Symbol)->setSize(Value);
173 }
174 
176  unsigned ByteAlignment) {
177  llvm_unreachable("Local common symbols are not yet implemented for Wasm");
178 }
179 
181  // TODO(sbc): Add the ident section once we support mergable strings
182  // sections in the object format
183 }
184 
185 void MCWasmStreamer::emitInstToFragment(const MCInst &Inst,
186  const MCSubtargetInfo &STI) {
187  this->MCObjectStreamer::emitInstToFragment(Inst, STI);
188  MCRelaxableFragment &F = *cast<MCRelaxableFragment>(getCurrentFragment());
189 
190  for (auto &Fixup : F.getFixups())
191  fixSymbolsInTLSFixups(Fixup.getValue());
192 }
193 
194 void MCWasmStreamer::emitInstToData(const MCInst &Inst,
195  const MCSubtargetInfo &STI) {
196  MCAssembler &Assembler = getAssembler();
199  raw_svector_ostream VecOS(Code);
200  Assembler.getEmitter().encodeInstruction(Inst, VecOS, Fixups, STI);
201 
202  for (auto &Fixup : Fixups)
203  fixSymbolsInTLSFixups(Fixup.getValue());
204 
205  // Append the encoded instruction to the current data fragment (or create a
206  // new such fragment if the current fragment is not a data fragment).
208 
209  // Add the fixups and data.
210  for (unsigned I = 0, E = Fixups.size(); I != E; ++I) {
211  Fixups[I].setOffset(Fixups[I].getOffset() + DF->getContents().size());
212  DF->getFixups().push_back(Fixups[I]);
213  }
214  DF->setHasInstructions(STI);
215  DF->getContents().append(Code.begin(), Code.end());
216 }
217 
219  emitFrames(nullptr);
220 
222 }
223 
224 void MCWasmStreamer::fixSymbolsInTLSFixups(const MCExpr *expr) {
225  switch (expr->getKind()) {
226  case MCExpr::Target:
227  case MCExpr::Constant:
228  break;
229 
230  case MCExpr::Binary: {
231  const MCBinaryExpr *be = cast<MCBinaryExpr>(expr);
232  fixSymbolsInTLSFixups(be->getLHS());
233  fixSymbolsInTLSFixups(be->getRHS());
234  break;
235  }
236 
237  case MCExpr::SymbolRef: {
238  const MCSymbolRefExpr &symRef = *cast<MCSymbolRefExpr>(expr);
239  switch (symRef.getKind()) {
243  cast<MCSymbolWasm>(symRef.getSymbol()).setTLS();
244  break;
245  default:
246  break;
247  }
248  break;
249  }
250 
251  case MCExpr::Unary:
252  fixSymbolsInTLSFixups(cast<MCUnaryExpr>(expr)->getSubExpr());
253  break;
254  }
255 }
256 
258  llvm_unreachable("Generic Wasm doesn't support this directive");
259 }
260 
261 void MCWasmStreamer::emitSymbolDesc(MCSymbol *Symbol, unsigned DescValue) {
262  llvm_unreachable("Wasm doesn't support this directive");
263 }
264 
266  uint64_t Size, unsigned ByteAlignment,
267  SMLoc Loc) {
268  llvm_unreachable("Wasm doesn't support this directive");
269 }
270 
272  uint64_t Size, unsigned ByteAlignment) {
273  llvm_unreachable("Wasm doesn't support this directive");
274 }
275 
277  std::unique_ptr<MCAsmBackend> &&MAB,
278  std::unique_ptr<MCObjectWriter> &&OW,
279  std::unique_ptr<MCCodeEmitter> &&CE,
280  bool RelaxAll) {
281  MCWasmStreamer *S =
282  new MCWasmStreamer(Context, std::move(MAB), std::move(OW), std::move(CE));
283  if (RelaxAll)
284  S->getAssembler().setRelaxAll(true);
285  return S;
286 }
llvm::MCAssembler::getBackend
MCAsmBackend & getBackend() const
Definition: MCAssembler.h:329
llvm::MCSymbolRefExpr::getKind
VariantKind getKind() const
Definition: MCExpr.h:401
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:265
llvm
This is an optimization pass for GlobalISel generic memory operations.
Definition: AddressRanges.h:18
llvm::MCRelaxableFragment
A relaxable fragment holds on to its MCInst, since it may need to be relaxed during the assembler lay...
Definition: MCFragment.h:270
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:286
MCWasmStreamer.h
llvm::MCAssembler::registerSymbol
void registerSymbol(const MCSymbol &Symbol, bool *Created=nullptr)
Definition: MCAssembler.cpp:467
llvm::MCContext
Context object for machine code objects.
Definition: MCContext.h:76
llvm::Attribute
Definition: Attributes.h:66
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:1199
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:211
ErrorHandling.h
MCFragment.h
MCAssembler.h
llvm::MCObjectStreamer::emitLabelAtPos
virtual void emitLabelAtPos(MCSymbol *Symbol, SMLoc Loc, MCFragment *F, uint64_t Offset)
Definition: MCObjectStreamer.cpp:322
llvm::MCWasmStreamer::emitAssemblerFlag
void emitAssemblerFlag(MCAssemblerFlag Flag) override
Note in the output the specified Flag.
Definition: MCWasmStreamer.cpp:76
Offset
uint64_t Offset
Definition: ELFObjHandler.cpp:79
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:363
llvm::MCEncodedFragmentWithFixups::getFixups
SmallVectorImpl< MCFixup > & getFixups()
Definition: MCFragment.h:222
llvm::MCAssemblerFlag
MCAssemblerFlag
Definition: MCDirectives.h:51
llvm::MCBinaryExpr
Binary assembler expressions.
Definition: MCExpr.h:481
llvm::getOffset
static Error getOffset(const SymbolRef &Sym, SectionRef Sec, uint64_t &Result)
Definition: RuntimeDyld.cpp:172
llvm::MCWasmStreamer::emitELFSize
void emitELFSize(MCSymbol *Symbol, const MCExpr *Value) override
Emit an ELF .size directive.
Definition: MCWasmStreamer.cpp:171
F
#define F(x, y, z)
Definition: MD5.cpp:55
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:82
llvm::MCSA_NoDeadStrip
@ MCSA_NoDeadStrip
.no_dead_strip (MachO)
Definition: MCDirectives.h:39
MCObjectStreamer.h
llvm::MCFragment
Definition: MCFragment.h:30
llvm::MCStreamer
Streaming machine code generation interface.
Definition: MCStreamer.h:212
llvm::MCWasmStreamer::changeSection
void changeSection(MCSection *Section, const MCExpr *Subsection) override
Update streamer for a new active section.
Definition: MCWasmStreamer.cpp:84
MCAsmBackend.h
llvm::SMLoc
Represents a location in source code.
Definition: SMLoc.h:23
SmallString.h
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:43
MCSymbol.h
llvm::MCSA_LazyReference
@ MCSA_LazyReference
.lazy_reference (MachO)
Definition: MCDirectives.h:37
llvm::MCWasmStreamer::emitLabel
void emitLabel(MCSymbol *Symbol, SMLoc Loc=SMLoc()) override
Emit a label for Symbol into the current section.
Definition: MCWasmStreamer.cpp:55
llvm::AArch64::Fixups
Fixups
Definition: AArch64FixupKinds.h:17
llvm::MCSA_Reference
@ MCSA_Reference
.reference (MachO)
Definition: MCDirectives.h:44
llvm::MCID::Flag
Flag
These should be considered private to the implementation of the MCInstrDesc class.
Definition: MCInstrDesc.h:147
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:399
llvm::wasm::WASM_SYMBOL_TYPE_FUNCTION
@ WASM_SYMBOL_TYPE_FUNCTION
Definition: Wasm.h:383
llvm::MCSA_Hidden
@ MCSA_Hidden
.hidden (ELF)
Definition: MCDirectives.h:33
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:201
llvm::MCStreamer::getCurrentSectionOnly
MCSection * getCurrentSectionOnly() const
Definition: MCStreamer.h:389
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:393
llvm::SmallString< 256 >
llvm::MCSA_Exported
@ MCSA_Exported
.globl _foo, exported (XCOFF)
Definition: MCDirectives.h:34
llvm::MCSA_WeakDefAutoPrivate
@ MCSA_WeakDefAutoPrivate
.weak_def_can_be_hidden (MachO)
Definition: MCDirectives.h:48
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:276
llvm::MCAssembler
Definition: MCAssembler.h:73
llvm::MCWasmStreamer::emitCommonSymbol
void emitCommonSymbol(MCSymbol *Symbol, uint64_t Size, unsigned ByteAlignment) override
Emit a common symbol.
Definition: MCWasmStreamer.cpp:166
llvm::MCAssembler::getEmitter
MCCodeEmitter & getEmitter() const
Definition: MCAssembler.h:331
llvm::MCSymbolRefExpr::VK_WASM_GOT_TLS
@ VK_WASM_GOT_TLS
Definition: MCExpr.h:332
uint64_t
llvm::MCSA_WeakReference
@ MCSA_WeakReference
.weak_reference (MachO)
Definition: MCDirectives.h:47
llvm::MCSymbolRefExpr::VK_WASM_TLSREL
@ VK_WASM_TLSREL
Definition: MCExpr.h:329
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:58
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:96
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:128
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:225
Fixup
PowerPC TLS Dynamic Call Fixup
Definition: PPCTLSDynamicCall.cpp:215
llvm::StringRef
StringRef - Represent a constant reference to a string, i.e.
Definition: StringRef.h:50
llvm_unreachable
#define llvm_unreachable(msg)
Marks that the current location is not supposed to be reachable.
Definition: ErrorHandling.h:143
MCFixup.h
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:461
llvm::MCWasmStreamer::emitIdent
void emitIdent(StringRef IdentString) override
Emit the "identifiers" directive.
Definition: MCWasmStreamer.cpp:180
llvm::MCSA_IndirectSymbol
@ MCSA_IndirectSymbol
.indirect_symbol (MachO)
Definition: MCDirectives.h:35
llvm::MCSymbolRefExpr::VK_WEAKREF
@ VK_WEAKREF
Definition: MCExpr.h:225
llvm::MCWasmStreamer::emitSymbolAttribute
bool emitSymbolAttribute(MCSymbol *Symbol, MCSymbolAttr Attribute) override
Add the given Attribute to Symbol.
Definition: MCWasmStreamer.cpp:104
llvm::AArch64::Alias
StringRef Alias
Definition: AArch64TargetParser.h:135
llvm::MCSA_SymbolResolver
@ MCSA_SymbolResolver
.symbol_resolver (MachO)
Definition: MCDirectives.h:40
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:271
llvm::MCEncodedFragment::getSubtargetInfo
const MCSubtargetInfo * getSubtargetInfo() const
Retrieve the MCSubTargetInfo in effect when the instruction was encoded.
Definition: MCFragment.h:172
Casting.h
llvm::MCSymbolRefExpr::create
static const MCSymbolRefExpr * create(const MCSymbol *Symbol, MCContext &Ctx)
Definition: MCExpr.h:386
llvm::MCWasmStreamer::emitLabelAtPos
void emitLabelAtPos(MCSymbol *Symbol, SMLoc Loc, MCFragment *F, uint64_t Offset) override
Definition: MCWasmStreamer.cpp:65
llvm::MCSA_Global
@ MCSA_Global
.type _foo, @gnu_unique_object
Definition: MCDirectives.h:30
llvm::MCSA_WeakDefinition
@ MCSA_WeakDefinition
.weak_definition (MachO)
Definition: MCDirectives.h:46
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:83
llvm::MCSA_Weak
@ MCSA_Weak
.weak
Definition: MCDirectives.h:45
llvm::MCObjectStreamer::flushPendingLabels
void flushPendingLabels()
Create a data fragment for any pending labels across all Sections and Subsections.
Definition: MCObjectStreamer.cpp:91
llvm::MCWasmStreamer::finishImpl
void finishImpl() override
Streamer specific finalization.
Definition: MCWasmStreamer.cpp:218
llvm::MCWasmStreamer::emitSymbolDesc
void emitSymbolDesc(MCSymbol *Symbol, unsigned DescValue) override
Set the DescValue for the Symbol.
Definition: MCWasmStreamer.cpp:261
llvm::MCStreamer::getContext
MCContext & getContext() const
Definition: MCStreamer.h:293
SmallVector.h
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:175
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:257
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:42
llvm::HexStyle::Asm
@ Asm
0ffh
Definition: MCInstPrinter.h:34
InlinePriorityMode::Size
@ Size
llvm::MCObjectStreamer::finishImpl
void finishImpl() override
Streamer specific finalization.
Definition: MCObjectStreamer.cpp:916
llvm::MCObjectStreamer::emitFrames
void emitFrames(MCAsmBackend *MAB)
Definition: MCObjectStreamer.cpp:190
raw_ostream.h
llvm::MCDataFragment
Fragment for data and encoded instructions.
Definition: MCFragment.h:241
TargetRegistry.h
MCExpr.h
llvm::MCSubtargetInfo
Generic base class for all target subtargets.
Definition: MCSubtargetInfo.h:76
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
llvm::MCEncodedFragmentWithContents::getContents
SmallVectorImpl< char > & getContents()
Definition: MCFragment.h:196
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.