Skip to content

Commit 96bd4d3

Browse files
committed
[DebugInfo] Support for DWARF attribute DW_AT_rank
This patch adds support for DWARF attribute DW_AT_rank. Summary: Fortran assumed rank arrays have dynamic rank. DWARF attribute DW_AT_rank is needed to support that. Testing: unit test cases added (hand-written) check llvm check debug-info Reviewed By: aprantl Differential Revision: https://reviews.llvm.org/D89141
1 parent 0db08e5 commit 96bd4d3

File tree

17 files changed

+404
-72
lines changed

17 files changed

+404
-72
lines changed

llvm/docs/LangRef.rst

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4906,7 +4906,9 @@ arrays which can be attached to actual arrays, this attachment between pointer
49064906
and pointee is called association. The optional ``associated`` is a
49074907
DIExpression that describes whether the pointer array is currently associated.
49084908
The optional ``allocated`` is a DIExpression that describes whether the
4909-
allocatable array is currently allocated.
4909+
allocatable array is currently allocated. The optional ``rank`` is a
4910+
DIExpression that describes the rank (number of dimensions) of fortran assumed
4911+
rank array (rank is known at runtime).
49104912

49114913
For ``DW_TAG_enumeration_type``, the ``elements:`` should be :ref:`enumerator
49124914
descriptors <DIEnumerator>`, each representing the definition of an enumeration

llvm/include/llvm/IR/DebugInfoMetadata.h

Lines changed: 42 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -1026,14 +1026,14 @@ class DICompositeType : public DIType {
10261026
DINodeArray Elements, unsigned RuntimeLang, DIType *VTableHolder,
10271027
DITemplateParameterArray TemplateParams, StringRef Identifier,
10281028
DIDerivedType *Discriminator, Metadata *DataLocation,
1029-
Metadata *Associated, Metadata *Allocated, StorageType Storage,
1030-
bool ShouldCreate = true) {
1031-
return getImpl(Context, Tag, getCanonicalMDString(Context, Name), File,
1032-
Line, Scope, BaseType, SizeInBits, AlignInBits, OffsetInBits,
1033-
Flags, Elements.get(), RuntimeLang, VTableHolder,
1034-
TemplateParams.get(),
1035-
getCanonicalMDString(Context, Identifier), Discriminator,
1036-
DataLocation, Associated, Allocated, Storage, ShouldCreate);
1029+
Metadata *Associated, Metadata *Allocated, Metadata *Rank,
1030+
StorageType Storage, bool ShouldCreate = true) {
1031+
return getImpl(
1032+
Context, Tag, getCanonicalMDString(Context, Name), File, Line, Scope,
1033+
BaseType, SizeInBits, AlignInBits, OffsetInBits, Flags, Elements.get(),
1034+
RuntimeLang, VTableHolder, TemplateParams.get(),
1035+
getCanonicalMDString(Context, Identifier), Discriminator, DataLocation,
1036+
Associated, Allocated, Rank, Storage, ShouldCreate);
10371037
}
10381038
static DICompositeType *
10391039
getImpl(LLVMContext &Context, unsigned Tag, MDString *Name, Metadata *File,
@@ -1042,16 +1042,17 @@ class DICompositeType : public DIType {
10421042
DIFlags Flags, Metadata *Elements, unsigned RuntimeLang,
10431043
Metadata *VTableHolder, Metadata *TemplateParams,
10441044
MDString *Identifier, Metadata *Discriminator, Metadata *DataLocation,
1045-
Metadata *Associated, Metadata *Allocated, StorageType Storage,
1046-
bool ShouldCreate = true);
1045+
Metadata *Associated, Metadata *Allocated, Metadata *Rank,
1046+
StorageType Storage, bool ShouldCreate = true);
10471047

10481048
TempDICompositeType cloneImpl() const {
1049-
return getTemporary(
1050-
getContext(), getTag(), getName(), getFile(), getLine(), getScope(),
1051-
getBaseType(), getSizeInBits(), getAlignInBits(), getOffsetInBits(),
1052-
getFlags(), getElements(), getRuntimeLang(), getVTableHolder(),
1053-
getTemplateParams(), getIdentifier(), getDiscriminator(),
1054-
getRawDataLocation(), getRawAssociated(), getRawAllocated());
1049+
return getTemporary(getContext(), getTag(), getName(), getFile(), getLine(),
1050+
getScope(), getBaseType(), getSizeInBits(),
1051+
getAlignInBits(), getOffsetInBits(), getFlags(),
1052+
getElements(), getRuntimeLang(), getVTableHolder(),
1053+
getTemplateParams(), getIdentifier(),
1054+
getDiscriminator(), getRawDataLocation(),
1055+
getRawAssociated(), getRawAllocated(), getRawRank());
10551056
}
10561057

