[Alignment][NFC] Convert StoreInst to MaybeAlign
[llvm-complete.git] / include / llvm / CodeGen / MachineModuleInfoImpls.h
blob746e9223961300c76d0410391b597bdd548aead0
1 //===- llvm/CodeGen/MachineModuleInfoImpls.h --------------------*- C++ -*-===//
2 //
3 // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
4 // See https://llvm.org/LICENSE.txt for license information.
5 // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
6 //
7 //===----------------------------------------------------------------------===//
8 //
9 // This file defines object-file format specific implementations of
10 // MachineModuleInfoImpl.
12 //===----------------------------------------------------------------------===//
14 #ifndef LLVM_CODEGEN_MACHINEMODULEINFOIMPLS_H
15 #define LLVM_CODEGEN_MACHINEMODULEINFOIMPLS_H
17 #include "llvm/ADT/DenseMap.h"
18 #include "llvm/CodeGen/MachineModuleInfo.h"
19 #include <cassert>
21 namespace llvm {
23 class MCSymbol;
25 /// MachineModuleInfoMachO - This is a MachineModuleInfoImpl implementation
26 /// for MachO targets.
27 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;
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;
38 virtual void anchor(); // Out of line virtual method.
40 public:
41 MachineModuleInfoMachO(const MachineModuleInfo &) {}
43 StubValueTy &getGVStubEntry(MCSymbol *Sym) {
44 assert(Sym && "Key cannot be null");
45 return GVStubs[Sym];
48 StubValueTy &getThreadLocalGVStubEntry(MCSymbol *Sym) {
49 assert(Sym && "Key cannot be null");
50 return ThreadLocalGVStubs[Sym];
53 /// Accessor methods to return the set of stubs in sorted order.
54 SymbolListTy GetGVStubList() { return getSortedStubs(GVStubs); }
55 SymbolListTy GetThreadLocalGVStubList() {
56 return getSortedStubs(ThreadLocalGVStubs);
60 /// MachineModuleInfoELF - This is a MachineModuleInfoImpl implementation
61 /// for ELF targets.
62 class MachineModuleInfoELF : public MachineModuleInfoImpl {
63 /// GVStubs - These stubs are used to materialize global addresses in PIC
64 /// mode.
65 DenseMap<MCSymbol *, StubValueTy> GVStubs;
67 virtual void anchor(); // Out of line virtual method.
69 public:
70 MachineModuleInfoELF(const MachineModuleInfo &) {}
72 StubValueTy &getGVStubEntry(MCSymbol *Sym) {
73 assert(Sym && "Key cannot be null");
74 return GVStubs[Sym];
77 /// Accessor methods to return the set of stubs in sorted order.
79 SymbolListTy GetGVStubList() { return getSortedStubs(GVStubs); }
82 /// MachineModuleInfoCOFF - This is a MachineModuleInfoImpl implementation
83 /// for COFF targets.
84 class MachineModuleInfoCOFF : public MachineModuleInfoImpl {
85 /// GVStubs - These stubs are used to materialize global addresses in PIC
86 /// mode.
87 DenseMap<MCSymbol *, StubValueTy> GVStubs;
89 virtual void anchor(); // Out of line virtual method.
91 public:
92 MachineModuleInfoCOFF(const MachineModuleInfo &) {}
94 StubValueTy &getGVStubEntry(MCSymbol *Sym) {
95 assert(Sym && "Key cannot be null");
96 return GVStubs[Sym];
99 /// Accessor methods to return the set of stubs in sorted order.
101 SymbolListTy GetGVStubList() { return getSortedStubs(GVStubs); }
104 } // end namespace llvm
106 #endif // LLVM_CODEGEN_MACHINEMODULEINFOIMPLS_H