LLVM  16.0.0git
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 "ConstantsContext.h"
18 #include "llvm/ADT/APFloat.h"
19 #include "llvm/ADT/APInt.h"
20 #include "llvm/ADT/Any.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"
33 #include "llvm/IR/Constants.h"
35 #include "llvm/IR/DerivedTypes.h"
36 #include "llvm/IR/LLVMContext.h"
37 #include "llvm/IR/Metadata.h"
38 #include "llvm/IR/Module.h"
39 #include "llvm/IR/TrackingMDRef.h"
40 #include "llvm/IR/Type.h"
41 #include "llvm/IR/Value.h"
42 #include "llvm/Support/Allocator.h"
43 #include "llvm/Support/Casting.h"
45 #include <algorithm>
46 #include <cassert>
47 #include <cstddef>
48 #include <cstdint>
49 #include <memory>
50 #include <string>
51 #include <utility>
52 #include <vector>
53 
54 namespace llvm {
55 
56 class AttributeImpl;
57 class AttributeListImpl;
58 class AttributeSetNode;
59 class BasicBlock;
60 struct DiagnosticHandler;
61 class ElementCount;
62 class Function;
63 class GlobalObject;
64 class GlobalValue;
65 class InlineAsm;
66 class LLVMRemarkStreamer;
67 class OptPassGate;
68 namespace remarks {
69 class RemarkStreamer;
70 }
71 template <typename T> class StringMapEntry;
72 class StringRef;
73 class TypedPointerType;
74 class ValueHandleBase;
75 
77 
79  static inline APFloat getEmptyKey() { return APFloat(APFloat::Bogus(), 1); }
80  static inline APFloat getTombstoneKey() {
81  return APFloat(APFloat::Bogus(), 2);
82  }
83 
84  static unsigned getHashValue(const APFloat &Key) {
85  return static_cast<unsigned>(hash_value(Key));
86  }
87 
88  static bool isEqual(const APFloat &LHS, const APFloat &RHS) {
89  return LHS.bitwiseIsEqual(RHS);
90  }
91 };
92 
94  struct KeyTy {
96  bool isPacked;
97 
98  KeyTy(const ArrayRef<Type *> &E, bool P) : ETypes(E), isPacked(P) {}
99 
101  : ETypes(ST->elements()), isPacked(ST->isPacked()) {}
102 
103  bool operator==(const KeyTy &that) const {
104  if (isPacked != that.isPacked)
105  return false;
106  if (ETypes != that.ETypes)
107  return false;
108  return true;
109  }
110  bool operator!=(const KeyTy &that) const { return !this->operator==(that); }
111  };
112 
113  static inline StructType *getEmptyKey() {
115  }
116 
117  static inline StructType *getTombstoneKey() {
119  }
120 
121  static unsigned getHashValue(const KeyTy &Key) {
122  return hash_combine(
123  hash_combine_range(Key.ETypes.begin(), Key.ETypes.end()), Key.isPacked);
124  }
125 
126  static unsigned getHashValue(const StructType *ST) {
127  return getHashValue(KeyTy(ST));
128  }
129 
130  static bool isEqual(const KeyTy &LHS, const StructType *RHS) {
131  if (RHS == getEmptyKey() || RHS == getTombstoneKey())
132  return false;
133  return LHS == KeyTy(RHS);
134  }
135 
136  static bool isEqual(const StructType *LHS, const StructType *RHS) {
137  return LHS == RHS;
138  }
139 };
140 
142  struct KeyTy {
143  const Type *ReturnType;
145  bool isVarArg;
146 
147  KeyTy(const Type *R, const ArrayRef<Type *> &P, bool V)
148  : ReturnType(R), Params(P), isVarArg(V) {}
149  KeyTy(const FunctionType *FT)
150  : ReturnType(FT->getReturnType()), Params(FT->params()),
151  isVarArg(FT->isVarArg()) {}
152 
153  bool operator==(const KeyTy &that) const {
154  if (ReturnType != that.ReturnType)
155  return false;
156  if (isVarArg != that.isVarArg)
157  return false;
158  if (Params != that.Params)
159  return false;
160  return true;
161  }
162  bool operator!=(const KeyTy &that) const { return !this->operator==(that); }
163  };
164 
165  static inline FunctionType *getEmptyKey() {
167  }
168 
169  static inline FunctionType *getTombstoneKey() {
171  }
172 
173  static unsigned getHashValue(const KeyTy &Key) {
174  return hash_combine(
175  Key.ReturnType,
176  hash_combine_range(Key.Params.begin(), Key.Params.end()), Key.isVarArg);
177  }
178 
179  static unsigned getHashValue(const FunctionType *FT) {
180  return getHashValue(KeyTy(FT));
181  }
182 
183  static bool isEqual(const KeyTy &LHS, const FunctionType *RHS) {
184  if (RHS == getEmptyKey() || RHS == getTombstoneKey())
185  return false;
186  return LHS == KeyTy(RHS);
187  }
188 
189  static bool isEqual(const FunctionType *LHS, const FunctionType *RHS) {
190  return LHS == RHS;
191  }
192 };
193 
194 /// Structure for hashing arbitrary MDNode operands.
196  ArrayRef<Metadata *> RawOps;
198  unsigned Hash;
199 
200 protected:
202  : RawOps(Ops), Hash(calculateHash(Ops)) {}
203 
204  template <class NodeTy>
205  MDNodeOpsKey(const NodeTy *N, unsigned Offset = 0)
206  : Ops(N->op_begin() + Offset, N->op_end()), Hash(N->getHash()) {}
207 
208  template <class NodeTy>
209  bool compareOps(const NodeTy *RHS, unsigned Offset = 0) const {
210  if (getHash() != RHS->getHash())
211  return false;
212 
213  assert((RawOps.empty() || Ops.empty()) && "Two sets of operands?");
214  return RawOps.empty() ? compareOps(Ops, RHS, Offset)
215  : compareOps(RawOps, RHS, Offset);
216  }
217 
218  static unsigned calculateHash(MDNode *N, unsigned Offset = 0);
219 
220 private:
221  template <class T>
222  static bool compareOps(ArrayRef<T> Ops, const MDNode *RHS, unsigned Offset) {
223  if (Ops.size() != RHS->getNumOperands() - Offset)
224  return false;
225  return std::equal(Ops.begin(), Ops.end(), RHS->op_begin() + Offset);
226  }
227 
228  static unsigned calculateHash(ArrayRef<Metadata *> Ops);
229 
230 public:
231  unsigned getHash() const { return Hash; }
232 };
233 
234 template <class NodeTy> struct MDNodeKeyImpl;
235 
236 /// Configuration point for MDNodeInfo::isEqual().
237 template <class NodeTy> struct MDNodeSubsetEqualImpl {
239 
240  static bool isSubsetEqual(const KeyTy &LHS, const NodeTy *RHS) {
241  return false;
242  }
243 
244  static bool isSubsetEqual(const NodeTy *LHS, const NodeTy *RHS) {
245  return false;
246  }
247 };
248 
249 /// DenseMapInfo for MDTuple.
250 ///
251 /// Note that we don't need the is-function-local bit, since that's implicit in
252 /// the operands.
253 template <> struct MDNodeKeyImpl<MDTuple> : MDNodeOpsKey {
256 
257  bool isKeyOf(const MDTuple *RHS) const { return compareOps(RHS); }
258 
259  unsigned getHashValue() const { return getHash(); }
260 
261  static unsigned calculateHash(MDTuple *N) {
263  }
264 };
265 
266 /// DenseMapInfo for DILocation.
267 template <> struct MDNodeKeyImpl<DILocation> {
268  unsigned Line;
269  unsigned Column;
273 
274  MDNodeKeyImpl(unsigned Line, unsigned Column, Metadata *Scope,
275  Metadata *InlinedAt, bool ImplicitCode)
276  : Line(Line), Column(Column), Scope(Scope), InlinedAt(InlinedAt),
277  ImplicitCode(ImplicitCode) {}
279  : Line(L->getLine()), Column(L->getColumn()), Scope(L->getRawScope()),
280  InlinedAt(L->getRawInlinedAt()), ImplicitCode(L->isImplicitCode()) {}
281 
282  bool isKeyOf(const DILocation *RHS) const {
283  return Line == RHS->getLine() && Column == RHS->getColumn() &&
284  Scope == RHS->getRawScope() && InlinedAt == RHS->getRawInlinedAt() &&
285  ImplicitCode == RHS->isImplicitCode();
286  }
287 
288  unsigned getHashValue() const {
289  return hash_combine(Line, Column, Scope, InlinedAt, ImplicitCode);
290  }
291 };
292 
293 /// DenseMapInfo for GenericDINode.
294 template <> struct MDNodeKeyImpl<GenericDINode> : MDNodeOpsKey {
295  unsigned Tag;
297 
298  MDNodeKeyImpl(unsigned Tag, MDString *Header, ArrayRef<Metadata *> DwarfOps)
299  : MDNodeOpsKey(DwarfOps), Tag(Tag), Header(Header) {}
301  : MDNodeOpsKey(N, 1), Tag(N->getTag()), Header(N->getRawHeader()) {}
302 
303  bool isKeyOf(const GenericDINode *RHS) const {
304  return Tag == RHS->getTag() && Header == RHS->getRawHeader() &&
305  compareOps(RHS, 1);
306  }
307 
308  unsigned getHashValue() const { return hash_combine(getHash(), Tag, Header); }
309 
310  static unsigned calculateHash(GenericDINode *N) {
311  return MDNodeOpsKey::calculateHash(N, 1);
312  }
313 };
314 
315 template <> struct MDNodeKeyImpl<DISubrange> {
320 
321  MDNodeKeyImpl(Metadata *CountNode, Metadata *LowerBound, Metadata *UpperBound,
322  Metadata *Stride)
323  : CountNode(CountNode), LowerBound(LowerBound), UpperBound(UpperBound),
324  Stride(Stride) {}
326  : CountNode(N->getRawCountNode()), LowerBound(N->getRawLowerBound()),
327  UpperBound(N->getRawUpperBound()), Stride(N->getRawStride()) {}
328 
329  bool isKeyOf(const DISubrange *RHS) const {
330  auto BoundsEqual = [=](Metadata *Node1, Metadata *Node2) -> bool {
331  if (Node1 == Node2)
332  return true;
333 
334  ConstantAsMetadata *MD1 = dyn_cast_or_null<ConstantAsMetadata>(Node1);
335  ConstantAsMetadata *MD2 = dyn_cast_or_null<ConstantAsMetadata>(Node2);
336  if (MD1 && MD2) {
337  ConstantInt *CV1 = cast<ConstantInt>(MD1->getValue());
338  ConstantInt *CV2 = cast<ConstantInt>(MD2->getValue());
339  if (CV1->getSExtValue() == CV2->getSExtValue())
340  return true;
341  }
342  return false;
343  };
344 
345  return BoundsEqual(CountNode, RHS->getRawCountNode()) &&
346  BoundsEqual(LowerBound, RHS->getRawLowerBound()) &&
347  BoundsEqual(UpperBound, RHS->getRawUpperBound()) &&
348  BoundsEqual(Stride, RHS->getRawStride());
349  }
350 
351  unsigned getHashValue() const {
352  if (CountNode)
353  if (auto *MD = dyn_cast<ConstantAsMetadata>(CountNode))
354  return hash_combine(cast<ConstantInt>(MD->getValue())->getSExtValue(),
355  LowerBound, UpperBound, Stride);
356  return hash_combine(CountNode, LowerBound, UpperBound, Stride);
357  }
358 };
359 
360 template <> struct MDNodeKeyImpl<DIGenericSubrange> {
365 
366  MDNodeKeyImpl(Metadata *CountNode, Metadata *LowerBound, Metadata *UpperBound,
367  Metadata *Stride)
368  : CountNode(CountNode), LowerBound(LowerBound), UpperBound(UpperBound),
369  Stride(Stride) {}
371  : CountNode(N->getRawCountNode()), LowerBound(N->getRawLowerBound()),
372  UpperBound(N->getRawUpperBound()), Stride(N->getRawStride()) {}
373 
374  bool isKeyOf(const DIGenericSubrange *RHS) const {
375  return (CountNode == RHS->getRawCountNode()) &&
376  (LowerBound == RHS->getRawLowerBound()) &&
377  (UpperBound == RHS->getRawUpperBound()) &&
378  (Stride == RHS->getRawStride());
379  }
380 
381  unsigned getHashValue() const {
382  auto *MD = dyn_cast_or_null<ConstantAsMetadata>(CountNode);
383  if (CountNode && MD)
384  return hash_combine(cast<ConstantInt>(MD->getValue())->getSExtValue(),
385  LowerBound, UpperBound, Stride);
386  return hash_combine(CountNode, LowerBound, UpperBound, Stride);
387  }
388 };
389 
390 template <> struct MDNodeKeyImpl<DIEnumerator> {
394 
395  MDNodeKeyImpl(APInt Value, bool IsUnsigned, MDString *Name)
396  : Value(Value), Name(Name), IsUnsigned(IsUnsigned) {}
397  MDNodeKeyImpl(int64_t Value, bool IsUnsigned, MDString *Name)
398  : Value(APInt(64, Value, !IsUnsigned)), Name(Name),
399  IsUnsigned(IsUnsigned) {}
401  : Value(N->getValue()), Name(N->getRawName()),
402  IsUnsigned(N->isUnsigned()) {}
403 
404  bool isKeyOf(const DIEnumerator *RHS) const {
405  return Value.getBitWidth() == RHS->getValue().getBitWidth() &&
406  Value == RHS->getValue() && IsUnsigned == RHS->isUnsigned() &&
407  Name == RHS->getRawName();
408  }
409 
410  unsigned getHashValue() const { return hash_combine(Value, Name); }
411 };
412 
413 template <> struct MDNodeKeyImpl<DIBasicType> {
414  unsigned Tag;
418  unsigned Encoding;
419  unsigned Flags;
420 
421  MDNodeKeyImpl(unsigned Tag, MDString *Name, uint64_t SizeInBits,
422  uint32_t AlignInBits, unsigned Encoding, unsigned Flags)
423  : Tag(Tag), Name(Name), SizeInBits(SizeInBits), AlignInBits(AlignInBits),
424  Encoding(Encoding), Flags(Flags) {}
426  : Tag(N->getTag()), Name(N->getRawName()), SizeInBits(N->getSizeInBits()),
427  AlignInBits(N->getAlignInBits()), Encoding(N->getEncoding()),
428  Flags(N->getFlags()) {}
429 
430  bool isKeyOf(const DIBasicType *RHS) const {
431  return Tag == RHS->getTag() && Name == RHS->getRawName() &&
432  SizeInBits == RHS->getSizeInBits() &&
433  AlignInBits == RHS->getAlignInBits() &&
434  Encoding == RHS->getEncoding() && Flags == RHS->getFlags();
435  }
436 
437  unsigned getHashValue() const {
438  return hash_combine(Tag, Name, SizeInBits, AlignInBits, Encoding);
439  }
440 };
441 
442 template <> struct MDNodeKeyImpl<DIStringType> {
443  unsigned Tag;
450  unsigned Encoding;
451 
452  MDNodeKeyImpl(unsigned Tag, MDString *Name, Metadata *StringLength,
453  Metadata *StringLengthExp, Metadata *StringLocationExp,
454  uint64_t SizeInBits, uint32_t AlignInBits, unsigned Encoding)
455  : Tag(Tag), Name(Name), StringLength(StringLength),
456  StringLengthExp(StringLengthExp), StringLocationExp(StringLocationExp),
457  SizeInBits(SizeInBits), AlignInBits(AlignInBits), Encoding(Encoding) {}
459  : Tag(N->getTag()), Name(N->getRawName()),
460  StringLength(N->getRawStringLength()),
461  StringLengthExp(N->getRawStringLengthExp()),
462  StringLocationExp(N->getRawStringLocationExp()),
463  SizeInBits(N->getSizeInBits()), AlignInBits(N->getAlignInBits()),
464  Encoding(N->getEncoding()) {}
465 
466  bool isKeyOf(const DIStringType *RHS) const {
467  return Tag == RHS->getTag() && Name == RHS->getRawName() &&
468  SizeInBits == RHS->getSizeInBits() &&
469  AlignInBits == RHS->getAlignInBits() &&
470  Encoding == RHS->getEncoding();
471  }
472  unsigned getHashValue() const { return hash_combine(Tag, Name, Encoding); }
473 };
474 
475 template <> struct MDNodeKeyImpl<DIDerivedType> {
476  unsigned Tag;
479  unsigned Line;
486  unsigned Flags;
489 
490  MDNodeKeyImpl(unsigned Tag, MDString *Name, Metadata *File, unsigned Line,
491  Metadata *Scope, Metadata *BaseType, uint64_t SizeInBits,
492  uint32_t AlignInBits, uint64_t OffsetInBits,
493  Optional<unsigned> DWARFAddressSpace, unsigned Flags,
494  Metadata *ExtraData, Metadata *Annotations)
495  : Tag(Tag), Name(Name), File(File), Line(Line), Scope(Scope),
496  BaseType(BaseType), SizeInBits(SizeInBits), OffsetInBits(OffsetInBits),
497  AlignInBits(AlignInBits), DWARFAddressSpace(DWARFAddressSpace),
498  Flags(Flags), ExtraData(ExtraData), Annotations(Annotations) {}
500  : Tag(N->getTag()), Name(N->getRawName()), File(N->getRawFile()),
501  Line(N->getLine()), Scope(N->getRawScope()),
502  BaseType(N->getRawBaseType()), SizeInBits(N->getSizeInBits()),
503  OffsetInBits(N->getOffsetInBits()), AlignInBits(N->getAlignInBits()),
504  DWARFAddressSpace(N->getDWARFAddressSpace()), Flags(N->getFlags()),
505  ExtraData(N->getRawExtraData()), Annotations(N->getRawAnnotations()) {}
506 
507  bool isKeyOf(const DIDerivedType *RHS) const {
508  return Tag == RHS->getTag() && Name == RHS->getRawName() &&
509  File == RHS->getRawFile() && Line == RHS->getLine() &&
510  Scope == RHS->getRawScope() && BaseType == RHS->getRawBaseType() &&
511  SizeInBits == RHS->getSizeInBits() &&
512  AlignInBits == RHS->getAlignInBits() &&
513  OffsetInBits == RHS->getOffsetInBits() &&
514  DWARFAddressSpace == RHS->getDWARFAddressSpace() &&
515  Flags == RHS->getFlags() && ExtraData == RHS->getRawExtraData() &&
516  Annotations == RHS->getRawAnnotations();
517  }
518 
519  unsigned getHashValue() const {
520  // If this is a member inside an ODR type, only hash the type and the name.
521  // Otherwise the hash will be stronger than
522  // MDNodeSubsetEqualImpl::isODRMember().
523  if (Tag == dwarf::DW_TAG_member && Name)
524  if (auto *CT = dyn_cast_or_null<DICompositeType>(Scope))
525  if (CT->getRawIdentifier())
526  return hash_combine(Name, Scope);
527 
528  // Intentionally computes the hash on a subset of the operands for
529  // performance reason. The subset has to be significant enough to avoid
530  // collision "most of the time". There is no correctness issue in case of
531  // collision because of the full check above.
532  return hash_combine(Tag, Name, File, Line, Scope, BaseType, Flags);
533  }
534 };
535 
538 
539  static bool isSubsetEqual(const KeyTy &LHS, const DIDerivedType *RHS) {
540  return isODRMember(LHS.Tag, LHS.Scope, LHS.Name, RHS);
541  }
542 
543  static bool isSubsetEqual(const DIDerivedType *LHS,
544  const DIDerivedType *RHS) {
545  return isODRMember(LHS->getTag(), LHS->getRawScope(), LHS->getRawName(),
546  RHS);
547  }
548 
549  /// Subprograms compare equal if they declare the same function in an ODR
550  /// type.
551  static bool isODRMember(unsigned Tag, const Metadata *Scope,
552  const MDString *Name, const DIDerivedType *RHS) {
553  // Check whether the LHS is eligible.
554  if (Tag != dwarf::DW_TAG_member || !Name)
555  return false;
556 
557  auto *CT = dyn_cast_or_null<DICompositeType>(Scope);
558  if (!CT || !CT->getRawIdentifier())
559  return false;
560 
561  // Compare to the RHS.
562  return Tag == RHS->getTag() && Name == RHS->getRawName() &&
563  Scope == RHS->getRawScope();
564  }
565 };
566 
567 template <> struct MDNodeKeyImpl<DICompositeType> {
568  unsigned Tag;
571  unsigned Line;
577  unsigned Flags;
579  unsigned RuntimeLang;
589 
590  MDNodeKeyImpl(unsigned Tag, MDString *Name, Metadata *File, unsigned Line,
591  Metadata *Scope, Metadata *BaseType, uint64_t SizeInBits,
592  uint32_t AlignInBits, uint64_t OffsetInBits, unsigned Flags,
593  Metadata *Elements, unsigned RuntimeLang,
594  Metadata *VTableHolder, Metadata *TemplateParams,
595  MDString *Identifier, Metadata *Discriminator,
596  Metadata *DataLocation, Metadata *Associated,
597  Metadata *Allocated, Metadata *Rank, Metadata *Annotations)
598  : Tag(Tag), Name(Name), File(File), Line(Line), Scope(Scope),
599  BaseType(BaseType), SizeInBits(SizeInBits), OffsetInBits(OffsetInBits),
600  AlignInBits(AlignInBits), Flags(Flags), Elements(Elements),
601  RuntimeLang(RuntimeLang), VTableHolder(VTableHolder),
602  TemplateParams(TemplateParams), Identifier(Identifier),
603  Discriminator(Discriminator), DataLocation(DataLocation),
604  Associated(Associated), Allocated(Allocated), Rank(Rank),
607  : Tag(N->getTag()), Name(N->getRawName()), File(N->getRawFile()),
608  Line(N->getLine()), Scope(N->getRawScope()),
609  BaseType(N->getRawBaseType()), SizeInBits(N->getSizeInBits()),
610  OffsetInBits(N->getOffsetInBits()), AlignInBits(N->getAlignInBits()),
611  Flags(N->getFlags()), Elements(N->getRawElements()),
612  RuntimeLang(N->getRuntimeLang()), VTableHolder(N->getRawVTableHolder()),
613  TemplateParams(N->getRawTemplateParams()),
614  Identifier(N->getRawIdentifier()),
615  Discriminator(N->getRawDiscriminator()),
616  DataLocation(N->getRawDataLocation()),
617  Associated(N->getRawAssociated()), Allocated(N->getRawAllocated()),
618  Rank(N->getRawRank()), Annotations(N->getRawAnnotations()) {}
619 
620  bool isKeyOf(const DICompositeType *RHS) const {
621  return Tag == RHS->getTag() && Name == RHS->getRawName() &&
622  File == RHS->getRawFile() && Line == RHS->getLine() &&
623  Scope == RHS->getRawScope() && BaseType == RHS->getRawBaseType() &&
624  SizeInBits == RHS->getSizeInBits() &&
625  AlignInBits == RHS->getAlignInBits() &&
626  OffsetInBits == RHS->getOffsetInBits() && Flags == RHS->getFlags() &&
627  Elements == RHS->getRawElements() &&
628  RuntimeLang == RHS->getRuntimeLang() &&
629  VTableHolder == RHS->getRawVTableHolder() &&
630  TemplateParams == RHS->getRawTemplateParams() &&
631  Identifier == RHS->getRawIdentifier() &&
632  Discriminator == RHS->getRawDiscriminator() &&
633  DataLocation == RHS->getRawDataLocation() &&
634  Associated == RHS->getRawAssociated() &&
635  Allocated == RHS->getRawAllocated() && Rank == RHS->getRawRank() &&
636  Annotations == RHS->getRawAnnotations();
637  }
638 
639  unsigned getHashValue() const {
640  // Intentionally computes the hash on a subset of the operands for
641  // performance reason. The subset has to be significant enough to avoid
642  // collision "most of the time". There is no correctness issue in case of
643  // collision because of the full check above.
644  return hash_combine(Name, File, Line, BaseType, Scope, Elements,
645  TemplateParams, Annotations);
646  }
647 };
648 
649 template <> struct MDNodeKeyImpl<DISubroutineType> {
650  unsigned Flags;
651  uint8_t CC;
653 
654  MDNodeKeyImpl(unsigned Flags, uint8_t CC, Metadata *TypeArray)
655  : Flags(Flags), CC(CC), TypeArray(TypeArray) {}
657  : Flags(N->getFlags()), CC(N->getCC()), TypeArray(N->getRawTypeArray()) {}
658 
659  bool isKeyOf(const DISubroutineType *RHS) const {
660  return Flags == RHS->getFlags() && CC == RHS->getCC() &&
661  TypeArray == RHS->getRawTypeArray();
662  }
663 
664  unsigned getHashValue() const { return hash_combine(Flags, CC, TypeArray); }
665 };
666 
667 template <> struct MDNodeKeyImpl<DIFile> {
672 
673  MDNodeKeyImpl(MDString *Filename, MDString *Directory,
676  : Filename(Filename), Directory(Directory), Checksum(Checksum),
677  Source(Source) {}
679  : Filename(N->getRawFilename()), Directory(N->getRawDirectory()),
680  Checksum(N->getRawChecksum()), Source(N->getRawSource()) {}
681 
682  bool isKeyOf(const DIFile *RHS) const {
683  return Filename == RHS->getRawFilename() &&
684  Directory == RHS->getRawDirectory() &&
685  Checksum == RHS->getRawChecksum() && Source == RHS->getRawSource();
686  }
687 
688  unsigned getHashValue() const {
689  return hash_combine(Filename, Directory, Checksum ? Checksum->Kind : 0,
690  Checksum ? Checksum->Value : nullptr,
691  Source.value_or(nullptr));
692  }
693 };
694 
695 template <> struct MDNodeKeyImpl<DISubprogram> {
700  unsigned Line;
702  unsigned ScopeLine;
704  unsigned VirtualIndex;
706  unsigned Flags;
707  unsigned SPFlags;
715 
717  Metadata *File, unsigned Line, Metadata *Type,
718  unsigned ScopeLine, Metadata *ContainingType,
719  unsigned VirtualIndex, int ThisAdjustment, unsigned Flags,
720  unsigned SPFlags, Metadata *Unit, Metadata *TemplateParams,
721  Metadata *Declaration, Metadata *RetainedNodes,
722  Metadata *ThrownTypes, Metadata *Annotations,
723  MDString *TargetFuncName)
724  : Scope(Scope), Name(Name), LinkageName(LinkageName), File(File),
725  Line(Line), Type(Type), ScopeLine(ScopeLine),
726  ContainingType(ContainingType), VirtualIndex(VirtualIndex),
727  ThisAdjustment(ThisAdjustment), Flags(Flags), SPFlags(SPFlags),
728  Unit(Unit), TemplateParams(TemplateParams), Declaration(Declaration),
729  RetainedNodes(RetainedNodes), ThrownTypes(ThrownTypes),
730  Annotations(Annotations), TargetFuncName(TargetFuncName) {}
732  : Scope(N->getRawScope()), Name(N->getRawName()),
733  LinkageName(N->getRawLinkageName()), File(N->getRawFile()),
734  Line(N->getLine()), Type(N->getRawType()), ScopeLine(N->getScopeLine()),
735  ContainingType(N->getRawContainingType()),
736  VirtualIndex(N->getVirtualIndex()),
737  ThisAdjustment(N->getThisAdjustment()), Flags(N->getFlags()),
738  SPFlags(N->getSPFlags()), Unit(N->getRawUnit()),
739  TemplateParams(N->getRawTemplateParams()),
740  Declaration(N->getRawDeclaration()),
741  RetainedNodes(N->getRawRetainedNodes()),
742  ThrownTypes(N->getRawThrownTypes()),
743  Annotations(N->getRawAnnotations()),
744  TargetFuncName(N->getRawTargetFuncName()) {}
745 
746  bool isKeyOf(const DISubprogram *RHS) const {
747  return Scope == RHS->getRawScope() && Name == RHS->getRawName() &&
748  LinkageName == RHS->getRawLinkageName() &&
749  File == RHS->getRawFile() && Line == RHS->getLine() &&
750  Type == RHS->getRawType() && ScopeLine == RHS->getScopeLine() &&
751  ContainingType == RHS->getRawContainingType() &&
752  VirtualIndex == RHS->getVirtualIndex() &&
753  ThisAdjustment == RHS->getThisAdjustment() &&
754  Flags == RHS->getFlags() && SPFlags == RHS->getSPFlags() &&
755  Unit == RHS->getUnit() &&
756  TemplateParams == RHS->getRawTemplateParams() &&
757  Declaration == RHS->getRawDeclaration() &&
758  RetainedNodes == RHS->getRawRetainedNodes() &&
759  ThrownTypes == RHS->getRawThrownTypes() &&
760  Annotations == RHS->getRawAnnotations() &&
761  TargetFuncName == RHS->getRawTargetFuncName();
762  }
763 
764  bool isDefinition() const { return SPFlags & DISubprogram::SPFlagDefinition; }
765 
766  unsigned getHashValue() const {
767  // If this is a declaration inside an ODR type, only hash the type and the
768  // name. Otherwise the hash will be stronger than
769  // MDNodeSubsetEqualImpl::isDeclarationOfODRMember().
770  if (!isDefinition() && LinkageName)
771  if (auto *CT = dyn_cast_or_null<DICompositeType>(Scope))
772  if (CT->getRawIdentifier())
773  return hash_combine(LinkageName, Scope);
774 
775  // Intentionally computes the hash on a subset of the operands for
776  // performance reason. The subset has to be significant enough to avoid
777  // collision "most of the time". There is no correctness issue in case of
778  // collision because of the full check above.
779  return hash_combine(Name, Scope, File, Type, Line);
780  }
781 };
782 
783 template <> struct MDNodeSubsetEqualImpl<DISubprogram> {
785 
786  static bool isSubsetEqual(const KeyTy &LHS, const DISubprogram *RHS) {
787  return isDeclarationOfODRMember(LHS.isDefinition(), LHS.Scope,
788  LHS.LinkageName, LHS.TemplateParams, RHS);
789  }
790 
791  static bool isSubsetEqual(const DISubprogram *LHS, const DISubprogram *RHS) {
792  return isDeclarationOfODRMember(LHS->isDefinition(), LHS->getRawScope(),
793  LHS->getRawLinkageName(),
794  LHS->getRawTemplateParams(), RHS);
795  }
796 
797  /// Subprograms compare equal if they declare the same function in an ODR
798  /// type.
799  static bool isDeclarationOfODRMember(bool IsDefinition, const Metadata *Scope,
800  const MDString *LinkageName,
801  const Metadata *TemplateParams,
802  const DISubprogram *RHS) {
803  // Check whether the LHS is eligible.
804  if (IsDefinition || !Scope || !LinkageName)
805  return false;
806 
807  auto *CT = dyn_cast_or_null<DICompositeType>(Scope);
808  if (!CT || !CT->getRawIdentifier())
809  return false;
810 
811  // Compare to the RHS.
812  // FIXME: We need to compare template parameters here to avoid incorrect
813  // collisions in mapMetadata when RF_ReuseAndMutateDistinctMDs and a
814  // ODR-DISubprogram has a non-ODR template parameter (i.e., a
815  // DICompositeType that does not have an identifier). Eventually we should
816  // decouple ODR logic from uniquing logic.
817  return IsDefinition == RHS->isDefinition() && Scope == RHS->getRawScope() &&
818  LinkageName == RHS->getRawLinkageName() &&
819  TemplateParams == RHS->getRawTemplateParams();
820  }
821 };
822 
823 template <> struct MDNodeKeyImpl<DILexicalBlock> {
826  unsigned Line;
827  unsigned Column;
828 
829  MDNodeKeyImpl(Metadata *Scope, Metadata *File, unsigned Line, unsigned Column)
830  : Scope(Scope), File(File), Line(Line), Column(Column) {}
832  : Scope(N->getRawScope()), File(N->getRawFile()), Line(N->getLine()),
833  Column(N->getColumn()) {}
834 
835  bool isKeyOf(const DILexicalBlock *RHS) const {
836  return Scope == RHS->getRawScope() && File == RHS->getRawFile() &&
837  Line == RHS->getLine() && Column == RHS->getColumn();
838  }
839 
840  unsigned getHashValue() const {
841  return hash_combine(Scope, File, Line, Column);
842  }
843 };
844 
845 template <> struct MDNodeKeyImpl<DILexicalBlockFile> {
848  unsigned Discriminator;
849 
850  MDNodeKeyImpl(Metadata *Scope, Metadata *File, unsigned Discriminator)
851  : Scope(Scope), File(File), Discriminator(Discriminator) {}
853  : Scope(N->getRawScope()), File(N->getRawFile()),
854  Discriminator(N->getDiscriminator()) {}
855 
856  bool isKeyOf(const DILexicalBlockFile *RHS) const {
857  return Scope == RHS->getRawScope() && File == RHS->getRawFile() &&
858  Discriminator == RHS->getDiscriminator();
859  }
860 
861  unsigned getHashValue() const {
862  return hash_combine(Scope, File, Discriminator);
863  }
864 };
865 
866 template <> struct MDNodeKeyImpl<DINamespace> {
870 
871  MDNodeKeyImpl(Metadata *Scope, MDString *Name, bool ExportSymbols)
872  : Scope(Scope), Name(Name), ExportSymbols(ExportSymbols) {}
874  : Scope(N->getRawScope()), Name(N->getRawName()),
875  ExportSymbols(N->getExportSymbols()) {}
876 
877  bool isKeyOf(const DINamespace *RHS) const {
878  return Scope == RHS->getRawScope() && Name == RHS->getRawName() &&
879  ExportSymbols == RHS->getExportSymbols();
880  }
881 
882  unsigned getHashValue() const { return hash_combine(Scope, Name); }
883 };
884 
885 template <> struct MDNodeKeyImpl<DICommonBlock> {
890  unsigned LineNo;
891 
893  unsigned LineNo)
894  : Scope(Scope), Decl(Decl), Name(Name), File(File), LineNo(LineNo) {}
896  : Scope(N->getRawScope()), Decl(N->getRawDecl()), Name(N->getRawName()),
897  File(N->getRawFile()), LineNo(N->getLineNo()) {}
898 
899  bool isKeyOf(const DICommonBlock *RHS) const {
900  return Scope == RHS->getRawScope() && Decl == RHS->getRawDecl() &&
901  Name == RHS->getRawName() && File == RHS->getRawFile() &&
902  LineNo == RHS->getLineNo();
903  }
904 
905  unsigned getHashValue() const {
906  return hash_combine(Scope, Decl, Name, File, LineNo);
907  }
908 };
909 
910 template <> struct MDNodeKeyImpl<DIModule> {
917  unsigned LineNo;
918  bool IsDecl;
919 
921  MDString *ConfigurationMacros, MDString *IncludePath,
922  MDString *APINotesFile, unsigned LineNo, bool IsDecl)
923  : File(File), Scope(Scope), Name(Name),
924  ConfigurationMacros(ConfigurationMacros), IncludePath(IncludePath),
925  APINotesFile(APINotesFile), LineNo(LineNo), IsDecl(IsDecl) {}
927  : File(N->getRawFile()), Scope(N->getRawScope()), Name(N->getRawName()),
928  ConfigurationMacros(N->getRawConfigurationMacros()),
929  IncludePath(N->getRawIncludePath()),
930  APINotesFile(N->getRawAPINotesFile()), LineNo(N->getLineNo()),
931  IsDecl(N->getIsDecl()) {}
932 
933  bool isKeyOf(const DIModule *RHS) const {
934  return Scope == RHS->getRawScope() && Name == RHS->getRawName() &&
935  ConfigurationMacros == RHS->getRawConfigurationMacros() &&
936  IncludePath == RHS->getRawIncludePath() &&
937  APINotesFile == RHS->getRawAPINotesFile() &&
938  File == RHS->getRawFile() && LineNo == RHS->getLineNo() &&
939  IsDecl == RHS->getIsDecl();
940  }
941 
942  unsigned getHashValue() const {
943  return hash_combine(Scope, Name, ConfigurationMacros, IncludePath);
944  }
945 };
946 
950  bool IsDefault;
951 
953  : Name(Name), Type(Type), IsDefault(IsDefault) {}
955  : Name(N->getRawName()), Type(N->getRawType()),
956  IsDefault(N->isDefault()) {}
957 
958  bool isKeyOf(const DITemplateTypeParameter *RHS) const {
959  return Name == RHS->getRawName() && Type == RHS->getRawType() &&
960  IsDefault == RHS->isDefault();
961  }
962 
963  unsigned getHashValue() const { return hash_combine(Name, Type, IsDefault); }
964 };
965 
967  unsigned Tag;
970  bool IsDefault;
972 
973  MDNodeKeyImpl(unsigned Tag, MDString *Name, Metadata *Type, bool IsDefault,
974  Metadata *Value)
975  : Tag(Tag), Name(Name), Type(Type), IsDefault(IsDefault), Value(Value) {}
977  : Tag(N->getTag()), Name(N->getRawName()), Type(N->getRawType()),
978  IsDefault(N->isDefault()), Value(N->getValue()) {}
979 
980  bool isKeyOf(const DITemplateValueParameter *RHS) const {
981  return Tag == RHS->getTag() && Name == RHS->getRawName() &&
982  Type == RHS->getRawType() && IsDefault == RHS->isDefault() &&
983  Value == RHS->getValue();
984  }
985 
986  unsigned getHashValue() const {
987  return hash_combine(Tag, Name, Type, IsDefault, Value);
988  }
989 };
990 
991 template <> struct MDNodeKeyImpl<DIGlobalVariable> {
996  unsigned Line;
1004 
1006  Metadata *File, unsigned Line, Metadata *Type,
1007  bool IsLocalToUnit, bool IsDefinition,
1008  Metadata *StaticDataMemberDeclaration, Metadata *TemplateParams,
1009  uint32_t AlignInBits, Metadata *Annotations)
1010  : Scope(Scope), Name(Name), LinkageName(LinkageName), File(File),
1011  Line(Line), Type(Type), IsLocalToUnit(IsLocalToUnit),
1012  IsDefinition(IsDefinition),
1013  StaticDataMemberDeclaration(StaticDataMemberDeclaration),
1014  TemplateParams(TemplateParams), AlignInBits(AlignInBits),
1017  : Scope(N->getRawScope()), Name(N->getRawName()),
1018  LinkageName(N->getRawLinkageName()), File(N->getRawFile()),
1019  Line(N->getLine()), Type(N->getRawType()),
1020  IsLocalToUnit(N->isLocalToUnit()), IsDefinition(N->isDefinition()),
1021  StaticDataMemberDeclaration(N->getRawStaticDataMemberDeclaration()),
1022  TemplateParams(N->getRawTemplateParams()),
1023  AlignInBits(N->getAlignInBits()), Annotations(N->getRawAnnotations()) {}
1024 
1025  bool isKeyOf(const DIGlobalVariable *RHS) const {
1026  return Scope == RHS->getRawScope() && Name == RHS->getRawName() &&
1027  LinkageName == RHS->getRawLinkageName() &&
1028  File == RHS->getRawFile() && Line == RHS->getLine() &&
1029  Type == RHS->getRawType() && IsLocalToUnit == RHS->isLocalToUnit() &&
1030  IsDefinition == RHS->isDefinition() &&
1031  StaticDataMemberDeclaration ==
1032  RHS->getRawStaticDataMemberDeclaration() &&
1033  TemplateParams == RHS->getRawTemplateParams() &&
1034  AlignInBits == RHS->getAlignInBits() &&
1035  Annotations == RHS->getRawAnnotations();
1036  }
1037 
1038  unsigned getHashValue() const {
1039  // We do not use AlignInBits in hashing function here on purpose:
1040  // in most cases this param for local variable is zero (for function param
1041  // it is always zero). This leads to lots of hash collisions and errors on
1042  // cases with lots of similar variables.
1043  // clang/test/CodeGen/debug-info-257-args.c is an example of this problem,
1044  // generated IR is random for each run and test fails with Align included.
1045  // TODO: make hashing work fine with such situations
1046  return hash_combine(Scope, Name, LinkageName, File, Line, Type,
1047  IsLocalToUnit, IsDefinition, /* AlignInBits, */
1048  StaticDataMemberDeclaration, Annotations);
1049  }
1050 };
1051 
1052 template <> struct MDNodeKeyImpl<DILocalVariable> {
1056  unsigned Line;
1058  unsigned Arg;
1059  unsigned Flags;
1062 
1063  MDNodeKeyImpl(Metadata *Scope, MDString *Name, Metadata *File, unsigned Line,
1064  Metadata *Type, unsigned Arg, unsigned Flags,
1065  uint32_t AlignInBits, Metadata *Annotations)
1066  : Scope(Scope), Name(Name), File(File), Line(Line), Type(Type), Arg(Arg),
1067  Flags(Flags), AlignInBits(AlignInBits), Annotations(Annotations) {}
1069  : Scope(N->getRawScope()), Name(N->getRawName()), File(N->getRawFile()),
1070  Line(N->getLine()), Type(N->getRawType()), Arg(N->getArg()),
1071  Flags(N->getFlags()), AlignInBits(N->getAlignInBits()),
1072  Annotations(N->getRawAnnotations()) {}
1073 
1074  bool isKeyOf(const DILocalVariable *RHS) const {
1075  return Scope == RHS->getRawScope() && Name == RHS->getRawName() &&
1076  File == RHS->getRawFile() && Line == RHS->getLine() &&
1077  Type == RHS->getRawType() && Arg == RHS->getArg() &&
1078  Flags == RHS->getFlags() && AlignInBits == RHS->getAlignInBits() &&
1079  Annotations == RHS->getRawAnnotations();
1080  }
1081 
1082  unsigned getHashValue() const {
1083  // We do not use AlignInBits in hashing function here on purpose:
1084  // in most cases this param for local variable is zero (for function param
1085  // it is always zero). This leads to lots of hash collisions and errors on
1086  // cases with lots of similar variables.
1087  // clang/test/CodeGen/debug-info-257-args.c is an example of this problem,
1088  // generated IR is random for each run and test fails with Align included.
1089  // TODO: make hashing work fine with such situations
1090  return hash_combine(Scope, Name, File, Line, Type, Arg, Flags, Annotations);
1091  }
1092 };
1093 
1094 template <> struct MDNodeKeyImpl<DILabel> {
1098  unsigned Line;
1099 
1100  MDNodeKeyImpl(Metadata *Scope, MDString *Name, Metadata *File, unsigned Line)
1101  : Scope(Scope), Name(Name), File(File), Line(Line) {}
1103  : Scope(N->getRawScope()), Name(N->getRawName()), File(N->getRawFile()),
1104  Line(N->getLine()) {}
1105 
1106  bool isKeyOf(const DILabel *RHS) const {
1107  return Scope == RHS->getRawScope() && Name == RHS->getRawName() &&
1108  File == RHS->getRawFile() && Line == RHS->getLine();
1109  }
1110 
1111  /// Using name and line to get hash value. It should already be mostly unique.
1112  unsigned getHashValue() const { return hash_combine(Scope, Name, Line); }
1113 };
1114 
1115 template <> struct MDNodeKeyImpl<DIExpression> {
1117 
1118  MDNodeKeyImpl(ArrayRef<uint64_t> Elements) : Elements(Elements) {}
1119  MDNodeKeyImpl(const DIExpression *N) : Elements(N->getElements()) {}
1120 
1121  bool isKeyOf(const DIExpression *RHS) const {
1122  return Elements == RHS->getElements();
1123  }
1124 
1125  unsigned getHashValue() const {
1126  return hash_combine_range(Elements.begin(), Elements.end());
1127  }
1128 };
1129 
1133 
1135  : Variable(Variable), Expression(Expression) {}
1137  : Variable(N->getRawVariable()), Expression(N->getRawExpression()) {}
1138 
1140  return Variable == RHS->getRawVariable() &&
1141  Expression == RHS->getRawExpression();
1142  }
1143 
1144  unsigned getHashValue() const { return hash_combine(Variable, Expression); }
1145 };
1146 
1147 template <> struct MDNodeKeyImpl<DIObjCProperty> {
1150  unsigned Line;
1153  unsigned Attributes;
1155 
1156  MDNodeKeyImpl(MDString *Name, Metadata *File, unsigned Line,
1157  MDString *GetterName, MDString *SetterName, unsigned Attributes,
1158  Metadata *Type)
1159  : Name(Name), File(File), Line(Line), GetterName(GetterName),
1160  SetterName(SetterName), Attributes(Attributes), Type(Type) {}
1162  : Name(N->getRawName()), File(N->getRawFile()), Line(N->getLine()),
1163  GetterName(N->getRawGetterName()), SetterName(N->getRawSetterName()),
1164  Attributes(N->getAttributes()), Type(N->getRawType()) {}
1165 
1166  bool isKeyOf(const DIObjCProperty *RHS) const {
1167  return Name == RHS->getRawName() && File == RHS->getRawFile() &&
1168  Line == RHS->getLine() && GetterName == RHS->getRawGetterName() &&
1169  SetterName == RHS->getRawSetterName() &&
1170  Attributes == RHS->getAttributes() && Type == RHS->getRawType();
1171  }
1172 
1173  unsigned getHashValue() const {
1174  return hash_combine(Name, File, Line, GetterName, SetterName, Attributes,
1175  Type);
1176  }
1177 };
1178 
1179 template <> struct MDNodeKeyImpl<DIImportedEntity> {
1180  unsigned Tag;
1184  unsigned Line;
1187 
1188  MDNodeKeyImpl(unsigned Tag, Metadata *Scope, Metadata *Entity, Metadata *File,
1189  unsigned Line, MDString *Name, Metadata *Elements)
1190  : Tag(Tag), Scope(Scope), Entity(Entity), File(File), Line(Line),
1191  Name(Name), Elements(Elements) {}
1193  : Tag(N->getTag()), Scope(N->getRawScope()), Entity(N->getRawEntity()),
1194  File(N->getRawFile()), Line(N->getLine()), Name(N->getRawName()),
1195  Elements(N->getRawElements()) {}
1196 
1197  bool isKeyOf(const DIImportedEntity *RHS) const {
1198  return Tag == RHS->getTag() && Scope == RHS->getRawScope() &&
1199  Entity == RHS->getRawEntity() && File == RHS->getFile() &&
1200  Line == RHS->getLine() && Name == RHS->getRawName() &&
1201  Elements == RHS->getRawElements();
1202  }
1203 
1204  unsigned getHashValue() const {
1205  return hash_combine(Tag, Scope, Entity, File, Line, Name, Elements);
1206  }
1207 };
1208 
1209 template <> struct MDNodeKeyImpl<DIMacro> {
1210  unsigned MIType;
1211  unsigned Line;
1214 
1215  MDNodeKeyImpl(unsigned MIType, unsigned Line, MDString *Name, MDString *Value)
1216  : MIType(MIType), Line(Line), Name(Name), Value(Value) {}
1218  : MIType(N->getMacinfoType()), Line(N->getLine()), Name(N->getRawName()),
1219  Value(N->getRawValue()) {}
1220 
1221  bool isKeyOf(const DIMacro *RHS) const {
1222  return MIType == RHS->getMacinfoType() && Line == RHS->getLine() &&
1223  Name == RHS->getRawName() && Value == RHS->getRawValue();
1224  }
1225 
1226  unsigned getHashValue() const {
1227  return hash_combine(MIType, Line, Name, Value);
1228  }
1229 };
1230 
1231 template <> struct MDNodeKeyImpl<DIMacroFile> {
1232  unsigned MIType;
1233  unsigned Line;
1236 
1237  MDNodeKeyImpl(unsigned MIType, unsigned Line, Metadata *File,
1238  Metadata *Elements)
1239  : MIType(MIType), Line(Line), File(File), Elements(Elements) {}
1241  : MIType(N->getMacinfoType()), Line(N->getLine()), File(N->getRawFile()),
1242  Elements(N->getRawElements()) {}
1243 
1244  bool isKeyOf(const DIMacroFile *RHS) const {
1245  return MIType == RHS->getMacinfoType() && Line == RHS->getLine() &&
1246  File == RHS->getRawFile() && Elements == RHS->getRawElements();
1247  }
1248 
1249  unsigned getHashValue() const {
1250  return hash_combine(MIType, Line, File, Elements);
1251  }
1252 };
1253 
1254 template <> struct MDNodeKeyImpl<DIArgList> {
1256 
1258  MDNodeKeyImpl(const DIArgList *N) : Args(N->getArgs()) {}
1259 
1260  bool isKeyOf(const DIArgList *RHS) const { return Args == RHS->getArgs(); }
1261 
1262  unsigned getHashValue() const {
1263  return hash_combine_range(Args.begin(), Args.end());
1264  }
1265 };
1266 
1267 /// DenseMapInfo for MDNode subclasses.
1268 template <class NodeTy> struct MDNodeInfo {
1271 
1272  static inline NodeTy *getEmptyKey() {
1274  }
1275 
1276  static inline NodeTy *getTombstoneKey() {
1278  }
1279 
1280  static unsigned getHashValue(const KeyTy &Key) { return Key.getHashValue(); }
1281 
1282  static unsigned getHashValue(const NodeTy *N) {
1283  return KeyTy(N).getHashValue();
1284  }
1285 
1286  static bool isEqual(const KeyTy &LHS, const NodeTy *RHS) {
1287  if (RHS == getEmptyKey() || RHS == getTombstoneKey())
1288  return false;
1289  return SubsetEqualTy::isSubsetEqual(LHS, RHS) || LHS.isKeyOf(RHS);
1290  }
1291 
1292  static bool isEqual(const NodeTy *LHS, const NodeTy *RHS) {
1293  if (LHS == RHS)
1294  return true;
1295  if (RHS == getEmptyKey() || RHS == getTombstoneKey())
1296  return false;
1298  }
1299 };
1300 
1301 #define HANDLE_MDNODE_LEAF(CLASS) using CLASS##Info = MDNodeInfo<CLASS>;
1302 #include "llvm/IR/Metadata.def"
1303 
1304 /// Multimap-like storage for metadata attachments.
1306 public:
1307  struct Attachment {
1308  unsigned MDKind;
1310  };
1311 
1312 private:
1313  SmallVector<Attachment, 1> Attachments;
1314 
1315 public:
1316  bool empty() const { return Attachments.empty(); }
1317  size_t size() const { return Attachments.size(); }
1318 
1319  /// Returns the first attachment with the given ID or nullptr if no such
1320  /// attachment exists.
1321  MDNode *lookup(unsigned ID) const;
1322 
1323  /// Appends all attachments with the given ID to \c Result in insertion order.
1324  /// If the global has no attachments with the given ID, or if ID is invalid,
1325  /// leaves Result unchanged.
1326  void get(unsigned ID, SmallVectorImpl<MDNode *> &Result) const;
1327 
1328  /// Appends all attachments for the global to \c Result, sorting by attachment
1329  /// ID. Attachments with the same ID appear in insertion order. This function
1330  /// does \em not clear \c Result.
1331  void getAll(SmallVectorImpl<std::pair<unsigned, MDNode *>> &Result) const;
1332 
1333  /// Set an attachment to a particular node.
1334  ///
1335  /// Set the \c ID attachment to \c MD, replacing the current attachments at \c
1336  /// ID (if anyway).
1337  void set(unsigned ID, MDNode *MD);
1338 
1339  /// Adds an attachment to a particular node.
1340  void insert(unsigned ID, MDNode &MD);
1341 
1342  /// Remove attachments with the given ID.
1343  ///
1344  /// Remove the attachments at \c ID, if any.
1345  bool erase(unsigned ID);
1346 
1347  /// Erase matching attachments.
1348  ///
1349  /// Erases all attachments matching the \c shouldRemove predicate.
1350  template <class PredTy> void remove_if(PredTy shouldRemove) {
1351  llvm::erase_if(Attachments, shouldRemove);
1352  }
1353 };
1354 
1356 public:
1357  /// OwnedModules - The set of modules instantiated in this context, and which
1358  /// will be automatically deleted if this context is deleted.
1360 
1361  /// The main remark streamer used by all the other streamers (e.g. IR, MIR,
1362  /// frontends, etc.). This should only be used by the specific streamers, and
1363  /// never directly.
1364  std::unique_ptr<remarks::RemarkStreamer> MainRemarkStreamer;
1365 
1366  std::unique_ptr<DiagnosticHandler> DiagHandler;
1369  /// The minimum hotness value a diagnostic needs in order to be included in
1370  /// optimization diagnostics.
1371  ///
1372  /// The threshold is an Optional value, which maps to one of the 3 states:
1373  /// 1). 0 => threshold disabled. All emarks will be printed.
1374  /// 2). positive int => manual threshold by user. Remarks with hotness exceed
1375  /// threshold will be printed.
1376  /// 3). None => 'auto' threshold by user. The actual value is not
1377  /// available at command line, but will be synced with
1378  /// hotness threhold from profile summary during
1379  /// compilation.
1380  ///
1381  /// State 1 and 2 are considered as terminal states. State transition is
1382  /// only allowed from 3 to 2, when the threshold is first synced with profile
1383  /// summary. This ensures that the threshold is set only once and stays
1384  /// constant.
1385  ///
1386  /// If threshold option is not specified, it is disabled (0) by default.
1388 
1389  /// The percentage of difference between profiling branch weights and
1390  /// llvm.expect branch weights to tolerate when emiting MisExpect diagnostics
1393 
1394  /// The specialized remark streamer used by LLVM's OptimizationRemarkEmitter.
1395  std::unique_ptr<LLVMRemarkStreamer> LLVMRS;
1396 
1398  void *YieldOpaqueHandle = nullptr;
1399 
1401 
1402  using IntMapTy =
1405 
1406  using FPMapTy =
1409 
1413 
1417 
1418 #define HANDLE_MDNODE_LEAF_UNIQUABLE(CLASS) \
1419  DenseSet<CLASS *, CLASS##Info> CLASS##s;
1420 #include "llvm/IR/Metadata.def"
1421 
1422  // Optional map for looking up composite types by identifier.
1424 
1425  // MDNodes may be uniqued or not uniqued. When they're not uniqued, they
1426  // aren't in the MDNodeSet, but they're still shared between objects, so no
1427  // one object can destroy them. Keep track of them here so we can delete
1428  // them on context teardown.
1429  std::vector<MDNode *> DistinctMDNodes;
1430 
1432 
1435 
1438 
1441 
1443 
1445 
1447 
1449 
1452 
1454 
1456 
1458 
1460 
1463 
1464  // Basic type instances.
1469 
1470  std::unique_ptr<ConstantTokenNone> TheNoneToken;
1471 
1474 
1476 
1483 
1486  DenseMap<Type *, PointerType *> PointerTypes; // Pointers in AddrSpace = 0
1489 
1490  /// ValueHandles - This map keeps track of all of the value handles that are
1491  /// watching a Value*. The Value::HasValueHandle bit is used to know
1492  /// whether or not a value has an entry in this map.
1495 
1496  /// CustomMDKindNames - Map to hold the metadata string to ID mapping.
1498 
1499  /// Collection of metadata used in this context.
1501 
1502  /// Collection of per-GlobalObject sections used in this context.
1504 
1505  /// Collection of per-GlobalValue partitions used in this context.
1507 
1510 
1511  /// DiscriminatorTable - This table maps file:line locations to an
1512  /// integer representing the next DWARF path discriminator to assign to
1513  /// instructions in different blocks at the same location.
1515 
1516  /// A set of interned tags for operand bundles. The StringMap maps
1517  /// bundle tags to their IDs.
1518  ///
1519  /// \see LLVMContext::getOperandBundleTagID
1521 
1525 
1526  /// A set of interned synchronization scopes. The StringMap maps
1527  /// synchronization scope names to their respective synchronization scope IDs.
1529 
1530  /// getOrInsertSyncScopeID - Maps synchronization scope name to
1531  /// synchronization scope ID. Every synchronization scope registered with
1532  /// LLVMContext has unique ID except pre-defined ones.
1534 
1535  /// getSyncScopeNames - Populates client supplied SmallVector with
1536  /// synchronization scope names registered with LLVMContext. Synchronization
1537  /// scope names are ordered by increasing synchronization scope IDs.
1539 
1540  /// Maintain the GC name for each function.
1541  ///
1542  /// This saves allocating an additional word in Function for programs which
1543  /// do not use GC (i.e., most programs) at the cost of increased overhead for
1544  /// clients which do use GC.
1546 
1547  /// Flag to indicate if Value (other than GlobalValue) retains their name or
1548  /// not.
1549  bool DiscardValueNames = false;
1550 
1552  ~LLVMContextImpl();
1553 
1554  /// Destroy the ConstantArrays if they are not used.
1556 
1557  mutable OptPassGate *OPG = nullptr;
1558 
1559  /// Access the object which can disable optional passes and individual
1560  /// optimizations at compile time.
1561  OptPassGate &getOptPassGate() const;
1562 
1563  /// Set the object which can disable optional passes and individual
1564  /// optimizations at compile time.
1565  ///
1566  /// The lifetime of the object must be guaranteed to extend as long as the
1567  /// LLVMContext is used by compilation.
1568  void setOptPassGate(OptPassGate &);
1569 
1570  // TODO: clean up the following after we no longer support non-opaque pointer
1571  // types.
1572  bool getOpaquePointers();
1573  bool hasOpaquePointersValue();
1574  void setOpaquePointers(bool OP);
1575 
1576 private:
1577  Optional<bool> OpaquePointers;
1578 };
1579 
1580 } // end namespace llvm
1581 
1582 #endif // LLVM_LIB_IR_LLVMCONTEXTIMPL_H
llvm::MDNodeKeyImpl< DIGlobalVariable >::IsDefinition
bool IsDefinition
Definition: LLVMContextImpl.h:999
llvm::MDNodeKeyImpl< DISubprogram >::isDefinition
bool isDefinition() const
Definition: LLVMContextImpl.h:764
llvm::MDNodeKeyImpl< MDTuple >::MDNodeKeyImpl
MDNodeKeyImpl(ArrayRef< Metadata * > Ops)
Definition: LLVMContextImpl.h:254
llvm::MDNodeKeyImpl< DITemplateValueParameter >::isKeyOf
bool isKeyOf(const DITemplateValueParameter *RHS) const
Definition: LLVMContextImpl.h:980
llvm::MDNodeKeyImpl< DIGlobalVariableExpression >::Variable
Metadata * Variable
Definition: LLVMContextImpl.h:1131
llvm::FunctionTypeKeyInfo::getTombstoneKey
static FunctionType * getTombstoneKey()
Definition: LLVMContextImpl.h:169
llvm::LLVMContextImpl::Alloc
BumpPtrAllocator Alloc
Definition: LLVMContextImpl.h:1472
llvm::LLVMContextImpl::IntegerTypes
DenseMap< unsigned, IntegerType * > IntegerTypes
Definition: LLVMContextImpl.h:1475
llvm::lltok::APFloat
@ APFloat
Definition: LLToken.h:438
llvm::MDNodeKeyImpl< DICompositeType >::TemplateParams
Metadata * TemplateParams
Definition: LLVMContextImpl.h:581
llvm::MDNodeKeyImpl< DISubrange >::CountNode
Metadata * CountNode
Definition: LLVMContextImpl.h:316
llvm::MDAttachments::Attachment::MDKind
unsigned MDKind
Definition: LLVMContextImpl.h:1308
llvm::DenseMapAPFloatKeyInfo::getHashValue
static unsigned getHashValue(const APFloat &Key)
Definition: LLVMContextImpl.h:84
llvm::LLVMContextImpl::InlineAsms
ConstantUniqueMap< InlineAsm > InlineAsms
Definition: LLVMContextImpl.h:1459
llvm::MDNodeKeyImpl< DIImportedEntity >::MDNodeKeyImpl
MDNodeKeyImpl(unsigned Tag, Metadata *Scope, Metadata *Entity, Metadata *File, unsigned Line, MDString *Name, Metadata *Elements)
Definition: LLVMContextImpl.h:1188
llvm::MDNodeKeyImpl< DIImportedEntity >::Entity
Metadata * Entity
Definition: LLVMContextImpl.h:1182
llvm::MDNodeKeyImpl< DIExpression >::getHashValue
unsigned getHashValue() const
Definition: LLVMContextImpl.h:1125
llvm::AnonStructTypeKeyInfo::isEqual
static bool isEqual(const StructType *LHS, const StructType *RHS)
Definition: LLVMContextImpl.h:136
llvm::MDNodeKeyImpl< DICommonBlock >::getHashValue
unsigned getHashValue() const
Definition: LLVMContextImpl.h:905
llvm::DIArgList
List of ValueAsMetadata, to be used as an argument to a dbg.value intrinsic.
Definition: DebugInfoMetadata.h:3565
llvm::MDNodeKeyImpl< GenericDINode >::getHashValue
unsigned getHashValue() const
Definition: LLVMContextImpl.h:308
llvm::MDNodeKeyImpl< DISubprogram >::LinkageName
MDString * LinkageName
Definition: LLVMContextImpl.h:698
llvm
This is an optimization pass for GlobalISel generic memory operations.
Definition: AddressRanges.h:18
llvm::MDNodeKeyImpl< DILexicalBlockFile >::Scope
Metadata * Scope
Definition: LLVMContextImpl.h:846
llvm::MDNodeKeyImpl< DIStringType >::StringLengthExp
Metadata * StringLengthExp
Definition: LLVMContextImpl.h:446
llvm::LLVMContextImpl::BlockAddresses
DenseMap< std::pair< const Function *, const BasicBlock * >, BlockAddress * > BlockAddresses
Definition: LLVMContextImpl.h:1451
llvm::StringMapEntry< uint32_t >
Optional.h
llvm::MDNodeKeyImpl< DISubroutineType >::isKeyOf
bool isKeyOf(const DISubroutineType *RHS) const
Definition: LLVMContextImpl.h:659
llvm::MDNodeKeyImpl< DITemplateTypeParameter >::getHashValue
unsigned getHashValue() const
Definition: LLVMContextImpl.h:963
llvm::MDNodeKeyImpl< DIDerivedType >::getHashValue
unsigned getHashValue() const
Definition: LLVMContextImpl.h:519
llvm::MDNodeKeyImpl< DIModule >::IsDecl
bool IsDecl
Definition: LLVMContextImpl.h:918
llvm::MDNodeKeyImpl< DIObjCProperty >::Line
unsigned Line
Definition: LLVMContextImpl.h:1150
Metadata.h
llvm::FunctionTypeKeyInfo::getHashValue
static unsigned getHashValue(const FunctionType *FT)
Definition: LLVMContextImpl.h:179
llvm::MDNodeKeyImpl< DILexicalBlock >::MDNodeKeyImpl
MDNodeKeyImpl(Metadata *Scope, Metadata *File, unsigned Line, unsigned Column)
Definition: LLVMContextImpl.h:829
llvm::MDNodeKeyImpl< DISubprogram >::MDNodeKeyImpl
MDNodeKeyImpl(const DISubprogram *N)
Definition: LLVMContextImpl.h:731
llvm::MDNodeKeyImpl< DINamespace >::Scope
Metadata * Scope
Definition: LLVMContextImpl.h:867
DebugInfoMetadata.h
llvm::LLVMContextImpl::FPConstants
FPMapTy FPConstants
Definition: LLVMContextImpl.h:1408
llvm::MDNodeKeyImpl< DIArgList >::MDNodeKeyImpl
MDNodeKeyImpl(const DIArgList *N)
Definition: LLVMContextImpl.h:1258
llvm::LLVMContextImpl::DiscardValueNames
bool DiscardValueNames
Flag to indicate if Value (other than GlobalValue) retains their name or not.
Definition: LLVMContextImpl.h:1549
llvm::MDNodeKeyImpl< MDTuple >::calculateHash
static unsigned calculateHash(MDTuple *N)
Definition: LLVMContextImpl.h:261
llvm::MDNodeKeyImpl< DIImportedEntity >::Tag
unsigned Tag
Definition: LLVMContextImpl.h:1180
llvm::DIGenericSubrange
Definition: DebugInfoMetadata.h:363
llvm::MDNodeKeyImpl< DICommonBlock >::File
Metadata * File
Definition: LLVMContextImpl.h:889
P
This currently compiles esp xmm0 movsd esp eax eax esp ret We should use not the dag combiner This is because dagcombine2 needs to be able to see through the X86ISD::Wrapper which DAGCombine can t really do The code for turning x load into a single vector load is target independent and should be moved to the dag combiner The code for turning x load into a vector load can only handle a direct load from a global or a direct load from the stack It should be generalized to handle any load from P
Definition: README-SSE.txt:411
llvm::LLVMContextImpl::Int64Ty
IntegerType Int64Ty
Definition: LLVMContextImpl.h:1468
llvm::LLVMContextImpl::UVConstants
DenseMap< Type *, std::unique_ptr< UndefValue > > UVConstants
Definition: LLVMContextImpl.h:1444
llvm::MDNodeKeyImpl< DITemplateTypeParameter >::MDNodeKeyImpl
MDNodeKeyImpl(MDString *Name, Metadata *Type, bool IsDefault)
Definition: LLVMContextImpl.h:952
llvm::MDNodeKeyImpl< DIDerivedType >::Flags
unsigned Flags
Definition: LLVMContextImpl.h:486
llvm::MDNodeKeyImpl< DINamespace >::Name
MDString * Name
Definition: LLVMContextImpl.h:868
llvm::LLVMContextImpl::FloatTy
Type FloatTy
Definition: LLVMContextImpl.h:1465
llvm::MDNodeKeyImpl< DICompositeType >::Discriminator
Metadata * Discriminator
Definition: LLVMContextImpl.h:583
llvm::LLVMContextImpl::ArrayTypes
DenseMap< std::pair< Type *, uint64_t >, ArrayType * > ArrayTypes
Definition: LLVMContextImpl.h:1484
llvm::MDNodeKeyImpl< DIImportedEntity >::isKeyOf
bool isKeyOf(const DIImportedEntity *RHS) const
Definition: LLVMContextImpl.h:1197
llvm::MDNodeInfo::isEqual
static bool isEqual(const NodeTy *LHS, const NodeTy *RHS)
Definition: LLVMContextImpl.h:1292
llvm::MDNodeKeyImpl< DIFile >::Filename
MDString * Filename
Definition: LLVMContextImpl.h:668
llvm::DILexicalBlockFile
Definition: DebugInfoMetadata.h:2140
llvm::SmallVector
This is a 'vector' (really, a variable-sized array), optimized for the case when the array is small.
Definition: SmallVector.h:1182
llvm::MDNodeKeyImpl< DIEnumerator >::MDNodeKeyImpl
MDNodeKeyImpl(const DIEnumerator *N)
Definition: LLVMContextImpl.h:400
llvm::MDAttachments::set
void set(unsigned ID, MDNode *MD)
Set an attachment to a particular node.
Definition: Metadata.cpp:1263
llvm::DenseMapAPFloatKeyInfo
Definition: LLVMContextImpl.h:78
llvm::DIStringType
String type, Fortran CHARACTER(n)
Definition: DebugInfoMetadata.h:832
llvm::MDAttachments::size
size_t size() const
Definition: LLVMContextImpl.h:1317
llvm::MDNodeInfo::getEmptyKey
static NodeTy * getEmptyKey()
Definition: LLVMContextImpl.h:1272
llvm::DIFile::ChecksumInfo
A single checksum, represented by a Kind and a Value (a string).
Definition: DebugInfoMetadata.h:546
llvm::MDNodeKeyImpl< DINamespace >::MDNodeKeyImpl
MDNodeKeyImpl(const DINamespace *N)
Definition: LLVMContextImpl.h:873
llvm::MDNodeKeyImpl< DISubprogram >::Declaration
Metadata * Declaration
Definition: LLVMContextImpl.h:710
Allocator.h
llvm::erase_if
void erase_if(Container &C, UnaryPredicate P)
Provide a container algorithm similar to C++ Library Fundamentals v2's erase_if which is equivalent t...
Definition: STLExtras.h:1802
llvm::FunctionTypeKeyInfo::KeyTy::Params
ArrayRef< Type * > Params
Definition: LLVMContextImpl.h:144
llvm::LLVMContextImpl::ExprConstants
ConstantUniqueMap< ConstantExpr > ExprConstants
Definition: LLVMContextImpl.h:1457
llvm::LLVMContextImpl::setOptPassGate
void setOptPassGate(OptPassGate &)
Set the object which can disable optional passes and individual optimizations at compile time.
Definition: LLVMContextImpl.cpp:247
llvm::MDNodeKeyImpl< DILocation >::Column
unsigned Column
Definition: LLVMContextImpl.h:269
llvm::MDNodeKeyImpl< DILocalVariable >::MDNodeKeyImpl
MDNodeKeyImpl(Metadata *Scope, MDString *Name, Metadata *File, unsigned Line, Metadata *Type, unsigned Arg, unsigned Flags, uint32_t AlignInBits, Metadata *Annotations)
Definition: LLVMContextImpl.h:1063
llvm::MDNodeInfo::getHashValue
static unsigned getHashValue(const KeyTy &Key)
Definition: LLVMContextImpl.h:1280
llvm::MDNodeSubsetEqualImpl
Configuration point for MDNodeInfo::isEqual().
Definition: LLVMContextImpl.h:237
llvm::MDAttachments::erase
bool erase(unsigned ID)
Remove attachments with the given ID.
Definition: Metadata.cpp:1273
llvm::MDNodeKeyImpl< DISubroutineType >::MDNodeKeyImpl
MDNodeKeyImpl(unsigned Flags, uint8_t CC, Metadata *TypeArray)
Definition: LLVMContextImpl.h:654
llvm::MDNodeKeyImpl< DIGenericSubrange >::Stride
Metadata * Stride
Definition: LLVMContextImpl.h:364
llvm::MDNodeKeyImpl< DIGlobalVariableExpression >::isKeyOf
bool isKeyOf(const DIGlobalVariableExpression *RHS) const
Definition: LLVMContextImpl.h:1139
llvm::MDNodeKeyImpl< DILocalVariable >::getHashValue
unsigned getHashValue() const
Definition: LLVMContextImpl.h:1082
APInt.h
llvm::MDNodeKeyImpl< DIFile >::MDNodeKeyImpl
MDNodeKeyImpl(MDString *Filename, MDString *Directory, Optional< DIFile::ChecksumInfo< MDString * >> Checksum, Optional< MDString * > Source)
Definition: LLVMContextImpl.h:673
llvm::MDNodeKeyImpl< GenericDINode >::MDNodeKeyImpl
MDNodeKeyImpl(unsigned Tag, MDString *Header, ArrayRef< Metadata * > DwarfOps)
Definition: LLVMContextImpl.h:298
llvm::MDNodeKeyImpl< DICompositeType >::OffsetInBits
uint64_t OffsetInBits
Definition: LLVMContextImpl.h:575
llvm::MDNodeKeyImpl< DIBasicType >::isKeyOf
bool isKeyOf(const DIBasicType *RHS) const
Definition: LLVMContextImpl.h:430
llvm::DILocation
Debug location.
Definition: DebugInfoMetadata.h:1557
llvm::MDNodeKeyImpl< DISubprogram >::Annotations
Metadata * Annotations
Definition: LLVMContextImpl.h:713
llvm::MDNodeKeyImpl< DILabel >::MDNodeKeyImpl
MDNodeKeyImpl(const DILabel *N)
Definition: LLVMContextImpl.h:1102
llvm::MDNodeKeyImpl< DILexicalBlock >::MDNodeKeyImpl
MDNodeKeyImpl(const DILexicalBlock *N)
Definition: LLVMContextImpl.h:831
llvm::Type
The instances of the Type class are immutable: once they are created, they are never changed.
Definition: Type.h:45
DenseMap.h
llvm::MDNodeKeyImpl< DIStringType >::MDNodeKeyImpl
MDNodeKeyImpl(unsigned Tag, MDString *Name, Metadata *StringLength, Metadata *StringLengthExp, Metadata *StringLocationExp, uint64_t SizeInBits, uint32_t AlignInBits, unsigned Encoding)
Definition: LLVMContextImpl.h:452
Module.h
llvm::MDNodeInfo::KeyTy
MDNodeKeyImpl< NodeTy > KeyTy
Definition: LLVMContextImpl.h:1269
llvm::MDNodeKeyImpl< DIStringType >::MDNodeKeyImpl
MDNodeKeyImpl(const DIStringType *N)
Definition: LLVMContextImpl.h:458
llvm::LLVMContextImpl::MainRemarkStreamer
std::unique_ptr< remarks::RemarkStreamer > MainRemarkStreamer
The main remark streamer used by all the other streamers (e.g.
Definition: LLVMContextImpl.h:1364
llvm::MDNodeKeyImpl< DIImportedEntity >::getHashValue
unsigned getHashValue() const
Definition: LLVMContextImpl.h:1204
llvm::MDNodeKeyImpl< DIFile >::Directory
MDString * Directory
Definition: LLVMContextImpl.h:669
llvm::MDNodeKeyImpl< DIMacro >::MDNodeKeyImpl
MDNodeKeyImpl(unsigned MIType, unsigned Line, MDString *Name, MDString *Value)
Definition: LLVMContextImpl.h:1215
llvm::MDNodeKeyImpl< DILexicalBlockFile >::isKeyOf
bool isKeyOf(const DILexicalBlockFile *RHS) const
Definition: LLVMContextImpl.h:856
llvm::MDNodeKeyImpl< DIGlobalVariableExpression >::MDNodeKeyImpl
MDNodeKeyImpl(Metadata *Variable, Metadata *Expression)
Definition: LLVMContextImpl.h:1134
llvm::LLVMContextImpl::DiagnosticsHotnessRequested
bool DiagnosticsHotnessRequested
Definition: LLVMContextImpl.h:1368
llvm::MDNodeKeyImpl< DIGlobalVariable >::File
Metadata * File
Definition: LLVMContextImpl.h:995
llvm::LLVMContextImpl::X86_AMXTy
Type X86_AMXTy
Definition: LLVMContextImpl.h:1467
llvm::Optional< unsigned >
llvm::MDNodeKeyImpl< DISubprogram >::getHashValue
unsigned getHashValue() const
Definition: LLVMContextImpl.h:766
llvm::MDNodeKeyImpl< DISubprogram >::ContainingType
Metadata * ContainingType
Definition: LLVMContextImpl.h:703
llvm::MDNodeKeyImpl< DIDerivedType >::Tag
unsigned Tag
Definition: LLVMContextImpl.h:476
llvm::SmallPtrSet< Module *, 4 >
llvm::Intrinsic::getAttributes
AttributeList getAttributes(LLVMContext &C, ID id)
Return the attributes for an intrinsic.
llvm::MDNodeKeyImpl< DIObjCProperty >::Name
MDString * Name
Definition: LLVMContextImpl.h:1148
llvm::LLVMContextImpl::ValueNames
DenseMap< const Value *, ValueName * > ValueNames
Definition: LLVMContextImpl.h:1400
llvm::MDNodeKeyImpl< DICompositeType >::MDNodeKeyImpl
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, Metadata *DataLocation, Metadata *Associated, Metadata *Allocated, Metadata *Rank, Metadata *Annotations)
Definition: LLVMContextImpl.h:590
llvm::MDNodeKeyImpl< DIMacro >::MDNodeKeyImpl
MDNodeKeyImpl(const DIMacro *N)
Definition: LLVMContextImpl.h:1217
Hashing.h
llvm::MDNodeKeyImpl< DISubrange >::getHashValue
unsigned getHashValue() const
Definition: LLVMContextImpl.h:351
STLExtras.h
llvm::LLVMContextImpl::ValuesAsMetadata
DenseMap< Value *, ValueAsMetadata * > ValuesAsMetadata
Definition: LLVMContextImpl.h:1415
llvm::MDNodeKeyImpl< DIDerivedType >::File
Metadata * File
Definition: LLVMContextImpl.h:478
llvm::DIExpression
DWARF expression.
Definition: DebugInfoMetadata.h:2558
RHS
Value * RHS
Definition: X86PartialReduction.cpp:76
llvm::ArrayType
Class to represent array types.
Definition: DerivedTypes.h:357
llvm::MDNodeKeyImpl< DITemplateTypeParameter >::MDNodeKeyImpl
MDNodeKeyImpl(const DITemplateTypeParameter *N)
Definition: LLVMContextImpl.h:954
that
we should consider alternate ways to model stack dependencies Lots of things could be done in WebAssemblyTargetTransformInfo cpp there are numerous optimization related hooks that can be overridden in WebAssemblyTargetLowering Instead of the OptimizeReturned which should consider preserving the returned attribute through to MachineInstrs and extending the MemIntrinsicResults pass to do this optimization on calls too That would also let the WebAssemblyPeephole pass clean up dead defs for such as it does for stores Consider implementing and or getMachineCombinerPatterns Find a clean way to fix the problem which leads to the Shrink Wrapping pass being run after the WebAssembly PEI pass When setting multiple variables to the same we currently get code like const It could be done with a smaller encoding like local tee $pop5 local $pop6 WebAssembly registers are implicitly initialized to zero Explicit zeroing is therefore often redundant and could be optimized away Small indices may use smaller encodings than large indices WebAssemblyRegColoring and or WebAssemblyRegRenumbering should sort registers according to their usage frequency to maximize the usage of smaller encodings Many cases of irreducible control flow could be transformed more optimally than via the transform in WebAssemblyFixIrreducibleControlFlow cpp It may also be worthwhile to do transforms before register particularly when duplicating to allow register coloring to be aware of the duplication WebAssemblyRegStackify could use AliasAnalysis to reorder loads and stores more aggressively WebAssemblyRegStackify is currently a greedy algorithm This means that
Definition: README.txt:130
llvm::MDNodeKeyImpl< DIMacroFile >::Line
unsigned Line
Definition: LLVMContextImpl.h:1233
llvm::dwarf::Tag
Tag
Definition: Dwarf.h:105
llvm::DINameKind::LinkageName
@ LinkageName
BaseType
llvm::LLVMContextImpl::~LLVMContextImpl
~LLVMContextImpl()
Definition: LLVMContextImpl.cpp:55
llvm::hash_value
hash_code hash_value(const APFloat &Arg)
See friend declarations above.
Definition: APFloat.cpp:4828
llvm::MDNodeKeyImpl< DIDerivedType >::MDNodeKeyImpl
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, Metadata *Annotations)
Definition: LLVMContextImpl.h:490
llvm::MDNodeInfo
DenseMapInfo for MDNode subclasses.
Definition: LLVMContextImpl.h:1268
getTag
static Optional< unsigned > getTag(const TargetRegisterInfo *TRI, const MachineInstr &MI, const LoadInfo &LI)
Definition: AArch64FalkorHWPFFix.cpp:659
llvm::LLVMContextImpl::DSOLocalEquivalents
DenseMap< const GlobalValue *, DSOLocalEquivalent * > DSOLocalEquivalents
Definition: LLVMContextImpl.h:1453
llvm::MDNodeKeyImpl< DIGlobalVariable >::Annotations
Metadata * Annotations
Definition: LLVMContextImpl.h:1003
llvm::MDNodeKeyImpl< DIEnumerator >::Value
APInt Value
Definition: LLVMContextImpl.h:391
llvm::LLVMContextImpl::AnonStructTypes
StructTypeSet AnonStructTypes
Definition: LLVMContextImpl.h:1480
llvm::MDNodeKeyImpl< DIMacroFile >::File
Metadata * File
Definition: LLVMContextImpl.h:1234
llvm::MDNodeKeyImpl< DILabel >::MDNodeKeyImpl
MDNodeKeyImpl(Metadata *Scope, MDString *Name, Metadata *File, unsigned Line)
Definition: LLVMContextImpl.h:1100
llvm::MDNodeKeyImpl< DICompositeType >::Scope
Metadata * Scope
Definition: LLVMContextImpl.h:572
llvm::MDNodeKeyImpl< DILexicalBlock >::Column
unsigned Column
Definition: LLVMContextImpl.h:827
llvm::DINamespace
Definition: DebugInfoMetadata.h:2258
llvm::MDNodeKeyImpl< DISubprogram >::TargetFuncName
MDString * TargetFuncName
Definition: LLVMContextImpl.h:714
llvm::LLVMContextImpl::GlobalValuePartitions
DenseMap< const GlobalValue *, StringRef > GlobalValuePartitions
Collection of per-GlobalValue partitions used in this context.
Definition: LLVMContextImpl.h:1506
llvm::LLVMContextImpl::AttrsSet
FoldingSet< AttributeImpl > AttrsSet
Definition: LLVMContextImpl.h:1410
llvm::AnonStructTypeKeyInfo
Definition: LLVMContextImpl.h:93
llvm::DILexicalBlock
Definition: DebugInfoMetadata.h:2087
llvm::ArrayRef::empty
bool empty() const
empty - Check if the array is empty.
Definition: ArrayRef.h:159
llvm::MDNodeKeyImpl< DILexicalBlock >::Line
unsigned Line
Definition: LLVMContextImpl.h:826
llvm::MDNodeKeyImpl< DIGenericSubrange >::MDNodeKeyImpl
MDNodeKeyImpl(const DIGenericSubrange *N)
Definition: LLVMContextImpl.h:370
llvm::MDNodeKeyImpl< DILocation >::Line
unsigned Line
Definition: LLVMContextImpl.h:268
llvm::MDNodeKeyImpl< DIMacro >::Value
MDString * Value
Definition: LLVMContextImpl.h:1213
llvm::MDNodeKeyImpl< DIDerivedType >
Definition: LLVMContextImpl.h:475
llvm::LLVMContextImpl::getSyncScopeNames
void getSyncScopeNames(SmallVectorImpl< StringRef > &SSNs) const
getSyncScopeNames - Populates client supplied SmallVector with synchronization scope names registered...
Definition: LLVMContextImpl.cpp:232
llvm::LLVMContextImpl::TheNoneToken
std::unique_ptr< ConstantTokenNone > TheNoneToken
Definition: LLVMContextImpl.h:1470
llvm::lltok::equal
@ equal
Definition: LLToken.h:25
llvm::Annotations
Annotations lets you mark points and ranges inside source code, for tests:
Definition: Annotations.h:48
llvm::LLVMContextImpl::ArrayConstants
ArrayConstantsTy ArrayConstants
Definition: LLVMContextImpl.h:1434
llvm::MDNodeKeyImpl< DIModule >::Scope
Metadata * Scope
Definition: LLVMContextImpl.h:912
llvm::ConstantAsMetadata::getValue
Constant * getValue() const
Definition: Metadata.h:428
llvm::MDNodeKeyImpl< MDTuple >::getHashValue
unsigned getHashValue() const
Definition: LLVMContextImpl.h:259
llvm::MDNodeKeyImpl< DICompositeType >::Allocated
Metadata * Allocated
Definition: LLVMContextImpl.h:586
llvm::LLVMContextImpl::X86_MMXTy
Type X86_MMXTy
Definition: LLVMContextImpl.h:1467
llvm::FunctionTypeKeyInfo::getEmptyKey
static FunctionType * getEmptyKey()
Definition: LLVMContextImpl.h:165
llvm::MDNodeKeyImpl< DILocalVariable >::Type
Metadata * Type
Definition: LLVMContextImpl.h:1057
llvm::LLVMContextImpl::MetadataTy
Type MetadataTy
Definition: LLVMContextImpl.h:1465
llvm::MDAttachments::Attachment
Definition: LLVMContextImpl.h:1307
llvm::UniqueStringSaver
Saves strings in the provided stable storage and returns a StringRef with a stable character pointer.
Definition: StringSaver.h:42
llvm::MDNodeSubsetEqualImpl< DIDerivedType >::isSubsetEqual
static bool isSubsetEqual(const DIDerivedType *LHS, const DIDerivedType *RHS)
Definition: LLVMContextImpl.h:543
Arg
amdgpu Simplify well known AMD library false FunctionCallee Value * Arg
Definition: AMDGPULibCalls.cpp:186
llvm::LLVMContextImpl::TokenTy
Type TokenTy
Definition: LLVMContextImpl.h:1466
llvm::MDNodeKeyImpl< DISubrange >::UpperBound
Metadata * UpperBound
Definition: LLVMContextImpl.h:318
llvm::LLVMContextImpl::DiagnosticsMisExpectTolerance
Optional< uint32_t > DiagnosticsMisExpectTolerance
The percentage of difference between profiling branch weights and llvm.expect branch weights to toler...
Definition: LLVMContextImpl.h:1391
llvm::MDNodeKeyImpl< DITemplateValueParameter >::IsDefault
bool IsDefault
Definition: LLVMContextImpl.h:970
LHS
Value * LHS
Definition: X86PartialReduction.cpp:75
llvm::ConstantInt
This is the shared class of boolean and integer constants.
Definition: Constants.h:79
llvm::DIObjCProperty
Definition: DebugInfoMetadata.h:3213
llvm::MDNodeKeyImpl< DILabel >::File
Metadata * File
Definition: LLVMContextImpl.h:1097
llvm::DenseMapInfo
An information struct used to provide DenseMap with the various necessary components for a given valu...
Definition: APInt.h:34
llvm::MDNodeKeyImpl< DIGenericSubrange >::isKeyOf
bool isKeyOf(const DIGenericSubrange *RHS) const
Definition: LLVMContextImpl.h:374
llvm::LLVMContextImpl::Int16Ty
IntegerType Int16Ty
Definition: LLVMContextImpl.h:1468
llvm::MDNodeKeyImpl< DIArgList >::Args
ArrayRef< ValueAsMetadata * > Args
Definition: LLVMContextImpl.h:1255
llvm::MDNodeKeyImpl< DIGlobalVariable >::StaticDataMemberDeclaration
Metadata * StaticDataMemberDeclaration
Definition: LLVMContextImpl.h:1000
llvm::LLVMContextImpl::dropTriviallyDeadConstantArrays
void dropTriviallyDeadConstantArrays()
Destroy the ConstantArrays if they are not used.
Definition: LLVMContextImpl.cpp:145
llvm::MDNodeKeyImpl< DICompositeType >::Elements
Metadata * Elements
Definition: LLVMContextImpl.h:578
llvm::LLVMContextImpl::DiscriminatorTable
DenseMap< std::pair< const char *, unsigned >, unsigned > DiscriminatorTable
DiscriminatorTable - This table maps file:line locations to an integer representing the next DWARF pa...
Definition: LLVMContextImpl.h:1514
llvm::MDNodeKeyImpl< DICompositeType >::getHashValue
unsigned getHashValue() const
Definition: LLVMContextImpl.h:639
llvm::MDNodeKeyImpl< DIGlobalVariable >::isKeyOf
bool isKeyOf(const DIGlobalVariable *RHS) const
Definition: LLVMContextImpl.h:1025
Constants.h
llvm::MDNodeKeyImpl< DILexicalBlock >::isKeyOf
bool isKeyOf(const DILexicalBlock *RHS) const
Definition: LLVMContextImpl.h:835
llvm::AnonStructTypeKeyInfo::KeyTy::KeyTy
KeyTy(const ArrayRef< Type * > &E, bool P)
Definition: LLVMContextImpl.h:98
llvm::MDNodeKeyImpl< DIObjCProperty >::File
Metadata * File
Definition: LLVMContextImpl.h:1149
llvm::MDNodeKeyImpl< DILexicalBlock >::File
Metadata * File
Definition: LLVMContextImpl.h:825
llvm::LLVMContextImpl::ValueHandles
ValueHandlesTy ValueHandles
Definition: LLVMContextImpl.h:1494
llvm::LLVMContextImpl::GlobalValueSanitizerMetadata
DenseMap< const GlobalValue *, GlobalValue::SanitizerMetadata > GlobalValueSanitizerMetadata
Definition: LLVMContextImpl.h:1509
llvm::DILocalVariable
Local variable.
Definition: DebugInfoMetadata.h:3058
llvm::MDNodeKeyImpl< DIGlobalVariable >::AlignInBits
uint32_t AlignInBits
Definition: LLVMContextImpl.h:1002
llvm::LLVMContextImpl::X86_FP80Ty
Type X86_FP80Ty
Definition: LLVMContextImpl.h:1467
llvm::MDNodeKeyImpl< DICompositeType >::RuntimeLang
unsigned RuntimeLang
Definition: LLVMContextImpl.h:579
llvm::MDNodeKeyImpl< DIImportedEntity >::Elements
Metadata * Elements
Definition: LLVMContextImpl.h:1186
llvm::FunctionTypeKeyInfo::isEqual
static bool isEqual(const FunctionType *LHS, const FunctionType *RHS)
Definition: LLVMContextImpl.h:189
llvm::DIMacro
Definition: DebugInfoMetadata.h:3448
E
static GCRegistry::Add< CoreCLRGC > E("coreclr", "CoreCLR-compatible GC")
llvm::FunctionTypeKeyInfo::KeyTy::ReturnType
const Type * ReturnType
Definition: LLVMContextImpl.h:143
llvm::LLVMContextImpl::getOperandBundleTagID
uint32_t getOperandBundleTagID(StringRef Tag) const
Definition: LLVMContextImpl.cpp:219
llvm::MDNodeKeyImpl< DIExpression >::isKeyOf
bool isKeyOf(const DIExpression *RHS) const
Definition: LLVMContextImpl.h:1121
llvm::MDNodeInfo::isEqual
static bool isEqual(const KeyTy &LHS, const NodeTy *RHS)
Definition: LLVMContextImpl.h:1286
llvm::MDNodeKeyImpl< DISubrange >::MDNodeKeyImpl
MDNodeKeyImpl(Metadata *CountNode, Metadata *LowerBound, Metadata *UpperBound, Metadata *Stride)
Definition: LLVMContextImpl.h:321
llvm::MDNodeKeyImpl< DIEnumerator >::MDNodeKeyImpl
MDNodeKeyImpl(APInt Value, bool IsUnsigned, MDString *Name)
Definition: LLVMContextImpl.h:395
llvm::MDNodeInfo::getTombstoneKey
static NodeTy * getTombstoneKey()
Definition: LLVMContextImpl.h:1276
C
(vector float) vec_cmpeq(*A, *B) C
Definition: README_ALTIVEC.txt:86
llvm::MDNodeKeyImpl< DITemplateTypeParameter >::Type
Metadata * Type
Definition: LLVMContextImpl.h:949
llvm::MDNodeKeyImpl< DILocation >::InlinedAt
Metadata * InlinedAt
Definition: LLVMContextImpl.h:271
llvm::LLVMContextImpl
Definition: LLVMContextImpl.h:1355
llvm::MDNodeKeyImpl< DISubprogram >::Name
MDString * Name
Definition: LLVMContextImpl.h:697
llvm::LLVMContextImpl::CAZConstants
DenseMap< Type *, std::unique_ptr< ConstantAggregateZero > > CAZConstants
Definition: LLVMContextImpl.h:1431
llvm::MDNodeKeyImpl< DILabel >::getHashValue
unsigned getHashValue() const
Using name and line to get hash value. It should already be mostly unique.
Definition: LLVMContextImpl.h:1112
llvm::MDNodeSubsetEqualImpl< DISubprogram >::isSubsetEqual
static bool isSubsetEqual(const KeyTy &LHS, const DISubprogram *RHS)
Definition: LLVMContextImpl.h:786
llvm::MDNodeKeyImpl< DIEnumerator >::IsUnsigned
bool IsUnsigned
Definition: LLVMContextImpl.h:393
llvm::OptPassGate
Extensions to this class implement mechanisms to disable passes and individual optimizations at compi...
Definition: OptBisect.h:26
llvm::MDNodeKeyImpl< DIObjCProperty >::MDNodeKeyImpl
MDNodeKeyImpl(const DIObjCProperty *N)
Definition: LLVMContextImpl.h:1161
llvm::MDNodeKeyImpl< GenericDINode >::Header
MDString * Header
Definition: LLVMContextImpl.h:296
llvm::MDNodeKeyImpl< DISubrange >::LowerBound
Metadata * LowerBound
Definition: LLVMContextImpl.h:317
llvm::MDTuple
Tuple of metadata.
Definition: Metadata.h:1329
llvm::MDNodeKeyImpl< DICompositeType >::DataLocation
Metadata * DataLocation
Definition: LLVMContextImpl.h:584
llvm::LLVMContextImpl::ASTypedPointerTypes
DenseMap< std::pair< Type *, unsigned >, TypedPointerType * > ASTypedPointerTypes
Definition: LLVMContextImpl.h:1488
llvm::LLVMContextImpl::PointerTypes
DenseMap< Type *, PointerType * > PointerTypes
Definition: LLVMContextImpl.h:1486
llvm::LLVMContextImpl::getOrInsertBundleTag
StringMapEntry< uint32_t > * getOrInsertBundleTag(StringRef Tag)
Definition: LLVMContextImpl.cpp:208
llvm::AMDGPU::PALMD::Key
Key
PAL metadata keys.
Definition: AMDGPUMetadata.h:486
llvm::APFloatBase::Bogus
static const fltSemantics & Bogus() LLVM_READNONE
A Pseudo fltsemantic used to construct APFloats that cannot conflict with anything real.
Definition: APFloat.cpp:182
llvm::DISubrange
Array subrange.
Definition: DebugInfoMetadata.h:300
DenseSet.h
llvm::MDNodeKeyImpl< DIModule >::getHashValue
unsigned getHashValue() const
Definition: LLVMContextImpl.h:942
remarks
annotation remarks
Definition: AnnotationRemarks.cpp:114
llvm::MDNodeKeyImpl< DIGlobalVariable >::LinkageName
MDString * LinkageName
Definition: LLVMContextImpl.h:994
llvm::MDAttachments::lookup
MDNode * lookup(unsigned ID) const
Returns the first attachment with the given ID or nullptr if no such attachment exists.
Definition: Metadata.cpp:1239
llvm::MDNodeKeyImpl< DIObjCProperty >::Attributes
unsigned Attributes
Definition: LLVMContextImpl.h:1153
llvm::DITemplateTypeParameter
Definition: DebugInfoMetadata.h:2403
llvm::LLVMContextImpl::VectorTypes
DenseMap< std::pair< Type *, ElementCount >, VectorType * > VectorTypes
Definition: LLVMContextImpl.h:1485
llvm::MDNodeKeyImpl< DIGenericSubrange >::MDNodeKeyImpl
MDNodeKeyImpl(Metadata *CountNode, Metadata *LowerBound, Metadata *UpperBound, Metadata *Stride)
Definition: LLVMContextImpl.h:366
llvm::IntegerType
Class to represent integer types.
Definition: DerivedTypes.h:40
llvm::MDNodeKeyImpl< DILabel >::Scope
Metadata * Scope
Definition: LLVMContextImpl.h:1095
llvm::MDNodeKeyImpl< DIGlobalVariableExpression >::MDNodeKeyImpl
MDNodeKeyImpl(const DIGlobalVariableExpression *N)
Definition: LLVMContextImpl.h:1136
llvm::MDNodeKeyImpl< GenericDINode >::isKeyOf
bool isKeyOf(const GenericDINode *RHS) const
Definition: LLVMContextImpl.h:303
llvm::MDNodeKeyImpl< DIFile >::isKeyOf
bool isKeyOf(const DIFile *RHS) const
Definition: LLVMContextImpl.h:682
llvm::MDNodeKeyImpl< DIDerivedType >::Line
unsigned Line
Definition: LLVMContextImpl.h:479
llvm::MDNodeKeyImpl< DIGlobalVariable >::getHashValue
unsigned getHashValue() const
Definition: LLVMContextImpl.h:1038
llvm::MDNodeKeyImpl< DIDerivedType >::Scope
Metadata * Scope
Definition: LLVMContextImpl.h:480
llvm::LLVMContextImpl::OwnedModules
SmallPtrSet< Module *, 4 > OwnedModules
OwnedModules - The set of modules instantiated in this context, and which will be automatically delet...
Definition: LLVMContextImpl.h:1359
llvm::MDNodeKeyImpl< DISubprogram >::Unit
Metadata * Unit
Definition: LLVMContextImpl.h:708
llvm::ConstantUniqueMap< ConstantArray >
llvm::MDNodeKeyImpl< DILocation >::MDNodeKeyImpl
MDNodeKeyImpl(const DILocation *L)
Definition: LLVMContextImpl.h:278
llvm::MDNodeKeyImpl< DICommonBlock >::MDNodeKeyImpl
MDNodeKeyImpl(const DICommonBlock *N)
Definition: LLVMContextImpl.h:895
APFloat.h
llvm::MDNodeKeyImpl< DIObjCProperty >::Type
Metadata * Type
Definition: LLVMContextImpl.h:1154
llvm::MDNodeKeyImpl< DICompositeType >::Associated
Metadata * Associated
Definition: LLVMContextImpl.h:585
llvm::MDNodeSubsetEqualImpl::isSubsetEqual
static bool isSubsetEqual(const NodeTy *LHS, const NodeTy *RHS)
Definition: LLVMContextImpl.h:244
llvm::LLVMContextImpl::Int1Ty
IntegerType Int1Ty
Definition: LLVMContextImpl.h:1468
llvm::MDNodeKeyImpl< DINamespace >::MDNodeKeyImpl
MDNodeKeyImpl(Metadata *Scope, MDString *Name, bool ExportSymbols)
Definition: LLVMContextImpl.h:871
llvm::LLVMContextImpl::LabelTy
Type LabelTy
Definition: LLVMContextImpl.h:1465
SmallPtrSet.h
llvm::MDNodeKeyImpl< DIFile >::MDNodeKeyImpl
MDNodeKeyImpl(const DIFile *N)
Definition: LLVMContextImpl.h:678
llvm::MDNodeKeyImpl< DIBasicType >::MDNodeKeyImpl
MDNodeKeyImpl(const DIBasicType *N)
Definition: LLVMContextImpl.h:425
llvm::MDNodeKeyImpl< DIModule >::LineNo
unsigned LineNo
Definition: LLVMContextImpl.h:917
llvm::MDNodeKeyImpl< DICompositeType >::File
Metadata * File
Definition: LLVMContextImpl.h:570
llvm::MDNodeKeyImpl< DIDerivedType >::isKeyOf
bool isKeyOf(const DIDerivedType *RHS) const
Definition: LLVMContextImpl.h:507
llvm::MDNodeKeyImpl< DIGenericSubrange >::LowerBound
Metadata * LowerBound
Definition: LLVMContextImpl.h:362
llvm::MDNodeKeyImpl< DIStringType >::AlignInBits
uint32_t AlignInBits
Definition: LLVMContextImpl.h:449
llvm::MDNodeKeyImpl< DIMacro >::isKeyOf
bool isKeyOf(const DIMacro *RHS) const
Definition: LLVMContextImpl.h:1221
llvm::Metadata
Root of the metadata hierarchy.
Definition: Metadata.h:62
llvm::MDNodeKeyImpl< DILocalVariable >::Name
MDString * Name
Definition: LLVMContextImpl.h:1054
llvm::MDNodeKeyImpl< DISubprogram >::ThisAdjustment
int ThisAdjustment
Definition: LLVMContextImpl.h:705
llvm::MDNodeKeyImpl< DICommonBlock >::LineNo
unsigned LineNo
Definition: LLVMContextImpl.h:890
llvm::MDNodeKeyImpl< DIExpression >::MDNodeKeyImpl
MDNodeKeyImpl(const DIExpression *N)
Definition: LLVMContextImpl.h:1119
llvm::MDNodeKeyImpl< DISubprogram >::SPFlags
unsigned SPFlags
Definition: LLVMContextImpl.h:707
llvm::MDNodeKeyImpl< DISubprogram >::TemplateParams
Metadata * TemplateParams
Definition: LLVMContextImpl.h:709
llvm::LLVMContextImpl::CDSConstants
StringMap< std::unique_ptr< ConstantDataSequential > > CDSConstants
Definition: LLVMContextImpl.h:1448
llvm::MDNodeKeyImpl< DISubprogram >::File
Metadata * File
Definition: LLVMContextImpl.h:699
llvm::LLVMContextImpl::DoubleTy
Type DoubleTy
Definition: LLVMContextImpl.h:1465
llvm::MDNodeKeyImpl< DICommonBlock >::Decl
Metadata * Decl
Definition: LLVMContextImpl.h:887
llvm::CallingConv::ID
unsigned ID
LLVM IR allows to use arbitrary numbers as calling convention identifiers.
Definition: CallingConv.h:24
Type.h
llvm::MDNodeKeyImpl< MDTuple >::isKeyOf
bool isKeyOf(const MDTuple *RHS) const
Definition: LLVMContextImpl.h:257
llvm::MDNodeKeyImpl< DIMacroFile >::MDNodeKeyImpl
MDNodeKeyImpl(unsigned MIType, unsigned Line, Metadata *File, Metadata *Elements)
Definition: LLVMContextImpl.h:1237
llvm::LLVMContextImpl::RespectDiagnosticFilters
bool RespectDiagnosticFilters
Definition: LLVMContextImpl.h:1367
llvm::StringMap
StringMap - This is an unconventional map that is specialized for handling keys that are "strings",...
Definition: StringMap.h:110
llvm::MDNodeKeyImpl< DISubrange >::MDNodeKeyImpl
MDNodeKeyImpl(const DISubrange *N)
Definition: LLVMContextImpl.h:325
llvm::MDNodeKeyImpl< DIImportedEntity >::Name
MDString * Name
Definition: LLVMContextImpl.h:1185
llvm::MDNodeKeyImpl< DIEnumerator >::getHashValue
unsigned getHashValue() const
Definition: LLVMContextImpl.h:410
StringSaver.h
llvm::DICommonBlock
Definition: DebugInfoMetadata.h:2999
llvm::MDNodeKeyImpl< DISubprogram >::Flags
unsigned Flags
Definition: LLVMContextImpl.h:706
llvm::LLVMContextImpl::BundleTagCache
StringMap< uint32_t > BundleTagCache
A set of interned tags for operand bundles.
Definition: LLVMContextImpl.h:1520
llvm::VectorType
Base class of all SIMD vector types.
Definition: DerivedTypes.h:389
llvm::LLVMContextImpl::ValueMetadata
DenseMap< const Value *, MDAttachments > ValueMetadata
Collection of metadata used in this context.
Definition: LLVMContextImpl.h:1500
llvm::DenseSet< FunctionType *, FunctionTypeKeyInfo >
llvm::MDNodeKeyImpl< DITemplateTypeParameter >::Name
MDString * Name
Definition: LLVMContextImpl.h:948
llvm::APFloat
Definition: APFloat.h:701
llvm::MDNodeInfo::getHashValue
static unsigned getHashValue(const NodeTy *N)
Definition: LLVMContextImpl.h:1282
llvm::MDNodeKeyImpl< DILocation >::getHashValue
unsigned getHashValue() const
Definition: LLVMContextImpl.h:288
llvm::AnonStructTypeKeyInfo::getEmptyKey
static StructType * getEmptyKey()
Definition: LLVMContextImpl.h:113
llvm::MDNodeKeyImpl< DIStringType >::getHashValue
unsigned getHashValue() const
Definition: LLVMContextImpl.h:472
llvm::MDNodeKeyImpl< DIMacro >::Line
unsigned Line
Definition: LLVMContextImpl.h:1211
llvm::LLVMContext::YieldCallbackTy
void(*)(LLVMContext *Context, void *OpaqueHandle) YieldCallbackTy
Defines the type of a yield callback.
Definition: LLVMContext.h:159
llvm::MDNodeKeyImpl< DIGlobalVariable >::TemplateParams
Metadata * TemplateParams
Definition: LLVMContextImpl.h:1001
llvm::LLVMContextImpl::Int32Ty
IntegerType Int32Ty
Definition: LLVMContextImpl.h:1468
llvm::MDNodeKeyImpl< GenericDINode >::Tag
unsigned Tag
Definition: LLVMContextImpl.h:295
llvm::MDNodeKeyImpl< DIDerivedType >::ExtraData
Metadata * ExtraData
Definition: LLVMContextImpl.h:487
llvm::LLVMContextImpl::HalfTy
Type HalfTy
Definition: LLVMContextImpl.h:1465
llvm::MDNodeKeyImpl< DITemplateValueParameter >::Value
Metadata * Value
Definition: LLVMContextImpl.h:971
llvm::MDNodeKeyImpl< DITemplateValueParameter >::Type
Metadata * Type
Definition: LLVMContextImpl.h:969
llvm::LLVMContextImpl::setOpaquePointers
void setOpaquePointers(bool OP)
Definition: LLVMContextImpl.cpp:261
llvm::LLVMContextImpl::CPNConstants
DenseMap< PointerType *, std::unique_ptr< ConstantPointerNull > > CPNConstants
Definition: LLVMContextImpl.h:1442
llvm::DIEnumerator
Enumeration value.
Definition: DebugInfoMetadata.h:411
uint64_t
llvm::MDNodeKeyImpl< DIDerivedType >::AlignInBits
uint32_t AlignInBits
Definition: LLVMContextImpl.h:484
llvm::FunctionTypeKeyInfo::KeyTy
Definition: LLVMContextImpl.h:142
llvm::ARM_MB::ST
@ ST
Definition: ARMBaseInfo.h:73
llvm::LLVMContextImpl::TheFalseVal
ConstantInt * TheFalseVal
Definition: LLVMContextImpl.h:1462
llvm::MDNodeKeyImpl< DILocation >::MDNodeKeyImpl
MDNodeKeyImpl(unsigned Line, unsigned Column, Metadata *Scope, Metadata *InlinedAt, bool ImplicitCode)
Definition: LLVMContextImpl.h:274
llvm::MDNodeKeyImpl< DIObjCProperty >::GetterName
MDString * GetterName
Definition: LLVMContextImpl.h:1151
llvm::MDNodeKeyImpl< DILexicalBlockFile >::MDNodeKeyImpl
MDNodeKeyImpl(Metadata *Scope, Metadata *File, unsigned Discriminator)
Definition: LLVMContextImpl.h:850
llvm::LLVMContextImpl::Int128Ty
IntegerType Int128Ty
Definition: LLVMContextImpl.h:1468
llvm::BumpPtrAllocatorImpl
Allocate memory in an ever growing pool, as if by bump-pointer.
Definition: Allocator.h:63
llvm::MDNodeKeyImpl< DICompositeType >::Rank
Metadata * Rank
Definition: LLVMContextImpl.h:587
llvm::DIGlobalVariable
Global variables.
Definition: DebugInfoMetadata.h:2914
llvm::LLVMContext
This is an important class for using LLVM in a threaded context.
Definition: LLVMContext.h:67
llvm::FunctionTypeKeyInfo::isEqual
static bool isEqual(const KeyTy &LHS, const FunctionType *RHS)
Definition: LLVMContextImpl.h:183
llvm::MDNodeKeyImpl< DIBasicType >::MDNodeKeyImpl
MDNodeKeyImpl(unsigned Tag, MDString *Name, uint64_t SizeInBits, uint32_t AlignInBits, unsigned Encoding, unsigned Flags)
Definition: LLVMContextImpl.h:421
llvm::FunctionTypeKeyInfo::KeyTy::isVarArg
bool isVarArg
Definition: LLVMContextImpl.h:145
llvm::MDNodeKeyImpl< DISubroutineType >::CC
uint8_t CC
Definition: LLVMContextImpl.h:651
llvm::DenseMap
Definition: DenseMap.h:714
llvm::SyncScope::ID
uint8_t ID
Definition: LLVMContext.h:46
llvm::LLVMContextImpl::NamedStructTypesUniqueID
unsigned NamedStructTypesUniqueID
Definition: LLVMContextImpl.h:1482
llvm::MDNodeKeyImpl< DICommonBlock >::Scope
Metadata * Scope
Definition: LLVMContextImpl.h:886
llvm::MDAttachments
Multimap-like storage for metadata attachments.
Definition: LLVMContextImpl.h:1305
llvm::MDNodeKeyImpl< DILocalVariable >::Annotations
Metadata * Annotations
Definition: LLVMContextImpl.h:1061
llvm::MDNodeKeyImpl< DIFile >::Source
Optional< MDString * > Source
Definition: LLVMContextImpl.h:671
llvm::LLVMContextImpl::GlobalObjectSections
DenseMap< const GlobalObject *, StringRef > GlobalObjectSections
Collection of per-GlobalObject sections used in this context.
Definition: LLVMContextImpl.h:1503
llvm::MDNodeKeyImpl< DICompositeType >::Line
unsigned Line
Definition: LLVMContextImpl.h:571
llvm::LLVMContextImpl::getOperandBundleTags
void getOperandBundleTags(SmallVectorImpl< StringRef > &Tags) const
Definition: LLVMContextImpl.cpp:213
Attributes
AMDGPU Kernel Attributes
Definition: AMDGPULowerKernelAttributes.cpp:244
llvm::MDNodeKeyImpl< DITemplateValueParameter >::MDNodeKeyImpl
MDNodeKeyImpl(unsigned Tag, MDString *Name, Metadata *Type, bool IsDefault, Metadata *Value)
Definition: LLVMContextImpl.h:973
llvm::DIImportedEntity
An imported module (C++ using directive or similar).
Definition: DebugInfoMetadata.h:3293
llvm::MDNodeKeyImpl< DIModule >::File
Metadata * File
Definition: LLVMContextImpl.h:911
llvm::MDAttachments::empty
bool empty() const
Definition: LLVMContextImpl.h:1316
llvm::PointerType
Class to represent pointers.
Definition: DerivedTypes.h:632
llvm::MDNodeKeyImpl< DICompositeType >::VTableHolder
Metadata * VTableHolder
Definition: LLVMContextImpl.h:580
ArrayRef.h
llvm::LLVMContextImpl::BFloatTy
Type BFloatTy
Definition: LLVMContextImpl.h:1465
llvm::MDNodeKeyImpl< DIModule >::MDNodeKeyImpl
MDNodeKeyImpl(const DIModule *N)
Definition: LLVMContextImpl.h:926
llvm::MDNodeKeyImpl< DIMacro >::Name
MDString * Name
Definition: LLVMContextImpl.h:1212
llvm::LLVMContextImpl::OPG
OptPassGate * OPG
Definition: LLVMContextImpl.h:1557
llvm::MDNodeKeyImpl< DILexicalBlock >::getHashValue
unsigned getHashValue() const
Definition: LLVMContextImpl.h:840
llvm::AnonStructTypeKeyInfo::getTombstoneKey
static StructType * getTombstoneKey()
Definition: LLVMContextImpl.h:117
llvm::MDNodeKeyImpl< DIFile >::Checksum
Optional< DIFile::ChecksumInfo< MDString * > > Checksum
Definition: LLVMContextImpl.h:670
llvm::MDNodeKeyImpl< DITemplateValueParameter >::Tag
unsigned Tag
Definition: LLVMContextImpl.h:967
llvm::DIMacroFile
Definition: DebugInfoMetadata.h:3499
llvm::MDNodeOpsKey
Structure for hashing arbitrary MDNode operands.
Definition: LLVMContextImpl.h:195
llvm::MDNodeKeyImpl< DILexicalBlockFile >::getHashValue
unsigned getHashValue() const
Definition: LLVMContextImpl.h:861
llvm::LLVMContextImpl::hasOpaquePointersValue
bool hasOpaquePointersValue()
Definition: LLVMContextImpl.cpp:251
llvm::AnonStructTypeKeyInfo::isEqual
static bool isEqual(const KeyTy &LHS, const StructType *RHS)
Definition: LLVMContextImpl.h:130
assert
assert(ImpDefSCC.getReg()==AMDGPU::SCC &&ImpDefSCC.isDef())
llvm::LLVMContextImpl::DiagHandler
std::unique_ptr< DiagnosticHandler > DiagHandler
Definition: LLVMContextImpl.h:1366
llvm::MDNodeKeyImpl< DICompositeType >::Annotations
Metadata * Annotations
Definition: LLVMContextImpl.h:588
llvm::MDNodeKeyImpl< DICompositeType >::MDNodeKeyImpl
MDNodeKeyImpl(const DICompositeType *N)
Definition: LLVMContextImpl.h:606
llvm::MDNodeKeyImpl< DILabel >::Line
unsigned Line
Definition: LLVMContextImpl.h:1098
llvm::LLVMContextImpl::TheTrueVal
ConstantInt * TheTrueVal
Definition: LLVMContextImpl.h:1461
llvm::MDNodeKeyImpl< DIBasicType >::Encoding
unsigned Encoding
Definition: LLVMContextImpl.h:418
ConstantsContext.h
llvm::LLVMContextImpl::AttrsLists
FoldingSet< AttributeListImpl > AttrsLists
Definition: LLVMContextImpl.h:1411
llvm::ISD::BasicBlock
@ BasicBlock
Various leaf nodes.
Definition: ISDOpcodes.h:71
llvm::MDNodeKeyImpl< DISubroutineType >::getHashValue
unsigned getHashValue() const
Definition: LLVMContextImpl.h:664
llvm::MDNode
Metadata node.
Definition: Metadata.h:944
OP
#define OP(n)
Definition: regex2.h:73
llvm::LLVMContextImpl::YieldCallback
LLVMContext::YieldCallbackTy YieldCallback
Definition: LLVMContextImpl.h:1397
llvm::MDNodeKeyImpl< DISubprogram >
Definition: LLVMContextImpl.h:695
llvm::FunctionTypeKeyInfo::KeyTy::KeyTy
KeyTy(const FunctionType *FT)
Definition: LLVMContextImpl.h:149
llvm::MDNodeKeyImpl< DIDerivedType >::OffsetInBits
uint64_t OffsetInBits
Definition: LLVMContextImpl.h:483
llvm::DIBasicType
Basic type, like 'int' or 'float'.
Definition: DebugInfoMetadata.h:764
llvm::MDNodeSubsetEqualImpl< DIDerivedType >::isODRMember
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.
Definition: LLVMContextImpl.h:551
llvm::APInt
Class for arbitrary precision integers.
Definition: APInt.h:75
llvm::MDNodeKeyImpl< DIObjCProperty >::SetterName
MDString * SetterName
Definition: LLVMContextImpl.h:1152
llvm::MDNodeKeyImpl< DISubprogram >::RetainedNodes
Metadata * RetainedNodes
Definition: LLVMContextImpl.h:711
llvm::MDNodeKeyImpl< DIModule >::IncludePath
MDString * IncludePath
Definition: LLVMContextImpl.h:915
llvm::LLVMContextImpl::IntConstants
IntMapTy IntConstants
Definition: LLVMContextImpl.h:1404
llvm::DISubroutineType
Type array for a subprogram.
Definition: DebugInfoMetadata.h:1265
llvm::MDNodeKeyImpl< DISubprogram >::ThrownTypes
Metadata * ThrownTypes
Definition: LLVMContextImpl.h:712
llvm::MDAttachments::insert
void insert(unsigned ID, MDNode &MD)
Adds an attachment to a particular node.
Definition: Metadata.cpp:1269
llvm::MDNodeKeyImpl< DIMacro >::MIType
unsigned MIType
Definition: LLVMContextImpl.h:1210
llvm::Expression
Class representing an expression and its matching format.
Definition: FileCheckImpl.h:237
llvm::DICompositeType
Composite types.
Definition: DebugInfoMetadata.h:1042
llvm::BlockAddress
The address of a basic block.
Definition: Constants.h:849
llvm::MDNodeKeyImpl< DISubprogram >::Line
unsigned Line
Definition: LLVMContextImpl.h:700
llvm::LLVMContextImpl::GCNames
DenseMap< const Function *, std::string > GCNames
Maintain the GC name for each function.
Definition: LLVMContextImpl.h:1545
llvm::FoldingSet
FoldingSet - This template class is used to instantiate a specialized implementation of the folding s...
Definition: FoldingSet.h:520
llvm::Sched::Source
@ Source
Definition: TargetLowering.h:98
llvm::MDAttachments::remove_if
void remove_if(PredTy shouldRemove)
Erase matching attachments.
Definition: LLVMContextImpl.h:1350
llvm::MDNodeKeyImpl< DIImportedEntity >::MDNodeKeyImpl
MDNodeKeyImpl(const DIImportedEntity *N)
Definition: LLVMContextImpl.h:1192
llvm::MDNodeKeyImpl< DIStringType >::Name
MDString * Name
Definition: LLVMContextImpl.h:444
llvm::ArrayRef
ArrayRef - Represent a constant reference to an array (0 or more elements consecutively in memory),...
Definition: APInt.h:32
llvm::LLVMContextImpl::getOptPassGate
OptPassGate & getOptPassGate() const
Access the object which can disable optional passes and individual optimizations at compile time.
Definition: LLVMContextImpl.cpp:241
llvm::LLVMContextImpl::MDStringCache
StringMap< MDString, BumpPtrAllocator > MDStringCache
Definition: LLVMContextImpl.h:1414
elements
This compiles xmm1 mulss xmm1 xorps xmm0 movss xmm0 ret Because mulss doesn t modify the top elements
Definition: README-SSE.txt:221
llvm::MDNodeKeyImpl< DICompositeType >::isKeyOf
bool isKeyOf(const DICompositeType *RHS) const
Definition: LLVMContextImpl.h:620
llvm::MDNodeKeyImpl< DIGenericSubrange >::UpperBound
Metadata * UpperBound
Definition: LLVMContextImpl.h:363
llvm::StructType
Class to represent struct types.
Definition: DerivedTypes.h:213
llvm::StringRef
StringRef - Represent a constant reference to a string, i.e.
Definition: StringRef.h:50
Dwarf.h
llvm::LLVMContextImpl::getOpaquePointers
bool getOpaquePointers()
Definition: LLVMContextImpl.cpp:255
llvm::MDNodeKeyImpl< DISubroutineType >::MDNodeKeyImpl
MDNodeKeyImpl(const DISubroutineType *N)
Definition: LLVMContextImpl.h:656
llvm::MDNodeKeyImpl< DIMacroFile >::isKeyOf
bool isKeyOf(const DIMacroFile *RHS) const
Definition: LLVMContextImpl.h:1244
llvm::MDNodeKeyImpl< DIExpression >::MDNodeKeyImpl
MDNodeKeyImpl(ArrayRef< uint64_t > Elements)
Definition: LLVMContextImpl.h:1118
llvm::MDNodeKeyImpl< DISubprogram >::Type
Metadata * Type
Definition: LLVMContextImpl.h:701
llvm::FunctionTypeKeyInfo::KeyTy::operator==
bool operator==(const KeyTy &that) const
Definition: LLVMContextImpl.h:153
llvm::MDNodeKeyImpl< DISubprogram >::VirtualIndex
unsigned VirtualIndex
Definition: LLVMContextImpl.h:704
uint32_t
llvm::MDNodeKeyImpl< DISubprogram >::ScopeLine
unsigned ScopeLine
Definition: LLVMContextImpl.h:702
llvm::LLVMContextImpl::StructConstants
StructConstantsTy StructConstants
Definition: LLVMContextImpl.h:1437
llvm::MDNodeKeyImpl< DISubroutineType >::Flags
unsigned Flags
Definition: LLVMContextImpl.h:650
llvm::LLVMContextImpl::getOrInsertSyncScopeID
SyncScope::ID getOrInsertSyncScopeID(StringRef SSN)
getOrInsertSyncScopeID - Maps synchronization scope name to synchronization scope ID.
Definition: LLVMContextImpl.cpp:225
llvm::MDNodeKeyImpl< DILabel >::isKeyOf
bool isKeyOf(const DILabel *RHS) const
Definition: LLVMContextImpl.h:1106
llvm::MDNodeOpsKey::MDNodeOpsKey
MDNodeOpsKey(ArrayRef< Metadata * > Ops)
Definition: LLVMContextImpl.h:201
llvm::LLVMContextImpl::PVConstants
DenseMap< Type *, std::unique_ptr< PoisonValue > > PVConstants
Definition: LLVMContextImpl.h:1446
llvm::MDNodeKeyImpl< DICompositeType >::AlignInBits
uint32_t AlignInBits
Definition: LLVMContextImpl.h:576
llvm::GenericDINode
Generic tagged DWARF-like metadata node.
Definition: DebugInfoMetadata.h:227
llvm::MDNodeKeyImpl< DIDerivedType >::SizeInBits
uint64_t SizeInBits
Definition: LLVMContextImpl.h:482
CC
auto CC
Definition: RISCVRedundantCopyElimination.cpp:79
llvm::MDNodeKeyImpl< DIDerivedType >::MDNodeKeyImpl
MDNodeKeyImpl(const DIDerivedType *N)
Definition: LLVMContextImpl.h:499
llvm::ConstantInt::getSExtValue
int64_t getSExtValue() const
Return the constant as a 64-bit integer value after it has been sign extended as appropriate for the ...
Definition: Constants.h:148
llvm::MDNodeKeyImpl< DIGlobalVariable >::Scope
Metadata * Scope
Definition: LLVMContextImpl.h:992
llvm::MDNodeKeyImpl< DIFile >::getHashValue
unsigned getHashValue() const
Definition: LLVMContextImpl.h:688
llvm::FunctionTypeKeyInfo::KeyTy::operator!=
bool operator!=(const KeyTy &that) const
Definition: LLVMContextImpl.h:162
llvm::MDNodeKeyImpl< DILexicalBlockFile >::MDNodeKeyImpl
MDNodeKeyImpl(const DILexicalBlockFile *N)
Definition: LLVMContextImpl.h:852
llvm::MDNodeKeyImpl< DILocalVariable >::Arg
unsigned Arg
Definition: LLVMContextImpl.h:1058
llvm::MDNodeKeyImpl< DIStringType >::Tag
unsigned Tag
Definition: LLVMContextImpl.h:443
llvm::AnonStructTypeKeyInfo::KeyTy::isPacked
bool isPacked
Definition: LLVMContextImpl.h:96
llvm::MDNodeKeyImpl< DILocation >::Scope
Metadata * Scope
Definition: LLVMContextImpl.h:270
llvm::MDNodeOpsKey::MDNodeOpsKey
MDNodeOpsKey(const NodeTy *N, unsigned Offset=0)
Definition: LLVMContextImpl.h:205
FoldingSet.h
llvm::MDNodeKeyImpl< DITemplateValueParameter >::getHashValue
unsigned getHashValue() const
Definition: LLVMContextImpl.h:986
llvm::MDNodeKeyImpl< DIGenericSubrange >::getHashValue
unsigned getHashValue() const
Definition: LLVMContextImpl.h:381
llvm::MDNodeKeyImpl< DIStringType >::StringLength
Metadata * StringLength
Definition: LLVMContextImpl.h:445
llvm::MDNodeKeyImpl< DILabel >::Name
MDString * Name
Definition: LLVMContextImpl.h:1096
llvm::MDNodeKeyImpl< DIDerivedType >::Annotations
Metadata * Annotations
Definition: LLVMContextImpl.h:488
llvm::ConstantAsMetadata
Definition: Metadata.h:413
llvm::MDNodeKeyImpl< DIMacroFile >::MDNodeKeyImpl
MDNodeKeyImpl(const DIMacroFile *N)
Definition: LLVMContextImpl.h:1240
llvm::MDNodeKeyImpl< DILocalVariable >::Line
unsigned Line
Definition: LLVMContextImpl.h:1056
llvm::MDNodeKeyImpl< DIBasicType >::Name
MDString * Name
Definition: LLVMContextImpl.h:415
llvm::MDNodeKeyImpl< DICompositeType >::Tag
unsigned Tag
Definition: LLVMContextImpl.h:568
llvm::MDNodeKeyImpl< DIStringType >::Encoding
unsigned Encoding
Definition: LLVMContextImpl.h:450
llvm::LLVMContextImpl::CustomMDKindNames
StringMap< unsigned > CustomMDKindNames
CustomMDKindNames - Map to hold the metadata string to ID mapping.
Definition: LLVMContextImpl.h:1497
llvm::MDNodeKeyImpl< DIObjCProperty >::isKeyOf
bool isKeyOf(const DIObjCProperty *RHS) const
Definition: LLVMContextImpl.h:1166
llvm::MDNodeKeyImpl< DITemplateValueParameter >::MDNodeKeyImpl
MDNodeKeyImpl(const DITemplateValueParameter *N)
Definition: LLVMContextImpl.h:976
llvm::LLVMContextImpl::MisExpectWarningRequested
bool MisExpectWarningRequested
Definition: LLVMContextImpl.h:1392
llvm::GraphProgram::Name
Name
Definition: GraphWriter.h:50
llvm::MDNodeKeyImpl< DICommonBlock >::isKeyOf
bool isKeyOf(const DICommonBlock *RHS) const
Definition: LLVMContextImpl.h:899
llvm::MDNodeKeyImpl< DITemplateValueParameter >::Name
MDString * Name
Definition: LLVMContextImpl.h:968
getFlags
static uint32_t getFlags(const Symbol *Sym)
Definition: TapiFile.cpp:27
llvm::MDNodeKeyImpl< DICompositeType >::SizeInBits
uint64_t SizeInBits
Definition: LLVMContextImpl.h:574
llvm::ArrayRef::begin
iterator begin() const
Definition: ArrayRef.h:152
llvm::AnonStructTypeKeyInfo::KeyTy::KeyTy
KeyTy(const StructType *ST)
Definition: LLVMContextImpl.h:100
llvm::MDNodeKeyImpl< DILocalVariable >::Flags
unsigned Flags
Definition: LLVMContextImpl.h:1059
llvm::MDNodeKeyImpl< DILocalVariable >::MDNodeKeyImpl
MDNodeKeyImpl(const DILocalVariable *N)
Definition: LLVMContextImpl.h:1068
llvm::MDNodeKeyImpl< DIGlobalVariable >::Line
unsigned Line
Definition: LLVMContextImpl.h:996
llvm::AnonStructTypeKeyInfo::KeyTy::operator==
bool operator==(const KeyTy &that) const
Definition: LLVMContextImpl.h:103
Casting.h
llvm::AnonStructTypeKeyInfo::KeyTy
Definition: LLVMContextImpl.h:94
llvm::MDNodeKeyImpl< DIArgList >::isKeyOf
bool isKeyOf(const DIArgList *RHS) const
Definition: LLVMContextImpl.h:1260
TrackingMDRef.h
llvm::FunctionTypeKeyInfo
Definition: LLVMContextImpl.h:141
llvm::DenseMapAPFloatKeyInfo::getEmptyKey
static APFloat getEmptyKey()
Definition: LLVMContextImpl.h:79
llvm::LLVMContextImpl::VoidTy
Type VoidTy
Definition: LLVMContextImpl.h:1465
llvm::MDNodeKeyImpl< DIGlobalVariableExpression >::getHashValue
unsigned getHashValue() const
Definition: LLVMContextImpl.h:1144
llvm::MDNodeKeyImpl< DIBasicType >::AlignInBits
uint32_t AlignInBits
Definition: LLVMContextImpl.h:417
llvm::DenseMapAPFloatKeyInfo::getTombstoneKey
static APFloat getTombstoneKey()
Definition: LLVMContextImpl.h:80
llvm::AnonStructTypeKeyInfo::KeyTy::operator!=
bool operator!=(const KeyTy &that) const
Definition: LLVMContextImpl.h:110
llvm::LLVMContextImpl::DiagnosticsHotnessThreshold
Optional< uint64_t > DiagnosticsHotnessThreshold
The minimum hotness value a diagnostic needs in order to be included in optimization diagnostics.
Definition: LLVMContextImpl.h:1387
llvm::LLVMContextImpl::AttrsSetNodes
FoldingSet< AttributeSetNode > AttrsSetNodes
Definition: LLVMContextImpl.h:1412
llvm::MDNodeKeyImpl< DIBasicType >::getHashValue
unsigned getHashValue() const
Definition: LLVMContextImpl.h:437
llvm::MDNodeKeyImpl< DIStringType >::SizeInBits
uint64_t SizeInBits
Definition: LLVMContextImpl.h:448
llvm::MDNodeKeyImpl< GenericDINode >::calculateHash
static unsigned calculateHash(GenericDINode *N)
Definition: LLVMContextImpl.h:310
llvm::LLVMContextImpl::ASPointerTypes
DenseMap< std::pair< Type *, unsigned >, PointerType * > ASPointerTypes
Definition: LLVMContextImpl.h:1487
llvm::MDNodeKeyImpl< DICommonBlock >::Name
MDString * Name
Definition: LLVMContextImpl.h:888
llvm::FunctionTypeKeyInfo::getHashValue
static unsigned getHashValue(const KeyTy &Key)
Definition: LLVMContextImpl.h:173
llvm::LLVMContextImpl::Int8Ty
IntegerType Int8Ty
Definition: LLVMContextImpl.h:1468
llvm::MDNodeKeyImpl< DIModule >::MDNodeKeyImpl
MDNodeKeyImpl(Metadata *File, Metadata *Scope, MDString *Name, MDString *ConfigurationMacros, MDString *IncludePath, MDString *APINotesFile, unsigned LineNo, bool IsDecl)
Definition: LLVMContextImpl.h:920
llvm::MDNodeKeyImpl< DILexicalBlock >::Scope
Metadata * Scope
Definition: LLVMContextImpl.h:824
llvm::MDNodeKeyImpl< DISubprogram >::Scope
Metadata * Scope
Definition: LLVMContextImpl.h:696
llvm::MDNodeKeyImpl< DILocation >::isKeyOf
bool isKeyOf(const DILocation *RHS) const
Definition: LLVMContextImpl.h:282
llvm::DIDerivedType
Derived types.
Definition: DebugInfoMetadata.h:924
llvm::MDNodeKeyImpl< DILocalVariable >::AlignInBits
uint32_t AlignInBits
Definition: LLVMContextImpl.h:1060
llvm::DIGlobalVariableExpression
A pair of DIGlobalVariable and DIExpression.
Definition: DebugInfoMetadata.h:3358
llvm::MDNodeKeyImpl< DIBasicType >::Flags
unsigned Flags
Definition: LLVMContextImpl.h:419
llvm::AnonStructTypeKeyInfo::getHashValue
static unsigned getHashValue(const StructType *ST)
Definition: LLVMContextImpl.h:126
llvm::MDNodeKeyImpl< DIDerivedType >::Name
MDString * Name
Definition: LLVMContextImpl.h:477
llvm::LLVMContextImpl::MetadataAsValues
DenseMap< Metadata *, MetadataAsValue * > MetadataAsValues
Definition: LLVMContextImpl.h:1416
llvm::MDNodeKeyImpl< DICompositeType >::Name
MDString * Name
Definition: LLVMContextImpl.h:569
llvm::MDNodeSubsetEqualImpl::isSubsetEqual
static bool isSubsetEqual(const KeyTy &LHS, const NodeTy *RHS)
Definition: LLVMContextImpl.h:240
Any.h
llvm::MDNodeKeyImpl< DIBasicType >::Tag
unsigned Tag
Definition: LLVMContextImpl.h:414
llvm::MDNodeKeyImpl< DIStringType >::StringLocationExp
Metadata * StringLocationExp
Definition: LLVMContextImpl.h:447
llvm::AnonStructTypeKeyInfo::KeyTy::ETypes
ArrayRef< Type * > ETypes
Definition: LLVMContextImpl.h:95
llvm::MDNodeKeyImpl< DILocation >::ImplicitCode
bool ImplicitCode
Definition: LLVMContextImpl.h:272
llvm::MDNodeKeyImpl< DIDerivedType >::DWARFAddressSpace
Optional< unsigned > DWARFAddressSpace
Definition: LLVMContextImpl.h:485
llvm::DITemplateValueParameter
Definition: DebugInfoMetadata.h:2442
llvm::FunctionTypeKeyInfo::KeyTy::KeyTy
KeyTy(const Type *R, const ArrayRef< Type * > &P, bool V)
Definition: LLVMContextImpl.h:147
llvm::MDAttachments::getAll
void getAll(SmallVectorImpl< std::pair< unsigned, MDNode * >> &Result) const
Appends all attachments for the global to Result, sorting by attachment ID.
Definition: Metadata.cpp:1252
llvm::TypedTrackingMDRef< MDNode >
SmallVector.h
llvm::LLVMContextImpl::Saver
UniqueStringSaver Saver
Definition: LLVMContextImpl.h:1473
llvm::LLVMContextImpl::PPC_FP128Ty
Type PPC_FP128Ty
Definition: LLVMContextImpl.h:1467
llvm::MDNodeSubsetEqualImpl< DISubprogram >::isSubsetEqual
static bool isSubsetEqual(const DISubprogram *LHS, const DISubprogram *RHS)
Definition: LLVMContextImpl.h:791
llvm::hash_combine
hash_code hash_combine(const Ts &...args)
Combine values into a single hash_code.
Definition: Hashing.h:605
llvm::MDNodeKeyImpl< DIStringType >::isKeyOf
bool isKeyOf(const DIStringType *RHS) const
Definition: LLVMContextImpl.h:466
llvm::MDNodeKeyImpl< GenericDINode >::MDNodeKeyImpl
MDNodeKeyImpl(const GenericDINode *N)
Definition: LLVMContextImpl.h:300
llvm::MDNodeKeyImpl< DISubrange >::isKeyOf
bool isKeyOf(const DISubrange *RHS) const
Definition: LLVMContextImpl.h:329
llvm::MDNodeKeyImpl< DITemplateTypeParameter >::isKeyOf
bool isKeyOf(const DITemplateTypeParameter *RHS) const
Definition: LLVMContextImpl.h:958
llvm::MDNodeKeyImpl< DIMacroFile >::MIType
unsigned MIType
Definition: LLVMContextImpl.h:1232
llvm::MDNodeOpsKey::getHash
unsigned getHash() const
Definition: LLVMContextImpl.h:231
llvm::MDNodeSubsetEqualImpl< DIDerivedType >::isSubsetEqual
static bool isSubsetEqual(const KeyTy &LHS, const DIDerivedType *RHS)
Definition: LLVMContextImpl.h:539
N
#define N
llvm::MDNodeKeyImpl< DILocalVariable >::Scope
Metadata * Scope
Definition: LLVMContextImpl.h:1053
llvm::MDNodeKeyImpl< DIGlobalVariable >::MDNodeKeyImpl
MDNodeKeyImpl(const DIGlobalVariable *N)
Definition: LLVMContextImpl.h:1016
llvm::hash_combine_range
hash_code hash_combine_range(InputIteratorT first, InputIteratorT last)
Compute a hash_code for a sequence of values.
Definition: Hashing.h:483
llvm::MDNodeKeyImpl< DISubrange >::Stride
Metadata * Stride
Definition: LLVMContextImpl.h:319
llvm::MDNodeSubsetEqualImpl< DISubprogram >::isDeclarationOfODRMember
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.
Definition: LLVMContextImpl.h:799
llvm::ArrayRef::size
size_t size() const
size - Get the array size.
Definition: ArrayRef.h:164
llvm::MDNodeKeyImpl< DIArgList >::getHashValue
unsigned getHashValue() const
Definition: LLVMContextImpl.h:1262
llvm::MDNodeKeyImpl< DINamespace >::ExportSymbols
bool ExportSymbols
Definition: LLVMContextImpl.h:869
llvm::MDNodeKeyImpl< DISubroutineType >::TypeArray
Metadata * TypeArray
Definition: LLVMContextImpl.h:652
llvm::MDNodeKeyImpl
Definition: LLVMContextImpl.h:234
llvm::MDNodeKeyImpl< DICompositeType >::BaseType
Metadata * BaseType
Definition: LLVMContextImpl.h:573
llvm::LLVMContextImpl::DITypeMap
Optional< DenseMap< const MDString *, DICompositeType * > > DITypeMap
Definition: LLVMContextImpl.h:1423
llvm::MDNodeKeyImpl< DIImportedEntity >::Line
unsigned Line
Definition: LLVMContextImpl.h:1184
llvm::LLVMContextImpl::SSC
StringMap< SyncScope::ID > SSC
A set of interned synchronization scopes.
Definition: LLVMContextImpl.h:1528
llvm::MDNodeKeyImpl< DIGenericSubrange >::CountNode
Metadata * CountNode
Definition: LLVMContextImpl.h:361
llvm::MDNodeKeyImpl< DINamespace >::getHashValue
unsigned getHashValue() const
Definition: LLVMContextImpl.h:882
llvm::MDNodeKeyImpl< DILocalVariable >::isKeyOf
bool isKeyOf(const DILocalVariable *RHS) const
Definition: LLVMContextImpl.h:1074
llvm::DISubprogram
Subprogram description.
Definition: DebugInfoMetadata.h:1803
llvm::LLVMContextImpl::VectorConstants
VectorConstantsTy VectorConstants
Definition: LLVMContextImpl.h:1440
llvm::SmallVectorImpl
This class consists of common code factored out of the SmallVector class to reduce code duplication b...
Definition: APFloat.h:42
llvm::MDNodeOpsKey::compareOps
bool compareOps(const NodeTy *RHS, unsigned Offset=0) const
Definition: LLVMContextImpl.h:209
DenseMapInfo.h
llvm::DIModule
Represents a module in the programming language, for example, a Clang module, or a Fortran module.
Definition: DebugInfoMetadata.h:2307
llvm::MDNodeKeyImpl< DICompositeType >::Flags
unsigned Flags
Definition: LLVMContextImpl.h:577
llvm::MDNodeKeyImpl< DILexicalBlockFile >::File
Metadata * File
Definition: LLVMContextImpl.h:847
DerivedTypes.h
llvm::MDNodeKeyImpl< DIExpression >::Elements
ArrayRef< uint64_t > Elements
Definition: LLVMContextImpl.h:1116
llvm::MDNodeKeyImpl< DIDerivedType >::BaseType
Metadata * BaseType
Definition: LLVMContextImpl.h:481
llvm::MDNodeKeyImpl< DIGlobalVariable >::Type
Metadata * Type
Definition: LLVMContextImpl.h:997
llvm::MDNodeOpsKey::calculateHash
static unsigned calculateHash(MDNode *N, unsigned Offset=0)
Definition: LLVMContextImpl.cpp:191
llvm::MDNodeKeyImpl< DIMacro >::getHashValue
unsigned getHashValue() const
Definition: LLVMContextImpl.h:1226
llvm::MDNodeKeyImpl< DIEnumerator >::MDNodeKeyImpl
MDNodeKeyImpl(int64_t Value, bool IsUnsigned, MDString *Name)
Definition: LLVMContextImpl.h:397
llvm::MDNodeKeyImpl< DIModule >::Name
MDString * Name
Definition: LLVMContextImpl.h:913
llvm::MDNodeKeyImpl< DIArgList >::MDNodeKeyImpl
MDNodeKeyImpl(ArrayRef< ValueAsMetadata * > Args)
Definition: LLVMContextImpl.h:1257
llvm::LLVMContextImpl::YieldOpaqueHandle
void * YieldOpaqueHandle
Definition: LLVMContextImpl.h:1398
llvm::MDNodeKeyImpl< DISubprogram >::isKeyOf
bool isKeyOf(const DISubprogram *RHS) const
Definition: LLVMContextImpl.h:746
llvm::LLVMContextImpl::DistinctMDNodes
std::vector< MDNode * > DistinctMDNodes
Definition: LLVMContextImpl.h:1429
llvm::MDNodeKeyImpl< DIImportedEntity >::Scope
Metadata * Scope
Definition: LLVMContextImpl.h:1181
llvm::DILabel
Label.
Definition: DebugInfoMetadata.h:3148
llvm::MDNodeKeyImpl< DINamespace >::isKeyOf
bool isKeyOf(const DINamespace *RHS) const
Definition: LLVMContextImpl.h:877
StringMap.h
LLVMContext.h
llvm::MDNodeKeyImpl< MDTuple >::MDNodeKeyImpl
MDNodeKeyImpl(const MDTuple *N)
Definition: LLVMContextImpl.h:255
llvm::AMDGPU::HSAMD::Kernel::Key::Args
constexpr char Args[]
Key for Kernel::Metadata::mArgs.
Definition: AMDGPUMetadata.h:394
llvm::MDNodeKeyImpl< DIImportedEntity >::File
Metadata * File
Definition: LLVMContextImpl.h:1183
llvm::MDNodeKeyImpl< DIObjCProperty >::getHashValue
unsigned getHashValue() const
Definition: LLVMContextImpl.h:1173
llvm::MDNodeKeyImpl< DISubprogram >::MDNodeKeyImpl
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, Metadata *Annotations, MDString *TargetFuncName)
Definition: LLVMContextImpl.h:716
llvm::MDNodeKeyImpl< DILexicalBlockFile >::Discriminator
unsigned Discriminator
Definition: LLVMContextImpl.h:848
llvm::MDNodeKeyImpl< DIGlobalVariableExpression >::Expression
Metadata * Expression
Definition: LLVMContextImpl.h:1132
llvm::LLVMContextImpl::LLVMRS
std::unique_ptr< LLVMRemarkStreamer > LLVMRS
The specialized remark streamer used by LLVM's OptimizationRemarkEmitter.
Definition: LLVMContextImpl.h:1395
llvm::LLVMContextImpl::FP128Ty
Type FP128Ty
Definition: LLVMContextImpl.h:1467
llvm::MDNodeKeyImpl< DIEnumerator >::Name
MDString * Name
Definition: LLVMContextImpl.h:392
llvm::MDNodeKeyImpl< DICompositeType >::Identifier
MDString * Identifier
Definition: LLVMContextImpl.h:582
llvm::MDNodeKeyImpl< DITemplateTypeParameter >::IsDefault
bool IsDefault
Definition: LLVMContextImpl.h:950
llvm::AnonStructTypeKeyInfo::getHashValue
static unsigned getHashValue(const KeyTy &Key)
Definition: LLVMContextImpl.h:121
llvm::MDAttachments::Attachment::Node
TrackingMDNodeRef Node
Definition: LLVMContextImpl.h:1309
llvm::MDNodeKeyImpl< DIGlobalVariable >::Name
MDString * Name
Definition: LLVMContextImpl.h:993
llvm::LLVMContextImpl::NoCFIValues
DenseMap< const GlobalValue *, NoCFIValue * > NoCFIValues
Definition: LLVMContextImpl.h:1455
llvm::MDNodeKeyImpl< DICommonBlock >::MDNodeKeyImpl
MDNodeKeyImpl(Metadata *Scope, Metadata *Decl, MDString *Name, Metadata *File, unsigned LineNo)
Definition: LLVMContextImpl.h:892
llvm::MDString
A single uniqued string.
Definition: Metadata.h:612
llvm::MDNodeKeyImpl< DIEnumerator >::isKeyOf
bool isKeyOf(const DIEnumerator *RHS) const
Definition: LLVMContextImpl.h:404
Value.h
llvm::LLVMContextImpl::NamedStructTypes
StringMap< StructType * > NamedStructTypes
Definition: LLVMContextImpl.h:1481
llvm::MDNodeKeyImpl< DIBasicType >::SizeInBits
uint64_t SizeInBits
Definition: LLVMContextImpl.h:416
llvm::MDNodeKeyImpl< DIModule >::ConfigurationMacros
MDString * ConfigurationMacros
Definition: LLVMContextImpl.h:914
llvm::MDNodeKeyImpl< DIMacroFile >::getHashValue
unsigned getHashValue() const
Definition: LLVMContextImpl.h:1249
llvm::MDAttachments::get
void get(unsigned ID, SmallVectorImpl< MDNode * > &Result) const
Appends all attachments with the given ID to Result in insertion order.
Definition: Metadata.cpp:1246
llvm::Value
LLVM Value Representation.
Definition: Value.h:74
llvm::MDNodeKeyImpl< DILocalVariable >::File
Metadata * File
Definition: LLVMContextImpl.h:1055
llvm::MDNodeKeyImpl< DIModule >::isKeyOf
bool isKeyOf(const DIModule *RHS) const
Definition: LLVMContextImpl.h:933
llvm::LLVMContextImpl::LLVMContextImpl
LLVMContextImpl(LLVMContext &C)
Definition: LLVMContextImpl.cpp:40
llvm::ArrayRef::end
iterator end() const
Definition: ArrayRef.h:153
llvm::MDNodeKeyImpl< DIGlobalVariable >::MDNodeKeyImpl
MDNodeKeyImpl(Metadata *Scope, MDString *Name, MDString *LinkageName, Metadata *File, unsigned Line, Metadata *Type, bool IsLocalToUnit, bool IsDefinition, Metadata *StaticDataMemberDeclaration, Metadata *TemplateParams, uint32_t AlignInBits, Metadata *Annotations)
Definition: LLVMContextImpl.h:1005
llvm::TypedPointerType
A few GPU targets, such as DXIL and SPIR-V, have typed pointers.
Definition: TypedPointerType.h:25
llvm::LLVMContextImpl::FunctionTypes
FunctionTypeSet FunctionTypes
Definition: LLVMContextImpl.h:1478
llvm::codeview::PublicSymFlags::Function
@ Function
llvm::DIFile
File.
Definition: DebugInfoMetadata.h:525
llvm::MDNodeKeyImpl< DIObjCProperty >::MDNodeKeyImpl
MDNodeKeyImpl(MDString *Name, Metadata *File, unsigned Line, MDString *GetterName, MDString *SetterName, unsigned Attributes, Metadata *Type)
Definition: LLVMContextImpl.h:1156
llvm::MDNodeKeyImpl< DIModule >::APINotesFile
MDString * APINotesFile
Definition: LLVMContextImpl.h:916
llvm::FunctionType
Class to represent function types.
Definition: DerivedTypes.h:103
llvm::MDNodeKeyImpl< DIGlobalVariable >::IsLocalToUnit
bool IsLocalToUnit
Definition: LLVMContextImpl.h:998
llvm::DenseMapAPFloatKeyInfo::isEqual
static bool isEqual(const APFloat &LHS, const APFloat &RHS)
Definition: LLVMContextImpl.h:88
llvm::MDNodeKeyImpl< DIMacroFile >::Elements
Metadata * Elements
Definition: LLVMContextImpl.h:1235