10571058
public:
@@ -1064,10 +1065,10 @@ class DICompositeType : public DIType {
10641065
DITemplateParameterArray TemplateParams = nullptr,
10651066
StringRef Identifier = "", DIDerivedType *Discriminator = nullptr,
10661067
Metadata *DataLocation = nullptr, Metadata *Associated = nullptr,
1067-
Metadata *Allocated = nullptr),
1068+
Metadata *Allocated = nullptr, Metadata *Rank = nullptr),
10681069
(Tag, Name, File, Line, Scope, BaseType, SizeInBits, AlignInBits,
10691070
OffsetInBits, Flags, Elements, RuntimeLang, VTableHolder, TemplateParams,
1070-
Identifier, Discriminator, DataLocation, Associated, Allocated))
1071+
Identifier, Discriminator, DataLocation, Associated, Allocated, Rank))
10711072
DEFINE_MDNODE_GET(
10721073
DICompositeType,
10731074
(unsigned Tag, MDString *Name, Metadata *File, unsigned Line,
@@ -1076,10 +1077,11 @@ class DICompositeType : public DIType {
10761077
Metadata *Elements, unsigned RuntimeLang, Metadata *VTableHolder,
10771078
Metadata *TemplateParams = nullptr, MDString *Identifier = nullptr,
10781079
Metadata *Discriminator = nullptr, Metadata *DataLocation = nullptr,
1079-
Metadata *Associated = nullptr, Metadata *Allocated = nullptr),
1080+
Metadata *Associated = nullptr, Metadata *Allocated = nullptr,
1081+
Metadata *Rank = nullptr),
10801082
(Tag, Name, File, Line, Scope, BaseType, SizeInBits, AlignInBits,
10811083
OffsetInBits, Flags, Elements, RuntimeLang, VTableHolder, TemplateParams,
1082-
Identifier, Discriminator, DataLocation, Associated, Allocated))
1084+
Identifier, Discriminator, DataLocation, Associated, Allocated, Rank))
10831085

10841086
TempDICompositeType clone() const { return cloneImpl(); }
10851087

@@ -1097,7 +1099,8 @@ class DICompositeType : public DIType {
10971099
uint64_t OffsetInBits, DIFlags Flags, Metadata *Elements,
10981100
unsigned RuntimeLang, Metadata *VTableHolder,
10991101
Metadata *TemplateParams, Metadata *Discriminator,
1100-
Metadata *DataLocation, Metadata *Associated, Metadata *Allocated);
1102+
Metadata *DataLocation, Metadata *Associated, Metadata *Allocated,
1103+
Metadata *Rank);
11011104
static DICompositeType *getODRTypeIfExists(LLVMContext &Context,
11021105
MDString &Identifier);
11031106

