LCOV - code coverage report
Current view: top level - lib/Target/AMDGPU/MCTargetDesc - AMDGPUTargetStreamer.h (source / functions) Hit Total Coverage
Test: llvm-toolchain.info Lines: 4 4 100.0 %
Date: 2017-09-14 15:23:50 Functions: 2 4 50.0 %
Legend: Lines: hit not hit

          Line data    Source code
       1             : //===-- AMDGPUTargetStreamer.h - AMDGPU Target Streamer --------*- 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_LIB_TARGET_AMDGPU_MCTARGETDESC_AMDGPUTARGETSTREAMER_H
      11             : #define LLVM_LIB_TARGET_AMDGPU_MCTARGETDESC_AMDGPUTARGETSTREAMER_H
      12             : 
      13             : #include "AMDGPUCodeObjectMetadataStreamer.h"
      14             : #include "AMDKernelCodeT.h"
      15             : #include "llvm/MC/MCStreamer.h"
      16             : 
      17             : namespace llvm {
      18             : #include "AMDGPUPTNote.h"
      19             : 
      20             : class DataLayout;
      21             : class Function;
      22             : class MCELFStreamer;
      23             : class MCSymbol;
      24             : class MDNode;
      25             : class Module;
      26             : class Type;
      27             : 
      28        3510 : class AMDGPUTargetStreamer : public MCTargetStreamer {
      29             : protected:
      30             :   AMDGPU::CodeObject::MetadataStreamer CodeObjectMetadataStreamer;
      31         114 :   MCContext &getContext() const { return Streamer.getContext(); }
      32             : 
      33             : public:
      34             :   AMDGPUTargetStreamer(MCStreamer &S);
      35             :   virtual void EmitDirectiveHSACodeObjectVersion(uint32_t Major,
      36             :                                                  uint32_t Minor) = 0;
      37             : 
      38             :   virtual void EmitDirectiveHSACodeObjectISA(uint32_t Major, uint32_t Minor,
      39             :                                              uint32_t Stepping,
      40             :                                              StringRef VendorName,
      41             :                                              StringRef ArchName) = 0;
      42             : 
      43             :   virtual void EmitAMDKernelCodeT(const amd_kernel_code_t &Header) = 0;
      44             : 
      45             :   virtual void EmitAMDGPUSymbolType(StringRef SymbolName, unsigned Type) = 0;
      46             : 
      47             :   virtual void EmitStartOfCodeObjectMetadata(const Module &Mod);
      48             : 
      49             :   virtual void EmitKernelCodeObjectMetadata(
      50             :       const Function &Func, const amd_kernel_code_t &KernelCode);
      51             : 
      52             :   virtual void EmitEndOfCodeObjectMetadata();
      53             : 
      54             :   /// \returns True on success, false on failure.
      55             :   virtual bool EmitCodeObjectMetadata(StringRef YamlString) = 0;
      56             : };
      57             : 
      58        3394 : class AMDGPUTargetAsmStreamer final : public AMDGPUTargetStreamer {
      59             :   formatted_raw_ostream &OS;
      60             : public:
      61             :   AMDGPUTargetAsmStreamer(MCStreamer &S, formatted_raw_ostream &OS);
      62             :   void EmitDirectiveHSACodeObjectVersion(uint32_t Major,
      63             :                                          uint32_t Minor) override;
      64             : 
      65             :   void EmitDirectiveHSACodeObjectISA(uint32_t Major, uint32_t Minor,
      66             :                                      uint32_t Stepping, StringRef VendorName,
      67             :                                      StringRef ArchName) override;
      68             : 
      69             :   void EmitAMDKernelCodeT(const amd_kernel_code_t &Header) override;
      70             : 
      71             :   void EmitAMDGPUSymbolType(StringRef SymbolName, unsigned Type) override;
      72             : 
      73             :   /// \returns True on success, false on failure.
      74             :   bool EmitCodeObjectMetadata(StringRef YamlString) override;
      75             : };
      76             : 
      77         116 : class AMDGPUTargetELFStreamer final : public AMDGPUTargetStreamer {
      78             :   MCStreamer &Streamer;
      79             : 
      80             :   void EmitAMDGPUNote(const MCExpr *DescSize,
      81             :                       AMDGPU::ElfNote::NoteType Type,
      82             :                       function_ref<void(MCELFStreamer &)> EmitDesc);
      83             : 
      84             : public:
      85             :   AMDGPUTargetELFStreamer(MCStreamer &S);
      86             : 
      87             :   MCELFStreamer &getStreamer();
      88             : 
      89             :   void EmitDirectiveHSACodeObjectVersion(uint32_t Major,
      90             :                                          uint32_t Minor) override;
      91             : 
      92             :   void EmitDirectiveHSACodeObjectISA(uint32_t Major, uint32_t Minor,
      93             :                                      uint32_t Stepping, StringRef VendorName,
      94             :                                      StringRef ArchName) override;
      95             : 
      96             :   void EmitAMDKernelCodeT(const amd_kernel_code_t &Header) override;
      97             : 
      98             :   void EmitAMDGPUSymbolType(StringRef SymbolName, unsigned Type) override;
      99             : 
     100             :   /// \returns True on success, false on failure.
     101             :   bool EmitCodeObjectMetadata(StringRef YamlString) override;
     102             : };
     103             : 
     104             : }
     105             : #endif

Generated by: LCOV version 1.13