1//===- llvm/CodeGen/MachineModuleInfoImpls.h --------------------*- C++ -*-===//
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
7//===----------------------------------------------------------------------===//
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
26/// MachineModuleInfoMachO - This is a MachineModuleInfoImpl implementation
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.
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.
39 /// Darwin '$auth_ptr' stubs. The key is the stub symbol, like
40 /// "Lfoo$auth_ptr$ib12ドル". The value is the MCExpr representing that
41 /// signed pointer, something like "_foo@AUTH(ib, 12)".
44 virtual void anchor();
// Out of line virtual method.
50 assert(Sym &&
"Key cannot be null");
55 assert(Sym &&
"Key cannot be null");
56 return ThreadLocalGVStubs[Sym];
60 assert(Sym &&
"Key cannot be null");
61 return AuthPtrStubs[Sym];
64 /// Accessor methods to return the set of stubs in sorted order.
75/// MachineModuleInfoELF - This is a MachineModuleInfoImpl implementation
78 /// GVStubs - These stubs are used to materialize global addresses in PIC
82 /// AuthPtrStubs - These stubs are used to materialize signed addresses for
83 /// extern_weak symbols.
86 /// HasSignedPersonality is true if the corresponding IR module has the
87 /// "ptrauth-sign-personality" flag set to 1.
88 bool HasSignedPersonality =
false;
90 virtual void anchor();
// Out of line virtual method.
96 assert(Sym &&
"Key cannot be null");
101 assert(Sym &&
"Key cannot be null");
102 return AuthPtrStubs[Sym];
105 /// Accessor methods to return the set of stubs in sorted order.
116/// MachineModuleInfoCOFF - This is a MachineModuleInfoImpl implementation
119 /// GVStubs - These stubs are used to materialize global addresses in PIC
123 virtual void anchor();
// Out of line virtual method.
129 assert(Sym &&
"Key cannot be null");
133 /// Accessor methods to return the set of stubs in sorted order.
138/// MachineModuleInfoWasm - This is a MachineModuleInfoImpl implementation
141 virtual void anchor();
// Out of line virtual method.
149}
// end namespace llvm
151#endif // LLVM_CODEGEN_MACHINEMODULEINFOIMPLS_H
assert(UImm &&(UImm !=~static_cast< T >(0)) &&"Invalid immediate!")
This file defines the DenseMap class.
This file implements a set that has insertion order iteration characteristics.
Base class for the full range of assembler expressions which are needed for parsing.
MCSymbol - Instances of this class represent a symbol name in the MC file, and MCSymbols are created ...
StubValueTy & getGVStubEntry(MCSymbol *Sym)
SymbolListTy GetGVStubList()
Accessor methods to return the set of stubs in sorted order.
MachineModuleInfoCOFF(const MachineModuleInfo &)
MachineModuleInfoELF(const MachineModuleInfo &)
const MCExpr *& getAuthPtrStubEntry(MCSymbol *Sym)
ExprStubListTy getAuthGVStubList()
bool hasSignedPersonality() const
StubValueTy & getGVStubEntry(MCSymbol *Sym)
SymbolListTy GetGVStubList()
Accessor methods to return the set of stubs in sorted order.
This class can be derived from and used by targets to hold private target-specific information for ea...
std::vector< std::pair< MCSymbol *, StubValueTy > > SymbolListTy
static SymbolListTy getSortedStubs(DenseMap< MCSymbol *, StubValueTy > &)
Return the entries from a DenseMap in a deterministic sorted orer.
std::vector< std::pair< MCSymbol *, const MCExpr * > > ExprStubListTy
A variant of SymbolListTy where the stub is a generalized MCExpr.
PointerIntPair< MCSymbol *, 1, bool > StubValueTy
static ExprStubListTy getSortedExprStubs(DenseMap< MCSymbol *, const MCExpr * > &)
Return the entries from a DenseMap in a deterministic sorted orer.
SymbolListTy GetThreadLocalGVStubList()
const MCExpr *& getAuthPtrStubEntry(MCSymbol *Sym)
StubValueTy & getGVStubEntry(MCSymbol *Sym)
StubValueTy & getThreadLocalGVStubEntry(MCSymbol *Sym)
SymbolListTy GetGVStubList()
Accessor methods to return the set of stubs in sorted order.
ExprStubListTy getAuthGVStubList()
MachineModuleInfoMachO(const MachineModuleInfo &)
MachineModuleInfoWasm(const MachineModuleInfo &)
SetVector< StringRef > MachineSymbolsUsed
This class contains meta information specific to a module.
A vector that has set insertion semantics.
This is an optimization pass for GlobalISel generic memory operations.