@@ -1110,13 +1113,15 @@ class DICompositeType : public DIType {
11101113
///
11111114
/// If not \a LLVMContext::isODRUniquingDebugTypes(), this function returns
11121115
/// nullptr.
1113-
static DICompositeType *buildODRType(
1114-
LLVMContext &Context, MDString &Identifier, unsigned Tag, MDString *Name,
1115-
Metadata *File, unsigned Line, Metadata *Scope, Metadata *BaseType,
1116-
uint64_t SizeInBits, uint32_t AlignInBits, uint64_t OffsetInBits,
1117-
DIFlags Flags, Metadata *Elements, unsigned RuntimeLang,
1118-
Metadata *VTableHolder, Metadata *TemplateParams, Metadata *Discriminator,
1119-
Metadata *DataLocation, Metadata *Associated, Metadata *Allocated);
1116+
static DICompositeType *
1117+
buildODRType(LLVMContext &Context, MDString &Identifier, unsigned Tag,
1118+
MDString *Name, Metadata *File, unsigned Line, Metadata *Scope,
1119+
Metadata *BaseType, uint64_t SizeInBits, uint32_t AlignInBits,
1120+
uint64_t OffsetInBits, DIFlags Flags, Metadata *Elements,
1121+
unsigned RuntimeLang, Metadata *VTableHolder,
1122+
Metadata *TemplateParams, Metadata *Discriminator,
1123+
Metadata *DataLocation, Metadata *Associated,
1124+
Metadata *Allocated, Metadata *Rank);
11201125

11211126
DIType *getBaseType() const { return cast_or_null<DIType>(getRawBaseType()); }
11221127
DINodeArray getElements() const {
@@ -1159,6 +1164,15 @@ class DICompositeType : public DIType {
11591164
DIExpression *getAllocatedExp() const {
11601165
return dyn_cast_or_null<DIExpression>(getRawAllocated());
11611166
}
1167+
Metadata *getRawRank() const { return getOperand(12); }
1168+
ConstantInt *getRankConst() const {
1169+
if (auto *MD = dyn_cast_or_null<ConstantAsMetadata>(getRawRank()))
1170+
return dyn_cast_or_null<ConstantInt>(MD->getValue());
1171+
return nullptr;
1172+
}
1173+
DIExpression *getRankExp() const {
1174+
return dyn_cast_or_null<DIExpression>(getRawRank());
1175+
}
11621176

11631177
/// Replace operands.
11641178
///

llvm/lib/AsmParser/LLParser.cpp

Lines changed: 13 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4712,18 +4712,26 @@ bool LLParser::ParseDICompositeType(MDNode *&Result, bool IsDistinct) {
47124712
OPTIONAL(discriminator, MDField, ); \
47134713
OPTIONAL(dataLocation, MDField, ); \
47144714
OPTIONAL(associated, MDField, ); \
4715-
OPTIONAL(allocated, MDField, );
4715+
OPTIONAL(allocated, MDField, ); \
4716+
OPTIONAL(rank, MDSignedOrMDField, );
47164717
PARSE_MD_FIELDS();
47174718
#undef VISIT_MD_FIELDS
47184719

4720+
Metadata *Rank = nullptr;
4721+
if (rank.isMDSignedField())
4722+
Rank = ConstantAsMetadata::get(ConstantInt::getSigned(
4723+
Type::getInt64Ty(Context), rank.getMDSignedValue()));
4724+
else if (rank.isMDField())
4725+
Rank = rank.getMDFieldValue();
4726+
47194727
// If this has an identifier try to build an ODR type.
47204728
if (identifier.Val)
47214729
if (auto *CT = DICompositeType::buildODRType(
47224730
Context, *identifier.Val, tag.Val, name.Val, file.Val, line.Val,
47234731
scope.Val, baseType.Val, size.Val, align.Val, offset.Val, flags.Val,
47244732
elements.Val, runtimeLang.Val, vtableHolder.Val, templateParams.Val,
4725-
discriminator.Val, dataLocation.Val, associated.Val,
4726-
allocated.Val)) {
4733+
discriminator.Val, dataLocation.Val, associated.Val, allocated.Val,
4734+
Rank)) {
47274735
Result = CT;
47284736
return false;
47294737
}
@@ -4735,7 +4743,8 @@ bool LLParser::ParseDICompositeType(MDNode *&Result, bool IsDistinct) {
47354743
(Context, tag.Val, name.Val, file.Val, line.Val, scope.Val, baseType.Val,
47364744
size.Val, align.Val, offset.Val, flags.Val, elements.Val,
47374745
runtimeLang.Val, vtableHolder.Val, templateParams.Val, identifier.Val,
4738-
discriminator.Val, dataLocation.Val, associated.Val, allocated.Val));
4746+
discriminator.Val, dataLocation.Val, associated.Val, allocated.Val,
4747+
Rank));
47394748
return false;
47404749
}
47414750

