Skip to content

Commit 67fb268

Browse files
authored
[DebugInfo] Add a specification attribute to LLVM DebugInfo (#115362)
Add a specification attribute to LLVM DebugInfo, which is analogous to DWARF's DW_AT_specification. According to the DWARF spec: "A debugging information entry that represents a declaration that completes another (earlier) non-defining declaration may have a DW_AT_specification attribute whose value is a reference to the debugging information entry representing the non-defining declaration." This patch allows types to be specifications of other types. This is used by Swift to represent generic types. For example, given this Swift program: ``` struct MyStruct<T> { let t: T } let variable = MyStruct<Int>(t: 43) ``` The Swift compiler emits (roughly) an unsubtituted type for MyStruct<T>: ``` DW_TAG_structure_type DW_AT_name ("MyStruct") // "$s1w8MyStructVyxGD" is a Swift mangled name roughly equivalent to // MyStruct<T> DW_AT_linkage_name ("$s1w8MyStructVyxGD") // other attributes here ``` And a specification for MyStruct<Int>: ``` DW_TAG_structure_type DW_AT_specification (<link to "MyStruct">) // "$s1w8MyStructVySiGD" is a Swift mangled name equivalent to // MyStruct<Int> DW_AT_linkage_name ("$s1w8MyStructVySiGD") DW_AT_byte_size (0x08) // other attributes here ```
1 parent 2bd6af8 commit 67fb268

File tree

13 files changed

+159
-91
lines changed

13 files changed

+159
-91
lines changed

llvm/include/llvm/IR/DIBuilder.h

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -488,6 +488,8 @@ namespace llvm {
488488
/// \param Elements Struct elements.
489489
/// \param RunTimeLang Optional parameter, Objective-C runtime version.
490490
/// \param UniqueIdentifier A unique identifier for the struct.
491+
/// \param Specification The type that this type completes. This is used by
492+
/// Swift to represent generic types.
491493
/// \param NumExtraInhabitants The number of extra inhabitants of the type.
492494
/// An extra inhabitant is a bit pattern that does not represent a valid
493495
/// value for instances of a given type. This is used by the Swift language.
@@ -496,7 +498,7 @@ namespace llvm {
496498
uint64_t SizeInBits, uint32_t AlignInBits, DINode::DIFlags Flags,
497499
DIType *DerivedFrom, DINodeArray Elements, unsigned RunTimeLang = 0,
498500
DIType *VTableHolder = nullptr, StringRef UniqueIdentifier = "",
499-
uint32_t NumExtraInhabitants = 0);
501+
DIType *Specification = nullptr, uint32_t NumExtraInhabitants = 0);
500502

501503
/// Create debugging information entry for an union.
502504
/// \param Scope Scope in which this union is defined.

llvm/include/llvm/IR/DebugInfoMetadata.h

Lines changed: 31 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -1201,7 +1201,7 @@ class DICompositeType : public DIType {
12011201
static DICompositeType *
12021202
getImpl(LLVMContext &Context, unsigned Tag, StringRef Name, Metadata *File,
12031203
unsigned Line, DIScope *Scope, DIType *BaseType, uint64_t SizeInBits,
1204-
uint32_t AlignInBits, uint64_t OffsetInBits,
1204+
uint32_t AlignInBits, uint64_t OffsetInBits, DIType *Specification,
12051205
uint32_t NumExtraInhabitants, DIFlags Flags, DINodeArray Elements,
12061206
unsigned RuntimeLang, DIType *VTableHolder,
12071207
DITemplateParameterArray TemplateParams, StringRef Identifier,
@@ -1215,7 +1215,7 @@ class DICompositeType : public DIType {
12151215
TemplateParams.get(),
12161216
getCanonicalMDString(Context, Identifier), Discriminator,
12171217
DataLocation, Associated, Allocated, Rank, Annotations.get(),
1218-
NumExtraInhabitants, Storage, ShouldCreate);
1218+
Specification, NumExtraInhabitants, Storage, ShouldCreate);
12191219
}
12201220
static DICompositeType *
12211221
getImpl(LLVMContext &Context, unsigned Tag, MDString *Name, Metadata *File,
@@ -1225,8 +1225,9 @@ class DICompositeType : public DIType {
12251225
Metadata *VTableHolder, Metadata *TemplateParams,
12261226
MDString *Identifier, Metadata *Discriminator, Metadata *DataLocation,
12271227
Metadata *Associated, Metadata *Allocated, Metadata *Rank,
1228-
Metadata *Annotations, uint32_t NumExtraInhabitants,
1229-
StorageType Storage, bool ShouldCreate = true);
1228+
Metadata *Annotations, Metadata *Specification,
1229+
uint32_t NumExtraInhabitants, StorageType Storage,
1230+
bool ShouldCreate = true);
12301231

12311232
TempDICompositeType cloneImpl() const {
12321233
return getTemporary(
@@ -1235,7 +1236,8 @@ class DICompositeType : public DIType {
12351236
getFlags(), getElements(), getRuntimeLang(), getVTableHolder(),
12361237
getTemplateParams(), getIdentifier(), getDiscriminator(),
12371238
getRawDataLocation(), getRawAssociated(), getRawAllocated(),
1238-
getRawRank(), getAnnotations(), getNumExtraInhabitants());
1239+
getRawRank(), getAnnotations(), getSpecification(),
1240+
getNumExtraInhabitants());
12391241
}
12401242

12411243
public:
@@ -1249,11 +1251,12 @@ class DICompositeType : public DIType {
12491251
StringRef Identifier = "", DIDerivedType *Discriminator = nullptr,
12501252
Metadata *DataLocation = nullptr, Metadata *Associated = nullptr,
12511253
Metadata *Allocated = nullptr, Metadata *Rank = nullptr,
1252-
DINodeArray Annotations = nullptr, uint32_t NumExtraInhabitants = 0),
1254+
DINodeArray Annotations = nullptr, DIType *Specification = nullptr,
1255+
uint32_t NumExtraInhabitants = 0),
12531256
(Tag, Name, File, Line, Scope, BaseType, SizeInBits, AlignInBits,
1254-
OffsetInBits, NumExtraInhabitants, Flags, Elements, RuntimeLang,
1255-
VTableHolder, TemplateParams, Identifier, Discriminator, DataLocation,
1256-
Associated, Allocated, Rank, Annotations))
1257+
OffsetInBits, Specification, NumExtraInhabitants, Flags, Elements,
1258+
RuntimeLang, VTableHolder, TemplateParams, Identifier, Discriminator,
1259+
DataLocation, Associated, Allocated, Rank, Annotations))
12571260
DEFINE_MDNODE_GET(
12581261
DICompositeType,
12591262
(unsigned Tag, MDString *Name, Metadata *File, unsigned Line,
@@ -1264,11 +1267,11 @@ class DICompositeType : public DIType {
12641267
Metadata *Discriminator = nullptr, Metadata *DataLocation = nullptr,
12651268
Metadata *Associated = nullptr, Metadata *Allocated = nullptr,
12661269
Metadata *Rank = nullptr, Metadata *Annotations = nullptr,
1267-
uint32_t NumExtraInhabitants = 0),
1270+
Metadata *Specification = nullptr, uint32_t NumExtraInhabitants = 0),
12681271
(Tag, Name, File, Line, Scope, BaseType, SizeInBits, AlignInBits,
12691272
OffsetInBits, Flags, Elements, RuntimeLang, VTableHolder, TemplateParams,
12701273
Identifier, Discriminator, DataLocation, Associated, Allocated, Rank,
1271-
Annotations, NumExtraInhabitants))
1274+
Annotations, Specification, NumExtraInhabitants))
12721275

