LLVM  9.0.0svn
LLVMContextImpl.h
Go to the documentation of this file.
1 //===- LLVMContextImpl.h - The LLVMContextImpl opaque class -----*- 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 declares LLVMContextImpl, the opaque implementation
10 // of LLVMContext.
11 //
12 //===----------------------------------------------------------------------===//
13 
14 #ifndef LLVM_LIB_IR_LLVMCONTEXTIMPL_H
15 #define LLVM_LIB_IR_LLVMCONTEXTIMPL_H
16 
17 #include "AttributeImpl.h"
18 #include "ConstantsContext.h"
19 #include "llvm/ADT/APFloat.h"
20 #include "llvm/ADT/APInt.h"
21 #include "llvm/ADT/ArrayRef.h"
22 #include "llvm/ADT/DenseMap.h"
23 #include "llvm/ADT/DenseMapInfo.h"
24 #include "llvm/ADT/DenseSet.h"
25 #include "llvm/ADT/FoldingSet.h"
26 #include "llvm/ADT/Hashing.h"
27 #include "llvm/ADT/Optional.h"
28 #include "llvm/ADT/STLExtras.h"
29 #include "llvm/ADT/SmallPtrSet.h"
30 #include "llvm/ADT/SmallVector.h"
31 #include "llvm/ADT/StringMap.h"
32 #include "llvm/ADT/StringRef.h"
33 #include "llvm/ADT/StringSet.h"
35 #include "llvm/IR/Constants.h"
37 #include "llvm/IR/DerivedTypes.h"
38 #include "llvm/IR/LLVMContext.h"
39 #include "llvm/IR/Metadata.h"
40 #include "llvm/IR/TrackingMDRef.h"
41 #include "llvm/Support/Allocator.h"
42 #include "llvm/Support/Casting.h"
44 #include <algorithm>
45 #include <cassert>
46 #include <cstddef>
47 #include <cstdint>
48 #include <memory>
49 #include <string>
50 #include <utility>
51 #include <vector>
52 
53 namespace llvm {
54 
55 class ConstantFP;
56 class ConstantInt;
57 class Type;
58 class Value;
59 class ValueHandleBase;
60 
62  static inline APInt getEmptyKey() {
63  APInt V(nullptr, 0);
64  V.U.VAL = 0;
65  return V;
66  }
67 
68  static inline APInt getTombstoneKey() {
69  APInt V(nullptr, 0);
70  V.U.VAL = 1;
71  return V;
72  }
73 
74  static unsigned getHashValue(const APInt &Key) {
75  return static_cast<unsigned>(hash_value(Key));
76  }
77 
78  static bool isEqual(const APInt &LHS, const APInt &RHS) {
79  return LHS.getBitWidth() == RHS.getBitWidth() && LHS == RHS;
80  }
81 };
82 
84  static inline APFloat getEmptyKey() { return APFloat(APFloat::Bogus(), 1); }
85  static inline APFloat getTombstoneKey() { return APFloat(APFloat::Bogus(), 2); }
86 
87  static unsigned getHashValue(const APFloat &Key) {
88  return static_cast<unsigned>(hash_value(Key));
89  }
90 
91  static bool isEqual(const APFloat &LHS, const APFloat &RHS) {
92  return LHS.bitwiseIsEqual(RHS);
93  }
94 };
95 
97  struct KeyTy {
99  bool isPacked;
100 
101  KeyTy(const ArrayRef<Type*>& E, bool P) :
102  ETypes(E), isPacked(P) {}
103 
105  : ETypes(ST->elements()), isPacked(ST->isPacked()) {}
106 
107  bool operator==(const KeyTy& that) const {
108  if (isPacked != that.isPacked)
109  return false;
110  if (ETypes != that.ETypes)
111  return false;
112  return true;
113  }
114  bool operator!=(const KeyTy& that) const {
115  return !this->operator==(that);
116  }
117  };
118 
119  static inline StructType* getEmptyKey() {
121  }
122 
123  static inline StructType* getTombstoneKey() {
125  }
126 
127  static unsigned getHashValue(const KeyTy& Key) {
128  return hash_combine(hash_combine_range(Key.ETypes.begin(),
129  Key.ETypes.end()),
130  Key.isPacked);
131  }
132 
133  static unsigned getHashValue(const StructType *ST) {
134  return getHashValue(KeyTy(ST));
135  }
136 
137  static bool isEqual(const KeyTy& LHS, const StructType *RHS) {
138  if (RHS == getEmptyKey() || RHS == getTombstoneKey())
139  return false;
140  return LHS == KeyTy(RHS);
141  }
142 
143  static bool isEqual(const StructType *LHS, const StructType *RHS) {
144  return LHS == RHS;
145  }
146 };
147 
149  struct KeyTy {
150  const Type *ReturnType;
152  bool isVarArg;
153 
154  KeyTy(const Type* R, const ArrayRef<Type*>& P, bool V) :
155  ReturnType(R), Params(P), isVarArg(V) {}
156  KeyTy(const FunctionType *FT)
157  : ReturnType(FT->getReturnType()), Params(FT->params()),
158  isVarArg(FT->isVarArg()) {}
159 
160  bool operator==(const KeyTy& that) const {
161  if (ReturnType != that.ReturnType)
162  return false;
163  if (isVarArg != that.isVarArg)
164  return false;
165  if (Params != that.Params)
166  return false;
167  return true;
168  }
169  bool operator!=(const KeyTy& that) const {
170  return !this->operator==(that);
171  }
172  };
173 
174  static inline FunctionType* getEmptyKey() {
176  }
177 
178  static inline FunctionType* getTombstoneKey() {
180  }
181 
182  static unsigned getHashValue(const KeyTy& Key) {
183  return hash_combine(Key.ReturnType,
184  hash_combine_range(Key.Params.begin(),
185  Key.Params.end()),
186  Key.isVarArg);
187  }
188 
189  static unsigned getHashValue(const FunctionType *FT) {
190  return getHashValue(KeyTy(FT));
191  }
192 
193  static bool isEqual(const KeyTy& LHS, const FunctionType *RHS) {
194  if (RHS == getEmptyKey() || RHS == getTombstoneKey())
195  return false;
196  return LHS == KeyTy(RHS);
197  }
198 
199  static bool isEqual(const FunctionType *LHS, const FunctionType *RHS) {
200  return LHS == RHS;
201  }
202 };
203 
204 /// Structure for hashing arbitrary MDNode operands.
206  ArrayRef<Metadata *> RawOps;
208  unsigned Hash;
209 
210 protected:
212  : RawOps(Ops), Hash(calculateHash(Ops)) {}
213 
214  template <class NodeTy>
215  MDNodeOpsKey(const NodeTy *N, unsigned Offset = 0)
216  : Ops(N->op_begin() + Offset, N->op_end()), Hash(N->getHash()) {}
217 
218  template <class NodeTy>
219  bool compareOps(const NodeTy *RHS, unsigned Offset = 0) const {
220  if (getHash() != RHS->getHash())
221  return false;
222 
223  assert((RawOps.empty() || Ops.empty()) && "Two sets of operands?");
224  return RawOps.empty() ? compareOps(Ops, RHS, Offset)
225  : compareOps(RawOps, RHS, Offset);
226  }
227 
228  static unsigned calculateHash(MDNode *N, unsigned Offset = 0);
229 
230 private:
231  template <class T>
232  static bool compareOps(ArrayRef<T> Ops, const MDNode *RHS, unsigned Offset) {
233  if (Ops.size() != RHS->getNumOperands() - Offset)
234  return false;
235  return std::equal(Ops.begin(), Ops.end(), RHS->op_begin() + Offset);
236  }
237 
238  static unsigned calculateHash(ArrayRef<Metadata *> Ops);
239 
240 public:
241  unsigned getHash() const { return Hash; }
242 };
243 
244 template <class NodeTy> struct MDNodeKeyImpl;
245 
246 /// Configuration point for MDNodeInfo::isEqual().
247 template <class NodeTy> struct MDNodeSubsetEqualImpl {
249 
250  static bool isSubsetEqual(const KeyTy &LHS, const NodeTy *RHS) {
251  return false;
252  }
253 
254  static bool isSubsetEqual(const NodeTy *LHS, const NodeTy *RHS) {
255  return false;
256  }
257 };
258 
259 /// DenseMapInfo for MDTuple.
260 ///
261 /// Note that we don't need the is-function-local bit, since that's implicit in
262 /// the operands.
263 template <> struct MDNodeKeyImpl<MDTuple> : MDNodeOpsKey {
266 
267  bool isKeyOf(const MDTuple *RHS) const { return compareOps(RHS); }
268 
269  unsigned getHashValue() const { return getHash(); }
270 
271  static unsigned calculateHash(MDTuple *N) {
272  return MDNodeOpsKey::calculateHash(N);
273  }
274 };
275 
276 /// DenseMapInfo for DILocation.
277 template <> struct MDNodeKeyImpl<DILocation> {
278  unsigned Line;
279  unsigned Column;
283 
284  MDNodeKeyImpl(unsigned Line, unsigned Column, Metadata *Scope,
285  Metadata *InlinedAt, bool ImplicitCode)
286  : Line(Line), Column(Column), Scope(Scope), InlinedAt(InlinedAt),
287  ImplicitCode(ImplicitCode) {}
289  : Line(L->getLine()), Column(L->getColumn()), Scope(L->getRawScope()),
290  InlinedAt(L->getRawInlinedAt()), ImplicitCode(L->isImplicitCode()) {}
291 
292  bool isKeyOf(const DILocation *RHS) const {
293  return Line == RHS->getLine() && Column == RHS->getColumn() &&
294  Scope == RHS->getRawScope() && InlinedAt == RHS->getRawInlinedAt() &&
295  ImplicitCode == RHS->isImplicitCode();
296  }
297 
298  unsigned getHashValue() const {
299  return hash_combine(Line, Column, Scope, InlinedAt, ImplicitCode);
300  }
301 };
302 
303 /// DenseMapInfo for GenericDINode.
304 template <> struct MDNodeKeyImpl<GenericDINode> : MDNodeOpsKey {
305  unsigned Tag;
307 
308  MDNodeKeyImpl(unsigned Tag, MDString *Header, ArrayRef<Metadata *> DwarfOps)
309  : MDNodeOpsKey(DwarfOps), Tag(Tag), Header(Header) {}
311  : MDNodeOpsKey(N, 1), Tag(N->getTag()), Header(N->getRawHeader()) {}
312 
313  bool isKeyOf(const GenericDINode *RHS) const {
314  return Tag == RHS->getTag() && Header == RHS->getRawHeader() &&
315  compareOps(RHS, 1);
316  }
317 
318  unsigned getHashValue() const { return hash_combine(getHash(), Tag, Header); }
319 
320  static unsigned calculateHash(GenericDINode *N) {
321  return MDNodeOpsKey::calculateHash(N, 1);
322  }
323 };
324 
325 template <> struct MDNodeKeyImpl<DISubrange> {
327  int64_t LowerBound;
328 
329  MDNodeKeyImpl(Metadata *CountNode, int64_t LowerBound)
330  : CountNode(CountNode), LowerBound(LowerBound) {}
332  : CountNode(N->getRawCountNode()),
333  LowerBound(N->getLowerBound()) {}
334 
335  bool isKeyOf(const DISubrange *RHS) const {
336  if (LowerBound != RHS->getLowerBound())
337  return false;
338 
339  if (auto *RHSCount = RHS->getCount().dyn_cast<ConstantInt*>())
340  if (auto *MD = dyn_cast<ConstantAsMetadata>(CountNode))
341  if (RHSCount->getSExtValue() ==
342  cast<ConstantInt>(MD->getValue())->getSExtValue())
343  return true;
344 
345  return CountNode == RHS->getRawCountNode();
346  }
347 
348  unsigned getHashValue() const {
349  if (auto *MD = dyn_cast<ConstantAsMetadata>(CountNode))
350  return hash_combine(cast<ConstantInt>(MD->getValue())->getSExtValue(),
351  LowerBound);
352  return hash_combine(CountNode, LowerBound);
353  }
354 };
355 
356 template <> struct MDNodeKeyImpl<DIEnumerator> {
357  int64_t Value;
360 
361  MDNodeKeyImpl(int64_t Value, bool IsUnsigned, MDString *Name)
362  : Value(Value), Name(Name), IsUnsigned(IsUnsigned) {}
364  : Value(N->getValue()), Name(N->getRawName()),
365  IsUnsigned(N->isUnsigned()) {}
366 
367  bool isKeyOf(const DIEnumerator *RHS) const {
368  return Value == RHS->getValue() && IsUnsigned == RHS->isUnsigned() &&
369  Name == RHS->getRawName();
370  }
371 
372  unsigned getHashValue() const { return hash_combine(Value, Name); }
373 };
374 
375 template <> struct MDNodeKeyImpl<DIBasicType> {
376  unsigned Tag;
378  uint64_t SizeInBits;
380  unsigned Encoding;
381  unsigned Flags;
382 
383  MDNodeKeyImpl(unsigned Tag, MDString *Name, uint64_t SizeInBits,
384  uint32_t AlignInBits, unsigned Encoding, unsigned Flags)
385  : Tag(Tag), Name(Name), SizeInBits(SizeInBits), AlignInBits(AlignInBits),
386  Encoding(Encoding), Flags(Flags) {}
388  : Tag(N->getTag()), Name(N->getRawName()), SizeInBits(N->getSizeInBits()),
389  AlignInBits(N->getAlignInBits()), Encoding(N->getEncoding()), Flags(N->getFlags()) {}
390 
391  bool isKeyOf(const DIBasicType *RHS) const {
392  return Tag == RHS->getTag() && Name == RHS->getRawName() &&
393  SizeInBits == RHS->getSizeInBits() &&
394  AlignInBits == RHS->getAlignInBits() &&
395  Encoding == RHS->getEncoding() &&
396  Flags == RHS->getFlags();
397  }
398 
399  unsigned getHashValue() const {
400  return hash_combine(Tag, Name, SizeInBits, AlignInBits, Encoding);
401  }
402 };
403 
404 template <> struct MDNodeKeyImpl<DIDerivedType> {
405  unsigned Tag;
408  unsigned Line;
411  uint64_t SizeInBits;
412  uint64_t OffsetInBits;
415  unsigned Flags;
417 
418  MDNodeKeyImpl(unsigned Tag, MDString *Name, Metadata *File, unsigned Line,
419  Metadata *Scope, Metadata *BaseType, uint64_t SizeInBits,
420  uint32_t AlignInBits, uint64_t OffsetInBits,
421  Optional<unsigned> DWARFAddressSpace, unsigned Flags,
422  Metadata *ExtraData)
423  : Tag(Tag), Name(Name), File(File), Line(Line), Scope(Scope),
424  BaseType(BaseType), SizeInBits(SizeInBits), OffsetInBits(OffsetInBits),
425  AlignInBits(AlignInBits), DWARFAddressSpace(DWARFAddressSpace),
426  Flags(Flags), ExtraData(ExtraData) {}
428  : Tag(N->getTag()), Name(N->getRawName()), File(N->getRawFile()),
429  Line(N->getLine()), Scope(N->getRawScope()),
430  BaseType(N->getRawBaseType()), SizeInBits(N->getSizeInBits()),
431  OffsetInBits(N->getOffsetInBits()), AlignInBits(N->getAlignInBits()),
432  DWARFAddressSpace(N->getDWARFAddressSpace()), Flags(N->getFlags()),
433  ExtraData(N->getRawExtraData()) {}
434 
435  bool isKeyOf(const DIDerivedType *RHS) const {
436  return Tag == RHS->getTag() && Name == RHS->getRawName() &&
437  File == RHS->getRawFile() && Line == RHS->getLine() &&
438  Scope == RHS->getRawScope() && BaseType == RHS->getRawBaseType() &&
439  SizeInBits == RHS->getSizeInBits() &&
440  AlignInBits == RHS->getAlignInBits() &&
441  OffsetInBits == RHS->getOffsetInBits() &&
442  DWARFAddressSpace == RHS->getDWARFAddressSpace() &&
443  Flags == RHS->getFlags() &&
444  ExtraData == RHS->getRawExtraData();
445  }
446 
447  unsigned getHashValue() const {
448  // If this is a member inside an ODR type, only hash the type and the name.
449  // Otherwise the hash will be stronger than
450  // MDNodeSubsetEqualImpl::isODRMember().
451  if (Tag == dwarf::DW_TAG_member && Name)
452  if (auto *CT = dyn_cast_or_null<DICompositeType>(Scope))
453  if (CT->getRawIdentifier())
454  return hash_combine(Name, Scope);
455 
456  // Intentionally computes the hash on a subset of the operands for
457  // performance reason. The subset has to be significant enough to avoid
458  // collision "most of the time". There is no correctness issue in case of
459  // collision because of the full check above.
460  return hash_combine(Tag, Name, File, Line, Scope, BaseType, Flags);
461  }
462 };
463 
466 
467  static bool isSubsetEqual(const KeyTy &LHS, const DIDerivedType *RHS) {
468  return isODRMember(LHS.Tag, LHS.Scope, LHS.Name, RHS);
469  }
470 
471  static bool isSubsetEqual(const DIDerivedType *LHS, const DIDerivedType *RHS) {
472  return isODRMember(LHS->getTag(), LHS->getRawScope(), LHS->getRawName(),
473  RHS);
474  }
475 
476  /// Subprograms compare equal if they declare the same function in an ODR
477  /// type.
478  static bool isODRMember(unsigned Tag, const Metadata *Scope,
479  const MDString *Name, const DIDerivedType *RHS) {
480  // Check whether the LHS is eligible.
481  if (Tag != dwarf::DW_TAG_member || !Name)
482  return false;
483 
484  auto *CT = dyn_cast_or_null<DICompositeType>(Scope);
485  if (!CT || !CT->getRawIdentifier())
486  return false;
487 
488  // Compare to the RHS.
489  return Tag == RHS->getTag() && Name == RHS->getRawName() &&
490  Scope == RHS->getRawScope();
491  }
492 };
493 
494 template <> struct MDNodeKeyImpl<DICompositeType> {
495  unsigned Tag;
498  unsigned Line;
501  uint64_t SizeInBits;
502  uint64_t OffsetInBits;
504  unsigned Flags;
506  unsigned RuntimeLang;
511 
512  MDNodeKeyImpl(unsigned Tag, MDString *Name, Metadata *File, unsigned Line,
513  Metadata *Scope, Metadata *BaseType, uint64_t SizeInBits,
514  uint32_t AlignInBits, uint64_t OffsetInBits, unsigned Flags,
515  Metadata *Elements, unsigned RuntimeLang,
516  Metadata *VTableHolder, Metadata *TemplateParams,
517  MDString *Identifier, Metadata *Discriminator)
518  : Tag(Tag), Name(Name), File(File), Line(Line), Scope(Scope),
519  BaseType(BaseType), SizeInBits(SizeInBits), OffsetInBits(OffsetInBits),
520  AlignInBits(AlignInBits), Flags(Flags), Elements(Elements),
521  RuntimeLang(RuntimeLang), VTableHolder(VTableHolder),
522  TemplateParams(TemplateParams), Identifier(Identifier),
523  Discriminator(Discriminator) {}
525  : Tag(N->getTag()), Name(N->getRawName()), File(N->getRawFile()),
526  Line(N->getLine()), Scope(N->getRawScope()),
527  BaseType(N->getRawBaseType()), SizeInBits(N->getSizeInBits()),
528  OffsetInBits(N->getOffsetInBits()), AlignInBits(N->getAlignInBits()),
529  Flags(N->getFlags()), Elements(N->getRawElements()),
530  RuntimeLang(N->getRuntimeLang()), VTableHolder(N->getRawVTableHolder()),
531  TemplateParams(N->getRawTemplateParams()),
532  Identifier(N->getRawIdentifier()),
533  Discriminator(N->getRawDiscriminator()) {}
534 
535  bool isKeyOf(const DICompositeType *RHS) const {
536  return Tag == RHS->getTag() && Name == RHS->getRawName() &&
537  File == RHS->getRawFile() && Line == RHS->getLine() &&
538  Scope == RHS->getRawScope() && BaseType == RHS->getRawBaseType() &&
539  SizeInBits == RHS->getSizeInBits() &&
540  AlignInBits == RHS->getAlignInBits() &&
541  OffsetInBits == RHS->getOffsetInBits() && Flags == RHS->getFlags() &&
542  Elements == RHS->getRawElements() &&
543  RuntimeLang == RHS->getRuntimeLang() &&
544  VTableHolder == RHS->getRawVTableHolder() &&
545  TemplateParams == RHS->getRawTemplateParams() &&
546  Identifier == RHS->getRawIdentifier() &&
547  Discriminator == RHS->getRawDiscriminator();
548  }
549 
550  unsigned getHashValue() const {
551  // Intentionally computes the hash on a subset of the operands for
552  // performance reason. The subset has to be significant enough to avoid
553  // collision "most of the time". There is no correctness issue in case of
554  // collision because of the full check above.
555  return hash_combine(Name, File, Line, BaseType, Scope, Elements,
556  TemplateParams);
557  }
558 };
559 
560 template <> struct MDNodeKeyImpl<DISubroutineType> {
561  unsigned Flags;
562  uint8_t CC;
564 
565  MDNodeKeyImpl(unsigned Flags, uint8_t CC, Metadata *TypeArray)
566  : Flags(Flags), CC(CC), TypeArray(TypeArray) {}
568  : Flags(N->getFlags()), CC(N->getCC()), TypeArray(N->getRawTypeArray()) {}
569 
570  bool isKeyOf(const DISubroutineType *RHS) const {
571  return Flags == RHS->getFlags() && CC == RHS->getCC() &&
572  TypeArray == RHS->getRawTypeArray();
573  }
574 
575  unsigned getHashValue() const { return hash_combine(Flags, CC, TypeArray); }
576 };
577 
578 template <> struct MDNodeKeyImpl<DIFile> {
583 
584  MDNodeKeyImpl(MDString *Filename, MDString *Directory,
586  Optional<MDString *> Source)
587  : Filename(Filename), Directory(Directory), Checksum(Checksum),
588  Source(Source) {}
590  : Filename(N->getRawFilename()), Directory(N->getRawDirectory()),
591  Checksum(N->getRawChecksum()), Source(N->getRawSource()) {}
592 
593  bool isKeyOf(const DIFile *RHS) const {
594  return Filename == RHS->getRawFilename() &&
595  Directory == RHS->getRawDirectory() &&
596  Checksum == RHS->getRawChecksum() &&
597  Source == RHS->getRawSource();
598  }
599 
600  unsigned getHashValue() const {
601  return hash_combine(
602  Filename, Directory, Checksum ? Checksum->Kind : 0,
603  Checksum ? Checksum->Value : nullptr, Source.getValueOr(nullptr));
604  }
605 };
606 
607 template <> struct MDNodeKeyImpl<DISubprogram> {
612  unsigned Line;
614  unsigned ScopeLine;
616  unsigned VirtualIndex;
618  unsigned Flags;
619  unsigned SPFlags;
625 
626  MDNodeKeyImpl(Metadata *Scope, MDString *Name, MDString *LinkageName,
627  Metadata *File, unsigned Line, Metadata *Type,
628  unsigned ScopeLine, Metadata *ContainingType,
629  unsigned VirtualIndex, int ThisAdjustment, unsigned Flags,
630  unsigned SPFlags, Metadata *Unit, Metadata *TemplateParams,
631  Metadata *Declaration, Metadata *RetainedNodes,
632  Metadata *ThrownTypes)
633  : Scope(Scope), Name(Name), LinkageName(LinkageName), File(File),
634  Line(Line), Type(Type), ScopeLine(ScopeLine),
635  ContainingType(ContainingType), VirtualIndex(VirtualIndex),
636  ThisAdjustment(ThisAdjustment), Flags(Flags), SPFlags(SPFlags),
637  Unit(Unit), TemplateParams(TemplateParams), Declaration(Declaration),
638  RetainedNodes(RetainedNodes), ThrownTypes(ThrownTypes) {}
640  : Scope(N->getRawScope()), Name(N->getRawName()),
641  LinkageName(N->getRawLinkageName()), File(N->getRawFile()),
642  Line(N->getLine()), Type(N->getRawType()), ScopeLine(N->getScopeLine()),
643  ContainingType(N->getRawContainingType()),
644  VirtualIndex(N->getVirtualIndex()),
645  ThisAdjustment(N->getThisAdjustment()), Flags(N->getFlags()),
646  SPFlags(N->getSPFlags()), Unit(N->getRawUnit()),
647  TemplateParams(N->getRawTemplateParams()),
648  Declaration(N->getRawDeclaration()),
649  RetainedNodes(N->getRawRetainedNodes()),
650  ThrownTypes(N->getRawThrownTypes()) {}
651 
652  bool isKeyOf(const DISubprogram *RHS) const {
653  return Scope == RHS->getRawScope() && Name == RHS->getRawName() &&
654  LinkageName == RHS->getRawLinkageName() &&
655  File == RHS->getRawFile() && Line == RHS->getLine() &&
656  Type == RHS->getRawType() && ScopeLine == RHS->getScopeLine() &&
657  ContainingType == RHS->getRawContainingType() &&
658  VirtualIndex == RHS->getVirtualIndex() &&
659  ThisAdjustment == RHS->getThisAdjustment() &&
660  Flags == RHS->getFlags() && SPFlags == RHS->getSPFlags() &&
661  Unit == RHS->getUnit() &&
662  TemplateParams == RHS->getRawTemplateParams() &&
663  Declaration == RHS->getRawDeclaration() &&
664  RetainedNodes == RHS->getRawRetainedNodes() &&
665  ThrownTypes == RHS->getRawThrownTypes();
666  }
667 
668  bool isDefinition() const { return SPFlags & DISubprogram::SPFlagDefinition; }
669 
670  unsigned getHashValue() const {
671  // If this is a declaration inside an ODR type, only hash the type and the
672  // name. Otherwise the hash will be stronger than
673  // MDNodeSubsetEqualImpl::isDeclarationOfODRMember().
674  if (!isDefinition() && LinkageName)
675  if (auto *CT = dyn_cast_or_null<DICompositeType>(Scope))
676  if (CT->getRawIdentifier())
677  return hash_combine(LinkageName, Scope);
678 
679  // Intentionally computes the hash on a subset of the operands for
680  // performance reason. The subset has to be significant enough to avoid
681  // collision "most of the time". There is no correctness issue in case of
682  // collision because of the full check above.
683  return hash_combine(Name, Scope, File, Type, Line);
684  }
685 };
686 
687 template <> struct MDNodeSubsetEqualImpl<DISubprogram> {
689 
690  static bool isSubsetEqual(const KeyTy &LHS, const DISubprogram *RHS) {
691  return isDeclarationOfODRMember(LHS.isDefinition(), LHS.Scope,
692  LHS.LinkageName, LHS.TemplateParams, RHS);
693  }
694 
695  static bool isSubsetEqual(const DISubprogram *LHS, const DISubprogram *RHS) {
696  return isDeclarationOfODRMember(LHS->isDefinition(), LHS->getRawScope(),
697  LHS->getRawLinkageName(),
698  LHS->getRawTemplateParams(), RHS);
699  }
700 
701  /// Subprograms compare equal if they declare the same function in an ODR
702  /// type.
703  static bool isDeclarationOfODRMember(bool IsDefinition, const Metadata *Scope,
704  const MDString *LinkageName,
705  const Metadata *TemplateParams,
706  const DISubprogram *RHS) {
707  // Check whether the LHS is eligible.
708  if (IsDefinition || !Scope || !LinkageName)
709  return false;
710 
711  auto *CT = dyn_cast_or_null<DICompositeType>(Scope);
712  if (!CT || !CT->getRawIdentifier())
713  return false;
714 
715  // Compare to the RHS.
716  // FIXME: We need to compare template parameters here to avoid incorrect
717  // collisions in mapMetadata when RF_MoveDistinctMDs and a ODR-DISubprogram
718  // has a non-ODR template parameter (i.e., a DICompositeType that does not
719  // have an identifier). Eventually we should decouple ODR logic from
720  // uniquing logic.
721  return IsDefinition == RHS->isDefinition() && Scope == RHS->getRawScope() &&
722  LinkageName == RHS->getRawLinkageName() &&
723  TemplateParams == RHS->getRawTemplateParams();
724  }
725 };
726 
727 template <> struct MDNodeKeyImpl<DILexicalBlock> {
730  unsigned Line;
731  unsigned Column;
732 
733  MDNodeKeyImpl(Metadata *Scope, Metadata *File, unsigned Line, unsigned Column)
734  : Scope(Scope), File(File), Line(Line), Column(Column) {}
736  : Scope(N->getRawScope()), File(N->getRawFile()), Line(N->getLine()),
737  Column(N->getColumn()) {}
738 
739  bool isKeyOf(const DILexicalBlock *RHS) const {
740  return Scope == RHS->getRawScope() && File == RHS->getRawFile() &&
741  Line == RHS->getLine() && Column == RHS->getColumn();
742  }
743 
744  unsigned getHashValue() const {
745  return hash_combine(Scope, File, Line, Column);
746  }
747 };
748 
749 template <> struct MDNodeKeyImpl<DILexicalBlockFile> {
752  unsigned Discriminator;
753 
754  MDNodeKeyImpl(Metadata *Scope, Metadata *File, unsigned Discriminator)
755  : Scope(Scope), File(File), Discriminator(Discriminator) {}
757  : Scope(N->getRawScope()), File(N->getRawFile()),
758  Discriminator(N->getDiscriminator()) {}
759 
760  bool isKeyOf(const DILexicalBlockFile *RHS) const {
761  return Scope == RHS->getRawScope() && File == RHS->getRawFile() &&
762  Discriminator == RHS->getDiscriminator();
763  }
764 
765  unsigned getHashValue() const {
766  return hash_combine(Scope, File, Discriminator);
767  }
768 };
769 
770 template <> struct MDNodeKeyImpl<DINamespace> {
774 
775  MDNodeKeyImpl(Metadata *Scope, MDString *Name, bool ExportSymbols)
776  : Scope(Scope), Name(Name), ExportSymbols(ExportSymbols) {}
778  : Scope(N->getRawScope()), Name(N->getRawName()),
779  ExportSymbols(N->getExportSymbols()) {}
780 
781  bool isKeyOf(const DINamespace *RHS) const {
782  return Scope == RHS->getRawScope() && Name == RHS->getRawName() &&
783  ExportSymbols == RHS->getExportSymbols();
784  }
785 
786  unsigned getHashValue() const {
787  return hash_combine(Scope, Name);
788  }
789 };
790 
791 template <> struct MDNodeKeyImpl<DIModule> {
797 
798  MDNodeKeyImpl(Metadata *Scope, MDString *Name, MDString *ConfigurationMacros,
799  MDString *IncludePath, MDString *ISysRoot)
800  : Scope(Scope), Name(Name), ConfigurationMacros(ConfigurationMacros),
801  IncludePath(IncludePath), ISysRoot(ISysRoot) {}
803  : Scope(N->getRawScope()), Name(N->getRawName()),
804  ConfigurationMacros(N->getRawConfigurationMacros()),
805  IncludePath(N->getRawIncludePath()), ISysRoot(N->getRawISysRoot()) {}
806 
807  bool isKeyOf(const DIModule *RHS) const {
808  return Scope == RHS->getRawScope() && Name == RHS->getRawName() &&
809  ConfigurationMacros == RHS->getRawConfigurationMacros() &&
810  IncludePath == RHS->getRawIncludePath() &&
811  ISysRoot == RHS->getRawISysRoot();
812  }
813 
814  unsigned getHashValue() const {
815  return hash_combine(Scope, Name,
816  ConfigurationMacros, IncludePath, ISysRoot);
817  }
818 };
819 
823 
824  MDNodeKeyImpl(MDString *Name, Metadata *Type) : Name(Name), Type(Type) {}
826  : Name(N->getRawName()), Type(N->getRawType()) {}
827 
828  bool isKeyOf(const DITemplateTypeParameter *RHS) const {
829  return Name == RHS->getRawName() && Type == RHS->getRawType();
830  }
831 
832  unsigned getHashValue() const { return hash_combine(Name, Type); }
833 };
834 
836  unsigned Tag;
840 
841  MDNodeKeyImpl(unsigned Tag, MDString *Name, Metadata *Type, Metadata *Value)
842  : Tag(Tag), Name(Name), Type(Type), Value(Value) {}
844  : Tag(N->getTag()), Name(N->getRawName()), Type(N->getRawType()),
845  Value(N->getValue()) {}
846 
847  bool isKeyOf(const DITemplateValueParameter *RHS) const {
848  return Tag == RHS->getTag() && Name == RHS->getRawName() &&
849  Type == RHS->getRawType() && Value == RHS->getValue();
850  }
851 
852  unsigned getHashValue() const { return hash_combine(Tag, Name, Type, Value); }
853 };
854 
855 template <> struct MDNodeKeyImpl<DIGlobalVariable> {
860  unsigned Line;
867 
868  MDNodeKeyImpl(Metadata *Scope, MDString *Name, MDString *LinkageName,
869  Metadata *File, unsigned Line, Metadata *Type,
870  bool IsLocalToUnit, bool IsDefinition,
871  Metadata *StaticDataMemberDeclaration, Metadata *TemplateParams,
872  uint32_t AlignInBits)
873  : Scope(Scope), Name(Name), LinkageName(LinkageName), File(File),
874  Line(Line), Type(Type), IsLocalToUnit(IsLocalToUnit),
875  IsDefinition(IsDefinition),
876  StaticDataMemberDeclaration(StaticDataMemberDeclaration),
877  TemplateParams(TemplateParams), AlignInBits(AlignInBits) {}
879  : Scope(N->getRawScope()), Name(N->getRawName()),
880  LinkageName(N->getRawLinkageName()), File(N->getRawFile()),
881  Line(N->getLine()), Type(N->getRawType()),
882  IsLocalToUnit(N->isLocalToUnit()), IsDefinition(N->isDefinition()),
883  StaticDataMemberDeclaration(N->getRawStaticDataMemberDeclaration()),
884  TemplateParams(N->getRawTemplateParams()),
885  AlignInBits(N->getAlignInBits()) {}
886 
887  bool isKeyOf(const DIGlobalVariable *RHS) const {
888  return Scope == RHS->getRawScope() && Name == RHS->getRawName() &&
889  LinkageName == RHS->getRawLinkageName() &&
890  File == RHS->getRawFile() && Line == RHS->getLine() &&
891  Type == RHS->getRawType() && IsLocalToUnit == RHS->isLocalToUnit() &&
892  IsDefinition == RHS->isDefinition() &&
893  StaticDataMemberDeclaration ==
895  TemplateParams == RHS->getRawTemplateParams() &&
896  AlignInBits == RHS->getAlignInBits();
897  }
898 
899  unsigned getHashValue() const {
900  // We do not use AlignInBits in hashing function here on purpose:
901  // in most cases this param for local variable is zero (for function param
902  // it is always zero). This leads to lots of hash collisions and errors on
903  // cases with lots of similar variables.
904  // clang/test/CodeGen/debug-info-257-args.c is an example of this problem,
905  // generated IR is random for each run and test fails with Align included.
906  // TODO: make hashing work fine with such situations
907  return hash_combine(Scope, Name, LinkageName, File, Line, Type,
908  IsLocalToUnit, IsDefinition, /* AlignInBits, */
909  StaticDataMemberDeclaration);
910  }
911 };
912 
913 template <> struct MDNodeKeyImpl<DILocalVariable> {
917  unsigned Line;
919  unsigned Arg;
920  unsigned Flags;
922 
923  MDNodeKeyImpl(Metadata *Scope, MDString *Name, Metadata *File, unsigned Line,
924  Metadata *Type, unsigned Arg, unsigned Flags,
925  uint32_t AlignInBits)
926  : Scope(Scope), Name(Name), File(File), Line(Line), Type(Type), Arg(Arg),
927  Flags(Flags), AlignInBits(AlignInBits) {}
929  : Scope(N->getRawScope()), Name(N->getRawName()), File(N->getRawFile()),
930  Line(N->getLine()), Type(N->getRawType()), Arg(N->getArg()),
931  Flags(N->getFlags()), AlignInBits(N->getAlignInBits()) {}
932 
933  bool isKeyOf(const DILocalVariable *RHS) const {
934  return Scope == RHS->getRawScope() && Name == RHS->getRawName() &&
935  File == RHS->getRawFile() && Line == RHS->getLine() &&
936  Type == RHS->getRawType() && Arg == RHS->getArg() &&
937  Flags == RHS->getFlags() && AlignInBits == RHS->getAlignInBits();
938  }
939 
940  unsigned getHashValue() const {
941  // We do not use AlignInBits in hashing function here on purpose:
942  // in most cases this param for local variable is zero (for function param
943  // it is always zero). This leads to lots of hash collisions and errors on
944  // cases with lots of similar variables.
945  // clang/test/CodeGen/debug-info-257-args.c is an example of this problem,
946  // generated IR is random for each run and test fails with Align included.
947  // TODO: make hashing work fine with such situations
948  return hash_combine(Scope, Name, File, Line, Type, Arg, Flags);
949  }
950 };
951 
952 template <> struct MDNodeKeyImpl<DILabel> {
956  unsigned Line;
957 
958  MDNodeKeyImpl(Metadata *Scope, MDString *Name, Metadata *File, unsigned Line)
959  : Scope(Scope), Name(Name), File(File), Line(Line) {}
961  : Scope(N->getRawScope()), Name(N->getRawName()), File(N->getRawFile()),
962  Line(N->getLine()) {}
963 
964  bool isKeyOf(const DILabel *RHS) const {
965  return Scope == RHS->getRawScope() && Name == RHS->getRawName() &&
966  File == RHS->getRawFile() && Line == RHS->getLine();
967  }
968 
969  /// Using name and line to get hash value. It should already be mostly unique.
970  unsigned getHashValue() const {
971  return hash_combine(Scope, Name, Line);
972  }
973 };
974 
975 template <> struct MDNodeKeyImpl<DIExpression> {
977 
978  MDNodeKeyImpl(ArrayRef<uint64_t> Elements) : Elements(Elements) {}
979  MDNodeKeyImpl(const DIExpression *N) : Elements(N->getElements()) {}
980 
981  bool isKeyOf(const DIExpression *RHS) const {
982  return Elements == RHS->getElements();
983  }
984 
985  unsigned getHashValue() const {
986  return hash_combine_range(Elements.begin(), Elements.end());
987  }
988 };
989 
993 
994  MDNodeKeyImpl(Metadata *Variable, Metadata *Expression)
995  : Variable(Variable), Expression(Expression) {}
997  : Variable(N->getRawVariable()), Expression(N->getRawExpression()) {}
998 
999  bool isKeyOf(const DIGlobalVariableExpression *RHS) const {
1000  return Variable == RHS->getRawVariable() &&
1001  Expression == RHS->getRawExpression();
1002  }
1003 
1004  unsigned getHashValue() const { return hash_combine(Variable, Expression); }
1005 };
1006 
1007 template <> struct MDNodeKeyImpl<DIObjCProperty> {
1010  unsigned Line;
1013  unsigned Attributes;
1015 
1016  MDNodeKeyImpl(MDString *Name, Metadata *File, unsigned Line,
1017  MDString *GetterName, MDString *SetterName, unsigned Attributes,
1018  Metadata *Type)
1019  : Name(Name), File(File), Line(Line), GetterName(GetterName),
1020  SetterName(SetterName), Attributes(Attributes), Type(Type) {}
1022  : Name(N->getRawName()), File(N->getRawFile()), Line(N->getLine()),
1023  GetterName(N->getRawGetterName()), SetterName(N->getRawSetterName()),
1024  Attributes(N->getAttributes()), Type(N->getRawType()) {}
1025 
1026  bool isKeyOf(const DIObjCProperty *RHS) const {
1027  return Name == RHS->getRawName() && File == RHS->getRawFile() &&
1028  Line == RHS->getLine() && GetterName == RHS->getRawGetterName() &&
1029  SetterName == RHS->getRawSetterName() &&
1030  Attributes == RHS->getAttributes() && Type == RHS->getRawType();
1031  }
1032 
1033  unsigned getHashValue() const {
1034  return hash_combine(Name, File, Line, GetterName, SetterName, Attributes,
1035  Type);
1036  }
1037 };
1038 
1039 template <> struct MDNodeKeyImpl<DIImportedEntity> {
1040  unsigned Tag;
1044  unsigned Line;
1046 
1047  MDNodeKeyImpl(unsigned Tag, Metadata *Scope, Metadata *Entity, Metadata *File,
1048  unsigned Line, MDString *Name)
1049  : Tag(Tag), Scope(Scope), Entity(Entity), File(File), Line(Line),
1050  Name(Name) {}
1052  : Tag(N->getTag()), Scope(N->getRawScope()), Entity(N->getRawEntity()),
1053  File(N->getRawFile()), Line(N->getLine()), Name(N->getRawName()) {}
1054 
1055  bool isKeyOf(const DIImportedEntity *RHS) const {
1056  return Tag == RHS->getTag() && Scope == RHS->getRawScope() &&
1057  Entity == RHS->getRawEntity() && File == RHS->getFile() &&
1058  Line == RHS->getLine() && Name == RHS->getRawName();
1059  }
1060 
1061  unsigned getHashValue() const {
1062  return hash_combine(Tag, Scope, Entity, File, Line, Name);
1063  }
1064 };
1065 
1066 template <> struct MDNodeKeyImpl<DIMacro> {
1067  unsigned MIType;
1068  unsigned Line;
1071 
1072  MDNodeKeyImpl(unsigned MIType, unsigned Line, MDString *Name, MDString *Value)
1073  : MIType(MIType), Line(Line), Name(Name), Value(Value) {}
1075  : MIType(N->getMacinfoType()), Line(N->getLine()), Name(N->getRawName()),
1076  Value(N->getRawValue()) {}
1077 
1078  bool isKeyOf(const DIMacro *RHS) const {
1079  return MIType == RHS->getMacinfoType() && Line == RHS->getLine() &&
1080  Name == RHS->getRawName() && Value == RHS->getRawValue();
1081  }
1082 
1083  unsigned getHashValue() const {
1084  return hash_combine(MIType, Line, Name, Value);
1085  }
1086 };
1087 
1088 template <> struct MDNodeKeyImpl<DIMacroFile> {
1089  unsigned MIType;
1090  unsigned Line;
1093 
1094  MDNodeKeyImpl(unsigned MIType, unsigned Line, Metadata *File,
1095  Metadata *Elements)
1096  : MIType(MIType), Line(Line), File(File), Elements(Elements) {}
1098  : MIType(N->getMacinfoType()), Line(N->getLine()), File(N->getRawFile()),
1099  Elements(N->getRawElements()) {}
1100 
1101  bool isKeyOf(const DIMacroFile *RHS) const {
1102  return MIType == RHS->getMacinfoType() && Line == RHS->getLine() &&
1103  File == RHS->getRawFile() && Elements == RHS->getRawElements();
1104  }
1105 
1106  unsigned getHashValue() const {
1107  return hash_combine(MIType, Line, File, Elements);
1108  }
1109 };
1110 
1111 /// DenseMapInfo for MDNode subclasses.
1112 template <class NodeTy> struct MDNodeInfo {
1115 
1116  static inline NodeTy *getEmptyKey() {
1118  }
1119 
1120  static inline NodeTy *getTombstoneKey() {
1122  }
1123 
1124  static unsigned getHashValue(const KeyTy &Key) { return Key.getHashValue(); }
1125 
1126  static unsigned getHashValue(const NodeTy *N) {
1127  return KeyTy(N).getHashValue();
1128  }
1129 
1130  static bool isEqual(const KeyTy &LHS, const NodeTy *RHS) {
1131  if (RHS == getEmptyKey() || RHS == getTombstoneKey())
1132  return false;
1133  return SubsetEqualTy::isSubsetEqual(LHS, RHS) || LHS.isKeyOf(RHS);
1134  }
1135 
1136  static bool isEqual(const NodeTy *LHS, const NodeTy *RHS) {
1137  if (LHS == RHS)
1138  return true;
1139  if (RHS == getEmptyKey() || RHS == getTombstoneKey())
1140  return false;
1141  return SubsetEqualTy::isSubsetEqual(LHS, RHS);
1142  }
1143 };
1144 
1145 #define HANDLE_MDNODE_LEAF(CLASS) using CLASS##Info = MDNodeInfo<CLASS>;
1146 #include "llvm/IR/Metadata.def"
1147 
1148 /// Map-like storage for metadata attachments.
1151 
1152 public:
1153  bool empty() const { return Attachments.empty(); }
1154  size_t size() const { return Attachments.size(); }
1155 
1156  /// Get a particular attachment (if any).
1157  MDNode *lookup(unsigned ID) const;
1158 
1159  /// Set an attachment to a particular node.
1160  ///
1161  /// Set the \c ID attachment to \c MD, replacing the current attachment at \c
1162  /// ID (if anyway).
1163  void set(unsigned ID, MDNode &MD);
1164 
1165  /// Remove an attachment.
1166  ///
1167  /// Remove the attachment at \c ID, if any.
1168  bool erase(unsigned ID);
1169 
1170  /// Copy out all the attachments.
1171  ///
1172  /// Copies all the current attachments into \c Result, sorting by attachment
1173  /// ID. This function does \em not clear \c Result.
1174  void getAll(SmallVectorImpl<std::pair<unsigned, MDNode *>> &Result) const;
1175 
1176  /// Erase matching attachments.
1177  ///
1178  /// Erases all attachments matching the \c shouldRemove predicate.
1179  template <class PredTy> void remove_if(PredTy shouldRemove) {
1180  Attachments.erase(llvm::remove_if(Attachments, shouldRemove),
1181  Attachments.end());
1182  }
1183 };
1184 
1185 /// Multimap-like storage for metadata attachments for globals. This differs
1186 /// from MDAttachmentMap in that it allows multiple attachments per metadata
1187 /// kind.
1189  struct Attachment {
1190  unsigned MDKind;
1192  };
1193  SmallVector<Attachment, 1> Attachments;
1194 
1195 public:
1196  bool empty() const { return Attachments.empty(); }
1197 
1198  /// Appends all attachments with the given ID to \c Result in insertion order.
1199  /// If the global has no attachments with the given ID, or if ID is invalid,
1200  /// leaves Result unchanged.
1201  void get(unsigned ID, SmallVectorImpl<MDNode *> &Result) const;
1202 
1203  /// Returns the first attachment with the given ID or nullptr if no such
1204  /// attachment exists.
1205  MDNode *lookup(unsigned ID) const;
1206 
1207  void insert(unsigned ID, MDNode &MD);
1208  bool erase(unsigned ID);
1209 
1210  /// Appends all attachments for the global to \c Result, sorting by attachment
1211  /// ID. Attachments with the same ID appear in insertion order. This function
1212  /// does \em not clear \c Result.
1213  void getAll(SmallVectorImpl<std::pair<unsigned, MDNode *>> &Result) const;
1214 };
1215 
1217 public:
1218  /// OwnedModules - The set of modules instantiated in this context, and which
1219  /// will be automatically deleted if this context is deleted.
1221 
1222  LLVMContext::InlineAsmDiagHandlerTy InlineAsmDiagHandler = nullptr;
1223  void *InlineAsmDiagContext = nullptr;
1224 
1225  std::unique_ptr<DiagnosticHandler> DiagHandler;
1226  bool RespectDiagnosticFilters = false;
1227  bool DiagnosticsHotnessRequested = false;
1228  uint64_t DiagnosticsHotnessThreshold = 0;
1229  std::unique_ptr<yaml::Output> DiagnosticsOutputFile;
1230 
1231  LLVMContext::YieldCallbackTy YieldCallback = nullptr;
1232  void *YieldOpaqueHandle = nullptr;
1233 
1234  using IntMapTy =
1237 
1238  using FPMapTy =
1241 
1245 
1249 
1251 
1252 #define HANDLE_MDNODE_LEAF_UNIQUABLE(CLASS) \
1253  DenseSet<CLASS *, CLASS##Info> CLASS##s;
1254 #include "llvm/IR/Metadata.def"
1255 
1256  // Optional map for looking up composite types by identifier.
1258 
1259  // MDNodes may be uniqued or not uniqued. When they're not uniqued, they
1260  // aren't in the MDNodeSet, but they're still shared between objects, so no
1261  // one object can destroy them. Keep track of them here so we can delete
1262  // them on context teardown.
1263  std::vector<MDNode *> DistinctMDNodes;
1264 
1266 
1269 
1272 
1275 
1277 
1279 
1281 
1285 
1287 
1288  ConstantInt *TheTrueVal = nullptr;
1289  ConstantInt *TheFalseVal = nullptr;
1290 
1291  std::unique_ptr<ConstantTokenNone> TheNoneToken;
1292 
1293  // Basic type instances.
1294  Type VoidTy, LabelTy, HalfTy, FloatTy, DoubleTy, MetadataTy, TokenTy;
1295  Type X86_FP80Ty, FP128Ty, PPC_FP128Ty, X86_MMXTy;
1296  IntegerType Int1Ty, Int8Ty, Int16Ty, Int32Ty, Int64Ty, Int128Ty;
1297 
1298  /// TypeAllocator - All dynamically allocated types are allocated from this.
1299  /// They live forever until the context is torn down.
1301 
1303 
1309  unsigned NamedStructTypesUniqueID = 0;
1310 
1313  DenseMap<Type*, PointerType*> PointerTypes; // Pointers in AddrSpace = 0
1315 
1316  /// ValueHandles - This map keeps track of all of the value handles that are
1317  /// watching a Value*. The Value::HasValueHandle bit is used to know
1318  /// whether or not a value has an entry in this map.
1321 
1322  /// CustomMDKindNames - Map to hold the metadata string to ID mapping.
1324 
1325  /// Collection of per-instruction metadata used in this context.
1327 
1328  /// Collection of per-GlobalObject metadata used in this context.
1330 
1331  /// Collection of per-GlobalObject sections used in this context.
1333 
1334  /// Stable collection of section strings.
1336 
1337  /// DiscriminatorTable - This table maps file:line locations to an
1338  /// integer representing the next DWARF path discriminator to assign to
1339  /// instructions in different blocks at the same location.
1341 
1342  int getOrAddScopeRecordIdxEntry(MDNode *N, int ExistingIdx);
1343  int getOrAddScopeInlinedAtIdxEntry(MDNode *Scope, MDNode *IA,int ExistingIdx);
1344 
1345  /// A set of interned tags for operand bundles. The StringMap maps
1346  /// bundle tags to their IDs.
1347  ///
1348  /// \see LLVMContext::getOperandBundleTagID
1350 
1351  StringMapEntry<uint32_t> *getOrInsertBundleTag(StringRef Tag);
1352  void getOperandBundleTags(SmallVectorImpl<StringRef> &Tags) const;
1353  uint32_t getOperandBundleTagID(StringRef Tag) const;
1354 
1355  /// A set of interned synchronization scopes. The StringMap maps
1356  /// synchronization scope names to their respective synchronization scope IDs.
1358 
1359  /// getOrInsertSyncScopeID - Maps synchronization scope name to
1360  /// synchronization scope ID. Every synchronization scope registered with
1361  /// LLVMContext has unique ID except pre-defined ones.
1362  SyncScope::ID getOrInsertSyncScopeID(StringRef SSN);
1363 
1364  /// getSyncScopeNames - Populates client supplied SmallVector with
1365  /// synchronization scope names registered with LLVMContext. Synchronization
1366  /// scope names are ordered by increasing synchronization scope IDs.
1367  void getSyncScopeNames(SmallVectorImpl<StringRef> &SSNs) const;
1368 
1369  /// Maintain the GC name for each function.
1370  ///
1371  /// This saves allocating an additional word in Function for programs which
1372  /// do not use GC (i.e., most programs) at the cost of increased overhead for
1373  /// clients which do use GC.
1375 
1376  /// Flag to indicate if Value (other than GlobalValue) retains their name or
1377  /// not.
1378  bool DiscardValueNames = false;
1379 
1381  ~LLVMContextImpl();
1382 
1383  /// Destroy the ConstantArrays if they are not used.
1384  void dropTriviallyDeadConstantArrays();
1385 
1386  mutable OptPassGate *OPG = nullptr;
1387 
1388  /// Access the object which can disable optional passes and individual
1389  /// optimizations at compile time.
1390  OptPassGate &getOptPassGate() const;
1391 
1392  /// Set the object which can disable optional passes and individual
1393  /// optimizations at compile time.
1394  ///
1395  /// The lifetime of the object must be guaranteed to extend as long as the
1396  /// LLVMContext is used by compilation.
1397  void setOptPassGate(OptPassGate&);
1398 };
1399 
1400 } // end namespace llvm
1401 
1402 #endif // LLVM_LIB_IR_LLVMCONTEXTIMPL_H
static unsigned calculateHash(MDNode *N, unsigned Offset=0)
DIFlags getFlags() const
static APInt getTombstoneKey()
uint64_t CallInst * C
static bool isEqual(const KeyTy &LHS, const FunctionType *RHS)
static APFloat getTombstoneKey()
MDString * getRawName() const
DenseMap< unsigned, IntegerType * > IntegerTypes
ArrayRef< uint64_t > getElements() const
uint64_t getOffsetInBits() const
Type
MessagePack types as defined in the standard, with the exception of Integer being divided into a sign...
Definition: MsgPackReader.h:48
static bool isEqual(const NodeTy *LHS, const NodeTy *RHS)
bool isKeyOf(const MDTuple *RHS) const
StringMap< MDString, BumpPtrAllocator > MDStringCache
static bool isSubsetEqual(const KeyTy &LHS, const NodeTy *RHS)
unsigned getLine() const
MDNodeKeyImpl(Metadata *Scope, MDString *Name, Metadata *File, unsigned Line, Metadata *Type, unsigned Arg, unsigned Flags, uint32_t AlignInBits)
static unsigned getHashValue(const KeyTy &Key)
FoldingSet< AttributeImpl > AttrsSet
This class represents lattice values for constants.
Definition: AllocatorList.h:23
static unsigned getHashValue(const KeyTy &Key)
Metadata * getRawScope() const
Structure for hashing arbitrary MDNode operands.
MDString * getRawName() const
Metadata * getRawVTableHolder() const
DenseMap< std::pair< const Function *, const BasicBlock * >, BlockAddress * > BlockAddresses
iterator begin() const
Definition: ArrayRef.h:136
MDString * getRawName() const
Extensions to this class implement mechanisms to disable passes and individual optimizations at compi...
Definition: OptBisect.h:31
amdgpu Simplify well known AMD library false FunctionCallee Value const Twine & Name
static StructType * getTombstoneKey()
void(*)(LLVMContext *Context, void *OpaqueHandle) YieldCallbackTy
Defines the type of a yield callback.
Definition: LLVMContext.h:176
Configuration point for MDNodeInfo::isEqual().
MDNodeKeyImpl(unsigned Tag, MDString *Name, Metadata *File, unsigned Line, Metadata *Scope, Metadata *BaseType, uint64_t SizeInBits, uint32_t AlignInBits, uint64_t OffsetInBits, unsigned Flags, Metadata *Elements, unsigned RuntimeLang, Metadata *VTableHolder, Metadata *TemplateParams, MDString *Identifier, Metadata *Discriminator)
DenseMap< Value *, ValueAsMetadata * > ValuesAsMetadata
unsigned getDiscriminator() const
MDString * getRawValue() const
bool isKeyOf(const DIMacro *RHS) const
MDNodeKeyImpl(const GenericDINode *N)
MDNodeKeyImpl(unsigned Line, unsigned Column, Metadata *Scope, Metadata *InlinedAt, bool ImplicitCode)
constexpr T getValueOr(U &&value) const LLVM_LVALUE_FUNCTION
Definition: Optional.h:267
Metadata * getRawFile() const
Return the raw underlying file.
static bool isEqual(const KeyTy &LHS, const StructType *RHS)
This file contains the declarations for metadata subclasses.
Metadata * getRawInlinedAt() const
bool operator!=(const KeyTy &that) const
static unsigned getHashValue(const StructType *ST)
bool isKeyOf(const DINamespace *RHS) const
MDNodeKeyImpl(MDString *Name, Metadata *File, unsigned Line, MDString *GetterName, MDString *SetterName, unsigned Attributes, Metadata *Type)
MDNodeKeyImpl(unsigned Tag, MDString *Name, uint64_t SizeInBits, uint32_t AlignInBits, unsigned Encoding, unsigned Flags)
Metadata node.
Definition: Metadata.h:863
Metadata * getRawScope() const
MDNodeOpsKey(const NodeTy *N, unsigned Offset=0)
DenseMap< std::pair< Type *, unsigned >, PointerType * > ASPointerTypes
MDNodeKeyImpl(const DISubrange *N)
Metadata * getRawTemplateParams() const
MDNodeKeyImpl(const DITemplateTypeParameter *N)
MDNodeKeyImpl(ArrayRef< uint64_t > Elements)
MDNodeKeyImpl(Metadata *Scope, Metadata *File, unsigned Line, unsigned Column)
Multimap-like storage for metadata attachments for globals.
static unsigned calculateHash(GenericDINode *N)
Tuple of metadata.
Definition: Metadata.h:1105
This file defines the MallocAllocator and BumpPtrAllocator interfaces.
unsigned getBitWidth() const
Return the number of bits in the APInt.
Definition: APInt.h:1508
MDNodeKeyImpl(const DIEnumerator *N)
MDString * getRawName() const
static bool isSubsetEqual(const KeyTy &LHS, const DISubprogram *RHS)
static NodeTy * getEmptyKey()
bool isKeyOf(const DISubroutineType *RHS) const
The address of a basic block.
Definition: Constants.h:839
Metadata * getRawTypeArray() const
DenseMap< const Instruction *, MDAttachmentMap > InstructionMetadata
Collection of per-instruction metadata used in this context.
static bool isDeclarationOfODRMember(bool IsDefinition, const Metadata *Scope, const MDString *LinkageName, const Metadata *TemplateParams, const DISubprogram *RHS)
Subprograms compare equal if they declare the same function in an ODR type.
MDNodeKeyImpl(const DIGlobalVariable *N)
static unsigned getHashValue(const APFloat &Key)
MDNodeKeyImpl(unsigned MIType, unsigned Line, Metadata *File, Metadata *Elements)
static bool isEqual(const APInt &LHS, const APInt &RHS)
unsigned getTag() const
Class to represent struct types.
Definition: DerivedTypes.h:232
Array subrange.
KeyTy(const FunctionType *FT)
uint64_t VAL
Used to store the <= 64 bits integer value.
Definition: APInt.h:93
unsigned getHashValue() const
Using name and line to get hash value. It should already be mostly unique.
MDNodeKeyImpl(const DIBasicType *N)
MDString * getRawSetterName() const
This class consists of common code factored out of the SmallVector class to reduce code duplication b...
Definition: APFloat.h:41
DenseMap< std::pair< Type *, uint64_t >, ArrayType * > ArrayTypes
std::unique_ptr< DiagnosticHandler > DiagHandler
MDNodeKeyImpl(Metadata *Scope, MDString *Name, MDString *LinkageName, Metadata *File, unsigned Line, Metadata *Type, bool IsLocalToUnit, bool IsDefinition, Metadata *StaticDataMemberDeclaration, Metadata *TemplateParams, uint32_t AlignInBits)
std::vector< MDNode * > DistinctMDNodes
uint64_t getSizeInBits() const
Metadata * getRawType() const
DenseMap< const Value *, ValueName * > ValueNames
static const uint16_t * lookup(unsigned opcode, unsigned domain, ArrayRef< uint16_t[3]> Table)
BumpPtrAllocator TypeAllocator
TypeAllocator - All dynamically allocated types are allocated from this.
unsigned getHash() const
This file implements a class to represent arbitrary precision integral constant values and operations...
static unsigned getHashValue(const FunctionType *FT)
MDString * getRawISysRoot() const
static StructType * getEmptyKey()
ConstantUniqueMap< InlineAsm > InlineAsms
op_iterator op_begin() const
Definition: Metadata.h:1058
AttributeList getAttributes(LLVMContext &C, ID id)
Return the attributes for an intrinsic.
MDNodeKeyImpl(const DISubprogram *N)
bool getExportSymbols() const
MDNodeKeyImpl(Metadata *Scope, MDString *Name, MDString *LinkageName, Metadata *File, unsigned Line, Metadata *Type, unsigned ScopeLine, Metadata *ContainingType, unsigned VirtualIndex, int ThisAdjustment, unsigned Flags, unsigned SPFlags, Metadata *Unit, Metadata *TemplateParams, Metadata *Declaration, Metadata *RetainedNodes, Metadata *ThrownTypes)
MDNodeKeyImpl(Metadata *Scope, MDString *Name, MDString *ConfigurationMacros, MDString *IncludePath, MDString *ISysRoot)
Subprogram description.
Key
PAL metadata keys.
Class to represent function types.
Definition: DerivedTypes.h:102
Optional< DIFile::ChecksumInfo< MDString * > > Checksum
unsigned getRuntimeLang() const
MDString * getRawName() const
Class to represent array types.
Definition: DerivedTypes.h:400
Enumeration value.
std::unique_ptr< ConstantTokenNone > TheNoneToken
ArrayRef - Represent a constant reference to an array (0 or more elements consecutively in memory)...
Definition: APInt.h:32
hash_code hash_value(const APFloat &Arg)
See friend declarations above.
Definition: APFloat.cpp:4430
uint32_t getAlignInBits() const
ArrayConstantsTy ArrayConstants
bool isKeyOf(const DISubprogram *RHS) const
Metadata * getRawEntity() const
Debug location.
DenseMap< std::pair< Type *, unsigned >, VectorType * > VectorTypes
MDNodeKeyImpl(MDString *Name, Metadata *Type)
bool isKeyOf(const DITemplateValueParameter *RHS) const
bool isKeyOf(const DIMacroFile *RHS) const
StringMap< SyncScope::ID > SSC
A set of interned synchronization scopes.
Class to represent pointers.
Definition: DerivedTypes.h:498
Metadata * getRawFile() const
unsigned getLine() const
bool isKeyOf(const DIGlobalVariable *RHS) const
MDNodeKeyImpl(unsigned Tag, Metadata *Scope, Metadata *Entity, Metadata *File, unsigned Line, MDString *Name)
bool isKeyOf(const DISubrange *RHS) const
DenseMap< PointerType *, std::unique_ptr< ConstantPointerNull > > CPNConstants
#define P(N)
StringMap< unsigned > CustomMDKindNames
CustomMDKindNames - Map to hold the metadata string to ID mapping.
bool operator==(const KeyTy &that) const
bool isKeyOf(const DILexicalBlock *RHS) const
unsigned getColumn() const
static bool isSubsetEqual(const DIDerivedType *LHS, const DIDerivedType *RHS)
Metadata * getRawDiscriminator() const
MDNodeKeyImpl(Metadata *Variable, Metadata *Expression)
A single checksum, represented by a Kind and a Value (a string).
The instances of the Type class are immutable: once they are created, they are never changed...
Definition: Type.h:45
This is an important class for using LLVM in a threaded context.
Definition: LLVMContext.h:68
bool operator!=(const KeyTy &that) const
Allocate memory in an ever growing pool, as if by bump-pointer.
Definition: Allocator.h:140
size_t size() const
size - Get the array size.
Definition: ArrayRef.h:148
static GCRegistry::Add< CoreCLRGC > E("coreclr", "CoreCLR-compatible GC")
CountType getCount() const
This file contains the declarations for the subclasses of Constant, which represent the different fla...
MDNodeKeyImpl(const DIExpression *N)
static unsigned calculateHash(MDTuple *N)
MDNodeKeyImpl(unsigned MIType, unsigned Line, MDString *Name, MDString *Value)
unsigned getAttributes() const
bool compareOps(const NodeTy *RHS, unsigned Offset=0) const
StringMap< uint32_t > BundleTagCache
A set of interned tags for operand bundles.
bool isKeyOf(const DIGlobalVariableExpression *RHS) const
static bool isEqual(const FunctionType *LHS, const FunctionType *RHS)
MDNodeKeyImpl(const DIObjCProperty *N)
MDNodeKeyImpl(const DISubroutineType *N)
MDNodeKeyImpl(Metadata *Scope, MDString *Name, bool ExportSymbols)
A pair of DIGlobalVariable and DIExpression.
This file declares a class to represent arbitrary precision floating point values and provide a varie...
bool isKeyOf(const DIImportedEntity *RHS) const
This file defines various helper methods and classes used by LLVMContextImpl for creating and managin...
ValueHandlesTy ValueHandles
MDNodeKeyImpl(const DILexicalBlockFile *N)
MDNodeKeyImpl(const DICompositeType *N)
static bool isSubsetEqual(const DISubprogram *LHS, const DISubprogram *RHS)
Class to represent integer types.
Definition: DerivedTypes.h:39
static FunctionType * getEmptyKey()
MDNodeKeyImpl(const DIDerivedType *N)
auto remove_if(R &&Range, UnaryPredicate P) -> decltype(adl_begin(Range))
Provide wrappers to std::remove_if which take ranges instead of having to pass begin/end explicitly...
Definition: STLExtras.h:1225
bool isKeyOf(const DILabel *RHS) const
static unsigned getHashValue(const NodeTy *N)
MDString * getRawConfigurationMacros() const
bool isKeyOf(const DIEnumerator *RHS) const
iterator erase(const_iterator CI)
Definition: SmallVector.h:437
unsigned getLine() const
bool isKeyOf(const DIBasicType *RHS) const
DenseMap< const GlobalObject *, StringRef > GlobalObjectSections
Collection of per-GlobalObject sections used in this context.
static bool isEqual(const APFloat &LHS, const APFloat &RHS)
size_t size() const
Definition: SmallVector.h:52
Metadata * getRawType() const
MDString * getRawName() const
MDString * getRawName() const
FoldingSet - This template class is used to instantiate a specialized implementation of the folding s...
Definition: FoldingSet.h:473
VectorConstantsTy VectorConstants
MDNodeKeyImpl(int64_t Value, bool IsUnsigned, MDString *Name)
An imported module (C++ using directive or similar).
static bool isEqual(const KeyTy &LHS, const NodeTy *RHS)
Metadata * getRawElements() const
int64_t getValue() const
DenseMap< Metadata *, MetadataAsValue * > MetadataAsValues
MDNodeKeyImpl(MDString *Filename, MDString *Directory, Optional< DIFile::ChecksumInfo< MDString *>> Checksum, Optional< MDString *> Source)
static bool isSubsetEqual(const NodeTy *LHS, const NodeTy *RHS)
Metadata * getRawScope() const
DenseMap< const GlobalObject *, MDGlobalAttachmentMap > GlobalObjectMetadata
Collection of per-GlobalObject metadata used in this context.
This is the shared class of boolean and integer constants.
Definition: Constants.h:83
MDNodeKeyImpl(Metadata *CountNode, int64_t LowerBound)
Metadata * getRawTemplateParams() const
static NodeTy * getTombstoneKey()
unsigned getLine() const
MDNodeKeyImpl(const DIGlobalVariableExpression *N)
bool isKeyOf(const DIDerivedType *RHS) const
This is a &#39;vector&#39; (really, a variable-sized array), optimized for the case when the array is small...
Definition: SmallVector.h:839
iterator end() const
Definition: ArrayRef.h:137
FunctionTypeSet FunctionTypes
MDString * getRawHeader() const
FoldingSet< AttributeListImpl > AttrsLists
MDNodeKeyImpl(ArrayRef< Metadata *> Ops)
Optional< MDString * > Source
static Optional< unsigned > getTag(const TargetRegisterInfo *TRI, const MachineInstr &MI, const LoadInfo &LI)
Metadata * getRawElements() const
Metadata * getRawFile() const
DWARF expression.
bool isKeyOf(const DITemplateTypeParameter *RHS) const
SmallPtrSet< Module *, 4 > OwnedModules
OwnedModules - The set of modules instantiated in this context, and which will be automatically delet...
MDNodeKeyImpl(const DITemplateValueParameter *N)
StringMap - This is an unconventional map that is specialized for handling keys that are "strings"...
Definition: StringMap.h:219
MDNodeKeyImpl(const DINamespace *N)
Class to represent vector types.
Definition: DerivedTypes.h:424
static bool isEqual(const StructType *LHS, const StructType *RHS)
This file contains constants used for implementing Dwarf debug support.
Class for arbitrary precision integers.
Definition: APInt.h:69
Metadata * getRawFile() const
bool isKeyOf(const DICompositeType *RHS) const
hash_code hash_combine(const Ts &...args)
Combine values into a single hash_code.
Definition: Hashing.h:600
A (clang) module that has been imported by the compile unit.
void(*)(const SMDiagnostic &, void *Context, unsigned LocCookie) InlineAsmDiagHandlerTy
Definition: LLVMContext.h:172
DenseMapInfo for MDNode subclasses.
hash_code hash_combine_range(InputIteratorT first, InputIteratorT last)
Compute a hash_code for a sequence of values.
Definition: Hashing.h:478
static bool isSubsetEqual(const KeyTy &LHS, const DIDerivedType *RHS)
Generic tagged DWARF-like metadata node.
MDNodeKeyImpl(const DILocalVariable *N)
MDNodeKeyImpl(Metadata *Scope, MDString *Name, Metadata *File, unsigned Line)
Metadata * getRawFile() const
MDNodeKeyImpl(const DIImportedEntity *N)
Metadata * getRawBaseType() const
static FunctionType * getTombstoneKey()
MDString * getRawName() const
MDNodeKeyImpl(unsigned Tag, MDString *Name, Metadata *Type, Metadata *Value)
MDNodeKeyImpl(const DILocation *L)
bool isKeyOf(const DILexicalBlockFile *RHS) const
Type array for a subprogram.
StructTypeSet AnonStructTypes
MDString * getRawIdentifier() const
unsigned getEncoding() const
bool isKeyOf(const GenericDINode *RHS) const
static unsigned getHashValue(const APInt &Key)
DenseMap< std::pair< const char *, unsigned >, unsigned > DiscriminatorTable
DiscriminatorTable - This table maps file:line locations to an integer representing the next DWARF pa...
LLVM_NODISCARD bool empty() const
Definition: SmallVector.h:55
StringMap< StructType * > NamedStructTypes
Metadata * getRawScope() const
static bool isODRMember(unsigned Tag, const Metadata *Scope, const MDString *Name, const DIDerivedType *RHS)
Subprograms compare equal if they declare the same function in an ODR type.
std::unique_ptr< yaml::Output > DiagnosticsOutputFile
#define N
static const fltSemantics & Bogus() LLVM_READNONE
A Pseudo fltsemantic used to construct APFloats that cannot conflict with anything real...
Definition: APFloat.cpp:131
DenseMap< const Function *, std::string > GCNames
Maintain the GC name for each function.
MDString * getRawName() const
DenseMap< Type *, std::unique_ptr< ConstantAggregateZero > > CAZConstants
unsigned getMacinfoType() const
ConstantUniqueMap< ConstantExpr > ExprConstants
bool operator==(const KeyTy &that) const
MDString * getRawLinkageName() const
Metadata * getRawStaticDataMemberDeclaration() const
KeyTy(const Type *R, const ArrayRef< Type *> &P, bool V)
unsigned getTag() const
assert(ImpDefSCC.getReg()==AMDGPU::SCC &&ImpDefSCC.isDef())
MDNodeKeyImpl(unsigned Tag, MDString *Name, Metadata *File, unsigned Line, Metadata *Scope, Metadata *BaseType, uint64_t SizeInBits, uint32_t AlignInBits, uint64_t OffsetInBits, Optional< unsigned > DWARFAddressSpace, unsigned Flags, Metadata *ExtraData)
uint32_t getAlignInBits() const
MDNodeKeyImpl(unsigned Tag, MDString *Header, ArrayRef< Metadata *> DwarfOps)
bool isKeyOf(const DIFile *RHS) const
StructConstantsTy StructConstants
unsigned getSizeInBits(unsigned Reg, const MachineRegisterInfo &MRI, const TargetRegisterInfo &TRI) const
Get the size in bits of Reg.
DenseMap< Type *, std::unique_ptr< UndefValue > > UVConstants
void remove_if(PredTy shouldRemove)
Erase matching attachments.
bool bitwiseIsEqual(const APFloat &RHS) const
Definition: APFloat.h:1111
Metadata * getRawScope() const
MDNodeKeyImpl(const DILexicalBlock *N)
StringSet - A wrapper for StringMap that provides set-like functionality.
Definition: StringSet.h:27
bool isKeyOf(const DIModule *RHS) const
FoldingSet< AttributeSetNode > AttrsSetNodes
Metadata * getRawScope() const
bool isKeyOf(const DILocation *RHS) const
bool isKeyOf(const DIObjCProperty *RHS) const
StringRef - Represent a constant reference to a string, i.e.
Definition: StringRef.h:48
A single uniqued string.
Definition: Metadata.h:603
MDString * getRawIncludePath() const
unsigned getLine() const
bool isKeyOf(const DILocalVariable *RHS) const
unsigned getLine() const
DenseMap< Type *, PointerType * > PointerTypes
bool operator==(uint64_t V1, const APInt &V2)
Definition: APInt.h:1966
MDNodeOpsKey(ArrayRef< Metadata *> Ops)
Metadata * getRawType() const
Metadata * getRawScope() const
unsigned getNumOperands() const
Return number of MDNode operands.
Definition: Metadata.h:1074
Map-like storage for metadata attachments.
KeyTy(const ArrayRef< Type *> &E, bool P)
StringMap< ConstantDataSequential * > CDSConstants
Optional< DenseMap< const MDString *, DICompositeType * > > DITypeMap
MDString * getRawName() const
Root of the metadata hierarchy.
Definition: Metadata.h:57
unsigned getLine() const
MDString * getRawGetterName() const
MDNodeKeyImpl(Metadata *Scope, Metadata *File, unsigned Discriminator)
Metadata * getRawScope() const
StringSet SectionStrings
Stable collection of section strings.
bool empty() const
empty - Check if the array is empty.
Definition: ArrayRef.h:143
IntegerType * Int32Ty
static unsigned getHashValue(const KeyTy &Key)
Basic type, like &#39;int&#39; or &#39;float&#39;.
MDNodeKeyImpl(unsigned Flags, uint8_t CC, Metadata *TypeArray)
bool isKeyOf(const DIExpression *RHS) const