LLVM  8.0.0svn
MachineModuleInfoImpls.h
Go to the documentation of this file.
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"
20 #include <cassert>
21 
22 namespace llvm {
23 
24 class MCSymbol;
25 
26 /// MachineModuleInfoMachO - This is a MachineModuleInfoImpl implementation
27 /// for MachO targets.
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.
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:
43 
45  assert(Sym && "Key cannot be null");
46  return GVStubs[Sym];
47  }
48 
50  assert(Sym && "Key cannot be null");
51  return ThreadLocalGVStubs[Sym];
52  }
53 
54  /// Accessor methods to return the set of stubs in sorted order.
55  SymbolListTy GetGVStubList() { return getSortedStubs(GVStubs); }
57  return getSortedStubs(ThreadLocalGVStubs);
58  }
59 };
60 
61 /// MachineModuleInfoELF - This is a MachineModuleInfoImpl implementation
62 /// for ELF targets.
64  /// GVStubs - These stubs are used to materialize global addresses in PIC
65  /// mode.
67 
68  virtual void anchor(); // Out of line virtual method.
69 
70 public:
72 
74  assert(Sym && "Key cannot be null");
75  return GVStubs[Sym];
76  }
77 
78  /// Accessor methods to return the set of stubs in sorted order.
79 
80  SymbolListTy GetGVStubList() { return getSortedStubs(GVStubs); }
81 };
82 
83 /// MachineModuleInfoCOFF - This is a MachineModuleInfoImpl implementation
84 /// for COFF targets.
86  /// GVStubs - These stubs are used to materialize global addresses in PIC
87  /// mode.
89 
90  virtual void anchor(); // Out of line virtual method.
91 
92 public:
94 
96  assert(Sym && "Key cannot be null");
97  return GVStubs[Sym];
98  }
99 
100  /// Accessor methods to return the set of stubs in sorted order.
101 
103 };
104 
105 } // end namespace llvm
106 
107 #endif // LLVM_CODEGEN_MACHINEMODULEINFOIMPLS_H
SymbolListTy GetGVStubList()
Accessor methods to return the set of stubs in sorted order.
Compute iterated dominance frontiers using a linear time algorithm.
Definition: AllocatorList.h:24
MCSymbol - Instances of this class represent a symbol name in the MC file, and MCSymbols are created ...
Definition: MCSymbol.h:42
StubValueTy & getThreadLocalGVStubEntry(MCSymbol *Sym)
SymbolListTy GetGVStubList()
Accessor methods to return the set of stubs in sorted order.
MachineModuleInfoCOFF - This is a MachineModuleInfoImpl implementation for COFF targets.
PointerIntPair - This class implements a pair of a pointer and small integer.
StubValueTy & getGVStubEntry(MCSymbol *Sym)
StubValueTy & getGVStubEntry(MCSymbol *Sym)
SymbolListTy GetGVStubList()
Accessor methods to return the set of stubs in sorted order.
MachineModuleInfoELF(const MachineModuleInfo &)
StubValueTy & getGVStubEntry(MCSymbol *Sym)
MachineModuleInfoELF - This is a MachineModuleInfoImpl implementation for ELF targets.
MachineModuleInfoMachO - This is a MachineModuleInfoImpl implementation for MachO targets...
std::vector< std::pair< MCSymbol *, StubValueTy > > SymbolListTy
MachineModuleInfoCOFF(const MachineModuleInfo &)
assert(ImpDefSCC.getReg()==AMDGPU::SCC &&ImpDefSCC.isDef())
MachineModuleInfoMachO(const MachineModuleInfo &)
This class can be derived from and used by targets to hold private target-specific information for ea...
static SymbolListTy getSortedStubs(DenseMap< MCSymbol *, StubValueTy > &)
Return the entries from a DenseMap in a deterministic sorted orer.
This class contains meta information specific to a module.