12731276
TempDICompositeType clone() const { return cloneImpl(); }
12741277

@@ -1283,8 +1286,9 @@ class DICompositeType : public DIType {
12831286
getODRType(LLVMContext &Context, MDString &Identifier, unsigned Tag,
12841287
MDString *Name, Metadata *File, unsigned Line, Metadata *Scope,
12851288
Metadata *BaseType, uint64_t SizeInBits, uint32_t AlignInBits,
1286-
uint64_t OffsetInBits, uint32_t NumExtraInhabitants, DIFlags Flags,
1287-
Metadata *Elements, unsigned RuntimeLang, Metadata *VTableHolder,
1289+
uint64_t OffsetInBits, Metadata *Specification,
1290+
uint32_t NumExtraInhabitants, DIFlags Flags, Metadata *Elements,
1291+
unsigned RuntimeLang, Metadata *VTableHolder,
12881292
Metadata *TemplateParams, Metadata *Discriminator,
12891293
Metadata *DataLocation, Metadata *Associated, Metadata *Allocated,
12901294
Metadata *Rank, Metadata *Annotations);
@@ -1300,14 +1304,16 @@ class DICompositeType : public DIType {
13001304
///
13011305
/// If not \a LLVMContext::isODRUniquingDebugTypes(), this function returns
13021306
/// nullptr.
1303-
static DICompositeType *buildODRType(
1304-
LLVMContext &Context, MDString &Identifier, unsigned Tag, MDString *Name,
1305-
Metadata *File, unsigned Line, Metadata *Scope, Metadata *BaseType,
1306-
uint64_t SizeInBits, uint32_t AlignInBits, uint64_t OffsetInBits,
1307-
uint32_t NumExtraInhabitants, DIFlags Flags, Metadata *Elements,
1308-
unsigned RuntimeLang, Metadata *VTableHolder, Metadata *TemplateParams,
1309-
Metadata *Discriminator, Metadata *DataLocation, Metadata *Associated,
1310-
Metadata *Allocated, Metadata *Rank, Metadata *Annotations);
1307+
static DICompositeType *
1308+
buildODRType(LLVMContext &Context, MDString &Identifier, unsigned Tag,
1309+
MDString *Name, Metadata *File, unsigned Line, Metadata *Scope,
1310+
Metadata *BaseType, uint64_t SizeInBits, uint32_t AlignInBits,
1311+
uint64_t OffsetInBits, Metadata *Specification,
1312+
uint32_t NumExtraInhabitants, DIFlags Flags, Metadata *Elements,
1313+
unsigned RuntimeLang, Metadata *VTableHolder,
1314+
Metadata *TemplateParams, Metadata *Discriminator,
1315+
Metadata *DataLocation, Metadata *Associated,
1316+
Metadata *Allocated, Metadata *Rank, Metadata *Annotations);
13111317

13121318
DIType *getBaseType() const { return cast_or_null<DIType>(getRawBaseType()); }
13131319
DINodeArray getElements() const {
@@ -1367,6 +1373,10 @@ class DICompositeType : public DIType {
13671373
return cast_or_null<MDTuple>(getRawAnnotations());
13681374
}
13691375

1376+
Metadata *getRawSpecification() const { return getOperand(14); }
1377+
DIType *getSpecification() const {
1378+
return cast_or_null<DIType>(getRawSpecification());
1379+
}
13701380
/// Replace operands.
13711381
///
13721382
/// If this \a isUniqued() and not \a isResolved(), on a uniquing collision

llvm/lib/AsmParser/LLParser.cpp

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -5437,7 +5437,8 @@ bool LLParser::parseDICompositeType(MDNode *&Result, bool IsDistinct) {
54375437
OPTIONAL(allocated, MDField, ); \
54385438
OPTIONAL(rank, MDSignedOrMDField, ); \
54395439
OPTIONAL(annotations, MDField, ); \
5440-
OPTIONAL(num_extra_inhabitants, MDUnsignedField, (0, UINT32_MAX));
5440+
OPTIONAL(num_extra_inhabitants, MDUnsignedField, (0, UINT32_MAX)); \
5441+
OPTIONAL(specification, MDField, );
54415442
PARSE_MD_FIELDS();
54425443
#undef VISIT_MD_FIELDS
54435444

@@ -5453,10 +5454,10 @@ bool LLParser::parseDICompositeType(MDNode *&Result, bool IsDistinct) {
54535454
if (auto *CT = DICompositeType::buildODRType(
54545455
Context, *identifier.Val, tag.Val, name.Val, file.Val, line.Val,
54555456
scope.Val, baseType.Val, size.Val, align.Val, offset.Val,
5456-
num_extra_inhabitants.Val, flags.Val, elements.Val, runtimeLang.Val,
5457-
vtableHolder.Val, templateParams.Val, discriminator.Val,
5458-
dataLocation.Val, associated.Val, allocated.Val, Rank,
5459-
annotations.Val)) {
5457+
specification.Val, num_extra_inhabitants.Val, flags.Val,
5458+
elements.Val, runtimeLang.Val, vtableHolder.Val, templateParams.Val,
5459+
discriminator.Val, dataLocation.Val, associated.Val, allocated.Val,
5460+
Rank, annotations.Val)) {
54605461
Result = CT;
54615462
return false;
54625463
}
@@ -5469,7 +5470,7 @@ bool LLParser::parseDICompositeType(MDNode *&Result, bool IsDistinct) {
54695470
size.Val, align.Val, offset.Val, flags.Val, elements.Val,
54705471
runtimeLang.Val, vtableHolder.Val, templateParams.Val, identifier.Val,
54715472
discriminator.Val, dataLocation.Val, associated.Val, allocated.Val, Rank,
5472-
annotations.Val, num_extra_inhabitants.Val));
5473+
annotations.Val, specification.Val, num_extra_inhabitants.Val));
54735474
return false;
54745475
}
54755476

