LLVM  4.0.0
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 
19 
20 namespace llvm {
21 class MCSymbol;
22 
23 /// MachineModuleInfoMachO - This is a MachineModuleInfoImpl implementation
24 /// for MachO targets.
26  /// GVStubs - Darwin '$non_lazy_ptr' stubs. The key is something like
27  /// "Lfoo$non_lazy_ptr", the value is something like "_foo". The extra bit
28  /// is true if this GV is external.
30 
31  /// ThreadLocalGVStubs - Darwin '$non_lazy_ptr' stubs. The key is something
32  /// like "Lfoo$non_lazy_ptr", the value is something like "_foo". The extra
33  /// bit is true if this GV is external.
34  DenseMap<MCSymbol *, StubValueTy> ThreadLocalGVStubs;
35 
36  virtual void anchor(); // Out of line virtual method.
37 public:
39 
41  assert(Sym && "Key cannot be null");
42  return GVStubs[Sym];
43  }
44 
46  assert(Sym && "Key cannot be null");
47  return ThreadLocalGVStubs[Sym];
48  }
49 
50  /// Accessor methods to return the set of stubs in sorted order.
51  SymbolListTy GetGVStubList() { return getSortedStubs(GVStubs); }
53  return getSortedStubs(ThreadLocalGVStubs);
54  }
55 };
56 
57 /// MachineModuleInfoELF - This is a MachineModuleInfoImpl implementation
58 /// for ELF targets.
60  /// GVStubs - These stubs are used to materialize global addresses in PIC
61  /// mode.
63 
64  virtual void anchor(); // Out of line virtual method.
65 public:
67 
69  assert(Sym && "Key cannot be null");
70  return GVStubs[Sym];
71  }
72 
73  /// Accessor methods to return the set of stubs in sorted order.
74 
75  SymbolListTy GetGVStubList() { return getSortedStubs(GVStubs); }
76 };
77 
78 } // end namespace llvm
79 
80 #endif
PointerIntPair< MCSymbol *, 1, bool > StubValueTy
SymbolListTy GetGVStubList()
Accessor methods to return the set of stubs in sorted order.
MCSymbol - Instances of this class represent a symbol name in the MC file, and MCSymbols are created ...
Definition: MCSymbol.h:39
std::vector< std::pair< MCSymbol *, StubValueTy > > SymbolListTy
StubValueTy & getThreadLocalGVStubEntry(MCSymbol *Sym)
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 &)
MachineModuleInfoELF - This is a MachineModuleInfoImpl implementation for ELF targets.
MachineModuleInfoMachO - This is a MachineModuleInfoImpl implementation for MachO targets...
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.