File indexing completed on 2026-05-10 08:43:31
0001
0002
0003
0004
0005
0006
0007
0008
0009
0010
0011
0012
0013
0014 #ifndef LLVM_CODEGEN_MACHINEMODULEINFOIMPLS_H
0015 #define LLVM_CODEGEN_MACHINEMODULEINFOIMPLS_H
0016
0017 #include "llvm/ADT/DenseMap.h"
0018 #include "llvm/ADT/SetVector.h"
0019 #include "llvm/CodeGen/MachineModuleInfo.h"
0020 #include <cassert>
0021
0022 namespace llvm {
0023
0024 class MCSymbol;
0025
0026
0027
0028 class MachineModuleInfoMachO : public MachineModuleInfoImpl {
0029
0030
0031
0032 DenseMap<MCSymbol *, StubValueTy> GVStubs;
0033
0034
0035
0036
0037 DenseMap<MCSymbol *, StubValueTy> ThreadLocalGVStubs;
0038
0039
0040
0041
0042 DenseMap<MCSymbol *, const MCExpr *> AuthPtrStubs;
0043
0044 virtual void anchor();
0045
0046 public:
0047 MachineModuleInfoMachO(const MachineModuleInfo &) {}
0048
0049 StubValueTy &getGVStubEntry(MCSymbol *Sym) {
0050 assert(Sym && "Key cannot be null");
0051 return GVStubs[Sym];
0052 }
0053
0054 StubValueTy &getThreadLocalGVStubEntry(MCSymbol *Sym) {
0055 assert(Sym && "Key cannot be null");
0056 return ThreadLocalGVStubs[Sym];
0057 }
0058
0059 const MCExpr *&getAuthPtrStubEntry(MCSymbol *Sym) {
0060 assert(Sym && "Key cannot be null");
0061 return AuthPtrStubs[Sym];
0062 }
0063
0064
0065 SymbolListTy GetGVStubList() { return getSortedStubs(GVStubs); }
0066 SymbolListTy GetThreadLocalGVStubList() {
0067 return getSortedStubs(ThreadLocalGVStubs);
0068 }
0069
0070 ExprStubListTy getAuthGVStubList() {
0071 return getSortedExprStubs(AuthPtrStubs);
0072 }
0073 };
0074
0075
0076
0077 class MachineModuleInfoELF : public MachineModuleInfoImpl {
0078
0079
0080 DenseMap<MCSymbol *, StubValueTy> GVStubs;
0081
0082
0083
0084 DenseMap<MCSymbol *, const MCExpr *> AuthPtrStubs;
0085
0086
0087
0088 bool HasSignedPersonality = false;
0089
0090 virtual void anchor();
0091
0092 public:
0093 MachineModuleInfoELF(const MachineModuleInfo &);
0094
0095 StubValueTy &getGVStubEntry(MCSymbol *Sym) {
0096 assert(Sym && "Key cannot be null");
0097 return GVStubs[Sym];
0098 }
0099
0100 const MCExpr *&getAuthPtrStubEntry(MCSymbol *Sym) {
0101 assert(Sym && "Key cannot be null");
0102 return AuthPtrStubs[Sym];
0103 }
0104
0105
0106
0107 SymbolListTy GetGVStubList() { return getSortedStubs(GVStubs); }
0108
0109 ExprStubListTy getAuthGVStubList() {
0110 return getSortedExprStubs(AuthPtrStubs);
0111 }
0112
0113 bool hasSignedPersonality() const { return HasSignedPersonality; }
0114 };
0115
0116
0117
0118 class MachineModuleInfoCOFF : public MachineModuleInfoImpl {
0119
0120
0121 DenseMap<MCSymbol *, StubValueTy> GVStubs;
0122
0123 virtual void anchor();
0124
0125 public:
0126 MachineModuleInfoCOFF(const MachineModuleInfo &) {}
0127
0128 StubValueTy &getGVStubEntry(MCSymbol *Sym) {
0129 assert(Sym && "Key cannot be null");
0130 return GVStubs[Sym];
0131 }
0132
0133
0134
0135 SymbolListTy GetGVStubList() { return getSortedStubs(GVStubs); }
0136 };
0137
0138
0139
0140 class MachineModuleInfoWasm : public MachineModuleInfoImpl {
0141 virtual void anchor();
0142
0143 public:
0144 MachineModuleInfoWasm(const MachineModuleInfo &) {}
0145
0146 SetVector<StringRef> MachineSymbolsUsed;
0147 };
0148
0149 }
0150
0151 #endif