llvm/lib/Bitcode/Reader/MetadataLoader.cpp

Lines changed: 11 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1600,7 +1600,7 @@ Error MetadataLoader::MetadataLoaderImpl::parseOneMetadata(
16001600
break;
16011601
}
16021602
case bitc::METADATA_COMPOSITE_TYPE: {
1603-
if (Record.size() < 16 || Record.size() > 23)
1603+
if (Record.size() < 16 || Record.size() > 24)
16041604
return error("Invalid record");
16051605

16061606
// If we have a UUID and this is not a forward declaration, lookup the
@@ -1630,6 +1630,7 @@ Error MetadataLoader::MetadataLoaderImpl::parseOneMetadata(
16301630
Metadata *Allocated = nullptr;
16311631
Metadata *Rank = nullptr;
16321632
Metadata *Annotations = nullptr;
1633+
Metadata *Specification = nullptr;
16331634
auto *Identifier = getMDString(Record[15]);
16341635
// If this module is being parsed so that it can be ThinLTO imported
16351636
// into another module, composite types only need to be imported as
@@ -1678,14 +1679,18 @@ Error MetadataLoader::MetadataLoaderImpl::parseOneMetadata(
16781679
if (Record.size() > 21) {
16791680
Annotations = getMDOrNull(Record[21]);
16801681
}
1682+
if (Record.size() > 23) {
1683+
Specification = getMDOrNull(Record[23]);
1684+
}
16811685
}
16821686
DICompositeType *CT = nullptr;
16831687
if (Identifier)
16841688
CT = DICompositeType::buildODRType(
16851689
Context, *Identifier, Tag, Name, File, Line, Scope, BaseType,
1686-
SizeInBits, AlignInBits, OffsetInBits, NumExtraInhabitants, Flags,
1687-
Elements, RuntimeLang, VTableHolder, TemplateParams, Discriminator,
1688-
DataLocation, Associated, Allocated, Rank, Annotations);
1690+
SizeInBits, AlignInBits, OffsetInBits, Specification,
1691+
NumExtraInhabitants, Flags, Elements, RuntimeLang, VTableHolder,
1692+
TemplateParams, Discriminator, DataLocation, Associated, Allocated,
1693+
Rank, Annotations);
16891694

16901695
// Create a node if we didn't get a lazy ODR type.
16911696
if (!CT)
@@ -1694,7 +1699,8 @@ Error MetadataLoader::MetadataLoaderImpl::parseOneMetadata(
16941699
SizeInBits, AlignInBits, OffsetInBits, Flags,
16951700
Elements, RuntimeLang, VTableHolder, TemplateParams,
16961701
Identifier, Discriminator, DataLocation, Associated,
1697-
Allocated, Rank, Annotations, NumExtraInhabitants));
1702+
Allocated, Rank, Annotations, Specification,
1703+
NumExtraInhabitants));
16981704
if (!IsNotUsedInTypeRef && Identifier)
16991705
MetadataList.addTypeRef(*Identifier, *cast<DICompositeType>(CT));
17001706

