LCOV - code coverage report
Current view: top level - include/llvm/MC - MCELFStreamer.h (source / functions) Hit Total Coverage
Test: llvm-toolchain.info Lines: 5 5 100.0 %
Date: 2018-06-17 00:07:59 Functions: 3 3 100.0 %
Legend: Lines: hit not hit

          Line data    Source code
       1             : //===- MCELFStreamer.h - MCStreamer ELF Object File Interface ---*- 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             : #ifndef LLVM_MC_MCELFSTREAMER_H
      11             : #define LLVM_MC_MCELFSTREAMER_H
      12             : 
      13             : #include "llvm/ADT/SmallVector.h"
      14             : #include "llvm/MC/MCDirectives.h"
      15             : #include "llvm/MC/MCObjectStreamer.h"
      16             : 
      17             : namespace llvm {
      18             : 
      19             : class MCAsmBackend;
      20             : class MCCodeEmitter;
      21             : class MCExpr;
      22             : class MCInst;
      23             : 
      24             : class MCELFStreamer : public MCObjectStreamer {
      25             : public:
      26             :   MCELFStreamer(MCContext &Context, std::unique_ptr<MCAsmBackend> TAB,
      27             :                 std::unique_ptr<MCObjectWriter> OW,
      28             :                 std::unique_ptr<MCCodeEmitter> Emitter);
      29             : 
      30       18725 :   ~MCELFStreamer() override = default;
      31             : 
      32             :   /// state management
      33        3645 :   void reset() override {
      34        3739 :     SeenIdent = false;
      35             :     BundleGroups.clear();
      36        3739 :     MCObjectStreamer::reset();
      37        3645 :   }
      38             : 
      39             :   /// \name MCStreamer Interface
      40             :   /// @{
      41             : 
      42             :   void InitSections(bool NoExecStack) override;
      43             :   void ChangeSection(MCSection *Section, const MCExpr *Subsection) override;
      44             :   void EmitLabel(MCSymbol *Symbol, SMLoc Loc = SMLoc()) override;
      45             :   void EmitLabel(MCSymbol *Symbol, SMLoc Loc, MCFragment *F) override;
      46             :   void EmitAssemblerFlag(MCAssemblerFlag Flag) override;
      47             :   void EmitThumbFunc(MCSymbol *Func) override;
      48             :   void EmitWeakReference(MCSymbol *Alias, const MCSymbol *Symbol) override;
      49             :   bool EmitSymbolAttribute(MCSymbol *Symbol, MCSymbolAttr Attribute) override;
      50             :   void EmitSymbolDesc(MCSymbol *Symbol, unsigned DescValue) override;
      51             :   void EmitCommonSymbol(MCSymbol *Symbol, uint64_t Size,
      52             :                         unsigned ByteAlignment) override;
      53             : 
      54             :   void emitELFSize(MCSymbol *Symbol, const MCExpr *Value) override;
      55             :   void emitELFSymverDirective(StringRef AliasName,
      56             :                               const MCSymbol *Aliasee) override;
      57             : 
      58             :   void EmitLocalCommonSymbol(MCSymbol *Symbol, uint64_t Size,
      59             :                              unsigned ByteAlignment) override;
      60             : 
      61             :   void EmitZerofill(MCSection *Section, MCSymbol *Symbol = nullptr,
      62             :                     uint64_t Size = 0, unsigned ByteAlignment = 0) override;
      63             :   void EmitTBSSSymbol(MCSection *Section, MCSymbol *Symbol, uint64_t Size,
      64             :                       unsigned ByteAlignment = 0) override;
      65             :   void EmitValueImpl(const MCExpr *Value, unsigned Size,
      66             :                      SMLoc Loc = SMLoc()) override;
      67             : 
      68             :   void EmitIdent(StringRef IdentString) override;
      69             : 
      70             :   void EmitValueToAlignment(unsigned, int64_t, unsigned, unsigned) override;
      71             : 
      72             :   void emitCGProfileEntry(const MCSymbolRefExpr *From,
      73             :                           const MCSymbolRefExpr *To, uint64_t Count) override;
      74             : 
      75             :   void FinishImpl() override;
      76             : 
      77             :   void EmitBundleAlignMode(unsigned AlignPow2) override;
      78             :   void EmitBundleLock(bool AlignToEnd) override;
      79             :   void EmitBundleUnlock() override;
      80             : 
      81             : private:
      82             :   bool isBundleLocked() const;
      83             :   void EmitInstToFragment(const MCInst &Inst, const MCSubtargetInfo &) override;
      84             :   void EmitInstToData(const MCInst &Inst, const MCSubtargetInfo &) override;
      85             : 
      86             :   void fixSymbolsInTLSFixups(const MCExpr *expr);
      87             :   void finalizeCGProfileEntry(const MCSymbolRefExpr *&S);
      88             :   void finalizeCGProfile();
      89             : 
      90             :   /// Merge the content of the fragment \p EF into the fragment \p DF.
      91             :   void mergeFragment(MCDataFragment *, MCDataFragment *);
      92             : 
      93             :   bool SeenIdent = false;
      94             : 
      95             :   /// BundleGroups - The stack of fragments holding the bundle-locked
      96             :   /// instructions.
      97             :   SmallVector<MCDataFragment *, 4> BundleGroups;
      98             : };
      99             : 
     100             : MCELFStreamer *createARMELFStreamer(MCContext &Context,
     101             :                                     std::unique_ptr<MCAsmBackend> TAB,
     102             :                                     std::unique_ptr<MCObjectWriter> OW,
     103             :                                     std::unique_ptr<MCCodeEmitter> Emitter,
     104             :                                     bool RelaxAll, bool IsThumb);
     105             : 
     106             : } // end namespace llvm
     107             : 
     108             : #endif // LLVM_MC_MCELFSTREAMER_H

Generated by: LCOV version 1.13