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

          Line data    Source code
       1             : //===- MCWasmStreamer.h - MCStreamer Wasm 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_MCWASMSTREAMER_H
      11             : #define LLVM_MC_MCWASMSTREAMER_H
      12             : 
      13             : #include "MCAsmBackend.h"
      14             : #include "MCCodeEmitter.h"
      15             : #include "llvm/ADT/SmallPtrSet.h"
      16             : #include "llvm/MC/MCDirectives.h"
      17             : #include "llvm/MC/MCObjectStreamer.h"
      18             : #include "llvm/MC/MCObjectWriter.h"
      19             : #include "llvm/MC/SectionKind.h"
      20             : #include "llvm/Support/DataTypes.h"
      21             : 
      22             : namespace llvm {
      23             : class MCAssembler;
      24             : class MCExpr;
      25             : class MCInst;
      26             : class raw_ostream;
      27             : 
      28             : class MCWasmStreamer : public MCObjectStreamer {
      29             : public:
      30         133 :   MCWasmStreamer(MCContext &Context, std::unique_ptr<MCAsmBackend> TAB,
      31             :                  std::unique_ptr<MCObjectWriter> OW,
      32             :                  std::unique_ptr<MCCodeEmitter> Emitter)
      33         133 :       : MCObjectStreamer(Context, std::move(TAB), std::move(OW),
      34             :                          std::move(Emitter)),
      35         665 :         SeenIdent(false) {}
      36             : 
      37             :   ~MCWasmStreamer() override;
      38             : 
      39             :   /// state management
      40         133 :   void reset() override {
      41         133 :     SeenIdent = false;
      42         133 :     MCObjectStreamer::reset();
      43         133 :   }
      44             : 
      45             :   /// \name MCStreamer Interface
      46             :   /// @{
      47             : 
      48             :   void ChangeSection(MCSection *Section, const MCExpr *Subsection) override;
      49             :   void EmitAssemblerFlag(MCAssemblerFlag Flag) override;
      50             :   void EmitThumbFunc(MCSymbol *Func) override;
      51             :   void EmitWeakReference(MCSymbol *Alias, const MCSymbol *Symbol) override;
      52             :   bool EmitSymbolAttribute(MCSymbol *Symbol, MCSymbolAttr Attribute) override;
      53             :   void EmitSymbolDesc(MCSymbol *Symbol, unsigned DescValue) override;
      54             :   void EmitCommonSymbol(MCSymbol *Symbol, uint64_t Size,
      55             :                         unsigned ByteAlignment) override;
      56             : 
      57             :   void emitELFSize(MCSymbol *Symbol, const MCExpr *Value) override;
      58             : 
      59             :   void EmitLocalCommonSymbol(MCSymbol *Symbol, uint64_t Size,
      60             :                              unsigned ByteAlignment) override;
      61             : 
      62             :   void EmitZerofill(MCSection *Section, MCSymbol *Symbol = nullptr,
      63             :                     uint64_t Size = 0, unsigned ByteAlignment = 0) override;
      64             :   void EmitTBSSSymbol(MCSection *Section, MCSymbol *Symbol, uint64_t Size,
      65             :                       unsigned ByteAlignment = 0) override;
      66             :   void EmitValueImpl(const MCExpr *Value, unsigned Size,
      67             :                      SMLoc Loc = SMLoc()) override;
      68             : 
      69             :   void EmitIdent(StringRef IdentString) override;
      70             : 
      71             :   void EmitValueToAlignment(unsigned, int64_t, unsigned, unsigned) override;
      72             : 
      73             :   void FinishImpl() override;
      74             : 
      75             : private:
      76             :   void EmitInstToFragment(const MCInst &Inst, const MCSubtargetInfo &) override;
      77             :   void EmitInstToData(const MCInst &Inst, const MCSubtargetInfo &) override;
      78             : 
      79             :   /// Merge the content of the fragment \p EF into the fragment \p DF.
      80             :   void mergeFragment(MCDataFragment *, MCDataFragment *);
      81             : 
      82             :   bool SeenIdent;
      83             : };
      84             : 
      85             : } // end namespace llvm
      86             : 
      87             : #endif

Generated by: LCOV version 1.13