LCOV - code coverage report
Current view: top level - include/llvm/MC - MCStreamer.h (source / functions) Hit Total Coverage
Test: llvm-toolchain.info Lines: 37 49 75.5 %
Date: 2018-06-17 00:07:59 Functions: 16 26 61.5 %
Legend: Lines: hit not hit

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

Generated by: LCOV version 1.13