LCOV - code coverage report
Current view: top level - include/llvm/CodeGen - MachineModuleInfoImpls.h (source / functions) Hit Total Coverage
Test: llvm-toolchain.info Lines: 10 10 100.0 %
Date: 2017-09-14 15:23:50 Functions: 3 4 75.0 %
Legend: Lines: hit not hit

          Line data    Source code
       1             : //===-- llvm/CodeGen/MachineModuleInfoImpls.h -------------------*- 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 defines object-file format specific implementations of
      11             : // MachineModuleInfoImpl.
      12             : //
      13             : //===----------------------------------------------------------------------===//
      14             : 
      15             : #ifndef LLVM_CODEGEN_MACHINEMODULEINFOIMPLS_H
      16             : #define LLVM_CODEGEN_MACHINEMODULEINFOIMPLS_H
      17             : 
      18             : #include "llvm/BinaryFormat/Wasm.h"
      19             : #include "llvm/CodeGen/MachineModuleInfo.h"
      20             : #include "llvm/CodeGen/ValueTypes.h"
      21             : 
      22             : namespace llvm {
      23             : class MCSymbol;
      24             : 
      25             : /// MachineModuleInfoMachO - This is a MachineModuleInfoImpl implementation
      26             : /// for MachO targets.
      27        8548 : class MachineModuleInfoMachO : public MachineModuleInfoImpl {
      28             :   /// GVStubs - Darwin '$non_lazy_ptr' stubs.  The key is something like
      29             :   /// "Lfoo$non_lazy_ptr", the value is something like "_foo". The extra bit
      30             :   /// is true if this GV is external.
      31             :   DenseMap<MCSymbol *, StubValueTy> GVStubs;
      32             : 
      33             :   /// ThreadLocalGVStubs - Darwin '$non_lazy_ptr' stubs.  The key is something
      34             :   /// like "Lfoo$non_lazy_ptr", the value is something like "_foo". The extra
      35             :   /// bit is true if this GV is external.
      36             :   DenseMap<MCSymbol *, StubValueTy> ThreadLocalGVStubs;
      37             : 
      38             :   virtual void anchor(); // Out of line virtual method.
      39             : public:
      40        6411 :   MachineModuleInfoMachO(const MachineModuleInfo &) {}
      41             : 
      42             :   StubValueTy &getGVStubEntry(MCSymbol *Sym) {
      43             :     assert(Sym && "Key cannot be null");
      44        3150 :     return GVStubs[Sym];
      45             :   }
      46             : 
      47             :   StubValueTy &getThreadLocalGVStubEntry(MCSymbol *Sym) {
      48             :     assert(Sym && "Key cannot be null");
      49          28 :     return ThreadLocalGVStubs[Sym];
      50             :   }
      51             : 
      52             :   /// Accessor methods to return the set of stubs in sorted order.
      53        2137 :   SymbolListTy GetGVStubList() { return getSortedStubs(GVStubs); }
      54             :   SymbolListTy GetThreadLocalGVStubList() {
      55         755 :     return getSortedStubs(ThreadLocalGVStubs);
      56             :   }
      57             : };
      58             : 
      59             : /// MachineModuleInfoELF - This is a MachineModuleInfoImpl implementation
      60             : /// for ELF targets.
      61       27490 : class MachineModuleInfoELF : public MachineModuleInfoImpl {
      62             :   /// GVStubs - These stubs are used to materialize global addresses in PIC
      63             :   /// mode.
      64             :   DenseMap<MCSymbol *, StubValueTy> GVStubs;
      65             : 
      66             :   virtual void anchor(); // Out of line virtual method.
      67             : public:
      68       27492 :   MachineModuleInfoELF(const MachineModuleInfo &) {}
      69             : 
      70             :   StubValueTy &getGVStubEntry(MCSymbol *Sym) {
      71             :     assert(Sym && "Key cannot be null");
      72         114 :     return GVStubs[Sym];
      73             :   }
      74             : 
      75             :   /// Accessor methods to return the set of stubs in sorted order.
      76             : 
      77       13740 :   SymbolListTy GetGVStubList() { return getSortedStubs(GVStubs); }
      78             : };
      79             : 
      80             : } // end namespace llvm
      81             : 
      82             : #endif

Generated by: LCOV version 1.13