LLVM  3.7.0
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/SmallVector.h"
19 #include "llvm/MC/MCDirectives.h"
20 #include "llvm/MC/MCDwarf.h"
22 #include "llvm/MC/MCWinEH.h"
23 #include "llvm/Support/DataTypes.h"
24 #include "llvm/Support/SMLoc.h"
25 #include <string>
26 
27 namespace llvm {
28 class MCAsmBackend;
29 class MCCodeEmitter;
30 class MCContext;
31 class MCExpr;
32 class MCInst;
33 class MCInstPrinter;
34 class MCSection;
35 class MCStreamer;
36 class MCSymbol;
37 class MCSymbolELF;
38 class MCSymbolRefExpr;
39 class MCSubtargetInfo;
40 class StringRef;
41 class Twine;
42 class raw_ostream;
43 class formatted_raw_ostream;
45 
46 typedef std::pair<MCSection *, const MCExpr *> MCSectionSubPair;
47 
48 /// Target specific streamer interface. This is used so that targets can
49 /// implement support for target specific assembly directives.
50 ///
51 /// If target foo wants to use this, it should implement 3 classes:
52 /// * FooTargetStreamer : public MCTargetStreamer
53 /// * FooTargetAsmStreamer : public FooTargetStreamer
54 /// * FooTargetELFStreamer : public FooTargetStreamer
55 ///
56 /// FooTargetStreamer should have a pure virtual method for each directive. For
57 /// example, for a ".bar symbol_name" directive, it should have
58 /// virtual emitBar(const MCSymbol &Symbol) = 0;
59 ///
60 /// The FooTargetAsmStreamer and FooTargetELFStreamer classes implement the
61 /// method. The assembly streamer just prints ".bar symbol_name". The object
62 /// streamer does whatever is needed to implement .bar in the object file.
63 ///
64 /// In the assembly printer and parser the target streamer can be used by
65 /// calling getTargetStreamer and casting it to FooTargetStreamer:
66 ///
67 /// MCTargetStreamer &TS = OutStreamer.getTargetStreamer();
68 /// FooTargetStreamer &ATS = static_cast<FooTargetStreamer &>(TS);
69 ///
70 /// The base classes FooTargetAsmStreamer and FooTargetELFStreamer should
71 /// *never* be treated differently. Callers should always talk to a
72 /// FooTargetStreamer.
74 protected:
76 
77 public:
79  virtual ~MCTargetStreamer();
80 
82 
83  // Allow a target to add behavior to the EmitLabel of MCStreamer.
84  virtual void emitLabel(MCSymbol *Symbol);
85  // Allow a target to add behavior to the emitAssignment of MCStreamer.
86  virtual void emitAssignment(MCSymbol *Symbol, const MCExpr *Value);
87 
88  virtual void prettyPrintAsm(MCInstPrinter &InstPrinter, raw_ostream &OS,
89  const MCInst &Inst, const MCSubtargetInfo &STI);
90 
91  virtual void finish();
92 };
93 
94 // FIXME: declared here because it is used from
95 // lib/CodeGen/AsmPrinter/ARMException.cpp.
97 public:
99  ~ARMTargetStreamer() override;
100 
101  virtual void emitFnStart();
102  virtual void emitFnEnd();
103  virtual void emitCantUnwind();
104  virtual void emitPersonality(const MCSymbol *Personality);
105  virtual void emitPersonalityIndex(unsigned Index);
106  virtual void emitHandlerData();
107  virtual void emitSetFP(unsigned FpReg, unsigned SpReg,
108  int64_t Offset = 0);
109  virtual void emitMovSP(unsigned Reg, int64_t Offset = 0);
110  virtual void emitPad(int64_t Offset);
111  virtual void emitRegSave(const SmallVectorImpl<unsigned> &RegList,
112  bool isVector);
113  virtual void emitUnwindRaw(int64_t StackOffset,
114  const SmallVectorImpl<uint8_t> &Opcodes);
115 
116  virtual void switchVendor(StringRef Vendor);
117  virtual void emitAttribute(unsigned Attribute, unsigned Value);
118  virtual void emitTextAttribute(unsigned Attribute, StringRef String);
119  virtual void emitIntTextAttribute(unsigned Attribute, unsigned IntValue,
120  StringRef StringValue = "");
121  virtual void emitFPU(unsigned FPU);
122  virtual void emitArch(unsigned Arch);
123  virtual void emitArchExtension(unsigned ArchExt);
124  virtual void emitObjectArch(unsigned Arch);
125  virtual void finishAttributeSection();
126  virtual void emitInst(uint32_t Inst, char Suffix = '\0');
127 
128  virtual void AnnotateTLSDescriptorSequence(const MCSymbolRefExpr *SRE);
129 
130  virtual void emitThumbSet(MCSymbol *Symbol, const MCExpr *Value);
131 
132  void finish() override;
133 
134  /// Callback used to implement the ldr= pseudo.
135  /// Add a new entry to the constant pool for the current section and return an
136  /// MCExpr that can be used to refer to the constant pool location.
137  const MCExpr *addConstantPoolEntry(const MCExpr *);
138 
139  /// Callback used to implemnt the .ltorg directive.
140  /// Emit contents of constant pool for the current section.
142 
143 private:
144  std::unique_ptr<AssemblerConstantPools> ConstantPools;
145 };
146 
147 /// \brief Streaming machine code generation interface.
148 ///
149 /// This interface is intended to provide a programatic interface that is very
150 /// similar to the level that an assembler .s file provides. It has callbacks
151 /// to emit bytes, handle directives, etc. The implementation of this interface
152 /// retains state to know what the current section is etc.
153 ///
154 /// There are multiple implementations of this interface: one for writing out
155 /// a .s file, and implementations that write out .o files of various formats.
156 ///
157 class MCStreamer {
158  MCContext &Context;
159  std::unique_ptr<MCTargetStreamer> TargetStreamer;
160 
161  MCStreamer(const MCStreamer &) = delete;
162  MCStreamer &operator=(const MCStreamer &) = delete;
163 
164  std::vector<MCDwarfFrameInfo> DwarfFrameInfos;
165  MCDwarfFrameInfo *getCurrentDwarfFrameInfo();
166  void EnsureValidDwarfFrame();
167 
168  MCSymbol *EmitCFICommon();
169 
170  std::vector<WinEH::FrameInfo *> WinFrameInfos;
171  WinEH::FrameInfo *CurrentWinFrameInfo;
172  void EnsureValidWinFrameInfo();
173 
174  /// \brief Tracks an index to represent the order a symbol was emitted in.
175  /// Zero means we did not emit that symbol.
177 
178  /// \brief This is stack of current and previous section values saved by
179  /// PushSection.
181 
182 protected:
183  MCStreamer(MCContext &Ctx);
184 
185  virtual void EmitCFIStartProcImpl(MCDwarfFrameInfo &Frame);
186  virtual void EmitCFIEndProcImpl(MCDwarfFrameInfo &CurFrame);
187 
189  return CurrentWinFrameInfo;
190  }
191 
192  virtual void EmitWindowsUnwindTables();
193 
194  virtual void EmitRawTextImpl(StringRef String);
195 
196 public:
197  virtual ~MCStreamer();
198 
199  void visitUsedExpr(const MCExpr &Expr);
200  virtual void visitUsedSymbol(const MCSymbol &Sym);
201 
203  TargetStreamer.reset(TS);
204  }
205 
206  /// State management
207  ///
208  virtual void reset();
209 
210  MCContext &getContext() const { return Context; }
211 
213  return TargetStreamer.get();
214  }
215 
216  unsigned getNumFrameInfos() { return DwarfFrameInfos.size(); }
218  return DwarfFrameInfos;
219  }
220 
221  unsigned getNumWinFrameInfos() { return WinFrameInfos.size(); }
223  return WinFrameInfos;
224  }
225 
227 
228  /// \name Assembly File Formatting.
229  /// @{
230 
231  /// \brief Return true if this streamer supports verbose assembly and if it is
232  /// enabled.
233  virtual bool isVerboseAsm() const { return false; }
234 
235  /// \brief Return true if this asm streamer supports emitting unformatted text
236  /// to the .s file with EmitRawText.
237  virtual bool hasRawTextSupport() const { return false; }
238 
239  /// \brief Is the integrated assembler required for this streamer to function
240  /// correctly?
241  virtual bool isIntegratedAssemblerRequired() const { return false; }
242 
243  /// \brief Add a textual command.
244  ///
245  /// Typically for comments that can be emitted to the generated .s
246  /// file if applicable as a QoI issue to make the output of the compiler
247  /// more readable. This only affects the MCAsmStreamer, and only when
248  /// verbose assembly output is enabled.
249  ///
250  /// If the comment includes embedded \n's, they will each get the comment
251  /// prefix as appropriate. The added comment should not end with a \n.
252  virtual void AddComment(const Twine &T) {}
253 
254  /// \brief Return a raw_ostream that comments can be written to. Unlike
255  /// AddComment, you are required to terminate comments with \n if you use this
256  /// method.
257  virtual raw_ostream &GetCommentOS();
258 
259  /// \brief Print T and prefix it with the comment string (normally #) and
260  /// optionally a tab. This prints the comment immediately, not at the end of
261  /// the current line. It is basically a safe version of EmitRawText: since it
262  /// only prints comments, the object streamer ignores it instead of asserting.
263  virtual void emitRawComment(const Twine &T, bool TabPrefix = true);
264 
265  /// AddBlankLine - Emit a blank line to a .s file to pretty it up.
266  virtual void AddBlankLine() {}
267 
268  /// @}
269 
270  /// \name Symbol & Section Management
271  /// @{
272 
273  /// \brief Return the current section that the streamer is emitting code to.
275  if (!SectionStack.empty())
276  return SectionStack.back().first;
277  return MCSectionSubPair();
278  }
279  MCSection *getCurrentSectionOnly() const { return getCurrentSection().first; }
280 
281  /// \brief Return the previous section that the streamer is emitting code to.
283  if (!SectionStack.empty())
284  return SectionStack.back().second;
285  return MCSectionSubPair();
286  }
287 
288  /// \brief Returns an index to represent the order a symbol was emitted in.
289  /// (zero if we did not emit that symbol)
290  unsigned GetSymbolOrder(const MCSymbol *Sym) const {
291  return SymbolOrdering.lookup(Sym);
292  }
293 
294  /// \brief Update streamer for a new active section.
295  ///
296  /// This is called by PopSection and SwitchSection, if the current
297  /// section changes.
298  virtual void ChangeSection(MCSection *, const MCExpr *);
299 
300  /// \brief Save the current and previous section on the section stack.
301  void PushSection() {
302  SectionStack.push_back(
303  std::make_pair(getCurrentSection(), getPreviousSection()));
304  }
305 
306  /// \brief Restore the current and previous section from the section stack.
307  /// Calls ChangeSection as needed.
308  ///
309  /// Returns false if the stack was empty.
310  bool PopSection() {
311  if (SectionStack.size() <= 1)
312  return false;
313  auto I = SectionStack.end();
314  --I;
315  MCSectionSubPair OldSection = I->first;
316  --I;
317  MCSectionSubPair NewSection = I->first;
318 
319  if (OldSection != NewSection)
320  ChangeSection(NewSection.first, NewSection.second);
321  SectionStack.pop_back();
322  return true;
323  }
324 
325  bool SubSection(const MCExpr *Subsection) {
326  if (SectionStack.empty())
327  return false;
328 
329  SwitchSection(SectionStack.back().first.first, Subsection);
330  return true;
331  }
332 
333  /// Set the current section where code is being emitted to \p Section. This
334  /// is required to update CurSection.
335  ///
336  /// This corresponds to assembler directives like .section, .text, etc.
337  virtual void SwitchSection(MCSection *Section,
338  const MCExpr *Subsection = nullptr);
339 
340  /// \brief Set the current section where code is being emitted to \p Section.
341  /// This is required to update CurSection. This version does not call
342  /// ChangeSection.
344  const MCExpr *Subsection = nullptr) {
345  assert(Section && "Cannot switch to a null section!");
346  MCSectionSubPair curSection = SectionStack.back().first;
347  SectionStack.back().second = curSection;
348  if (MCSectionSubPair(Section, Subsection) != curSection)
349  SectionStack.back().first = MCSectionSubPair(Section, Subsection);
350  }
351 
352  /// \brief Create the default sections and set the initial one.
353  virtual void InitSections(bool NoExecStack);
354 
356 
357  /// \brief Sets the symbol's section.
358  ///
359  /// Each emitted symbol will be tracked in the ordering table,
360  /// so we can sort on them later.
362 
363  /// \brief Emit a label for \p Symbol into the current section.
364  ///
365  /// This corresponds to an assembler statement such as:
366  /// foo:
367  ///
368  /// \param Symbol - The symbol to emit. A given symbol should only be
369  /// emitted as a label once, and symbols emitted as a label should never be
370  /// used in an assignment.
371  // FIXME: These emission are non-const because we mutate the symbol to
372  // add the section we're emitting it to later.
373  virtual void EmitLabel(MCSymbol *Symbol);
374 
375  virtual void EmitEHSymAttributes(const MCSymbol *Symbol, MCSymbol *EHSymbol);
376 
377  /// \brief Note in the output the specified \p Flag.
378  virtual void EmitAssemblerFlag(MCAssemblerFlag Flag);
379 
380  /// \brief Emit the given list \p Options of strings as linker
381  /// options into the output.
383 
384  /// \brief Note in the output the specified region \p Kind.
386 
387  /// \brief Specify the MachO minimum deployment target version.
388  virtual void EmitVersionMin(MCVersionMinType, unsigned Major, unsigned Minor,
389  unsigned Update) {}
390 
391  /// \brief Note in the output that the specified \p Func is a Thumb mode
392  /// function (ARM target only).
393  virtual void EmitThumbFunc(MCSymbol *Func);
394 
395  /// \brief Emit an assignment of \p Value to \p Symbol.
396  ///
397  /// This corresponds to an assembler statement such as:
398  /// symbol = value
399  ///
400  /// The assignment generates no code, but has the side effect of binding the
401  /// value in the current context. For the assembly streamer, this prints the
402  /// binding into the .s file.
403  ///
404  /// \param Symbol - The symbol being assigned to.
405  /// \param Value - The value for the symbol.
406  virtual void EmitAssignment(MCSymbol *Symbol, const MCExpr *Value);
407 
408  /// \brief Emit an weak reference from \p Alias to \p Symbol.
409  ///
410  /// This corresponds to an assembler statement such as:
411  /// .weakref alias, symbol
412  ///
413  /// \param Alias - The alias that is being created.
414  /// \param Symbol - The symbol being aliased.
415  virtual void EmitWeakReference(MCSymbol *Alias, const MCSymbol *Symbol);
416 
417  /// \brief Add the given \p Attribute to \p Symbol.
418  virtual bool EmitSymbolAttribute(MCSymbol *Symbol,
419  MCSymbolAttr Attribute) = 0;
420 
421  /// \brief Set the \p DescValue for the \p Symbol.
422  ///
423  /// \param Symbol - The symbol to have its n_desc field set.
424  /// \param DescValue - The value to set into the n_desc field.
425  virtual void EmitSymbolDesc(MCSymbol *Symbol, unsigned DescValue);
426 
427  /// \brief Start emitting COFF symbol definition
428  ///
429  /// \param Symbol - The symbol to have its External & Type fields set.
430  virtual void BeginCOFFSymbolDef(const MCSymbol *Symbol);
431 
432  /// \brief Emit the storage class of the symbol.
433  ///
434  /// \param StorageClass - The storage class the symbol should have.
435  virtual void EmitCOFFSymbolStorageClass(int StorageClass);
436 
437  /// \brief Emit the type of the symbol.
438  ///
439  /// \param Type - A COFF type identifier (see COFF::SymbolType in X86COFF.h)
440  virtual void EmitCOFFSymbolType(int Type);
441 
442  /// \brief Marks the end of the symbol definition.
443  virtual void EndCOFFSymbolDef();
444 
445  virtual void EmitCOFFSafeSEH(MCSymbol const *Symbol);
446 
447  /// \brief Emits a COFF section index.
448  ///
449  /// \param Symbol - Symbol the section number relocation should point to.
450  virtual void EmitCOFFSectionIndex(MCSymbol const *Symbol);
451 
452  /// \brief Emits a COFF section relative relocation.
453  ///
454  /// \param Symbol - Symbol the section relative relocation should point to.
455  virtual void EmitCOFFSecRel32(MCSymbol const *Symbol);
456 
457  /// \brief Emit an ELF .size directive.
458  ///
459  /// This corresponds to an assembler statement such as:
460  /// .size symbol, expression
461  virtual void emitELFSize(MCSymbolELF *Symbol, const MCExpr *Value);
462 
463  /// \brief Emit a Linker Optimization Hint (LOH) directive.
464  /// \param Args - Arguments of the LOH.
465  virtual void EmitLOHDirective(MCLOHType Kind, const MCLOHArgs &Args) {}
466 
467  /// \brief Emit a common symbol.
468  ///
469  /// \param Symbol - The common symbol to emit.
470  /// \param Size - The size of the common symbol.
471  /// \param ByteAlignment - The alignment of the symbol if
472  /// non-zero. This must be a power of 2.
473  virtual void EmitCommonSymbol(MCSymbol *Symbol, uint64_t Size,
474  unsigned ByteAlignment) = 0;
475 
476  /// \brief Emit a local common (.lcomm) symbol.
477  ///
478  /// \param Symbol - The common symbol to emit.
479  /// \param Size - The size of the common symbol.
480  /// \param ByteAlignment - The alignment of the common symbol in bytes.
481  virtual void EmitLocalCommonSymbol(MCSymbol *Symbol, uint64_t Size,
482  unsigned ByteAlignment);
483 
484  /// \brief Emit the zerofill section and an optional symbol.
485  ///
486  /// \param Section - The zerofill section to create and or to put the symbol
487  /// \param Symbol - The zerofill symbol to emit, if non-NULL.
488  /// \param Size - The size of the zerofill symbol.
489  /// \param ByteAlignment - The alignment of the zerofill symbol if
490  /// non-zero. This must be a power of 2 on some targets.
491  virtual void EmitZerofill(MCSection *Section, MCSymbol *Symbol = nullptr,
492  uint64_t Size = 0, unsigned ByteAlignment = 0) = 0;
493 
494  /// \brief Emit a thread local bss (.tbss) symbol.
495  ///
496  /// \param Section - The thread local common section.
497  /// \param Symbol - The thread local common symbol to emit.
498  /// \param Size - The size of the symbol.
499  /// \param ByteAlignment - The alignment of the thread local common symbol
500  /// if non-zero. This must be a power of 2 on some targets.
502  uint64_t Size, unsigned ByteAlignment = 0);
503 
504  /// @}
505  /// \name Generating Data
506  /// @{
507 
508  /// \brief Emit the bytes in \p Data into the output.
509  ///
510  /// This is used to implement assembler directives such as .byte, .ascii,
511  /// etc.
512  virtual void EmitBytes(StringRef Data);
513 
514  /// \brief Emit the expression \p Value into the output as a native
515  /// integer of the given \p Size bytes.
516  ///
517  /// This is used to implement assembler directives such as .word, .quad,
518  /// etc.
519  ///
520  /// \param Value - The value to emit.
521  /// \param Size - The size of the integer (in bytes) to emit. This must
522  /// match a native machine width.
523  /// \param Loc - The location of the expression for error reporting.
524  virtual void EmitValueImpl(const MCExpr *Value, unsigned Size,
525  const SMLoc &Loc = SMLoc());
526 
527  void EmitValue(const MCExpr *Value, unsigned Size,
528  const SMLoc &Loc = SMLoc());
529 
530  /// \brief Special case of EmitValue that avoids the client having
531  /// to pass in a MCExpr for constant integers.
532  virtual void EmitIntValue(uint64_t Value, unsigned Size);
533 
534  virtual void EmitULEB128Value(const MCExpr *Value);
535 
536  virtual void EmitSLEB128Value(const MCExpr *Value);
537 
538  /// \brief Special case of EmitULEB128Value that avoids the client having to
539  /// pass in a MCExpr for constant integers.
540  void EmitULEB128IntValue(uint64_t Value, unsigned Padding = 0);
541 
542  /// \brief Special case of EmitSLEB128Value that avoids the client having to
543  /// pass in a MCExpr for constant integers.
544  void EmitSLEB128IntValue(int64_t Value);
545 
546  /// \brief Special case of EmitValue that avoids the client having to pass in
547  /// a MCExpr for MCSymbols.
548  void EmitSymbolValue(const MCSymbol *Sym, unsigned Size,
549  bool IsSectionRelative = false);
550 
551  /// \brief Emit the expression \p Value into the output as a gprel64 (64-bit
552  /// GP relative) value.
553  ///
554  /// This is used to implement assembler directives such as .gpdword on
555  /// targets that support them.
556  virtual void EmitGPRel64Value(const MCExpr *Value);
557 
558  /// \brief Emit the expression \p Value into the output as a gprel32 (32-bit
559  /// GP relative) value.
560  ///
561  /// This is used to implement assembler directives such as .gprel32 on
562  /// targets that support them.
563  virtual void EmitGPRel32Value(const MCExpr *Value);
564 
565  /// \brief Emit NumBytes bytes worth of the value specified by FillValue.
566  /// This implements directives such as '.space'.
567  virtual void EmitFill(uint64_t NumBytes, uint8_t FillValue);
568 
569  /// \brief Emit NumBytes worth of zeros.
570  /// This function properly handles data in virtual sections.
571  virtual void EmitZeros(uint64_t NumBytes);
572 
573  /// \brief Emit some number of copies of \p Value until the byte alignment \p
574  /// ByteAlignment is reached.
575  ///
576  /// If the number of bytes need to emit for the alignment is not a multiple
577  /// of \p ValueSize, then the contents of the emitted fill bytes is
578  /// undefined.
579  ///
580  /// This used to implement the .align assembler directive.
581  ///
582  /// \param ByteAlignment - The alignment to reach. This must be a power of
583  /// two on some targets.
584  /// \param Value - The value to use when filling bytes.
585  /// \param ValueSize - The size of the integer (in bytes) to emit for
586  /// \p Value. This must match a native machine width.
587  /// \param MaxBytesToEmit - The maximum numbers of bytes to emit, or 0. If
588  /// the alignment cannot be reached in this many bytes, no bytes are
589  /// emitted.
590  virtual void EmitValueToAlignment(unsigned ByteAlignment, int64_t Value = 0,
591  unsigned ValueSize = 1,
592  unsigned MaxBytesToEmit = 0);
593 
594  /// \brief Emit nops until the byte alignment \p ByteAlignment is reached.
595  ///
596  /// This used to align code where the alignment bytes may be executed. This
597  /// can emit different bytes for different sizes to optimize execution.
598  ///
599  /// \param ByteAlignment - The alignment to reach. This must be a power of
600  /// two on some targets.
601  /// \param MaxBytesToEmit - The maximum numbers of bytes to emit, or 0. If
602  /// the alignment cannot be reached in this many bytes, no bytes are
603  /// emitted.
604  virtual void EmitCodeAlignment(unsigned ByteAlignment,
605  unsigned MaxBytesToEmit = 0);
606 
607  /// \brief Emit some number of copies of \p Value until the byte offset \p
608  /// Offset is reached.
609  ///
610  /// This is used to implement assembler directives such as .org.
611  ///
612  /// \param Offset - The offset to reach. This may be an expression, but the
613  /// expression must be associated with the current section.
614  /// \param Value - The value to use when filling bytes.
615  /// \return false on success, true if the offset was invalid.
616  virtual bool EmitValueToOffset(const MCExpr *Offset,
617  unsigned char Value = 0);
618 
619  /// @}
620 
621  /// \brief Switch to a new logical file. This is used to implement the '.file
622  /// "foo.c"' assembler directive.
623  virtual void EmitFileDirective(StringRef Filename);
624 
625  /// \brief Emit the "identifiers" directive. This implements the
626  /// '.ident "version foo"' assembler directive.
627  virtual void EmitIdent(StringRef IdentString) {}
628 
629  /// \brief Associate a filename with a specified logical file number. This
630  /// implements the DWARF2 '.file 4 "foo.c"' assembler directive.
631  virtual unsigned EmitDwarfFileDirective(unsigned FileNo, StringRef Directory,
632  StringRef Filename,
633  unsigned CUID = 0);
634 
635  /// \brief This implements the DWARF2 '.loc fileno lineno ...' assembler
636  /// directive.
637  virtual void EmitDwarfLocDirective(unsigned FileNo, unsigned Line,
638  unsigned Column, unsigned Flags,
639  unsigned Isa, unsigned Discriminator,
640  StringRef FileName);
641 
642  /// Emit the absolute difference between two symbols.
643  ///
644  /// \pre Offset of \c Hi is greater than the offset \c Lo.
645  virtual void emitAbsoluteSymbolDiff(const MCSymbol *Hi, const MCSymbol *Lo,
646  unsigned Size);
647 
648  virtual MCSymbol *getDwarfLineTableSymbol(unsigned CUID);
649  virtual void EmitCFISections(bool EH, bool Debug);
650  void EmitCFIStartProc(bool IsSimple);
651  void EmitCFIEndProc();
652  virtual void EmitCFIDefCfa(int64_t Register, int64_t Offset);
653  virtual void EmitCFIDefCfaOffset(int64_t Offset);
654  virtual void EmitCFIDefCfaRegister(int64_t Register);
655  virtual void EmitCFIOffset(int64_t Register, int64_t Offset);
656  virtual void EmitCFIPersonality(const MCSymbol *Sym, unsigned Encoding);
657  virtual void EmitCFILsda(const MCSymbol *Sym, unsigned Encoding);
658  virtual void EmitCFIRememberState();
659  virtual void EmitCFIRestoreState();
660  virtual void EmitCFISameValue(int64_t Register);
661  virtual void EmitCFIRestore(int64_t Register);
662  virtual void EmitCFIRelOffset(int64_t Register, int64_t Offset);
663  virtual void EmitCFIAdjustCfaOffset(int64_t Adjustment);
664  virtual void EmitCFIEscape(StringRef Values);
665  virtual void EmitCFISignalFrame();
666  virtual void EmitCFIUndefined(int64_t Register);
667  virtual void EmitCFIRegister(int64_t Register1, int64_t Register2);
668  virtual void EmitCFIWindowSave();
669 
670  virtual void EmitWinCFIStartProc(const MCSymbol *Symbol);
671  virtual void EmitWinCFIEndProc();
672  virtual void EmitWinCFIStartChained();
673  virtual void EmitWinCFIEndChained();
674  virtual void EmitWinCFIPushReg(unsigned Register);
675  virtual void EmitWinCFISetFrame(unsigned Register, unsigned Offset);
676  virtual void EmitWinCFIAllocStack(unsigned Size);
677  virtual void EmitWinCFISaveReg(unsigned Register, unsigned Offset);
678  virtual void EmitWinCFISaveXMM(unsigned Register, unsigned Offset);
679  virtual void EmitWinCFIPushFrame(bool Code);
680  virtual void EmitWinCFIEndProlog();
681 
682  virtual void EmitWinEHHandler(const MCSymbol *Sym, bool Unwind, bool Except);
683  virtual void EmitWinEHHandlerData();
684 
685  /// \brief Emit the given \p Instruction into the current section.
686  virtual void EmitInstruction(const MCInst &Inst, const MCSubtargetInfo &STI);
687 
688  /// \brief Set the bundle alignment mode from now on in the section.
689  /// The argument is the power of 2 to which the alignment is set. The
690  /// value 0 means turn the bundle alignment off.
691  virtual void EmitBundleAlignMode(unsigned AlignPow2);
692 
693  /// \brief The following instructions are a bundle-locked group.
694  ///
695  /// \param AlignToEnd - If true, the bundle-locked group will be aligned to
696  /// the end of a bundle.
697  virtual void EmitBundleLock(bool AlignToEnd);
698 
699  /// \brief Ends a bundle-locked group.
700  virtual void EmitBundleUnlock();
701 
702  /// \brief If this file is backed by a assembly streamer, this dumps the
703  /// specified string in the output .s file. This capability is indicated by
704  /// the hasRawTextSupport() predicate. By default this aborts.
705  void EmitRawText(const Twine &String);
706 
707  /// \brief Causes any cached state to be written out.
708  virtual void Flush() {}
709 
710  /// \brief Streamer specific finalization.
711  virtual void FinishImpl();
712  /// \brief Finish emission of machine code.
713  void Finish();
714 
715  virtual bool mayHaveInstructions(MCSection &Sec) const { return true; }
716 };
717 
718 /// Create a dummy machine code streamer, which does nothing. This is useful for
719 /// timing the assembler front end.
720 MCStreamer *createNullStreamer(MCContext &Ctx);
721 
722 /// Create a machine code streamer which will print out assembly for the native
723 /// target, suitable for compiling with a native assembler.
724 ///
725 /// \param InstPrint - If given, the instruction printer to use. If not given
726 /// the MCInst representation will be printed. This method takes ownership of
727 /// InstPrint.
728 ///
729 /// \param CE - If given, a code emitter to use to show the instruction
730 /// encoding inline with the assembly. This method takes ownership of \p CE.
731 ///
732 /// \param TAB - If given, a target asm backend to use to show the fixup
733 /// information in conjunction with encoding information. This method takes
734 /// ownership of \p TAB.
735 ///
736 /// \param ShowInst - Whether to show the MCInst representation inline with
737 /// the assembly.
738 MCStreamer *createAsmStreamer(MCContext &Ctx,
739  std::unique_ptr<formatted_raw_ostream> OS,
740  bool isVerboseAsm, bool useDwarfDirectory,
741  MCInstPrinter *InstPrint, MCCodeEmitter *CE,
742  MCAsmBackend *TAB, bool ShowInst);
743 } // end namespace llvm
744 
745 #endif
virtual void EmitBundleUnlock()
Ends a bundle-locked group.
Definition: MCStreamer.cpp:699
virtual void EmitAssemblerFlag(MCAssemblerFlag Flag)
Note in the output the specified Flag.
Definition: MCStreamer.cpp:666
virtual void EmitDwarfLocDirective(unsigned FileNo, unsigned Line, unsigned Column, unsigned Flags, unsigned Isa, unsigned Discriminator, StringRef FileName)
This implements the DWARF2 '.loc fileno lineno ...' assembler directive.
Definition: MCStreamer.cpp:153
void AssignSection(MCSymbol *Symbol, MCSection *Section)
Sets the symbol's section.
Definition: MCStreamer.cpp:192
virtual void EmitBundleAlignMode(unsigned AlignPow2)
Set the bundle alignment mode from now on in the section.
Definition: MCStreamer.cpp:696
Instances of this class represent a uniqued identifier for a section in the current translation unit...
Definition: MCSection.h:48
void push_back(const T &Elt)
Definition: SmallVector.h:222
virtual void emitInst(uint32_t Inst, char Suffix= '\0')
virtual void AnnotateTLSDescriptorSequence(const MCSymbolRefExpr *SRE)
virtual void EmitCFISameValue(int64_t Register)
Definition: MCStreamer.cpp:341
virtual void emitFPU(unsigned FPU)
MCSectionSubPair getPreviousSection() const
Return the previous section that the streamer is emitting code to.
Definition: MCStreamer.h:282
virtual void AddComment(const Twine &T)
Add a textual command.
Definition: MCStreamer.h:252
virtual void EmitCFIPersonality(const MCSymbol *Sym, unsigned Encoding)
Definition: MCStreamer.cpp:311
virtual void EmitSLEB128Value(const MCExpr *Value)
Definition: MCStreamer.cpp:687
void EmitRawText(const Twine &String)
If this file is backed by a assembly streamer, this dumps the specified string in the output ...
Definition: MCStreamer.cpp:577
virtual void EmitWinCFIEndProlog()
Definition: MCStreamer.cpp:550
void EmitSLEB128IntValue(int64_t Value)
Special case of EmitSLEB128Value that avoids the client having to pass in a MCExpr for constant integ...
Definition: MCStreamer.cpp:103
void EmitSymbolValue(const MCSymbol *Sym, unsigned Size, bool IsSectionRelative=false)
Special case of EmitValue that avoids the client having to pass in a MCExpr for MCSymbols.
Definition: MCStreamer.cpp:115
ValueT lookup(const KeyT &Val) const
lookup - Return the entry for the specified key, or a default constructed value if no such entry exis...
Definition: DenseMap.h:159
virtual void EmitTBSSSymbol(MCSection *Section, MCSymbol *Symbol, uint64_t Size, unsigned ByteAlignment=0)
Emit a thread local bss (.tbss) symbol.
Definition: MCStreamer.cpp:677
MCSymbol - Instances of this class represent a symbol name in the MC file, and MCSymbols are created ...
Definition: MCSymbol.h:39
virtual void EndCOFFSymbolDef()
Marks the end of the symbol definition.
Definition: MCStreamer.cpp:670
virtual void AddBlankLine()
AddBlankLine - Emit a blank line to a .s file to pretty it up.
Definition: MCStreamer.h:266
virtual ~MCTargetStreamer()
Definition: MCStreamer.cpp:31
virtual void EmitULEB128Value(const MCExpr *Value)
Definition: MCStreamer.cpp:686
virtual void emitArchExtension(unsigned ArchExt)
virtual void EmitWeakReference(MCSymbol *Alias, const MCSymbol *Symbol)
Emit an weak reference from Alias to Symbol.
Definition: MCStreamer.cpp:680
void SwitchSectionNoChange(MCSection *Section, const MCExpr *Subsection=nullptr)
Set the current section where code is being emitted to Section.
Definition: MCStreamer.h:343
virtual void EmitBytes(StringRef Data)
Emit the bytes in Data into the output.
Definition: MCStreamer.cpp:681
Target specific streamer interface.
Definition: MCStreamer.h:73
virtual void emitPad(int64_t Offset)
virtual void reset()
State management.
Definition: MCStreamer.cpp:53
MCStreamer * createNullStreamer(MCContext &Ctx)
Create a dummy machine code streamer, which does nothing.
virtual void EmitWindowsUnwindTables()
Definition: MCStreamer.cpp:582
void EmitCFIStartProc(bool IsSimple)
Definition: MCStreamer.cpp:217
virtual void BeginCOFFSymbolDef(const MCSymbol *Symbol)
Start emitting COFF symbol definition.
Definition: MCStreamer.cpp:669
virtual unsigned EmitDwarfFileDirective(unsigned FileNo, StringRef Directory, StringRef Filename, unsigned CUID=0)
Associate a filename with a specified logical file number.
Definition: MCStreamer.cpp:147
virtual bool hasRawTextSupport() const
Return true if this asm streamer supports emitting unformatted text to the .s file with EmitRawText...
Definition: MCStreamer.h:237
ArrayRef< WinEH::FrameInfo * > getWinFrameInfos() const
Definition: MCStreamer.h:222
void PushSection()
Save the current and previous section on the section stack.
Definition: MCStreamer.h:301
virtual void EmitCFIRegister(int64_t Register1, int64_t Register2)
Definition: MCStreamer.cpp:378
virtual void finishAttributeSection()
virtual void EmitValueImpl(const MCExpr *Value, unsigned Size, const SMLoc &Loc=SMLoc())
Emit the expression Value into the output as a native integer of the given Size bytes.
Definition: MCStreamer.cpp:682
MCDataRegionType
Definition: MCDirectives.h:55
ArrayRef< MCDwarfFrameInfo > getDwarfFrameInfos() const
Definition: MCStreamer.h:217
virtual void EmitCFIDefCfaOffset(int64_t Offset)
Definition: MCStreamer.cpp:270
virtual MCSymbol * getDwarfLineTableSymbol(unsigned CUID)
Definition: MCStreamer.cpp:162
COFF::SymbolStorageClass StorageClass
Definition: COFFYAML.cpp:294
virtual void EmitCOFFSymbolStorageClass(int StorageClass)
Emit the storage class of the symbol.
Definition: MCStreamer.cpp:672
virtual void EmitInstruction(const MCInst &Inst, const MCSubtargetInfo &STI)
Emit the given Instruction into the current section.
Definition: MCStreamer.cpp:639
virtual void emitPersonality(const MCSymbol *Personality)
virtual void emitPersonalityIndex(unsigned Index)
virtual void emitELFSize(MCSymbolELF *Symbol, const MCExpr *Value)
Emit an ELF .size directive.
Definition: MCStreamer.cpp:674
virtual void EmitCFISections(bool EH, bool Debug)
Definition: MCStreamer.cpp:213
virtual void EmitGPRel32Value(const MCExpr *Value)
Emit the expression Value into the output as a gprel32 (32-bit GP relative) value.
Definition: MCStreamer.cpp:130
virtual void EmitWinEHHandlerData()
Definition: MCStreamer.cpp:464
virtual void EmitCFIRememberState()
Definition: MCStreamer.cpp:326
void emitCurrentConstantPool()
Callback used to implemnt the .ltorg directive.
virtual void EmitCFILsda(const MCSymbol *Sym, unsigned Encoding)
Definition: MCStreamer.cpp:319
virtual void EmitGPRel64Value(const MCExpr *Value)
Emit the expression Value into the output as a gprel64 (64-bit GP relative) value.
Definition: MCStreamer.cpp:126
Twine - A lightweight data structure for efficiently representing the concatenation of temporary valu...
Definition: Twine.h:79
virtual void EmitCFIEscape(StringRef Values)
Definition: MCStreamer.cpp:357
MCSectionSubPair getCurrentSection() const
Return the current section that the streamer is emitting code to.
Definition: MCStreamer.h:274
virtual void EmitCOFFSymbolType(int Type)
Emit the type of the symbol.
Definition: MCStreamer.cpp:673
MCSection * getCurrentSectionOnly() const
Definition: MCStreamer.h:279
Base class for the full range of assembler expressions which are needed for parsing.
Definition: MCExpr.h:33
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:159
virtual void emitLabel(MCSymbol *Symbol)
Definition: MCStreamer.cpp:37
virtual bool isVerboseAsm() const
Return true if this streamer supports verbose assembly and if it is enabled.
Definition: MCStreamer.h:233
virtual bool mayHaveInstructions(MCSection &Sec) const
Definition: MCStreamer.h:715
virtual void EmitCFIStartProcImpl(MCDwarfFrameInfo &Frame)
Definition: MCStreamer.cpp:239
unsigned getNumWinFrameInfos()
Definition: MCStreamer.h:221
virtual ~MCStreamer()
Definition: MCStreamer.cpp:48
MCContext & getContext() const
Definition: MCStreamer.h:210
virtual void EmitAssignment(MCSymbol *Symbol, const MCExpr *Value)
Emit an assignment of Value to Symbol.
Definition: MCStreamer.cpp:596
Context object for machine code objects.
Definition: MCContext.h:48
bool LLVM_ATTRIBUTE_UNUSED_RESULT empty() const
Definition: SmallVector.h:57
virtual void finish()
Definition: MCStreamer.cpp:39
virtual bool isIntegratedAssemblerRequired() const
Is the integrated assembler required for this streamer to function correctly?
Definition: MCStreamer.h:241
virtual void EmitCFIEndProcImpl(MCDwarfFrameInfo &CurFrame)
Definition: MCStreamer.cpp:248
virtual bool EmitValueToOffset(const MCExpr *Offset, unsigned char Value=0)
Emit some number of copies of Value until the byte offset Offset is reached.
Definition: MCStreamer.cpp:693
std::pair< MCSection *, const MCExpr * > MCSectionSubPair
Definition: MCStreamer.h:44
ArrayRef - Represent a constant reference to an array (0 or more elements consecutively in memory)...
Definition: ArrayRef.h:31
virtual void emitMovSP(unsigned Reg, int64_t Offset=0)
virtual void emitRawComment(const Twine &T, bool TabPrefix=true)
Print T and prefix it with the comment string (normally #) and optionally a tab.
Definition: MCStreamer.cpp:69
virtual void EmitCFIRestoreState()
Definition: MCStreamer.cpp:333
ARMTargetStreamer(MCStreamer &S)
virtual void EmitIntValue(uint64_t Value, unsigned Size)
Special case of EmitValue that avoids the client having to pass in a MCExpr for constant integers...
Definition: MCStreamer.cpp:79
Instances of this class represent a single low-level machine instruction.
Definition: MCInst.h:150
virtual void EmitCFIRestore(int64_t Register)
Definition: MCStreamer.cpp:349
virtual void emitAttribute(unsigned Attribute, unsigned Value)
Flag
These should be considered private to the implementation of the MCInstrDesc class.
Definition: MCInstrDesc.h:97
virtual void EmitBundleLock(bool AlignToEnd)
The following instructions are a bundle-locked group.
Definition: MCStreamer.cpp:697
virtual void EmitLocalCommonSymbol(MCSymbol *Symbol, uint64_t Size, unsigned ByteAlignment)
Emit a local common (.lcomm) symbol.
Definition: MCStreamer.cpp:675
virtual raw_ostream & GetCommentOS()
Return a raw_ostream that comments can be written to.
Definition: MCStreamer.cpp:64
virtual void EmitVersionMin(MCVersionMinType, unsigned Major, unsigned Minor, unsigned Update)
Specify the MachO minimum deployment target version.
Definition: MCStreamer.h:388
virtual void EmitZeros(uint64_t NumBytes)
Emit NumBytes worth of zeros.
Definition: MCStreamer.cpp:143
Streaming machine code generation interface.
Definition: MCStreamer.h:157
virtual void emitRegSave(const SmallVectorImpl< unsigned > &RegList, bool isVector)
WinEH::FrameInfo * getCurrentWinFrameInfo()
Definition: MCStreamer.h:188
MCTargetStreamer * getTargetStreamer()
Definition: MCStreamer.h:212
virtual void EmitZerofill(MCSection *Section, MCSymbol *Symbol=nullptr, uint64_t Size=0, unsigned ByteAlignment=0)=0
Emit the zerofill section and an optional symbol.
The instances of the Type class are immutable: once they are created, they are never changed...
Definition: Type.h:45
virtual void EmitFill(uint64_t NumBytes, uint8_t FillValue)
Emit NumBytes bytes worth of the value specified by FillValue.
Definition: MCStreamer.cpp:136
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.
virtual void EmitWinCFIPushReg(unsigned Register)
Definition: MCStreamer.cpp:470
virtual void SwitchSection(MCSection *Section, const MCExpr *Subsection=nullptr)
Set the current section where code is being emitted to Section.
Definition: MCStreamer.cpp:701
virtual void emitThumbSet(MCSymbol *Symbol, const MCExpr *Value)
virtual void emitSetFP(unsigned FpReg, unsigned SpReg, int64_t Offset=0)
virtual void emitObjectArch(unsigned Arch)
virtual void EmitCFIDefCfaRegister(int64_t Register)
Definition: MCStreamer.cpp:286
virtual void EmitValueToAlignment(unsigned ByteAlignment, int64_t Value=0, unsigned ValueSize=1, unsigned MaxBytesToEmit=0)
Emit some number of copies of Value until the byte alignment ByteAlignment is reached.
Definition: MCStreamer.cpp:688
MCLOHType
Linker Optimization Hint Type.
virtual bool EmitSymbolAttribute(MCSymbol *Symbol, MCSymbolAttr Attribute)=0
Add the given Attribute to Symbol.
virtual void EmitCOFFSecRel32(MCSymbol const *Symbol)
Emits a COFF section relative relocation.
Definition: MCStreamer.cpp:565
virtual void emitUnwindRaw(int64_t StackOffset, const SmallVectorImpl< uint8_t > &Opcodes)
virtual void Flush()
Causes any cached state to be written out.
Definition: MCStreamer.h:708
virtual void EmitRawTextImpl(StringRef String)
EmitRawText - If this file is backed by an assembly streamer, this dumps the specified string in the ...
Definition: MCStreamer.cpp:571
virtual void EmitWinCFIEndChained()
Definition: MCStreamer.cpp:437
virtual void EmitWinCFIEndProc()
Definition: MCStreamer.cpp:416
virtual void EmitCFIUndefined(int64_t Register)
Definition: MCStreamer.cpp:370
virtual void EmitIdent(StringRef IdentString)
Emit the "identifiers" directive.
Definition: MCStreamer.h:627
void Finish()
Finish emission of machine code.
Definition: MCStreamer.cpp:585
virtual void EmitEHSymAttributes(const MCSymbol *Symbol, MCSymbol *EHSymbol)
Definition: MCStreamer.cpp:184
virtual void EmitWinEHHandler(const MCSymbol *Sym, bool Unwind, bool Except)
Definition: MCStreamer.cpp:450
virtual void EmitCOFFSafeSEH(MCSymbol const *Symbol)
Definition: MCStreamer.cpp:559
void generateCompactUnwindEncodings(MCAsmBackend *MAB)
Definition: MCStreamer.cpp:71
bool SubSection(const MCExpr *Subsection)
Definition: MCStreamer.h:325
virtual void EmitDataRegion(MCDataRegionType Kind)
Note in the output the specified region Kind.
Definition: MCStreamer.h:385
virtual void EmitWinCFIStartChained()
Definition: MCStreamer.cpp:426
virtual void InitSections(bool NoExecStack)
Create the default sections and set the initial one.
Definition: MCStreamer.cpp:188
MCStreamer & getStreamer()
Definition: MCStreamer.h:81
virtual void EmitLabel(MCSymbol *Symbol)
Emit a label for Symbol into the current section.
Definition: MCStreamer.cpp:203
virtual void EmitWinCFISaveXMM(unsigned Register, unsigned Offset)
Definition: MCStreamer.cpp:525
virtual void emitAbsoluteSymbolDiff(const MCSymbol *Hi, const MCSymbol *Lo, unsigned Size)
Emit the absolute difference between two symbols.
Definition: MCStreamer.cpp:647
virtual void EmitLOHDirective(MCLOHType Kind, const MCLOHArgs &Args)
Emit a Linker Optimization Hint (LOH) directive.
Definition: MCStreamer.h:465
virtual void EmitCFIOffset(int64_t Register, int64_t Offset)
Definition: MCStreamer.cpp:295
This is a 'vector' (really, a variable-sized array), optimized for the case when the array is small...
Definition: SmallVector.h:861
virtual void EmitCodeAlignment(unsigned ByteAlignment, unsigned MaxBytesToEmit=0)
Emit nops until the byte alignment ByteAlignment is reached.
Definition: MCStreamer.cpp:691
MCStreamer & Streamer
Definition: MCStreamer.h:75
Promote Memory to Register
Definition: Mem2Reg.cpp:58
virtual void prettyPrintAsm(MCInstPrinter &InstPrinter, raw_ostream &OS, const MCInst &Inst, const MCSubtargetInfo &STI)
Definition: MCStreamer.cpp:605
virtual void EmitWinCFIAllocStack(unsigned Size)
Definition: MCStreamer.cpp:498
virtual void ChangeSection(MCSection *, const MCExpr *)
Update streamer for a new active section.
Definition: MCStreamer.cpp:679
MCSymbolAttr
Definition: MCDirectives.h:19
void visitUsedExpr(const MCExpr &Expr)
Definition: MCStreamer.cpp:613
const MCExpr * addConstantPoolEntry(const MCExpr *)
Callback used to implement the ldr= pseudo.
MCTargetStreamer(MCStreamer &S)
Definition: MCStreamer.cpp:33
This is an instance of a target assembly language printer that converts an MCInst to valid target ass...
Definition: MCInstPrinter.h:38
virtual void EmitThumbFunc(MCSymbol *Func)
Note in the output that the specified Func is a Thumb mode function (ARM target only).
Definition: MCStreamer.cpp:667
unsigned getNumFrameInfos()
Definition: MCStreamer.h:216
virtual void EmitLinkerOptions(ArrayRef< std::string > Kind)
Emit the given list Options of strings as linker options into the output.
Definition: MCStreamer.h:382
virtual void EmitCFISignalFrame()
Definition: MCStreamer.cpp:364
virtual void EmitCFIRelOffset(int64_t Register, int64_t Offset)
Definition: MCStreamer.cpp:303
MCAssemblerFlag
Definition: MCDirectives.h:47
virtual void emitIntTextAttribute(unsigned Attribute, unsigned IntValue, StringRef StringValue="")
#define I(x, y, z)
Definition: MD5.cpp:54
virtual void EmitFileDirective(StringRef Filename)
Switch to a new logical file.
Definition: MCStreamer.cpp:671
MCSubtargetInfo - Generic base class for all target subtargets.
virtual void EmitCFIDefCfa(int64_t Register, int64_t Offset)
Definition: MCStreamer.cpp:261
void EmitValue(const MCExpr *Value, unsigned Size, const SMLoc &Loc=SMLoc())
Definition: MCStreamer.cpp:110
void EmitULEB128IntValue(uint64_t Value, unsigned Padding=0)
Special case of EmitULEB128Value that avoids the client having to pass in a MCExpr for constant integ...
Definition: MCStreamer.cpp:94
MCSymbol * endSection(MCSection *Section)
Definition: MCStreamer.cpp:715
const ARM::ArchExtKind Kind
virtual void EmitCommonSymbol(MCSymbol *Symbol, uint64_t Size, unsigned ByteAlignment)=0
Emit a common symbol.
virtual void FinishImpl()
Streamer specific finalization.
Definition: MCStreamer.cpp:698
bool PopSection()
Restore the current and previous section from the section stack.
Definition: MCStreamer.h:310
MCVersionMinType
Definition: MCDirectives.h:63
LLVM Value Representation.
Definition: Value.h:69
Generic interface to target specific assembler backends.
Definition: MCAsmBackend.h:34
static cl::opt< bool, true > Debug("debug", cl::desc("Enable debug output"), cl::Hidden, cl::location(DebugFlag))
virtual void EmitWinCFIStartProc(const MCSymbol *Symbol)
Definition: MCStreamer.cpp:402
This class implements an extremely fast bulk output stream that can only output to a stream...
Definition: raw_ostream.h:38
static TraceState * TS
virtual void EmitWinCFISaveReg(unsigned Register, unsigned Offset)
Definition: MCStreamer.cpp:512
virtual void EmitWinCFIPushFrame(bool Code)
Definition: MCStreamer.cpp:538
StringRef - Represent a constant reference to a string, i.e.
Definition: StringRef.h:40
virtual void emitArch(unsigned Arch)
virtual void visitUsedSymbol(const MCSymbol &Sym)
Definition: MCStreamer.cpp:610
Represents a location in source code.
Definition: SMLoc.h:23
void setTargetStreamer(MCTargetStreamer *TS)
Definition: MCStreamer.h:202
virtual void emitAssignment(MCSymbol *Symbol, const MCExpr *Value)
Definition: MCStreamer.cpp:41
virtual void EmitCOFFSectionIndex(MCSymbol const *Symbol)
Emits a COFF section index.
Definition: MCStreamer.cpp:562
virtual void EmitCFIAdjustCfaOffset(int64_t Adjustment)
Definition: MCStreamer.cpp:278
unsigned GetSymbolOrder(const MCSymbol *Sym) const
Returns an index to represent the order a symbol was emitted in.
Definition: MCStreamer.h:290
virtual void EmitWinCFISetFrame(unsigned Register, unsigned Offset)
Definition: MCStreamer.cpp:480
virtual void switchVendor(StringRef Vendor)
virtual void EmitSymbolDesc(MCSymbol *Symbol, unsigned DescValue)
Set the DescValue for the Symbol.
Definition: MCStreamer.cpp:668
virtual void EmitCFIWindowSave()
Definition: MCStreamer.cpp:386
virtual void emitTextAttribute(unsigned Attribute, StringRef String)