Lines Matching +full:odr +full:- +full:value

1 //===- LLVMContextImpl.h - The LLVMContextImpl opaque class -----*- C++ -*-===//
5 // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
7 //===----------------------------------------------------------------------===//
12 //===----------------------------------------------------------------------===//
39 #include "llvm/IR/Value.h"
101 : ETypes(ST->elements()), isPacked(ST->isPacked()) {}
110 bool operator!=(const KeyTy &that) const { return !this->operator==(that); }
150 : ReturnType(FT->getReturnType()), Params(FT->params()),
151 isVarArg(FT->isVarArg()) {}
162 bool operator!=(const KeyTy &that) const { return !this->operator==(that); }
203 : Name(TT->getName()), TypeParams(TT->type_params()),
204 IntParams(TT->int_params()) {}
210 bool operator!=(const KeyTy &that) const { return !this->operator==(that); }
255 : Ops(N->op_begin() + Offset, N->op_end()), Hash(N->getHash()) {}
259 if (getHash() != RHS->getHash())
272 if (Ops.size() != RHS->getNumOperands() - Offset)
274 return std::equal(Ops.begin(), Ops.end(), RHS->op_begin() + Offset);
300 /// Note that we don't need the is-function-local bit, since that's implicit in
328 : Line(L->getLine()), Column(L->getColumn()), Scope(L->getRawScope()),
329 InlinedAt(L->getRawInlinedAt()), ImplicitCode(L->isImplicitCode()) {}
332 return Line == RHS->getLine() && Column == RHS->getColumn() &&
333 Scope == RHS->getRawScope() && InlinedAt == RHS->getRawInlinedAt() &&
334 ImplicitCode == RHS->isImplicitCode();
350 : MDNodeOpsKey(N, 1), Tag(N->getTag()), Header(N->getRawHeader()) {}
353 return Tag == RHS->getTag() && Header == RHS->getRawHeader() &&
375 : CountNode(N->getRawCountNode()), LowerBound(N->getRawLowerBound()),
376 UpperBound(N->getRawUpperBound()), Stride(N->getRawStride()) {}
379 auto BoundsEqual = [=](Metadata *Node1, Metadata *Node2) -> bool {
386 ConstantInt *CV1 = cast<ConstantInt>(MD1->getValue());
387 ConstantInt *CV2 = cast<ConstantInt>(MD2->getValue());
388 if (CV1->getSExtValue() == CV2->getSExtValue())
394 return BoundsEqual(CountNode, RHS->getRawCountNode()) &&
395 BoundsEqual(LowerBound, RHS->getRawLowerBound()) &&
396 BoundsEqual(UpperBound, RHS->getRawUpperBound()) &&
397 BoundsEqual(Stride, RHS->getRawStride());
403 return hash_combine(cast<ConstantInt>(MD->getValue())->getSExtValue(),
420 : CountNode(N->getRawCountNode()), LowerBound(N->getRawLowerBound()),
421 UpperBound(N->getRawUpperBound()), Stride(N->getRawStride()) {}
424 return (CountNode == RHS->getRawCountNode()) &&
425 (LowerBound == RHS->getRawLowerBound()) &&
426 (UpperBound == RHS->getRawUpperBound()) &&
427 (Stride == RHS->getRawStride());
433 return hash_combine(cast<ConstantInt>(MD->getValue())->getSExtValue(),
440 APInt Value;
444 MDNodeKeyImpl(APInt Value, bool IsUnsigned, MDString *Name)
445 : Value(std::move(Value)), Name(Name), IsUnsigned(IsUnsigned) {}
446 MDNodeKeyImpl(int64_t Value, bool IsUnsigned, MDString *Name)
447 : Value(APInt(64, Value, !IsUnsigned)), Name(Name),
450 : Value(N->getValue()), Name(N->getRawName()),
451 IsUnsigned(N->isUnsigned()) {}
454 return Value.getBitWidth() == RHS->getValue().getBitWidth() &&
455 Value == RHS->getValue() && IsUnsigned == RHS->isUnsigned() &&
456 Name == RHS->getRawName();
459 unsigned getHashValue() const { return hash_combine(Value, Name); }
475 : Tag(N->getTag()), Name(N->getRawName()), SizeInBits(N->getSizeInBits()),
476 AlignInBits(N->getAlignInBits()), Encoding(N->getEncoding()),
477 Flags(N->getFlags()) {}
480 return Tag == RHS->getTag() && Name == RHS->getRawName() &&
481 SizeInBits == RHS->getSizeInBits() &&
482 AlignInBits == RHS->getAlignInBits() &&
483 Encoding == RHS->getEncoding() && Flags == RHS->getFlags();
508 : Tag(N->getTag()), Name(N->getRawName()),
509 StringLength(N->getRawStringLength()),
510 StringLengthExp(N->getRawStringLengthExp()),
511 StringLocationExp(N->getRawStringLocationExp()),
512 SizeInBits(N->getSizeInBits()), AlignInBits(N->getAlignInBits()),
513 Encoding(N->getEncoding()) {}
516 return Tag == RHS->getTag() && Name == RHS->getRawName() &&
517 StringLength == RHS->getRawStringLength() &&
518 StringLengthExp == RHS->getRawStringLengthExp() &&
519 StringLocationExp == RHS->getRawStringLocationExp() &&
520 SizeInBits == RHS->getSizeInBits() &&
521 AlignInBits == RHS->getAlignInBits() &&
522 Encoding == RHS->getEncoding();
561 : Tag(N->getTag()), Name(N->getRawName()), File(N->getRawFile()),
562 Line(N->getLine()), Scope(N->getRawScope()),
563 BaseType(N->getRawBaseType()), SizeInBits(N->getSizeInBits()),
564 OffsetInBits(N->getOffsetInBits()), AlignInBits(N->getAlignInBits()),
565 DWARFAddressSpace(N->getDWARFAddressSpace()),
566 PtrAuthData(N->getPtrAuthData()), Flags(N->getFlags()),
567 ExtraData(N->getRawExtraData()), Annotations(N->getRawAnnotations()) {}
570 return Tag == RHS->getTag() && Name == RHS->getRawName() &&
571 File == RHS->getRawFile() && Line == RHS->getLine() &&
572 Scope == RHS->getRawScope() && BaseType == RHS->getRawBaseType() &&
573 SizeInBits == RHS->getSizeInBits() &&
574 AlignInBits == RHS->getAlignInBits() &&
575 OffsetInBits == RHS->getOffsetInBits() &&
576 DWARFAddressSpace == RHS->getDWARFAddressSpace() &&
577 PtrAuthData == RHS->getPtrAuthData() && Flags == RHS->getFlags() &&
578 ExtraData == RHS->getRawExtraData() &&
579 Annotations == RHS->getRawAnnotations();
583 // If this is a member inside an ODR type, only hash the type and the name.
588 if (CT->getRawIdentifier())
608 return isODRMember(LHS->getTag(), LHS->getRawScope(), LHS->getRawName(),
612 /// Subprograms compare equal if they declare the same function in an ODR
621 if (!CT || !CT->getRawIdentifier())
625 return Tag == RHS->getTag() && Name == RHS->getRawName() &&
626 Scope == RHS->getRawScope();
670 : Tag(N->getTag()), Name(N->getRawName()), File(N->getRawFile()),
671 Line(N->getLine()), Scope(N->getRawScope()),
672 BaseType(N->getRawBaseType()), SizeInBits(N->getSizeInBits()),
673 OffsetInBits(N->getOffsetInBits()), AlignInBits(N->getAlignInBits()),
674 Flags(N->getFlags()), Elements(N->getRawElements()),
675 RuntimeLang(N->getRuntimeLang()), VTableHolder(N->getRawVTableHolder()),
676 TemplateParams(N->getRawTemplateParams()),
677 Identifier(N->getRawIdentifier()),
678 Discriminator(N->getRawDiscriminator()),
679 DataLocation(N->getRawDataLocation()),
680 Associated(N->getRawAssociated()), Allocated(N->getRawAllocated()),
681 Rank(N->getRawRank()), Annotations(N->getRawAnnotations()) {}
684 return Tag == RHS->getTag() && Name == RHS->getRawName() &&
685 File == RHS->getRawFile() && Line == RHS->getLine() &&
686 Scope == RHS->getRawScope() && BaseType == RHS->getRawBaseType() &&
687 SizeInBits == RHS->getSizeInBits() &&
688 AlignInBits == RHS->getAlignInBits() &&
689 OffsetInBits == RHS->getOffsetInBits() && Flags == RHS->getFlags() &&
690 Elements == RHS->getRawElements() &&
691 RuntimeLang == RHS->getRuntimeLang() &&
692 VTableHolder == RHS->getRawVTableHolder() &&
693 TemplateParams == RHS->getRawTemplateParams() &&
694 Identifier == RHS->getRawIdentifier() &&
695 Discriminator == RHS->getRawDiscriminator() &&
696 DataLocation == RHS->getRawDataLocation() &&
697 Associated == RHS->getRawAssociated() &&
698 Allocated == RHS->getRawAllocated() && Rank == RHS->getRawRank() &&
699 Annotations == RHS->getRawAnnotations();
720 : Flags(N->getFlags()), CC(N->getCC()), TypeArray(N->getRawTypeArray()) {}
723 return Flags == RHS->getFlags() && CC == RHS->getCC() &&
724 TypeArray == RHS->getRawTypeArray();
742 : Filename(N->getRawFilename()), Directory(N->getRawDirectory()),
743 Checksum(N->getRawChecksum()), Source(N->getRawSource()) {}
746 return Filename == RHS->getRawFilename() &&
747 Directory == RHS->getRawDirectory() &&
748 Checksum == RHS->getRawChecksum() && Source == RHS->getRawSource();
752 return hash_combine(Filename, Directory, Checksum ? Checksum->Kind : 0,
753 Checksum ? Checksum->Value : nullptr, Source);
794 : Scope(N->getRawScope()), Name(N->getRawName()),
795 LinkageName(N->getRawLinkageName()), File(N->getRawFile()),
796 Line(N->getLine()), Type(N->getRawType()), ScopeLine(N->getScopeLine()),
797 ContainingType(N->getRawContainingType()),
798 VirtualIndex(N->getVirtualIndex()),
799 ThisAdjustment(N->getThisAdjustment()), Flags(N->getFlags()),
800 SPFlags(N->getSPFlags()), Unit(N->getRawUnit()),
801 TemplateParams(N->getRawTemplateParams()),
802 Declaration(N->getRawDeclaration()),
803 RetainedNodes(N->getRawRetainedNodes()),
804 ThrownTypes(N->getRawThrownTypes()),
805 Annotations(N->getRawAnnotations()),
806 TargetFuncName(N->getRawTargetFuncName()) {}
809 return Scope == RHS->getRawScope() && Name == RHS->getRawName() &&
810 LinkageName == RHS->getRawLinkageName() &&
811 File == RHS->getRawFile() && Line == RHS->getLine() &&
812 Type == RHS->getRawType() && ScopeLine == RHS->getScopeLine() &&
813 ContainingType == RHS->getRawContainingType() &&
814 VirtualIndex == RHS->getVirtualIndex() &&
815 ThisAdjustment == RHS->getThisAdjustment() &&
816 Flags == RHS->getFlags() && SPFlags == RHS->getSPFlags() &&
817 Unit == RHS->getUnit() &&
818 TemplateParams == RHS->getRawTemplateParams() &&
819 Declaration == RHS->getRawDeclaration() &&
820 RetainedNodes == RHS->getRawRetainedNodes() &&
821 ThrownTypes == RHS->getRawThrownTypes() &&
822 Annotations == RHS->getRawAnnotations() &&
823 TargetFuncName == RHS->getRawTargetFuncName();
834 if (auto *ID = CT->getRawIdentifier())
835 ScopeLinkageName = ID->getString();
837 // If this is a declaration inside an ODR type, only hash the type and the
861 return isDeclarationOfODRMember(LHS->isDefinition(), LHS->getRawScope(),
862 LHS->getRawLinkageName(),
863 LHS->getRawTemplateParams(), RHS);
866 /// Subprograms compare equal if they declare the same function in an ODR
877 if (!CT || !CT->getRawIdentifier())
883 // ODR-DISubprogram has a non-ODR template parameter (i.e., a
885 // decouple ODR logic from uniquing logic.
886 return IsDefinition == RHS->isDefinition() && Scope == RHS->getRawScope() &&
887 LinkageName == RHS->getRawLinkageName() &&
888 TemplateParams == RHS->getRawTemplateParams();
901 : Scope(N->getRawScope()), File(N->getRawFile()), Line(N->getLine()),
902 Column(N->getColumn()) {}
905 return Scope == RHS->getRawScope() && File == RHS->getRawFile() &&
906 Line == RHS->getLine() && Column == RHS->getColumn();
922 : Scope(N->getRawScope()), File(N->getRawFile()),
923 Discriminator(N->getDiscriminator()) {}
926 return Scope == RHS->getRawScope() && File == RHS->getRawFile() &&
927 Discriminator == RHS->getDiscriminator();
943 : Scope(N->getRawScope()), Name(N->getRawName()),
944 ExportSymbols(N->getExportSymbols()) {}
947 return Scope == RHS->getRawScope() && Name == RHS->getRawName() &&
948 ExportSymbols == RHS->getExportSymbols();
965 : Scope(N->getRawScope()), Decl(N->getRawDecl()), Name(N->getRawName()),
966 File(N->getRawFile()), LineNo(N->getLineNo()) {}
969 return Scope == RHS->getRawScope() && Decl == RHS->getRawDecl() &&
970 Name == RHS->getRawName() && File == RHS->getRawFile() &&
971 LineNo == RHS->getLineNo();
996 : File(N->getRawFile()), Scope(N->getRawScope()), Name(N->getRawName()),
997 ConfigurationMacros(N->getRawConfigurationMacros()),
998 IncludePath(N->getRawIncludePath()),
999 APINotesFile(N->getRawAPINotesFile()), LineNo(N->getLineNo()),
1000 IsDecl(N->getIsDecl()) {}
1003 return Scope == RHS->getRawScope() && Name == RHS->getRawName() &&
1004 ConfigurationMacros == RHS->getRawConfigurationMacros() &&
1005 IncludePath == RHS->getRawIncludePath() &&
1006 APINotesFile == RHS->getRawAPINotesFile() &&
1007 File == RHS->getRawFile() && LineNo == RHS->getLineNo() &&
1008 IsDecl == RHS->getIsDecl();
1024 : Name(N->getRawName()), Type(N->getRawType()),
1025 IsDefault(N->isDefault()) {}
1028 return Name == RHS->getRawName() && Type == RHS->getRawType() &&
1029 IsDefault == RHS->isDefault();
1040 Metadata *Value;
1043 Metadata *Value)
1044 : Tag(Tag), Name(Name), Type(Type), IsDefault(IsDefault), Value(Value) {}
1046 : Tag(N->getTag()), Name(N->getRawName()), Type(N->getRawType()),
1047 IsDefault(N->isDefault()), Value(N->getValue()) {}
1050 return Tag == RHS->getTag() && Name == RHS->getRawName() &&
1051 Type == RHS->getRawType() && IsDefault == RHS->isDefault() &&
1052 Value == RHS->getValue();
1056 return hash_combine(Tag, Name, Type, IsDefault, Value);
1086 : Scope(N->getRawScope()), Name(N->getRawName()),
1087 LinkageName(N->getRawLinkageName()), File(N->getRawFile()),
1088 Line(N->getLine()), Type(N->getRawType()),
1089 IsLocalToUnit(N->isLocalToUnit()), IsDefinition(N->isDefinition()),
1090 StaticDataMemberDeclaration(N->getRawStaticDataMemberDeclaration()),
1091 TemplateParams(N->getRawTemplateParams()),
1092 AlignInBits(N->getAlignInBits()), Annotations(N->getRawAnnotations()) {}
1095 return Scope == RHS->getRawScope() && Name == RHS->getRawName() &&
1096 LinkageName == RHS->getRawLinkageName() &&
1097 File == RHS->getRawFile() && Line == RHS->getLine() &&
1098 Type == RHS->getRawType() && IsLocalToUnit == RHS->isLocalToUnit() &&
1099 IsDefinition == RHS->isDefinition() &&
1101 RHS->getRawStaticDataMemberDeclaration() &&
1102 TemplateParams == RHS->getRawTemplateParams() &&
1103 AlignInBits == RHS->getAlignInBits() &&
1104 Annotations == RHS->getRawAnnotations();
1112 // clang/test/CodeGen/debug-info-257-args.c is an example of this problem,
1138 : Scope(N->getRawScope()), Name(N->getRawName()), File(N->getRawFile()),
1139 Line(N->getLine()), Type(N->getRawType()), Arg(N->getArg()),
1140 Flags(N->getFlags()), AlignInBits(N->getAlignInBits()),
1141 Annotations(N->getRawAnnotations()) {}
1144 return Scope == RHS->getRawScope() && Name == RHS->getRawName() &&
1145 File == RHS->getRawFile() && Line == RHS->getLine() &&
1146 Type == RHS->getRawType() && Arg == RHS->getArg() &&
1147 Flags == RHS->getFlags() && AlignInBits == RHS->getAlignInBits() &&
1148 Annotations == RHS->getRawAnnotations();
1156 // clang/test/CodeGen/debug-info-257-args.c is an example of this problem,
1172 : Scope(N->getRawScope()), Name(N->getRawName()), File(N->getRawFile()),
1173 Line(N->getLine()) {}
1176 return Scope == RHS->getRawScope() && Name == RHS->getRawName() &&
1177 File == RHS->getRawFile() && Line == RHS->getLine();
1180 /// Using name and line to get hash value. It should already be mostly unique.
1188 MDNodeKeyImpl(const DIExpression *N) : Elements(N->getElements()) {}
1191 return Elements == RHS->getElements();
1206 : Variable(N->getRawVariable()), Expression(N->getRawExpression()) {}
1209 return Variable == RHS->getRawVariable() &&
1210 Expression == RHS->getRawExpression();
1231 : Name(N->getRawName()), File(N->getRawFile()), Line(N->getLine()),
1232 GetterName(N->getRawGetterName()), SetterName(N->getRawSetterName()),
1233 Attributes(N->getAttributes()), Type(N->getRawType()) {}
1236 return Name == RHS->getRawName() && File == RHS->getRawFile() &&
1237 Line == RHS->getLine() && GetterName == RHS->getRawGetterName() &&
1238 SetterName == RHS->getRawSetterName() &&
1239 Attributes == RHS->getAttributes() && Type == RHS->getRawType();
1262 : Tag(N->getTag()), Scope(N->getRawScope()), Entity(N->getRawEntity()),
1263 File(N->getRawFile()), Line(N->getLine()), Name(N->getRawName()),
1264 Elements(N->getRawElements()) {}
1267 return Tag == RHS->getTag() && Scope == RHS->getRawScope() &&
1268 Entity == RHS->getRawEntity() && File == RHS->getFile() &&
1269 Line == RHS->getLine() && Name == RHS->getRawName() &&
1270 Elements == RHS->getRawElements();
1282 MDString *Value;
1284 MDNodeKeyImpl(unsigned MIType, unsigned Line, MDString *Name, MDString *Value)
1285 : MIType(MIType), Line(Line), Name(Name), Value(Value) {}
1287 : MIType(N->getMacinfoType()), Line(N->getLine()), Name(N->getRawName()),
1288 Value(N->getRawValue()) {}
1291 return MIType == RHS->getMacinfoType() && Line == RHS->getLine() &&
1292 Name == RHS->getRawName() && Value == RHS->getRawValue();
1296 return hash_combine(MIType, Line, Name, Value);
1310 : MIType(N->getMacinfoType()), Line(N->getLine()), File(N->getRawFile()),
1311 Elements(N->getRawElements()) {}
1314 return MIType == RHS->getMacinfoType() && Line == RHS->getLine() &&
1315 File == RHS->getRawFile() && Elements == RHS->getRawElements();
1329 DIArgListKeyInfo(const DIArgList *N) : Args(N->getArgs()) {}
1331 bool isKeyOf(const DIArgList *RHS) const { return Args == RHS->getArgs(); }
1404 /// Multimap-like storage for metadata attachments.
1457 /// OwnedModules - The set of modules instantiated in this context, and which
1461 /// MachineFunctionNums - Keep the next available unique number available for
1473 /// The minimum hotness value a diagnostic needs in order to be included in
1476 /// The threshold is an Optional value, which maps to one of the 3 states:
1480 /// 3). None => 'auto' threshold by user. The actual value is not
1504 DenseMap<const Value *, ValueName *> ValueNames;
1521 DenseMap<Value *, ValueAsMetadata *> ValuesAsMetadata;
1614 /// ValueHandles - This map keeps track of all of the value handles that are
1615 /// watching a Value*. The Value::HasValueHandle bit is used to know
1616 /// whether or not a value has an entry in this map.
1617 using ValueHandlesTy = DenseMap<Value *, ValueHandleBase *>;
1620 /// CustomMDKindNames - Map to hold the metadata string to ID mapping.
1624 DenseMap<const Value *, MDAttachments> ValueMetadata;
1626 /// Map DIAssignID -> Instructions with that attachment.
1631 /// Collection of per-GlobalObject sections used in this context.
1634 /// Collection of per-GlobalValue partitions used in this context.
1640 /// DiscriminatorTable - This table maps file:line locations to an
1659 /// getOrInsertSyncScopeID - Maps synchronization scope name to
1661 /// LLVMContext has unique ID except pre-defined ones.
1664 /// getSyncScopeNames - Populates client supplied SmallVector with
1676 /// Flag to indicate if Value (other than GlobalValue) retains their name or
1700 /// of the "RemoveDIs" project, debug-info variable location records are going
1708 /// block, any debug-records between those two instructions will not have a