llvm/lib/Bitcode/Reader/MetadataLoader.cpp

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1362,7 +1362,7 @@ Error MetadataLoader::MetadataLoaderImpl::parseOneMetadata(
13621362
break;
13631363
}
13641364
case bitc::METADATA_COMPOSITE_TYPE: {
1365-
if (Record.size() < 16 || Record.size() > 20)
1365+
if (Record.size() < 16 || Record.size() > 21)
13661366
return error("Invalid record");
13671367

13681368
// If we have a UUID and this is not a forward declaration, lookup the
@@ -1389,6 +1389,7 @@ Error MetadataLoader::MetadataLoaderImpl::parseOneMetadata(
13891389
Metadata *DataLocation = nullptr;
13901390
Metadata *Associated = nullptr;
13911391
Metadata *Allocated = nullptr;
1392+
Metadata *Rank = nullptr;
13921393
auto *Identifier = getMDString(Record[15]);
13931394
// If this module is being parsed so that it can be ThinLTO imported
13941395
// into another module, composite types only need to be imported
@@ -1417,14 +1418,17 @@ Error MetadataLoader::MetadataLoaderImpl::parseOneMetadata(
14171418
Associated = getMDOrNull(Record[18]);
14181419
Allocated = getMDOrNull(Record[19]);
14191420
}
1421+
if (Record.size() > 20) {
1422+
Rank = getMDOrNull(Record[20]);
1423+
}
14201424
}
14211425
DICompositeType *CT = nullptr;
14221426
if (Identifier)
14231427
CT = DICompositeType::buildODRType(
14241428
Context, *Identifier, Tag, Name, File, Line, Scope, BaseType,
14251429
SizeInBits, AlignInBits, OffsetInBits, Flags, Elements, RuntimeLang,
14261430
VTableHolder, TemplateParams, Discriminator, DataLocation, Associated,
1427-
Allocated);
1431+
Allocated, Rank);
14281432

14291433
// Create a node if we didn't get a lazy ODR type.
14301434
if (!CT)
@@ -1433,7 +1437,7 @@ Error MetadataLoader::MetadataLoaderImpl::parseOneMetadata(
14331437
SizeInBits, AlignInBits, OffsetInBits, Flags,
14341438
Elements, RuntimeLang, VTableHolder, TemplateParams,
14351439
Identifier, Discriminator, DataLocation, Associated,
1436-
Allocated));
1440+
Allocated, Rank));
14371441
if (!IsNotUsedInTypeRef && Identifier)
14381442
MetadataList.addTypeRef(*Identifier, *cast<DICompositeType>(CT));
14391443

