@@ -833,12 +833,12 @@ ArrayRef<clang::ObjCCategoryDecl *> SwiftLookupTable::categories() {
833
833
834
834
// Map categories known to the reader.
835
835
for (auto declID : Reader->categories ()) {
836
- auto category =
837
- cast_or_null<clang::ObjCCategoryDecl>(
838
- Reader->getASTReader ().GetLocalDecl (Reader->getModuleFile (), declID));
836
+ auto localID = clang::LocalDeclID::get (Reader->getASTReader (),
837
+ Reader->getModuleFile (), declID);
838
+ auto category = cast_or_null<clang::ObjCCategoryDecl>(
839
+ Reader->getASTReader ().GetLocalDecl (Reader->getModuleFile (), localID));
839
840
if (category)
840
841
Categories.push_back (category);
841
-
842
842
}
843
843
844
844
return Categories;
@@ -930,8 +930,8 @@ static void printStoredContext(SwiftLookupTable::StoredContext context,
930
930
}
931
931
}
932
932
933
- static uint32_t getEncodedDeclID (uint64_t entry) {
934
- assert (SwiftLookupTable::isSerializationIDEntry (entry));
933
+ static uint64_t getEncodedDeclID (uint64_t entry) {
934
+ assert (SwiftLookupTable::isSerializationIDEntry (entry));
935
935
assert (SwiftLookupTable::isDeclEntry (entry));
936
936
return entry >> 2 ;
937
937
}
@@ -1190,7 +1190,7 @@ namespace {
1190
1190
uint64_t id;
1191
1191
auto mappedEntry = Table.mapStored (entry, isModule);
1192
1192
if (auto *decl = mappedEntry.dyn_cast <clang::NamedDecl *>()) {
1193
- id = (Writer.getDeclID (decl) << 2 ) | 0x02 ;
1193
+ id = (Writer.getDeclID (decl). getRawValue () << 2 ) | 0x02 ;
1194
1194
} else if (auto *macro = mappedEntry.dyn_cast <clang::MacroInfo *>()) {
1195
1195
id = static_cast <uint64_t >(Writer.getMacroID (macro)) << 32 ;
1196
1196
id |= 0x02 | 0x01 ;
@@ -1272,7 +1272,7 @@ namespace {
1272
1272
uint64_t id;
1273
1273
auto mappedEntry = Table.mapStored (entry, isModule);
1274
1274
if (auto *decl = mappedEntry.dyn_cast <clang::NamedDecl *>()) {
1275
- id = (Writer.getDeclID (decl) << 2 ) | 0x02 ;
1275
+ id = (Writer.getDeclID (decl). getRawValue () << 2 ) | 0x02 ;
1276
1276
} else if (auto *macro = mappedEntry.dyn_cast <clang::MacroInfo *>()) {
1277
1277
id = static_cast <uint64_t >(Writer.getMacroID (macro)) << 32 ;
1278
1278
id |= 0x02 | 0x01 ;
@@ -1332,7 +1332,7 @@ void SwiftLookupTableWriter::writeExtensionContents(
1332
1332
if (!table.Categories .empty ()) {
1333
1333
SmallVector<clang::serialization::DeclID, 4 > categoryIDs;
1334
1334
for (auto category : table.Categories ) {
1335
- categoryIDs.push_back (Writer.getDeclID (category));
1335
+ categoryIDs.push_back (Writer.getDeclID (category). getRawValue () );
1336
1336
}
1337
1337
1338
1338
StringRef blob (reinterpret_cast <const char *>(categoryIDs.data ()),
@@ -1555,10 +1555,11 @@ clang::NamedDecl *SwiftLookupTable::mapStoredDecl(uint64_t &entry) {
1555
1555
1556
1556
// Otherwise, resolve the declaration.
1557
1557
assert (Reader && " Cannot resolve the declaration without a reader" );
1558
- uint32_t declID = getEncodedDeclID (entry);
1558
+ auto declID = getEncodedDeclID (entry);
1559
+ auto localID = clang::LocalDeclID::get (Reader->getASTReader (),
1560
+ Reader->getModuleFile (), declID);
1559
1561
auto decl = cast_or_null<clang::NamedDecl>(
1560
- Reader->getASTReader ().GetLocalDecl (Reader->getModuleFile (),
1561
- declID));
1562
+ Reader->getASTReader ().GetLocalDecl (Reader->getModuleFile (), localID));
1562
1563
1563
1564
// Update the entry now that we've resolved the declaration.
1564
1565
entry = encodeEntry (decl);
0 commit comments