llvm/lib/Bitcode/Writer/BitcodeWriter.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1947,6 +1947,7 @@ void ModuleBitcodeWriter::writeDICompositeType(
19471947
Record.push_back(VE.getMetadataOrNullID(N->getRawRank()));
19481948
Record.push_back(VE.getMetadataOrNullID(N->getAnnotations().get()));
19491949
Record.push_back(N->getNumExtraInhabitants());
1950+
Record.push_back(VE.getMetadataOrNullID(N->getRawSpecification()));
19501951

19511952
Stream.EmitRecord(bitc::METADATA_COMPOSITE_TYPE, Record, Abbrev);
19521953
Record.clear();

llvm/lib/CodeGen/AsmPrinter/DwarfUnit.cpp

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1043,6 +1043,11 @@ void DwarfUnit::constructTypeDIE(DIE &Buffer, const DICompositeType *CTy) {
10431043
addUInt(Buffer, dwarf::DW_AT_calling_convention, dwarf::DW_FORM_data1,
10441044
CC);
10451045
}
1046+
1047+
if (auto *SpecifiedFrom = CTy->getSpecification())
1048+
addDIEEntry(Buffer, dwarf::DW_AT_specification,
1049+
*getOrCreateContextDIE(SpecifiedFrom));
1050+
10461051
break;
10471052
}
10481053
default:

llvm/lib/IR/AsmWriter.cpp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2235,6 +2235,8 @@ static void writeDICompositeType(raw_ostream &Out, const DICompositeType *N,
22352235
else
22362236
Printer.printMetadata("rank", N->getRawRank(), /*ShouldSkipNull */ true);
22372237
Printer.printMetadata("annotations", N->getRawAnnotations());
2238+
if (auto *Specification = N->getRawSpecification())
2239+
Printer.printMetadata("specification", Specification);
22382240
Out << ")";
22392241
}
22402242

llvm/lib/IR/DIBuilder.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -521,13 +521,13 @@ DICompositeType *DIBuilder::createStructType(
521521
DIScope *Context, StringRef Name, DIFile *File, unsigned LineNumber,
522522
uint64_t SizeInBits, uint32_t AlignInBits, DINode::DIFlags Flags,
523523
DIType *DerivedFrom, DINodeArray Elements, unsigned RunTimeLang,
524-
DIType *VTableHolder, StringRef UniqueIdentifier,
524+
DIType *VTableHolder, StringRef UniqueIdentifier, DIType *Specification,
525525
uint32_t NumExtraInhabitants) {
526526
auto *R = DICompositeType::get(
527527
VMContext, dwarf::DW_TAG_structure_type, Name, File, LineNumber,
528528
getNonCompileUnitScope(Context), DerivedFrom, SizeInBits, AlignInBits, 0,
529529
Flags, Elements, RunTimeLang, VTableHolder, nullptr, UniqueIdentifier,
530-
nullptr, nullptr, nullptr, nullptr, nullptr, nullptr,
530+
nullptr, nullptr, nullptr, nullptr, nullptr, nullptr, Specification,
531531
NumExtraInhabitants);
532532
trackIfUnresolved(R);
533533
return R;

llvm/lib/IR/DebugInfoMetadata.cpp

Lines changed: 22 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -770,21 +770,21 @@ DICompositeType *DICompositeType::getImpl(
770770
Metadata *Elements, unsigned RuntimeLang, Metadata *VTableHolder,
771771
Metadata *TemplateParams, MDString *Identifier, Metadata *Discriminator,
772772
Metadata *DataLocation, Metadata *Associated, Metadata *Allocated,
773-
Metadata *Rank, Metadata *Annotations, uint32_t NumExtraInhabitants,
774-
StorageType Storage, bool ShouldCreate) {
773+
Metadata *Rank, Metadata *Annotations, Metadata *Specification,
774+
uint32_t NumExtraInhabitants, StorageType Storage, bool ShouldCreate) {
775775
assert(isCanonical(Name) && "Expected canonical MDString");
776776

777777
// Keep this in sync with buildODRType.
778-
DEFINE_GETIMPL_LOOKUP(DICompositeType,
779-
(Tag, Name, File, Line, Scope, BaseType, SizeInBits,
780-
AlignInBits, OffsetInBits, Flags, Elements,
781-
RuntimeLang, VTableHolder, TemplateParams, Identifier,
782-
Discriminator, DataLocation, Associated, Allocated,
783-
Rank, Annotations, NumExtraInhabitants));
778+
DEFINE_GETIMPL_LOOKUP(
779+
DICompositeType,
780+
(Tag, Name, File, Line, Scope, BaseType, SizeInBits, AlignInBits,
781+
OffsetInBits, Flags, Elements, RuntimeLang, VTableHolder, TemplateParams,
782+
Identifier, Discriminator, DataLocation, Associated, Allocated, Rank,
783+
Annotations, Specification, NumExtraInhabitants));
784784
Metadata *Ops[] = {File, Scope, Name, BaseType,
785785
Elements, VTableHolder, TemplateParams, Identifier,
786786
Discriminator, DataLocation, Associated, Allocated,
787-
Rank, Annotations};
787+
Rank, Annotations, Specification};
788788
DEFINE_GETIMPL_STORE(DICompositeType,
789789
(Tag, Line, RuntimeLang, SizeInBits, AlignInBits,
790790
OffsetInBits, NumExtraInhabitants, Flags),
@@ -795,10 +795,11 @@ DICompositeType *DICompositeType::buildODRType(
795795
LLVMContext &Context, MDString &Identifier, unsigned Tag, MDString *Name,
796796
Metadata *File, unsigned Line, Metadata *Scope, Metadata *BaseType,
797797
uint64_t SizeInBits, uint32_t AlignInBits, uint64_t OffsetInBits,
798-
uint32_t NumExtraInhabitants, DIFlags Flags, Metadata *Elements,
799-
unsigned RuntimeLang, Metadata *VTableHolder, Metadata *TemplateParams,
800-
Metadata *Discriminator, Metadata *DataLocation, Metadata *Associated,
801-
Metadata *Allocated, Metadata *Rank, Metadata *Annotations) {
798+
Metadata *Specification, uint32_t NumExtraInhabitants, DIFlags Flags,
799+
Metadata *Elements, unsigned RuntimeLang, Metadata *VTableHolder,
800+
Metadata *TemplateParams, Metadata *Discriminator, Metadata *DataLocation,
801+
Metadata *Associated, Metadata *Allocated, Metadata *Rank,
802+
Metadata *Annotations) {
802803
assert(!Identifier.getString().empty() && "Expected valid identifier");
803804
if (!Context.isODRUniquingDebugTypes())
804805
return nullptr;
@@ -809,8 +810,7 @@ DICompositeType *DICompositeType::buildODRType(
809810
AlignInBits, OffsetInBits, Flags, Elements, RuntimeLang,
810811
VTableHolder, TemplateParams, &Identifier, Discriminator,
811812
DataLocation, Associated, Allocated, Rank, Annotations,
812-
NumExtraInhabitants);
813-
813+
Specification, NumExtraInhabitants);
814814
if (CT->getTag() != Tag)
815815
return nullptr;
816816

@@ -825,7 +825,7 @@ DICompositeType *DICompositeType::buildODRType(
825825
Metadata *Ops[] = {File, Scope, Name, BaseType,
826826
Elements, VTableHolder, TemplateParams, &Identifier,
827827
Discriminator, DataLocation, Associated, Allocated,
828-
Rank, Annotations};
828+
Rank, Annotations, Specification};
829829
assert((std::end(Ops) - std::begin(Ops)) == (int)CT->getNumOperands() &&
830830
"Mismatched number of operands");
831831
for (unsigned I = 0, E = CT->getNumOperands(); I != E; ++I)
@@ -838,10 +838,11 @@ DICompositeType *DICompositeType::getODRType(
838838
LLVMContext &Context, MDString &Identifier, unsigned Tag, MDString *Name,
839839
Metadata *File, unsigned Line, Metadata *Scope, Metadata *BaseType,
840840
uint64_t SizeInBits, uint32_t AlignInBits, uint64_t OffsetInBits,
841-
uint32_t NumExtraInhabitants, DIFlags Flags, Metadata *Elements,
842-
unsigned RuntimeLang, Metadata *VTableHolder, Metadata *TemplateParams,
843-
Metadata *Discriminator, Metadata *DataLocation, Metadata *Associated,
844-
Metadata *Allocated, Metadata *Rank, Metadata *Annotations) {
841+
Metadata *Specification, uint32_t NumExtraInhabitants, DIFlags Flags,
842+
Metadata *Elements, unsigned RuntimeLang, Metadata *VTableHolder,
843+
Metadata *TemplateParams, Metadata *Discriminator, Metadata *DataLocation,
844+
Metadata *Associated, Metadata *Allocated, Metadata *Rank,
845+
Metadata *Annotations) {
845846
assert(!Identifier.getString().empty() && "Expected valid identifier");
846847
if (!Context.isODRUniquingDebugTypes())
847848
return nullptr;
@@ -851,7 +852,7 @@ DICompositeType *DICompositeType::getODRType(
851852
Context, Tag, Name, File, Line, Scope, BaseType, SizeInBits,
852853
AlignInBits, OffsetInBits, Flags, Elements, RuntimeLang, VTableHolder,
853854
TemplateParams, &Identifier, Discriminator, DataLocation, Associated,
854-
Allocated, Rank, Annotations, NumExtraInhabitants);
855+
Allocated, Rank, Annotations, Specification, NumExtraInhabitants);
855856
} else {
856857
if (CT->getTag() != Tag)
857858
return nullptr;

0 commit comments

Comments
 (0)