Coverage Report

Created: 2018-07-19 03:59

/Users/buildslave/jenkins/workspace/clang-stage2-coverage-R/llvm/include/llvm/CodeGen/MachineModuleInfoImpls.h
Line
Count
Source
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/ADT/DenseMap.h"
19
#include "llvm/CodeGen/MachineModuleInfo.h"
20
#include <cassert>
21
22
namespace llvm {
23
24
class MCSymbol;
25
26
/// MachineModuleInfoMachO - This is a MachineModuleInfoImpl implementation
27
/// for MachO targets.
28
class MachineModuleInfoMachO : public MachineModuleInfoImpl {
29
  /// GVStubs - Darwin '$non_lazy_ptr' stubs.  The key is something like
30
  /// "Lfoo$non_lazy_ptr", the value is something like "_foo". The extra bit
31
  /// is true if this GV is external.
32
  DenseMap<MCSymbol *, StubValueTy> GVStubs;
33
34
  /// ThreadLocalGVStubs - Darwin '$non_lazy_ptr' stubs.  The key is something
35
  /// like "Lfoo$non_lazy_ptr", the value is something like "_foo". The extra
36
  /// bit is true if this GV is external.
37
  DenseMap<MCSymbol *, StubValueTy> ThreadLocalGVStubs;
38
39
  virtual void anchor(); // Out of line virtual method.
40
41
public:
42
7.90k
  MachineModuleInfoMachO(const MachineModuleInfo &) {}
43
44
19.4k
  StubValueTy &getGVStubEntry(MCSymbol *Sym) {
45
19.4k
    assert(Sym && "Key cannot be null");
46
19.4k
    return GVStubs[Sym];
47
19.4k
  }
48
49
14
  StubValueTy &getThreadLocalGVStubEntry(MCSymbol *Sym) {
50
14
    assert(Sym && "Key cannot be null");
51
14
    return ThreadLocalGVStubs[Sym];
52
14
  }
53
54
  /// Accessor methods to return the set of stubs in sorted order.
55
7.90k
  SymbolListTy GetGVStubList() { return getSortedStubs(GVStubs); }
56
2.86k
  SymbolListTy GetThreadLocalGVStubList() {
57
2.86k
    return getSortedStubs(ThreadLocalGVStubs);
58
2.86k
  }
59
};
60
61
/// MachineModuleInfoELF - This is a MachineModuleInfoImpl implementation
62
/// for ELF targets.
63
class MachineModuleInfoELF : public MachineModuleInfoImpl {
64
  /// GVStubs - These stubs are used to materialize global addresses in PIC
65
  /// mode.
66
  DenseMap<MCSymbol *, StubValueTy> GVStubs;
67
68
  virtual void anchor(); // Out of line virtual method.
69
70
public:
71
15.9k
  MachineModuleInfoELF(const MachineModuleInfo &) {}
72
73
19
  StubValueTy &getGVStubEntry(MCSymbol *Sym) {
74
19
    assert(Sym && "Key cannot be null");
75
19
    return GVStubs[Sym];
76
19
  }
77
78
  /// Accessor methods to return the set of stubs in sorted order.
79
80
15.9k
  SymbolListTy GetGVStubList() { return getSortedStubs(GVStubs); }
81
};
82
83
} // end namespace llvm
84
85
#endif // LLVM_CODEGEN_MACHINEMODULEINFOIMPLS_H