LLVM: lib/IR/LLVMContextImpl.cpp Source File (original) (raw)
1
2
3
4
5
6
7
8
9
10
11
12
27#include
28
29using namespace llvm;
30
41
43#ifndef NDEBUG
44
45
46
47
49#endif
50
51
52
53
56
57#ifndef NDEBUG
58
60 Pair.first->dump();
62#endif
63
64
65
67 I->dropAllReferences();
68#define HANDLE_MDNODE_LEAF_UNIQUABLE(CLASS) \
69 for (auto *I : CLASS##s) \
70 I->dropAllReferences();
71#include "llvm/IR/Metadata.def"
72
73
75 Pair.second->dropUsers();
77 Pair.second->dropUse();
78
79
81 AL->dropAllReferences( false);
82 delete AL;
83 }
85
86
88 I->deleteAsSubclass();
89
91 ConstantRangeListAttribute->~ConstantRangeListAttributeImpl();
92#define HANDLE_MDNODE_LEAF_UNIQUABLE(CLASS) \
93 for (CLASS * I : CLASS##s) \
94 delete I;
95#include "llvm/IR/Metadata.def"
96
97
99 I->dropAllReferences();
101 I->dropAllReferences();
103 I->dropAllReferences();
105 I->dropAllReferences();
112
125
126
130 delete &*Elem;
131 }
132
133
134 {
140 for (auto *V : MDVs)
141 delete V;
142 }
143
144
146 delete Pair.second;
147}
148
149namespace llvm {
150
151
152
153
154
155
156
157
158
159
160
161
162
163
165
166}
167
170#ifndef NDEBUG
171 {
174 assert(Hash == RawHash &&
175 "Expected hash of MDOperand to equal hash of Metadata*");
176 }
177#endif
178 return Hash;
179}
180
183}
184
189
193 Tags[T.second] = T.first();
194}
195
199 return I->second;
200}
201
203 auto NewSSID = SSC.size();
204 assert(NewSSID < std::numeric_limitsSyncScope::ID::max() &&
205 "Hit the maximum number of synchronization scopes allowed!");
206 return SSC.insert(std::make_pair(SSN, SyncScope::ID(NewSSID))).first->second;
207}
208
212 for (const auto &SSE : SSC)
213 SSNs[SSE.second] = SSE.first();
214}
215
216std::optional
218 for (const auto &SSE : SSC) {
219 if (SSE.second != Id)
220 continue;
221 return SSE.first();
222 }
223 return std::nullopt;
224}
225
226
227
229 if ()
231 return *OPG;
232}
233
235 this->OPG = &OPG;
236}
assert(UImm &&(UImm !=~static_cast< T >(0)) &&"Invalid immediate!")
This file defines the StringMapEntry class - it is intended to be a low dependency implementation det...
This file defines various helper methods and classes used by LLVMContextImpl for creating and managin...
Module.h This file contains the declarations for the Module class.
This defines the Use class.
const AbstractManglingParser< Derived, Alloc >::OperatorInfo AbstractManglingParser< Derived, Alloc >::Ops[]
const Type::TypeID FloatTyID
const Type::TypeID DoubleTyID
This file declares the interface for bisecting optimizations.
static TableGen::Emitter::OptClass< SkeletonEmitter > X("gen-skeleton-class", "Generate example skeleton class")
ArrayRef - Represent a constant reference to an array (0 or more elements consecutively in memory),...
List of ValueAsMetadata, to be used as an argument to a dbg.value intrinsic.
DenseMap< unsigned, std::unique_ptr< ConstantInt > > IntOneConstants
void getSyncScopeNames(SmallVectorImpl< StringRef > &SSNs) const
getSyncScopeNames - Populates client supplied SmallVector with synchronization scope names registered...
Definition LLVMContextImpl.cpp:209
DenseMap< unsigned, std::unique_ptr< ConstantInt > > IntZeroConstants
DenseMap< Metadata *, MetadataAsValue * > MetadataAsValues
DenseMap< APFloat, std::unique_ptr< ConstantFP > > FPConstants
SmallPtrSet< Module *, 4 > OwnedModules
OwnedModules - The set of modules instantiated in this context, and which will be automatically delet...
DenseMap< PointerType *, std::unique_ptr< ConstantPointerNull > > CPNConstants
DenseMap< Type *, std::unique_ptr< ConstantAggregateZero > > CAZConstants
DenseMap< Type *, std::unique_ptr< PoisonValue > > PVConstants
DenseMap< APInt, std::unique_ptr< ConstantInt > > IntConstants
std::vector< MDNode * > DistinctMDNodes
SyncScope::ID getOrInsertSyncScopeID(StringRef SSN)
getOrInsertSyncScopeID - Maps synchronization scope name to synchronization scope ID.
Definition LLVMContextImpl.cpp:202
void setOptPassGate(OptPassGate &)
Set the object which can disable optional passes and individual optimizations at compile time.
Definition LLVMContextImpl.cpp:234
VectorConstantsTy VectorConstants
~LLVMContextImpl()
Definition LLVMContextImpl.cpp:42
DenseMap< Type *, std::unique_ptr< UndefValue > > UVConstants
OptPassGate & getOptPassGate() const
Access the object which can disable optional passes and individual optimizations at compile time.
Definition LLVMContextImpl.cpp:228
DenseMap< const Value *, MDAttachments > ValueMetadata
Collection of metadata used in this context.
StringMapEntry< uint32_t > * getOrInsertBundleTag(StringRef Tag)
Definition LLVMContextImpl.cpp:185
std::unique_ptr< DiagnosticHandler > DiagHandler
StringMap< uint32_t > BundleTagCache
A set of interned tags for operand bundles.
StringMap< std::unique_ptr< ConstantDataSequential > > CDSConstants
StructConstantsTy StructConstants
void getOperandBundleTags(SmallVectorImpl< StringRef > &Tags) const
Definition LLVMContextImpl.cpp:190
FoldingSet< AttributeSetNode > AttrsSetNodes
ConstantUniqueMap< ConstantPtrAuth > ConstantPtrAuths
DenseMap< TargetExtType *, std::unique_ptr< ConstantTargetNone > > CTNConstants
ConstantUniqueMap< ConstantExpr > ExprConstants
uint32_t getOperandBundleTagID(StringRef Tag) const
Definition LLVMContextImpl.cpp:196
StringMap< SyncScope::ID > SSC
A set of interned synchronization scopes.
DenseMap< std::pair< ElementCount, APInt >, std::unique_ptr< ConstantInt > > IntSplatConstants
std::vector< ConstantRangeListAttributeImpl * > ConstantRangeListAttributes
DenseSet< DIArgList *, DIArgListInfo > DIArgLists
std::optional< StringRef > getSyncScopeName(SyncScope::ID Id) const
getSyncScopeName - Returns the name of a SyncScope::ID registered with LLVMContext,...
Definition LLVMContextImpl.cpp:217
ArrayConstantsTy ArrayConstants
DenseMap< Value *, ValueAsMetadata * > ValuesAsMetadata
ConstantUniqueMap< InlineAsm > InlineAsms
LLVMContextImpl(LLVMContext &C)
Definition LLVMContextImpl.cpp:31
SmallDenseMap< BasicBlock *, DbgMarker * > TrailingDbgRecords
Mapping of blocks to collections of "trailing" DbgVariableRecords.
DenseMap< std::pair< ElementCount, APFloat >, std::unique_ptr< ConstantFP > > FPSplatConstants
This is an important class for using LLVM in a threaded context.
static unsigned calculateHash(MDNode *N, unsigned Offset=0)
Definition LLVMContextImpl.cpp:168
Tracking metadata reference owned by Metadata.
Extensions to this class implement mechanisms to disable passes and individual optimizations at compi...
This class consists of common code factored out of the SmallVector class to reduce code duplication b...
void reserve(size_type N)
void push_back(const T &Elt)
This is a 'vector' (really, a variable-sized array), optimized for the case when the array is small.
StringMapEntry - This is used to represent one value that is inserted into a StringMap.
StringRef - Represent a constant reference to a string, i.e.
The instances of the Type class are immutable: once they are created, they are never changed.
@ C
The default llvm calling convention, compatible with C.
This is an optimization pass for GlobalISel generic memory operations.
auto drop_begin(T &&RangeOrContainer, size_t N=1)
Return a range covering RangeOrContainer with the first N elements excluded.
static const Metadata * get_hashable_data(const MDOperand &X)
Make MDOperand transparent for hashing.
Definition LLVMContextImpl.cpp:164
LLVM_ABI OptPassGate & getGlobalPassGate()
Singleton instance of the OptPassGate class, so multiple pass managers don't need to coordinate their...
hash_code hash_combine_range(InputIteratorT first, InputIteratorT last)
Compute a hash_code for a sequence of values.
Implement std::hash so that hash_code can be used in STL containers.
This is the base class for diagnostic handling in LLVM.