26 VoidTy(C,
Type::VoidTyID),
27 LabelTy(C,
Type::LabelTyID),
28 HalfTy(C,
Type::HalfTyID),
31 MetadataTy(C,
Type::MetadataTyID),
32 TokenTy(C,
Type::TokenTyID),
33 X86_FP80Ty(C,
Type::X86_FP80TyID),
34 FP128Ty(C,
Type::FP128TyID),
35 PPC_FP128Ty(C,
Type::PPC_FP128TyID),
36 X86_MMXTy(C,
Type::X86_MMXTyID),
55 assert(InstructionMetadata.empty() &&
56 "Instructions with metadata have been leaked");
62 I->dropAllReferences();
63 #define HANDLE_MDNODE_LEAF_UNIQUABLE(CLASS) \ 64 for (auto *I : CLASS##s) \ 65 I->dropAllReferences(); 66 #include "llvm/IR/Metadata.def" 70 Pair.second->dropUsers();
72 Pair.second->dropUse();
75 for (
MDNode *
I : DistinctMDNodes)
76 I->deleteAsSubclass();
77 #define HANDLE_MDNODE_LEAF_UNIQUABLE(CLASS) \ 78 for (CLASS * I : CLASS##s) \ 80 #include "llvm/IR/Metadata.def" 84 I->dropAllReferences();
86 I->dropAllReferences();
88 I->dropAllReferences();
90 I->dropAllReferences();
91 ExprConstants.freeConstants();
92 ArrayConstants.freeConstants();
93 StructConstants.freeConstants();
94 VectorConstants.freeConstants();
104 delete CDSConstant.second;
105 CDSConstants.clear();
132 MDVs.
reserve(MetadataAsValues.size());
133 for (
auto &Pair : MetadataAsValues)
135 MetadataAsValues.clear();
141 for (
auto &Pair : ValuesAsMetadata)
154 C->destroyConstant();
188 unsigned RawHash = calculateHash(MDs);
190 "Expected hash of MDOperand to equal hash of Metadata*");
208 Tags[
T.second] =
T.first();
220 "Hit the maximum number of synchronization scopes allowed!");
227 for (
const auto &SSE :
SSC)
228 SSNs[SSE.second] = SSE.first();
246 OPG = &(*OptBisector);
static unsigned calculateHash(MDNode *N, unsigned Offset=0)
This is the base class for diagnostic handling in LLVM.
Tracking metadata reference owned by Metadata.
static GCMetadataPrinterRegistry::Add< ErlangGCPrinter > X("erlang", "erlang-compatible garbage collector")
void getOperandBundleTags(SmallVectorImpl< StringRef > &Tags) const
GCNRegPressure max(const GCNRegPressure &P1, const GCNRegPressure &P2)
FoldingSet< AttributeImpl > AttrsSet
This class represents lattice values for constants.
Extensions to this class implement mechanisms to disable passes and individual optimizations at compi...
void push_back(const T &Elt)
DenseMap< Value *, ValueAsMetadata * > ValuesAsMetadata
uint32_t getOperandBundleTagID(StringRef Tag) const
iterator find(StringRef Key)
void getSyncScopeNames(SmallVectorImpl< StringRef > &SSNs) const
getSyncScopeNames - Populates client supplied SmallVector with synchronization scope names registered...
static const Metadata * get_hashable_data(const MDOperand &X)
Make MDOperand transparent for hashing.
std::enable_if<!std::is_array< T >::value, std::unique_ptr< T > >::type make_unique(Args &&... args)
Constructs a new T() with the given args and returns a unique_ptr<T> which owns the object...
void reserve(size_type N)
void dropTriviallyDeadConstantArrays()
Destroy the ConstantArrays if they are not used.
op_iterator op_end() const
DenseMap< const Instruction *, MDAttachmentMap > InstructionMetadata
Collection of per-instruction metadata used in this context.
std::vector< MDNode * > DistinctMDNodes
ConstantUniqueMap< InlineAsm > InlineAsms
op_iterator op_begin() const
LLVMContextImpl(LLVMContext &C)
const Type::TypeID FloatTyID
ArrayRef - Represent a constant reference to an array (0 or more elements consecutively in memory)...
ArrayConstantsTy ArrayConstants
StringMap< SyncScope::ID > SSC
A set of interned synchronization scopes.
DenseMap< PointerType *, std::unique_ptr< ConstantPointerNull > > CPNConstants
void setOptPassGate(OptPassGate &)
Set the object which can disable optional passes and individual optimizations at compile time...
OptPassGate & getOptPassGate() const
Access the object which can disable optional passes and individual optimizations at compile time...
The instances of the Type class are immutable: once they are created, they are never changed...
This is an important class for using LLVM in a threaded context.
StringMapEntry< uint32_t > * getOrInsertBundleTag(StringRef Tag)
static GCRegistry::Add< CoreCLRGC > E("coreclr", "CoreCLR-compatible GC")
LLVM_NODISCARD bool empty() const
StringMap< uint32_t > BundleTagCache
A set of interned tags for operand bundles.
VectorConstantsTy VectorConstants
LLVMContextImpl *const pImpl
DenseMap< Metadata *, MetadataAsValue * > MetadataAsValues
void dropTriviallyDeadConstantArrays()
Destroy ConstantArrays in LLVMContext if they are not used.
This is a 'vector' (really, a variable-sized array), optimized for the case when the array is small...
Module.h This file contains the declarations for the Module class.
FoldingSet< AttributeListImpl > AttrsLists
This file declares the interface for bisecting optimizations.
bool insert(MapEntryTy *KeyValue)
insert - Insert the specified key/value pair into the map.
SmallPtrSet< Module *, 4 > OwnedModules
OwnedModules - The set of modules instantiated in this context, and which will be automatically delet...
hash_code hash_combine_range(InputIteratorT first, InputIteratorT last)
Compute a hash_code for a sequence of values.
SyncScope::ID getOrInsertSyncScopeID(StringRef SSN)
getOrInsertSyncScopeID - Maps synchronization scope name to synchronization scope ID...
DenseMap< Type *, std::unique_ptr< ConstantAggregateZero > > CAZConstants
ConstantUniqueMap< ConstantExpr > ExprConstants
assert(ImpDefSCC.getReg()==AMDGPU::SCC &&ImpDefSCC.isDef())
const Type::TypeID DoubleTyID
StructConstantsTy StructConstants
DenseMap< Type *, std::unique_ptr< UndefValue > > UVConstants
static ManagedStatic< OptBisect > OptBisector
Singleton instance of the OptBisect class.
FoldingSet< AttributeSetNode > AttrsSetNodes
StringRef - Represent a constant reference to a string, i.e.
ManagedStatic - This transparently changes the behavior of global statics to be lazily constructed on...
StringMap< ConstantDataSequential * > CDSConstants