LLVM  5.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 
18 #include "llvm/BinaryFormat/Wasm.h"
21 
22 namespace llvm {
23 class MCSymbol;
24 
25 /// MachineModuleInfoMachO - This is a MachineModuleInfoImpl implementation
26 /// for MachO targets.
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.
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:
41 
43  assert(Sym && "Key cannot be null");
44  return GVStubs[Sym];
45  }
46 
48  assert(Sym && "Key cannot be null");
49  return ThreadLocalGVStubs[Sym];
50  }
51 
52  /// Accessor methods to return the set of stubs in sorted order.
53  SymbolListTy GetGVStubList() { return getSortedStubs(GVStubs); }
55  return getSortedStubs(ThreadLocalGVStubs);
56  }
57 };
58 
59 /// MachineModuleInfoELF - This is a MachineModuleInfoImpl implementation
60 /// for ELF targets.
62  /// GVStubs - These stubs are used to materialize global addresses in PIC
63  /// mode.
65 
66  virtual void anchor(); // Out of line virtual method.
67 public:
69 
71  assert(Sym && "Key cannot be null");
72  return GVStubs[Sym];
73  }
74 
75  /// Accessor methods to return the set of stubs in sorted order.
76 
77  SymbolListTy GetGVStubList() { return getSortedStubs(GVStubs); }
78 };
79 
80 } // end namespace llvm
81 
82 #endif
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:42
PointerIntPair< MCSymbol *, 1, bool > StubValueTy
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 &)
std::vector< std::pair< MCSymbol *, StubValueTy >> SymbolListTy
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.