LLVM  7.0.0svn
MCStreamer.h
Go to the documentation of this file.
1 //===- MCStreamer.h - High-level Streaming Machine Code Output --*- C++ -*-===//
2 //
3 // The LLVM Compiler Infrastructure
4 //
5 // This file is distributed under the University of Illinois Open Source
6 // License. See LICENSE.TXT for details.
7 //
8 //===----------------------------------------------------------------------===//
9 //
10 // This file declares the MCStreamer class.
11 //
12 //===----------------------------------------------------------------------===//
13 
14 #ifndef LLVM_MC_MCSTREAMER_H
15 #define LLVM_MC_MCSTREAMER_H
16 
17 #include "llvm/ADT/ArrayRef.h"
18 #include "llvm/ADT/DenseMap.h"
19 #include "llvm/ADT/SmallVector.h"
20 #include "llvm/ADT/StringRef.h"
21 #include "llvm/MC/MCDirectives.h"
22 #include "llvm/MC/MCDwarf.h"
24 #include "llvm/MC/MCSymbol.h"
25 #include "llvm/MC/MCWinEH.h"
26 #include "llvm/Support/MD5.h"
27 #include "llvm/Support/SMLoc.h"
29 #include <cassert>
30 #include <cstdint>
31 #include <memory>
32 #include <string>
33 #include <utility>
34 #include <vector>
35 
36 namespace llvm {
37 
38 class AssemblerConstantPools;
39 class formatted_raw_ostream;
40 class MCAsmBackend;
41 class MCCodeEmitter;
42 struct MCCodePaddingContext;
43 class MCContext;
44 class MCExpr;
45 class MCInst;
46 class MCInstPrinter;
47 class MCSection;
48 class MCStreamer;
49 class MCSymbolRefExpr;
50 class MCSubtargetInfo;
51 class raw_ostream;
52 class Twine;
53 
54 using MCSectionSubPair = std::pair<MCSection *, const MCExpr *>;
55 
56 /// Target specific streamer interface. This is used so that targets can
57 /// implement support for target specific assembly directives.
58 ///
59 /// If target foo wants to use this, it should implement 3 classes:
60 /// * FooTargetStreamer : public MCTargetStreamer
61 /// * FooTargetAsmStreamer : public FooTargetStreamer
62 /// * FooTargetELFStreamer : public FooTargetStreamer
63 ///
64 /// FooTargetStreamer should have a pure virtual method for each directive. For
65 /// example, for a ".bar symbol_name" directive, it should have
66 /// virtual emitBar(const MCSymbol &Symbol) = 0;
67 ///
68 /// The FooTargetAsmStreamer and FooTargetELFStreamer classes implement the
69 /// method. The assembly streamer just prints ".bar symbol_name". The object
70 /// streamer does whatever is needed to implement .bar in the object file.
71 ///
72 /// In the assembly printer and parser the target streamer can be used by
73 /// calling getTargetStreamer and casting it to FooTargetStreamer:
74 ///
75 /// MCTargetStreamer &TS = OutStreamer.getTargetStreamer();
76 /// FooTargetStreamer &ATS = static_cast<FooTargetStreamer &>(TS);
77 ///
78 /// The base classes FooTargetAsmStreamer and FooTargetELFStreamer should
79 /// *never* be treated differently. Callers should always talk to a
80 /// FooTargetStreamer.
82 protected:
84 
85 public:
87  virtual ~MCTargetStreamer();
88 
90 
91  // Allow a target to add behavior to the EmitLabel of MCStreamer.
92  virtual void emitLabel(MCSymbol *Symbol);
93  // Allow a target to add behavior to the emitAssignment of MCStreamer.
94  virtual void emitAssignment(MCSymbol *Symbol, const MCExpr *Value);
95 
96  virtual void prettyPrintAsm(MCInstPrinter &InstPrinter, raw_ostream &OS,
97  const MCInst &Inst, const MCSubtargetInfo &STI);
98 
99  virtual void emitDwarfFileDirective(StringRef Directive);
100 
101  /// Update streamer for a new active section.
102  ///
103  /// This is called by PopSection and SwitchSection, if the current
104  /// section changes.
105  virtual void changeSection(const MCSection *CurSection, MCSection *Section,
106  const MCExpr *SubSection, raw_ostream &OS);
107 
108  virtual void emitValue(const MCExpr *Value);
109 
110  virtual void finish();
111 };
112 
113 // FIXME: declared here because it is used from
114 // lib/CodeGen/AsmPrinter/ARMException.cpp.
116 public:
118  ~ARMTargetStreamer() override;
119 
120  virtual void emitFnStart();
121  virtual void emitFnEnd();
122  virtual void emitCantUnwind();
123  virtual void emitPersonality(const MCSymbol *Personality);
124  virtual void emitPersonalityIndex(unsigned Index);
125  virtual void emitHandlerData();
126  virtual void emitSetFP(unsigned FpReg, unsigned SpReg,
127  int64_t Offset = 0);
128  virtual void emitMovSP(unsigned Reg, int64_t Offset = 0);
129  virtual void emitPad(int64_t Offset);
130  virtual void emitRegSave(const SmallVectorImpl<unsigned> &RegList,
131  bool isVector);
132  virtual void emitUnwindRaw(int64_t StackOffset,
133  const SmallVectorImpl<uint8_t> &Opcodes);
134 
135  virtual void switchVendor(StringRef Vendor);
136  virtual void emitAttribute(unsigned Attribute, unsigned Value);
137  virtual void emitTextAttribute(unsigned Attribute, StringRef String);
138  virtual void emitIntTextAttribute(unsigned Attribute, unsigned IntValue,
139  StringRef StringValue = "");
140  virtual void emitFPU(unsigned FPU);
141  virtual void emitArch(ARM::ArchKind Arch);
142  virtual void emitArchExtension(unsigned ArchExt);
143  virtual void emitObjectArch(ARM::ArchKind Arch);
144  void emitTargetAttributes(const MCSubtargetInfo &STI);
145  virtual void finishAttributeSection();
146  virtual void emitInst(uint32_t Inst, char Suffix = '\0');
147 
148  virtual void AnnotateTLSDescriptorSequence(const MCSymbolRefExpr *SRE);
149 
150  virtual void emitThumbSet(MCSymbol *Symbol, const MCExpr *Value);
151 
152  void finish() override;
153 
154  /// Reset any state between object emissions, i.e. the equivalent of
155  /// MCStreamer's reset method.
156  virtual void reset();
157 
158  /// Callback used to implement the ldr= pseudo.
159  /// Add a new entry to the constant pool for the current section and return an
160  /// MCExpr that can be used to refer to the constant pool location.
161  const MCExpr *addConstantPoolEntry(const MCExpr *, SMLoc Loc);
162 
163  /// Callback used to implemnt the .ltorg directive.
164  /// Emit contents of constant pool for the current section.
165  void emitCurrentConstantPool();
166 
167 private:
168  std::unique_ptr<AssemblerConstantPools> ConstantPools;
169 };
170 
171 /// \brief Streaming machine code generation interface.
172 ///
173 /// This interface is intended to provide a programatic interface that is very
174 /// similar to the level that an assembler .s file provides. It has callbacks
175 /// to emit bytes, handle directives, etc. The implementation of this interface
176 /// retains state to know what the current section is etc.
177 ///
178 /// There are multiple implementations of this interface: one for writing out
179 /// a .s file, and implementations that write out .o files of various formats.
180 ///
181 class MCStreamer {
183  std::unique_ptr<MCTargetStreamer> TargetStreamer;
184 
185  std::vector<MCDwarfFrameInfo> DwarfFrameInfos;
186  MCDwarfFrameInfo *getCurrentDwarfFrameInfo();
187 
188  /// Similar to DwarfFrameInfos, but for SEH unwind info. Chained frames may
189  /// refer to each other, so use std::unique_ptr to provide pointer stability.
190  std::vector<std::unique_ptr<WinEH::FrameInfo>> WinFrameInfos;
191 
192  WinEH::FrameInfo *CurrentWinFrameInfo;
193 
194  /// Retreive the current frame info if one is available and it is not yet
195  /// closed. Otherwise, issue an error and return null.
196  WinEH::FrameInfo *EnsureValidWinFrameInfo(SMLoc Loc);
197 
198  /// \brief Tracks an index to represent the order a symbol was emitted in.
199  /// Zero means we did not emit that symbol.
201 
202  /// \brief This is stack of current and previous section values saved by
203  /// PushSection.
205 
206  /// The next unique ID to use when creating a WinCFI-related section (.pdata
207  /// or .xdata). This ID ensures that we have a one-to-one mapping from
208  /// code section to unwind info section, which MSVC's incremental linker
209  /// requires.
210  unsigned NextWinCFIID = 0;
211 
212 protected:
213  MCStreamer(MCContext &Ctx);
214 
215  virtual void EmitCFIStartProcImpl(MCDwarfFrameInfo &Frame);
216  virtual void EmitCFIEndProcImpl(MCDwarfFrameInfo &CurFrame);
217 
218  /// When emitting an object file, create and emit a real label. When emitting
219  /// textual assembly, this should do nothing to avoid polluting our output.
220  virtual MCSymbol *EmitCFILabel();
221 
223  return CurrentWinFrameInfo;
224  }
225 
226  virtual void EmitWindowsUnwindTables();
227 
228  virtual void EmitRawTextImpl(StringRef String);
229 
230 public:
231  MCStreamer(const MCStreamer &) = delete;
232  MCStreamer &operator=(const MCStreamer &) = delete;
233  virtual ~MCStreamer();
234 
235  void visitUsedExpr(const MCExpr &Expr);
236  virtual void visitUsedSymbol(const MCSymbol &Sym);
237 
239  TargetStreamer.reset(TS);
240  }
241 
242  /// State management
243  ///
244  virtual void reset();
245 
246  MCContext &getContext() const { return Context; }
247 
249  return TargetStreamer.get();
250  }
251 
252  unsigned getNumFrameInfos() { return DwarfFrameInfos.size(); }
254  return DwarfFrameInfos;
255  }
256 
257  bool hasUnfinishedDwarfFrameInfo();
258 
259  unsigned getNumWinFrameInfos() { return WinFrameInfos.size(); }
261  return WinFrameInfos;
262  }
263 
264  void generateCompactUnwindEncodings(MCAsmBackend *MAB);
265 
266  /// \name Assembly File Formatting.
267  /// @{
268 
269  /// \brief Return true if this streamer supports verbose assembly and if it is
270  /// enabled.
271  virtual bool isVerboseAsm() const { return false; }
272 
273  /// \brief Return true if this asm streamer supports emitting unformatted text
274  /// to the .s file with EmitRawText.
275  virtual bool hasRawTextSupport() const { return false; }
276 
277  /// \brief Is the integrated assembler required for this streamer to function
278  /// correctly?
279  virtual bool isIntegratedAssemblerRequired() const { return false; }
280 
281  /// \brief Add a textual comment.
282  ///
283  /// Typically for comments that can be emitted to the generated .s
284  /// file if applicable as a QoI issue to make the output of the compiler
285  /// more readable. This only affects the MCAsmStreamer, and only when
286  /// verbose assembly output is enabled.
287  ///
288  /// If the comment includes embedded \n's, they will each get the comment
289  /// prefix as appropriate. The added comment should not end with a \n.
290  /// By default, each comment is terminated with an end of line, i.e. the
291  /// EOL param is set to true by default. If one prefers not to end the
292  /// comment with a new line then the EOL param should be passed
293  /// with a false value.
294  virtual void AddComment(const Twine &T, bool EOL = true) {}
295 
296  /// \brief Return a raw_ostream that comments can be written to. Unlike
297  /// AddComment, you are required to terminate comments with \n if you use this
298  /// method.
299  virtual raw_ostream &GetCommentOS();
300 
301  /// \brief Print T and prefix it with the comment string (normally #) and
302  /// optionally a tab. This prints the comment immediately, not at the end of
303  /// the current line. It is basically a safe version of EmitRawText: since it
304  /// only prints comments, the object streamer ignores it instead of asserting.
305  virtual void emitRawComment(const Twine &T, bool TabPrefix = true);
306 
307  /// \brief Add explicit comment T. T is required to be a valid
308  /// comment in the output and does not need to be escaped.
309  virtual void addExplicitComment(const Twine &T);
310 
311  /// \brief Emit added explicit comments.
312  virtual void emitExplicitComments();
313 
314  /// AddBlankLine - Emit a blank line to a .s file to pretty it up.
315  virtual void AddBlankLine() {}
316 
317  /// @}
318 
319  /// \name Symbol & Section Management
320  /// @{
321 
322  /// \brief Return the current section that the streamer is emitting code to.
324  if (!SectionStack.empty())
325  return SectionStack.back().first;
326  return MCSectionSubPair();
327  }
328  MCSection *getCurrentSectionOnly() const { return getCurrentSection().first; }
329 
330  /// \brief Return the previous section that the streamer is emitting code to.
332  if (!SectionStack.empty())
333  return SectionStack.back().second;
334  return MCSectionSubPair();
335  }
336 
337  /// \brief Returns an index to represent the order a symbol was emitted in.
338  /// (zero if we did not emit that symbol)
339  unsigned GetSymbolOrder(const MCSymbol *Sym) const {
340  return SymbolOrdering.lookup(Sym);
341  }
342 
343  /// \brief Update streamer for a new active section.
344  ///
345  /// This is called by PopSection and SwitchSection, if the current
346  /// section changes.
347  virtual void ChangeSection(MCSection *, const MCExpr *);
348 
349  /// \brief Save the current and previous section on the section stack.
350  void PushSection() {
351  SectionStack.push_back(
352  std::make_pair(getCurrentSection(), getPreviousSection()));
353  }
354 
355  /// \brief Restore the current and previous section from the section stack.
356  /// Calls ChangeSection as needed.
357  ///
358  /// Returns false if the stack was empty.
359  bool PopSection() {
360  if (SectionStack.size() <= 1)
361  return false;
362  auto I = SectionStack.end();
363  --I;
364  MCSectionSubPair OldSection = I->first;
365  --I;
366  MCSectionSubPair NewSection = I->first;
367 
368  if (OldSection != NewSection)
369  ChangeSection(NewSection.first, NewSection.second);
370  SectionStack.pop_back();
371  return true;
372  }
373 
374  bool SubSection(const MCExpr *Subsection) {
375  if (SectionStack.empty())
376  return false;
377 
378  SwitchSection(SectionStack.back().first.first, Subsection);
379  return true;
380  }
381 
382  /// Set the current section where code is being emitted to \p Section. This
383  /// is required to update CurSection.
384  ///
385  /// This corresponds to assembler directives like .section, .text, etc.
386  virtual void SwitchSection(MCSection *Section,
387  const MCExpr *Subsection = nullptr);
388 
389  /// \brief Set the current section where code is being emitted to \p Section.
390  /// This is required to update CurSection. This version does not call
391  /// ChangeSection.
393  const MCExpr *Subsection = nullptr) {
394  assert(Section && "Cannot switch to a null section!");
395  MCSectionSubPair curSection = SectionStack.back().first;
396  SectionStack.back().second = curSection;
397  if (MCSectionSubPair(Section, Subsection) != curSection)
398  SectionStack.back().first = MCSectionSubPair(Section, Subsection);
399  }
400 
401  /// \brief Create the default sections and set the initial one.
402  virtual void InitSections(bool NoExecStack);
403 
404  MCSymbol *endSection(MCSection *Section);
405 
406  /// \brief Sets the symbol's section.
407  ///
408  /// Each emitted symbol will be tracked in the ordering table,
409  /// so we can sort on them later.
410  void AssignFragment(MCSymbol *Symbol, MCFragment *Fragment);
411 
412  /// \brief Emit a label for \p Symbol into the current section.
413  ///
414  /// This corresponds to an assembler statement such as:
415  /// foo:
416  ///
417  /// \param Symbol - The symbol to emit. A given symbol should only be
418  /// emitted as a label once, and symbols emitted as a label should never be
419  /// used in an assignment.
420  // FIXME: These emission are non-const because we mutate the symbol to
421  // add the section we're emitting it to later.
422  virtual void EmitLabel(MCSymbol *Symbol, SMLoc Loc = SMLoc());
423 
424  virtual void EmitEHSymAttributes(const MCSymbol *Symbol, MCSymbol *EHSymbol);
425 
426  /// \brief Note in the output the specified \p Flag.
427  virtual void EmitAssemblerFlag(MCAssemblerFlag Flag);
428 
429  /// \brief Emit the given list \p Options of strings as linker
430  /// options into the output.
432 
433  /// \brief Note in the output the specified region \p Kind.
435 
436  /// \brief Specify the Mach-O minimum deployment target version.
437  virtual void EmitVersionMin(MCVersionMinType Type, unsigned Major,
438  unsigned Minor, unsigned Update) {}
439 
440  /// Emit/Specify Mach-O build version command.
441  /// \p Platform should be one of MachO::PlatformType.
442  virtual void EmitBuildVersion(unsigned Platform, unsigned Major,
443  unsigned Minor, unsigned Update) {}
444 
445  void EmitVersionForTarget(const Triple &Target);
446 
447  /// \brief Note in the output that the specified \p Func is a Thumb mode
448  /// function (ARM target only).
449  virtual void EmitThumbFunc(MCSymbol *Func);
450 
451  /// \brief Emit an assignment of \p Value to \p Symbol.
452  ///
453  /// This corresponds to an assembler statement such as:
454  /// symbol = value
455  ///
456  /// The assignment generates no code, but has the side effect of binding the
457  /// value in the current context. For the assembly streamer, this prints the
458  /// binding into the .s file.
459  ///
460  /// \param Symbol - The symbol being assigned to.
461  /// \param Value - The value for the symbol.
462  virtual void EmitAssignment(MCSymbol *Symbol, const MCExpr *Value);
463 
464  /// \brief Emit an weak reference from \p Alias to \p Symbol.
465  ///
466  /// This corresponds to an assembler statement such as:
467  /// .weakref alias, symbol
468  ///
469  /// \param Alias - The alias that is being created.
470  /// \param Symbol - The symbol being aliased.
471  virtual void EmitWeakReference(MCSymbol *Alias, const MCSymbol *Symbol);
472 
473  /// \brief Add the given \p Attribute to \p Symbol.
474  virtual bool EmitSymbolAttribute(MCSymbol *Symbol,
475  MCSymbolAttr Attribute) = 0;
476 
477  /// \brief Set the \p DescValue for the \p Symbol.
478  ///
479  /// \param Symbol - The symbol to have its n_desc field set.
480  /// \param DescValue - The value to set into the n_desc field.
481  virtual void EmitSymbolDesc(MCSymbol *Symbol, unsigned DescValue);
482 
483  /// \brief Start emitting COFF symbol definition
484  ///
485  /// \param Symbol - The symbol to have its External & Type fields set.
486  virtual void BeginCOFFSymbolDef(const MCSymbol *Symbol);
487 
488  /// \brief Emit the storage class of the symbol.
489  ///
490  /// \param StorageClass - The storage class the symbol should have.
491  virtual void EmitCOFFSymbolStorageClass(int StorageClass);
492 
493  /// \brief Emit the type of the symbol.
494  ///
495  /// \param Type - A COFF type identifier (see COFF::SymbolType in X86COFF.h)
496  virtual void EmitCOFFSymbolType(int Type);
497 
498  /// \brief Marks the end of the symbol definition.
499  virtual void EndCOFFSymbolDef();
500 
501  virtual void EmitCOFFSafeSEH(MCSymbol const *Symbol);
502 
503  /// \brief Emits the symbol table index of a Symbol into the current section.
504  virtual void EmitCOFFSymbolIndex(MCSymbol const *Symbol);
505 
506  /// \brief Emits a COFF section index.
507  ///
508  /// \param Symbol - Symbol the section number relocation should point to.
509  virtual void EmitCOFFSectionIndex(MCSymbol const *Symbol);
510 
511  /// \brief Emits a COFF section relative relocation.
512  ///
513  /// \param Symbol - Symbol the section relative relocation should point to.
514  virtual void EmitCOFFSecRel32(MCSymbol const *Symbol, uint64_t Offset);
515 
516  /// \brief Emit an ELF .size directive.
517  ///
518  /// This corresponds to an assembler statement such as:
519  /// .size symbol, expression
520  virtual void emitELFSize(MCSymbol *Symbol, const MCExpr *Value);
521 
522  /// \brief Emit an ELF .symver directive.
523  ///
524  /// This corresponds to an assembler statement such as:
525  /// .symver _start, foo@@SOME_VERSION
526  /// \param Alias - The versioned alias (i.e. "foo@@SOME_VERSION")
527  /// \param Aliasee - The aliased symbol (i.e. "_start")
528  virtual void emitELFSymverDirective(MCSymbol *Alias, const MCSymbol *Aliasee);
529 
530  /// \brief Emit a Linker Optimization Hint (LOH) directive.
531  /// \param Args - Arguments of the LOH.
532  virtual void EmitLOHDirective(MCLOHType Kind, const MCLOHArgs &Args) {}
533 
534  /// \brief Emit a common symbol.
535  ///
536  /// \param Symbol - The common symbol to emit.
537  /// \param Size - The size of the common symbol.
538  /// \param ByteAlignment - The alignment of the symbol if
539  /// non-zero. This must be a power of 2.
540  virtual void EmitCommonSymbol(MCSymbol *Symbol, uint64_t Size,
541  unsigned ByteAlignment) = 0;
542 
543  /// \brief Emit a local common (.lcomm) symbol.
544  ///
545  /// \param Symbol - The common symbol to emit.
546  /// \param Size - The size of the common symbol.
547  /// \param ByteAlignment - The alignment of the common symbol in bytes.
548  virtual void EmitLocalCommonSymbol(MCSymbol *Symbol, uint64_t Size,
549  unsigned ByteAlignment);
550 
551  /// \brief Emit the zerofill section and an optional symbol.
552  ///
553  /// \param Section - The zerofill section to create and or to put the symbol
554  /// \param Symbol - The zerofill symbol to emit, if non-NULL.
555  /// \param Size - The size of the zerofill symbol.
556  /// \param ByteAlignment - The alignment of the zerofill symbol if
557  /// non-zero. This must be a power of 2 on some targets.
558  virtual void EmitZerofill(MCSection *Section, MCSymbol *Symbol = nullptr,
559  uint64_t Size = 0, unsigned ByteAlignment = 0) = 0;
560 
561  /// \brief Emit a thread local bss (.tbss) symbol.
562  ///
563  /// \param Section - The thread local common section.
564  /// \param Symbol - The thread local common symbol to emit.
565  /// \param Size - The size of the symbol.
566  /// \param ByteAlignment - The alignment of the thread local common symbol
567  /// if non-zero. This must be a power of 2 on some targets.
568  virtual void EmitTBSSSymbol(MCSection *Section, MCSymbol *Symbol,
569  uint64_t Size, unsigned ByteAlignment = 0);
570 
571  /// @}
572  /// \name Generating Data
573  /// @{
574 
575  /// \brief Emit the bytes in \p Data into the output.
576  ///
577  /// This is used to implement assembler directives such as .byte, .ascii,
578  /// etc.
579  virtual void EmitBytes(StringRef Data);
580 
581  /// Functionally identical to EmitBytes. When emitting textual assembly, this
582  /// method uses .byte directives instead of .ascii or .asciz for readability.
583  virtual void EmitBinaryData(StringRef Data);
584 
585  /// \brief Emit the expression \p Value into the output as a native
586  /// integer of the given \p Size bytes.
587  ///
588  /// This is used to implement assembler directives such as .word, .quad,
589  /// etc.
590  ///
591  /// \param Value - The value to emit.
592  /// \param Size - The size of the integer (in bytes) to emit. This must
593  /// match a native machine width.
594  /// \param Loc - The location of the expression for error reporting.
595  virtual void EmitValueImpl(const MCExpr *Value, unsigned Size,
596  SMLoc Loc = SMLoc());
597 
598  void EmitValue(const MCExpr *Value, unsigned Size, SMLoc Loc = SMLoc());
599 
600  /// \brief Special case of EmitValue that avoids the client having
601  /// to pass in a MCExpr for constant integers.
602  virtual void EmitIntValue(uint64_t Value, unsigned Size);
603 
604  virtual void EmitULEB128Value(const MCExpr *Value);
605 
606  virtual void EmitSLEB128Value(const MCExpr *Value);
607 
608  /// \brief Special case of EmitULEB128Value that avoids the client having to
609  /// pass in a MCExpr for constant integers.
610  void EmitULEB128IntValue(uint64_t Value);
611 
612  /// \brief Special case of EmitSLEB128Value that avoids the client having to
613  /// pass in a MCExpr for constant integers.
614  void EmitSLEB128IntValue(int64_t Value);
615 
616  /// \brief Special case of EmitValue that avoids the client having to pass in
617  /// a MCExpr for MCSymbols.
618  void EmitSymbolValue(const MCSymbol *Sym, unsigned Size,
619  bool IsSectionRelative = false);
620 
621  /// \brief Emit the expression \p Value into the output as a dtprel
622  /// (64-bit DTP relative) value.
623  ///
624  /// This is used to implement assembler directives such as .dtpreldword on
625  /// targets that support them.
626  virtual void EmitDTPRel64Value(const MCExpr *Value);
627 
628  /// \brief Emit the expression \p Value into the output as a dtprel
629  /// (32-bit DTP relative) value.
630  ///
631  /// This is used to implement assembler directives such as .dtprelword on
632  /// targets that support them.
633  virtual void EmitDTPRel32Value(const MCExpr *Value);
634 
635  /// \brief Emit the expression \p Value into the output as a tprel
636  /// (64-bit TP relative) value.
637  ///
638  /// This is used to implement assembler directives such as .tpreldword on
639  /// targets that support them.
640  virtual void EmitTPRel64Value(const MCExpr *Value);
641 
642  /// \brief Emit the expression \p Value into the output as a tprel
643  /// (32-bit TP relative) value.
644  ///
645  /// This is used to implement assembler directives such as .tprelword on
646  /// targets that support them.
647  virtual void EmitTPRel32Value(const MCExpr *Value);
648 
649  /// \brief Emit the expression \p Value into the output as a gprel64 (64-bit
650  /// GP relative) value.
651  ///
652  /// This is used to implement assembler directives such as .gpdword on
653  /// targets that support them.
654  virtual void EmitGPRel64Value(const MCExpr *Value);
655 
656  /// \brief Emit the expression \p Value into the output as a gprel32 (32-bit
657  /// GP relative) value.
658  ///
659  /// This is used to implement assembler directives such as .gprel32 on
660  /// targets that support them.
661  virtual void EmitGPRel32Value(const MCExpr *Value);
662 
663  /// \brief Emit NumBytes bytes worth of the value specified by FillValue.
664  /// This implements directives such as '.space'.
665  void emitFill(uint64_t NumBytes, uint8_t FillValue);
666 
667  /// \brief Emit \p Size bytes worth of the value specified by \p FillValue.
668  ///
669  /// This is used to implement assembler directives such as .space or .skip.
670  ///
671  /// \param NumBytes - The number of bytes to emit.
672  /// \param FillValue - The value to use when filling bytes.
673  /// \param Loc - The location of the expression for error reporting.
674  virtual void emitFill(const MCExpr &NumBytes, uint64_t FillValue,
675  SMLoc Loc = SMLoc());
676 
677  /// \brief Emit \p NumValues copies of \p Size bytes. Each \p Size bytes is
678  /// taken from the lowest order 4 bytes of \p Expr expression.
679  ///
680  /// This is used to implement assembler directives such as .fill.
681  ///
682  /// \param NumValues - The number of copies of \p Size bytes to emit.
683  /// \param Size - The size (in bytes) of each repeated value.
684  /// \param Expr - The expression from which \p Size bytes are used.
685  virtual void emitFill(const MCExpr &NumValues, int64_t Size, int64_t Expr,
686  SMLoc Loc = SMLoc());
687 
688  /// \brief Emit NumBytes worth of zeros.
689  /// This function properly handles data in virtual sections.
690  void EmitZeros(uint64_t NumBytes);
691 
692  /// \brief Emit some number of copies of \p Value until the byte alignment \p
693  /// ByteAlignment is reached.
694  ///
695  /// If the number of bytes need to emit for the alignment is not a multiple
696  /// of \p ValueSize, then the contents of the emitted fill bytes is
697  /// undefined.
698  ///
699  /// This used to implement the .align assembler directive.
700  ///
701  /// \param ByteAlignment - The alignment to reach. This must be a power of
702  /// two on some targets.
703  /// \param Value - The value to use when filling bytes.
704  /// \param ValueSize - The size of the integer (in bytes) to emit for
705  /// \p Value. This must match a native machine width.
706  /// \param MaxBytesToEmit - The maximum numbers of bytes to emit, or 0. If
707  /// the alignment cannot be reached in this many bytes, no bytes are
708  /// emitted.
709  virtual void EmitValueToAlignment(unsigned ByteAlignment, int64_t Value = 0,
710  unsigned ValueSize = 1,
711  unsigned MaxBytesToEmit = 0);
712 
713  /// \brief Emit nops until the byte alignment \p ByteAlignment is reached.
714  ///
715  /// This used to align code where the alignment bytes may be executed. This
716  /// can emit different bytes for different sizes to optimize execution.
717  ///
718  /// \param ByteAlignment - The alignment to reach. This must be a power of
719  /// two on some targets.
720  /// \param MaxBytesToEmit - The maximum numbers of bytes to emit, or 0. If
721  /// the alignment cannot be reached in this many bytes, no bytes are
722  /// emitted.
723  virtual void EmitCodeAlignment(unsigned ByteAlignment,
724  unsigned MaxBytesToEmit = 0);
725 
726  /// \brief Emit some number of copies of \p Value until the byte offset \p
727  /// Offset is reached.
728  ///
729  /// This is used to implement assembler directives such as .org.
730  ///
731  /// \param Offset - The offset to reach. This may be an expression, but the
732  /// expression must be associated with the current section.
733  /// \param Value - The value to use when filling bytes.
734  virtual void emitValueToOffset(const MCExpr *Offset, unsigned char Value,
735  SMLoc Loc);
736 
737  virtual void
739 
740  virtual void
742 
743  /// @}
744 
745  /// \brief Switch to a new logical file. This is used to implement the '.file
746  /// "foo.c"' assembler directive.
747  virtual void EmitFileDirective(StringRef Filename);
748 
749  /// \brief Emit the "identifiers" directive. This implements the
750  /// '.ident "version foo"' assembler directive.
751  virtual void EmitIdent(StringRef IdentString) {}
752 
753  /// \brief Associate a filename with a specified logical file number. This
754  /// implements the DWARF2 '.file 4 "foo.c"' assembler directive.
755  virtual unsigned EmitDwarfFileDirective(unsigned FileNo, StringRef Directory,
756  StringRef Filename,
757  MD5::MD5Result *Checksum = nullptr,
758  unsigned CUID = 0);
759 
760  /// \brief This implements the DWARF2 '.loc fileno lineno ...' assembler
761  /// directive.
762  virtual void EmitDwarfLocDirective(unsigned FileNo, unsigned Line,
763  unsigned Column, unsigned Flags,
764  unsigned Isa, unsigned Discriminator,
765  StringRef FileName);
766 
767  /// Associate a filename with a specified logical file number, and also
768  /// specify that file's checksum information. This implements the '.cv_file 4
769  /// "foo.c"' assembler directive. Returns true on success.
770  virtual bool EmitCVFileDirective(unsigned FileNo, StringRef Filename,
771  ArrayRef<uint8_t> Checksum,
772  unsigned ChecksumKind);
773 
774  /// \brief Introduces a function id for use with .cv_loc.
775  virtual bool EmitCVFuncIdDirective(unsigned FunctionId);
776 
777  /// \brief Introduces an inline call site id for use with .cv_loc. Includes
778  /// extra information for inline line table generation.
779  virtual bool EmitCVInlineSiteIdDirective(unsigned FunctionId, unsigned IAFunc,
780  unsigned IAFile, unsigned IALine,
781  unsigned IACol, SMLoc Loc);
782 
783  /// \brief This implements the CodeView '.cv_loc' assembler directive.
784  virtual void EmitCVLocDirective(unsigned FunctionId, unsigned FileNo,
785  unsigned Line, unsigned Column,
786  bool PrologueEnd, bool IsStmt,
787  StringRef FileName, SMLoc Loc);
788 
789  /// \brief This implements the CodeView '.cv_linetable' assembler directive.
790  virtual void EmitCVLinetableDirective(unsigned FunctionId,
791  const MCSymbol *FnStart,
792  const MCSymbol *FnEnd);
793 
794  /// \brief This implements the CodeView '.cv_inline_linetable' assembler
795  /// directive.
796  virtual void EmitCVInlineLinetableDirective(unsigned PrimaryFunctionId,
797  unsigned SourceFileId,
798  unsigned SourceLineNum,
799  const MCSymbol *FnStartSym,
800  const MCSymbol *FnEndSym);
801 
802  /// \brief This implements the CodeView '.cv_def_range' assembler
803  /// directive.
804  virtual void EmitCVDefRangeDirective(
805  ArrayRef<std::pair<const MCSymbol *, const MCSymbol *>> Ranges,
806  StringRef FixedSizePortion);
807 
808  /// \brief This implements the CodeView '.cv_stringtable' assembler directive.
809  virtual void EmitCVStringTableDirective() {}
810 
811  /// \brief This implements the CodeView '.cv_filechecksums' assembler directive.
813 
814  /// This implements the CodeView '.cv_filechecksumoffset' assembler
815  /// directive.
816  virtual void EmitCVFileChecksumOffsetDirective(unsigned FileNo) {}
817 
818  /// This implements the CodeView '.cv_fpo_data' assembler directive.
819  virtual void EmitCVFPOData(const MCSymbol *ProcSym, SMLoc Loc = {}) {}
820 
821  /// Emit the absolute difference between two symbols.
822  ///
823  /// \pre Offset of \c Hi is greater than the offset \c Lo.
824  virtual void emitAbsoluteSymbolDiff(const MCSymbol *Hi, const MCSymbol *Lo,
825  unsigned Size);
826 
827  /// Emit the absolute difference between two symbols encoded with ULEB128.
828  virtual void emitAbsoluteSymbolDiffAsULEB128(const MCSymbol *Hi,
829  const MCSymbol *Lo);
830 
831  virtual MCSymbol *getDwarfLineTableSymbol(unsigned CUID);
832  virtual void EmitCFISections(bool EH, bool Debug);
833  void EmitCFIStartProc(bool IsSimple);
834  void EmitCFIEndProc();
835  virtual void EmitCFIDefCfa(int64_t Register, int64_t Offset);
836  virtual void EmitCFIDefCfaOffset(int64_t Offset);
837  virtual void EmitCFIDefCfaRegister(int64_t Register);
838  virtual void EmitCFIOffset(int64_t Register, int64_t Offset);
839  virtual void EmitCFIPersonality(const MCSymbol *Sym, unsigned Encoding);
840  virtual void EmitCFILsda(const MCSymbol *Sym, unsigned Encoding);
841  virtual void EmitCFIRememberState();
842  virtual void EmitCFIRestoreState();
843  virtual void EmitCFISameValue(int64_t Register);
844  virtual void EmitCFIRestore(int64_t Register);
845  virtual void EmitCFIRelOffset(int64_t Register, int64_t Offset);
846  virtual void EmitCFIAdjustCfaOffset(int64_t Adjustment);
847  virtual void EmitCFIEscape(StringRef Values);
848  virtual void EmitCFIReturnColumn(int64_t Register);
849  virtual void EmitCFIGnuArgsSize(int64_t Size);
850  virtual void EmitCFISignalFrame();
851  virtual void EmitCFIUndefined(int64_t Register);
852  virtual void EmitCFIRegister(int64_t Register1, int64_t Register2);
853  virtual void EmitCFIWindowSave();
854 
855  virtual void EmitWinCFIStartProc(const MCSymbol *Symbol, SMLoc Loc = SMLoc());
856  virtual void EmitWinCFIEndProc(SMLoc Loc = SMLoc());
857  virtual void EmitWinCFIStartChained(SMLoc Loc = SMLoc());
858  virtual void EmitWinCFIEndChained(SMLoc Loc = SMLoc());
859  virtual void EmitWinCFIPushReg(unsigned Register, SMLoc Loc = SMLoc());
860  virtual void EmitWinCFISetFrame(unsigned Register, unsigned Offset,
861  SMLoc Loc = SMLoc());
862  virtual void EmitWinCFIAllocStack(unsigned Size, SMLoc Loc = SMLoc());
863  virtual void EmitWinCFISaveReg(unsigned Register, unsigned Offset,
864  SMLoc Loc = SMLoc());
865  virtual void EmitWinCFISaveXMM(unsigned Register, unsigned Offset,
866  SMLoc Loc = SMLoc());
867  virtual void EmitWinCFIPushFrame(bool Code, SMLoc Loc = SMLoc());
868  virtual void EmitWinCFIEndProlog(SMLoc Loc = SMLoc());
869  virtual void EmitWinEHHandler(const MCSymbol *Sym, bool Unwind, bool Except,
870  SMLoc Loc = SMLoc());
871  virtual void EmitWinEHHandlerData(SMLoc Loc = SMLoc());
872 
873  /// Get the .pdata section used for the given section. Typically the given
874  /// section is either the main .text section or some other COMDAT .text
875  /// section, but it may be any section containing code.
876  MCSection *getAssociatedPDataSection(const MCSection *TextSec);
877 
878  /// Get the .xdata section used for the given section.
879  MCSection *getAssociatedXDataSection(const MCSection *TextSec);
880 
881  virtual void EmitSyntaxDirective();
882 
883  /// \brief Emit a .reloc directive.
884  /// Returns true if the relocation could not be emitted because Name is not
885  /// known.
886  virtual bool EmitRelocDirective(const MCExpr &Offset, StringRef Name,
887  const MCExpr *Expr, SMLoc Loc) {
888  return true;
889  }
890 
891  /// \brief Emit the given \p Instruction into the current section.
892  /// PrintSchedInfo == true then schedul comment should be added to output
893  virtual void EmitInstruction(const MCInst &Inst, const MCSubtargetInfo &STI,
894  bool PrintSchedInfo = false);
895 
896  /// \brief Set the bundle alignment mode from now on in the section.
897  /// The argument is the power of 2 to which the alignment is set. The
898  /// value 0 means turn the bundle alignment off.
899  virtual void EmitBundleAlignMode(unsigned AlignPow2);
900 
901  /// \brief The following instructions are a bundle-locked group.
902  ///
903  /// \param AlignToEnd - If true, the bundle-locked group will be aligned to
904  /// the end of a bundle.
905  virtual void EmitBundleLock(bool AlignToEnd);
906 
907  /// \brief Ends a bundle-locked group.
908  virtual void EmitBundleUnlock();
909 
910  /// \brief If this file is backed by a assembly streamer, this dumps the
911  /// specified string in the output .s file. This capability is indicated by
912  /// the hasRawTextSupport() predicate. By default this aborts.
913  void EmitRawText(const Twine &String);
914 
915  /// \brief Streamer specific finalization.
916  virtual void FinishImpl();
917  /// \brief Finish emission of machine code.
918  void Finish();
919 
920  virtual bool mayHaveInstructions(MCSection &Sec) const { return true; }
921 };
922 
923 /// Create a dummy machine code streamer, which does nothing. This is useful for
924 /// timing the assembler front end.
926 
927 /// Create a machine code streamer which will print out assembly for the native
928 /// target, suitable for compiling with a native assembler.
929 ///
930 /// \param InstPrint - If given, the instruction printer to use. If not given
931 /// the MCInst representation will be printed. This method takes ownership of
932 /// InstPrint.
933 ///
934 /// \param CE - If given, a code emitter to use to show the instruction
935 /// encoding inline with the assembly. This method takes ownership of \p CE.
936 ///
937 /// \param TAB - If given, a target asm backend to use to show the fixup
938 /// information in conjunction with encoding information. This method takes
939 /// ownership of \p TAB.
940 ///
941 /// \param ShowInst - Whether to show the MCInst representation inline with
942 /// the assembly.
944  std::unique_ptr<formatted_raw_ostream> OS,
945  bool isVerboseAsm, bool useDwarfDirectory,
946  MCInstPrinter *InstPrint, MCCodeEmitter *CE,
947  MCAsmBackend *TAB, bool ShowInst);
948 
949 } // end namespace llvm
950 
951 #endif // LLVM_MC_MCSTREAMER_H
Instances of this class represent a uniqued identifier for a section in the current translation unit...
Definition: MCSection.h:39
unsigned GetSymbolOrder(const MCSymbol *Sym) const
Returns an index to represent the order a symbol was emitted in.
Definition: MCStreamer.h:339
virtual void EmitCVStringTableDirective()
This implements the CodeView &#39;.cv_stringtable&#39; assembler directive.
Definition: MCStreamer.h:809
LLVMContext & Context
Compute iterated dominance frontiers using a linear time algorithm.
Definition: AllocatorList.h:24
MCSymbol - Instances of this class represent a symbol name in the MC file, and MCSymbols are created ...
Definition: MCSymbol.h:42
LLVM_ATTRIBUTE_ALWAYS_INLINE size_type size() const
Definition: SmallVector.h:136
virtual void AddBlankLine()
AddBlankLine - Emit a blank line to a .s file to pretty it up.
Definition: MCStreamer.h:315
void SwitchSectionNoChange(MCSection *Section, const MCExpr *Subsection=nullptr)
Set the current section where code is being emitted to Section.
Definition: MCStreamer.h:392
Target specific streamer interface.
Definition: MCStreamer.h:81
MCStreamer * createNullStreamer(MCContext &Ctx)
Create a dummy machine code streamer, which does nothing.
void PushSection()
Save the current and previous section on the section stack.
Definition: MCStreamer.h:350
virtual void EmitCVFPOData(const MCSymbol *ProcSym, SMLoc Loc={})
This implements the CodeView &#39;.cv_fpo_data&#39; assembler directive.
Definition: MCStreamer.h:819
virtual void emitValue(const MCExpr *Value)
Definition: MCStreamer.cpp:66
MCDataRegionType
Definition: MCDirectives.h:56
COFF::SymbolStorageClass StorageClass
Definition: COFFYAML.cpp:354
MCContext & getContext() const
Definition: MCStreamer.h:246
Twine - A lightweight data structure for efficiently representing the concatenation of temporary valu...
Definition: Twine.h:81
Base class for the full range of assembler expressions which are needed for parsing.
Definition: MCExpr.h:36
Reg
All possible values of the reg field in the ModR/M byte.
Represent a reference to a symbol from inside an expression.
Definition: MCExpr.h:165
virtual void emitLabel(MCSymbol *Symbol)
Definition: MCStreamer.cpp:48
unsigned getNumWinFrameInfos()
Definition: MCStreamer.h:259
ArrayRef< std::unique_ptr< WinEH::FrameInfo > > getWinFrameInfos() const
Definition: MCStreamer.h:260
Context object for machine code objects.
Definition: MCContext.h:61
MCSectionSubPair getPreviousSection() const
Return the previous section that the streamer is emitting code to.
Definition: MCStreamer.h:331
virtual void AddComment(const Twine &T, bool EOL=true)
Add a textual comment.
Definition: MCStreamer.h:294
virtual void EmitCVFileChecksumsDirective()
This implements the CodeView &#39;.cv_filechecksums&#39; assembler directive.
Definition: MCStreamer.h:812
virtual void finish()
Definition: MCStreamer.cpp:50
ArrayRef - Represent a constant reference to an array (0 or more elements consecutively in memory)...
Definition: APInt.h:33
Instances of this class represent a single low-level machine instruction.
Definition: MCInst.h:159
virtual bool hasRawTextSupport() const
Return true if this asm streamer supports emitting unformatted text to the .s file with EmitRawText...
Definition: MCStreamer.h:275
Flag
These should be considered private to the implementation of the MCInstrDesc class.
Definition: MCInstrDesc.h:121
Streaming machine code generation interface.
Definition: MCStreamer.h:181
WinEH::FrameInfo * getCurrentWinFrameInfo()
Definition: MCStreamer.h:222
MCTargetStreamer * getTargetStreamer()
Definition: MCStreamer.h:248
The instances of the Type class are immutable: once they are created, they are never changed...
Definition: Type.h:46
MCStreamer * createAsmStreamer(MCContext &Ctx, std::unique_ptr< formatted_raw_ostream > OS, bool isVerboseAsm, bool useDwarfDirectory, MCInstPrinter *InstPrint, MCCodeEmitter *CE, MCAsmBackend *TAB, bool ShowInst)
Create a machine code streamer which will print out assembly for the native target, suitable for compiling with a native assembler.
MCCodeEmitter - Generic instruction encoding interface.
Definition: MCCodeEmitter.h:22
virtual void EmitCodePaddingBasicBlockStart(const MCCodePaddingContext &Context)
Definition: MCStreamer.h:738
MCLOHType
Linker Optimization Hint Type.
virtual bool mayHaveInstructions(MCSection &Sec) const
Definition: MCStreamer.h:920
virtual void EmitIdent(StringRef IdentString)
Emit the "identifiers" directive.
Definition: MCStreamer.h:751
bool SubSection(const MCExpr *Subsection)
Definition: MCStreamer.h:374
virtual void EmitDataRegion(MCDataRegionType Kind)
Note in the output the specified region Kind.
Definition: MCStreamer.h:434
Triple - Helper class for working with autoconf configuration names.
Definition: Triple.h:44
MCSectionSubPair getCurrentSection() const
Return the current section that the streamer is emitting code to.
Definition: MCStreamer.h:323
MCStreamer & getStreamer()
Definition: MCStreamer.h:89
std::pair< MCSection *, const MCExpr * > MCSectionSubPair
Definition: MCStreamer.h:54
virtual void EmitLOHDirective(MCLOHType Kind, const MCLOHArgs &Args)
Emit a Linker Optimization Hint (LOH) directive.
Definition: MCStreamer.h:532
This is a &#39;vector&#39; (really, a variable-sized array), optimized for the case when the array is small...
Definition: SmallVector.h:862
bool isVector(MCInstrInfo const &MCII, MCInst const &MCI)
MCStreamer & Streamer
Definition: MCStreamer.h:83
Promote Memory to Register
Definition: Mem2Reg.cpp:110
virtual void prettyPrintAsm(MCInstPrinter &InstPrinter, raw_ostream &OS, const MCInst &Inst, const MCSubtargetInfo &STI)
Definition: MCStreamer.cpp:841
virtual void EmitBuildVersion(unsigned Platform, unsigned Major, unsigned Minor, unsigned Update)
Emit/Specify Mach-O build version command.
Definition: MCStreamer.h:442
MCSymbolAttr
Definition: MCDirectives.h:19
virtual void changeSection(const MCSection *CurSection, MCSection *Section, const MCExpr *SubSection, raw_ostream &OS)
Update streamer for a new active section.
Definition: MCStreamer.cpp:52
Target - Wrapper for Target specific information.
MCSection * getCurrentSectionOnly() const
Definition: MCStreamer.h:328
MCTargetStreamer(MCStreamer &S)
Definition: MCStreamer.cpp:41
virtual void EmitCVFileChecksumOffsetDirective(unsigned FileNo)
This implements the CodeView &#39;.cv_filechecksumoffset&#39; assembler directive.
Definition: MCStreamer.h:816
LLVM_ATTRIBUTE_ALWAYS_INLINE iterator end()
Definition: SmallVector.h:120
This is an instance of a target assembly language printer that converts an MCInst to valid target ass...
Definition: MCInstPrinter.h:41
unsigned getNumFrameInfos()
Definition: MCStreamer.h:252
virtual bool EmitRelocDirective(const MCExpr &Offset, StringRef Name, const MCExpr *Expr, SMLoc Loc)
Emit a .reloc directive.
Definition: MCStreamer.h:886
virtual void EmitLinkerOptions(ArrayRef< std::string > Kind)
Emit the given list Options of strings as linker options into the output.
Definition: MCStreamer.h:431
LLVM_NODISCARD bool empty() const
Definition: SmallVector.h:61
MCAssemblerFlag
Definition: MCDirectives.h:48
#define I(x, y, z)
Definition: MD5.cpp:58
virtual void EmitCodePaddingBasicBlockEnd(const MCCodePaddingContext &Context)
Definition: MCStreamer.h:741
MCSubtargetInfo - Generic base class for all target subtargets.
ValueT lookup(const_arg_type_t< KeyT > Val) const
lookup - Return the entry for the specified key, or a default constructed value if no such entry exis...
Definition: DenseMap.h:181
const unsigned Kind
assert(ImpDefSCC.getReg()==AMDGPU::SCC &&ImpDefSCC.isDef())
bool PopSection()
Restore the current and previous section from the section stack.
Definition: MCStreamer.h:359
MCVersionMinType
Definition: MCDirectives.h:64
LLVM Value Representation.
Definition: Value.h:73
Generic interface to target specific assembler backends.
Definition: MCAsmBackend.h:40
ArrayRef< MCDwarfFrameInfo > getDwarfFrameInfos() const
Definition: MCStreamer.h:253
constexpr char Size[]
Key for Kernel::Arg::Metadata::mSize.
static cl::opt< bool, true > Debug("debug", cl::desc("Enable debug output"), cl::Hidden, cl::location(DebugFlag))
This class implements an extremely fast bulk output stream that can only output to a stream...
Definition: raw_ostream.h:44
StringRef - Represent a constant reference to a string, i.e.
Definition: StringRef.h:49
virtual void EmitVersionMin(MCVersionMinType Type, unsigned Major, unsigned Minor, unsigned Update)
Specify the Mach-O minimum deployment target version.
Definition: MCStreamer.h:437
virtual void emitDwarfFileDirective(StringRef Directive)
Definition: MCStreamer.cpp:62
Represents a location in source code.
Definition: SMLoc.h:24
virtual bool isVerboseAsm() const
Return true if this streamer supports verbose assembly and if it is enabled.
Definition: MCStreamer.h:271
void setTargetStreamer(MCTargetStreamer *TS)
Definition: MCStreamer.h:238
virtual void emitAssignment(MCSymbol *Symbol, const MCExpr *Value)
Definition: MCStreamer.cpp:74
constexpr char Args[]
Key for Kernel::Metadata::mArgs.
virtual bool isIntegratedAssemblerRequired() const
Is the integrated assembler required for this streamer to function correctly?
Definition: MCStreamer.h:279