diff options
Diffstat (limited to 'llvm/lib/Bitcode')
-rw-r--r-- | llvm/lib/Bitcode/Reader/MetadataLoader.cpp | 10 | ||||
-rw-r--r-- | llvm/lib/Bitcode/Writer/BitcodeWriter.cpp | 1 |
2 files changed, 8 insertions, 3 deletions
diff --git a/llvm/lib/Bitcode/Reader/MetadataLoader.cpp b/llvm/lib/Bitcode/Reader/MetadataLoader.cpp index 8493eb7..da6010e 100644 --- a/llvm/lib/Bitcode/Reader/MetadataLoader.cpp +++ b/llvm/lib/Bitcode/Reader/MetadataLoader.cpp @@ -1461,7 +1461,7 @@ Error MetadataLoader::MetadataLoaderImpl::parseOneMetadata( break; } case bitc::METADATA_COMPOSITE_TYPE: { - if (Record.size() < 16 || Record.size() > 21) + if (Record.size() < 16 || Record.size() > 22) return error("Invalid record"); // If we have a UUID and this is not a forward declaration, lookup the @@ -1489,6 +1489,7 @@ Error MetadataLoader::MetadataLoaderImpl::parseOneMetadata( Metadata *Associated = nullptr; Metadata *Allocated = nullptr; Metadata *Rank = nullptr; + Metadata *Annotations = nullptr; auto *Identifier = getMDString(Record[15]); // If this module is being parsed so that it can be ThinLTO imported // into another module, composite types only need to be imported @@ -1520,6 +1521,9 @@ Error MetadataLoader::MetadataLoaderImpl::parseOneMetadata( if (Record.size() > 20) { Rank = getMDOrNull(Record[20]); } + if (Record.size() > 21) { + Annotations = getMDOrNull(Record[21]); + } } DICompositeType *CT = nullptr; if (Identifier) @@ -1527,7 +1531,7 @@ Error MetadataLoader::MetadataLoaderImpl::parseOneMetadata( Context, *Identifier, Tag, Name, File, Line, Scope, BaseType, SizeInBits, AlignInBits, OffsetInBits, Flags, Elements, RuntimeLang, VTableHolder, TemplateParams, Discriminator, DataLocation, Associated, - Allocated, Rank); + Allocated, Rank, Annotations); // Create a node if we didn't get a lazy ODR type. if (!CT) @@ -1536,7 +1540,7 @@ Error MetadataLoader::MetadataLoaderImpl::parseOneMetadata( SizeInBits, AlignInBits, OffsetInBits, Flags, Elements, RuntimeLang, VTableHolder, TemplateParams, Identifier, Discriminator, DataLocation, Associated, - Allocated, Rank)); + Allocated, Rank, Annotations)); if (!IsNotUsedInTypeRef && Identifier) MetadataList.addTypeRef(*Identifier, *cast<DICompositeType>(CT)); diff --git a/llvm/lib/Bitcode/Writer/BitcodeWriter.cpp b/llvm/lib/Bitcode/Writer/BitcodeWriter.cpp index ed2c66e..c5d8c55 100644 --- a/llvm/lib/Bitcode/Writer/BitcodeWriter.cpp +++ b/llvm/lib/Bitcode/Writer/BitcodeWriter.cpp @@ -1714,6 +1714,7 @@ void ModuleBitcodeWriter::writeDICompositeType( Record.push_back(VE.getMetadataOrNullID(N->getRawAssociated())); Record.push_back(VE.getMetadataOrNullID(N->getRawAllocated())); Record.push_back(VE.getMetadataOrNullID(N->getRawRank())); + Record.push_back(VE.getMetadataOrNullID(N->getAnnotations().get())); Stream.EmitRecord(bitc::METADATA_COMPOSITE_TYPE, Record, Abbrev); Record.clear(); |