llvm/lib/Bitcode/Writer/BitcodeWriter.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1662,6 +1662,7 @@ void ModuleBitcodeWriter::writeDICompositeType(
16621662
Record.push_back(VE.getMetadataOrNullID(N->getRawDataLocation()));
16631663
Record.push_back(VE.getMetadataOrNullID(N->getRawAssociated()));
16641664
Record.push_back(VE.getMetadataOrNullID(N->getRawAllocated()));
1665+
Record.push_back(VE.getMetadataOrNullID(N->getRawRank()));
16651666

16661667
Stream.EmitRecord(bitc::METADATA_COMPOSITE_TYPE, Record, Abbrev);
16671668
Record.clear();

llvm/lib/CodeGen/AsmPrinter/DwarfUnit.cpp

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1472,6 +1472,17 @@ void DwarfUnit::constructArrayTypeDIE(DIE &Buffer, const DICompositeType *CTy) {
14721472
addBlock(Buffer, dwarf::DW_AT_allocated, DwarfExpr.finalize());
14731473
}
14741474

1475+
if (auto *RankConst = CTy->getRankConst()) {
1476+
addSInt(Buffer, dwarf::DW_AT_rank, dwarf::DW_FORM_sdata,
1477+
RankConst->getSExtValue());
1478+
} else if (auto *RankExpr = CTy->getRankExp()) {
1479+
DIELoc *Loc = new (DIEValueAllocator) DIELoc;
1480+
DIEDwarfExpression DwarfExpr(*Asm, getCU(), *Loc);
1481+
DwarfExpr.setMemoryLocationKind();
1482+
DwarfExpr.addExpression(RankExpr);
1483+
addBlock(Buffer, dwarf::DW_AT_rank, DwarfExpr.finalize());
1484+
}
1485+
14751486
// Emit the element type.
14761487
addType(Buffer, CTy->getBaseType());
14771488

llvm/lib/IR/AsmWriter.cpp

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1991,6 +1991,11 @@ static void writeDICompositeType(raw_ostream &Out, const DICompositeType *N,
19911991
Printer.printMetadata("dataLocation", N->getRawDataLocation());
19921992
Printer.printMetadata("associated", N->getRawAssociated());
19931993
Printer.printMetadata("allocated", N->getRawAllocated());
1994+
if (auto *RankConst = N->getRankConst())
1995+
Printer.printInt("rank", RankConst->getSExtValue(),
1996+
/* ShouldSkipZero */ false);
1997+
else
1998+
Printer.printMetadata("rank", N->getRawRank(), /*ShouldSkipNull */ true);
19941999
Out << ")";
19952000
}
19962001

llvm/lib/IR/DebugInfoMetadata.cpp

Lines changed: 16 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -508,18 +508,19 @@ DICompositeType *DICompositeType::getImpl(
508508
Metadata *Elements, unsigned RuntimeLang, Metadata *VTableHolder,
509509
Metadata *TemplateParams, MDString *Identifier, Metadata *Discriminator,
510510
Metadata *DataLocation, Metadata *Associated, Metadata *Allocated,
511-
StorageType Storage, bool ShouldCreate) {
511+
Metadata *Rank, StorageType Storage, bool ShouldCreate) {
512512
assert(isCanonical(Name) && "Expected canonical MDString");
513513

514514
// Keep this in sync with buildODRType.
515-
DEFINE_GETIMPL_LOOKUP(DICompositeType,
516-
(Tag, Name, File, Line, Scope, BaseType, SizeInBits,
517-
AlignInBits, OffsetInBits, Flags, Elements,
518-
RuntimeLang, VTableHolder, TemplateParams, Identifier,
519-
Discriminator, DataLocation, Associated, Allocated));
515+
DEFINE_GETIMPL_LOOKUP(
516+
DICompositeType,
517+
(Tag, Name, File, Line, Scope, BaseType, SizeInBits, AlignInBits,
518+
OffsetInBits, Flags, Elements, RuntimeLang, VTableHolder, TemplateParams,
519+
Identifier, Discriminator, DataLocation, Associated, Allocated, Rank));
520520
Metadata *Ops[] = {File, Scope, Name, BaseType,
521521
Elements, VTableHolder, TemplateParams, Identifier,
522-
Discriminator, DataLocation, Associated, Allocated};
522+
Discriminator, DataLocation, Associated, Allocated,
523+
Rank};
523524
DEFINE_GETIMPL_STORE(DICompositeType, (Tag, Line, RuntimeLang, SizeInBits,
524525
AlignInBits, OffsetInBits, Flags),
525526
Ops);
@@ -531,7 +532,8 @@ DICompositeType *DICompositeType::buildODRType(
531532
uint64_t SizeInBits, uint32_t AlignInBits, uint64_t OffsetInBits,
532533
DIFlags Flags, Metadata *Elements, unsigned RuntimeLang,
533534
Metadata *VTableHolder, Metadata *TemplateParams, Metadata *Discriminator,
534-
Metadata *DataLocation, Metadata *Associated, Metadata *Allocated) {
535+
Metadata *DataLocation, Metadata *Associated, Metadata *Allocated,
536+
Metadata *Rank) {
535537
assert(!Identifier.getString().empty() && "Expected valid identifier");
536538
if (!Context.isODRUniquingDebugTypes())
537539
return nullptr;
@@ -541,7 +543,7 @@ DICompositeType *DICompositeType::buildODRType(
541543
Context, Tag, Name, File, Line, Scope, BaseType, SizeInBits,
542544
AlignInBits, OffsetInBits, Flags, Elements, RuntimeLang,
543545
VTableHolder, TemplateParams, &Identifier, Discriminator,
544-
DataLocation, Associated, Allocated);
546+
DataLocation, Associated, Allocated, Rank);
545547

546548
// Only mutate CT if it's a forward declaration and the new operands aren't.
547549
assert(CT->getRawIdentifier() == &Identifier && "Wrong ODR identifier?");
@@ -553,7 +555,8 @@ DICompositeType *DICompositeType::buildODRType(
553555
Flags);
554556
Metadata *Ops[] = {File, Scope, Name, BaseType,
555557
Elements, VTableHolder, TemplateParams, &Identifier,
556-
Discriminator, DataLocation, Associated, Allocated};
558+
Discriminator, DataLocation, Associated, Allocated,
559+
Rank};
557560
assert((std::end(Ops) - std::begin(Ops)) == (int)CT->getNumOperands() &&
558561
"Mismatched number of operands");
559562
for (unsigned I = 0, E = CT->getNumOperands(); I != E; ++I)
@@ -568,7 +571,8 @@ DICompositeType *DICompositeType::getODRType(
568571
uint64_t SizeInBits, uint32_t AlignInBits, uint64_t OffsetInBits,
569572
DIFlags Flags, Metadata *Elements, unsigned RuntimeLang,
570573
Metadata *VTableHolder, Metadata *TemplateParams, Metadata *Discriminator,
571-
Metadata *DataLocation, Metadata *Associated, Metadata *Allocated) {
574+
Metadata *DataLocation, Metadata *Associated, Metadata *Allocated,
575+
Metadata *Rank) {
572576
assert(!Identifier.getString().empty() && "Expected valid identifier");
573577
if (!Context.isODRUniquingDebugTypes())
574578
return nullptr;
@@ -578,7 +582,7 @@ DICompositeType *DICompositeType::getODRType(
578582
Context, Tag, Name, File, Line, Scope, BaseType, SizeInBits,
579583
AlignInBits, OffsetInBits, Flags, Elements, RuntimeLang, VTableHolder,
580584
TemplateParams, &Identifier, Discriminator, DataLocation, Associated,
581-
Allocated);
585+
Allocated, Rank);
582586
return CT;
583587
}
584588

llvm/lib/IR/LLVMContextImpl.h

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -538,6 +538,7 @@ template <> struct MDNodeKeyImpl<DICompositeType> {
538538
Metadata *DataLocation;
539539
Metadata *Associated;
540540
Metadata *Allocated;
541+
Metadata *Rank;
541542

542543
MDNodeKeyImpl(unsigned Tag, MDString *Name, Metadata *File, unsigned Line,
543544
Metadata *Scope, Metadata *BaseType, uint64_t SizeInBits,
@@ -546,14 +547,14 @@ template <> struct MDNodeKeyImpl<DICompositeType> {
546547
Metadata *VTableHolder, Metadata *TemplateParams,
547548
MDString *Identifier, Metadata *Discriminator,
548549
Metadata *DataLocation, Metadata *Associated,
549-
Metadata *Allocated)
550+
Metadata *Allocated, Metadata *Rank)
550551
: Tag(Tag), Name(Name), File(File), Line(Line), Scope(Scope),
551552
BaseType(BaseType), SizeInBits(SizeInBits), OffsetInBits(OffsetInBits),
552553
AlignInBits(AlignInBits), Flags(Flags), Elements(Elements),
553554
RuntimeLang(RuntimeLang), VTableHolder(VTableHolder),
554555
TemplateParams(TemplateParams), Identifier(Identifier),
555556
Discriminator(Discriminator), DataLocation(DataLocation),
556-
Associated(Associated), Allocated(Allocated) {}
557+
Associated(Associated), Allocated(Allocated), Rank(Rank) {}
557558
MDNodeKeyImpl(const DICompositeType *N)
558559
: Tag(N->getTag()), Name(N->getRawName()), File(N->getRawFile()),
559560
Line(N->getLine()), Scope(N->getRawScope()),
@@ -565,7 +566,8 @@ template <> struct MDNodeKeyImpl<DICompositeType> {
565566
Identifier(N->getRawIdentifier()),
566567
Discriminator(N->getRawDiscriminator()),
567568
DataLocation(N->getRawDataLocation()),
568-
Associated(N->getRawAssociated()), Allocated(N->getRawAllocated()) {}
569+
Associated(N->getRawAssociated()), Allocated(N->getRawAllocated()),
570+
Rank(N->getRawRank()) {}
569571

570572
bool isKeyOf(const DICompositeType *RHS) const {
571573
return Tag == RHS->getTag() && Name == RHS->getRawName() &&
@@ -582,7 +584,7 @@ template <> struct MDNodeKeyImpl<DICompositeType> {
582584
Discriminator == RHS->getRawDiscriminator() &&
583585
DataLocation == RHS->getRawDataLocation() &&
584586
Associated == RHS->getRawAssociated() &&
585-
Allocated == RHS->getRawAllocated();
587+
Allocated == RHS->getRawAllocated() && Rank == RHS->getRawRank();
586588
}
587589

588590
unsigned getHashValue() const {

0 commit comments

Comments
 (0)