@@ -1138,21 +1138,20 @@ getActualCtorInitializerKind(uint8_t raw) {
1138
1138
return None;
1139
1139
}
1140
1140
1141
- // / Determine whether the two modules are re-exported to the same module.
1142
- static bool reExportedToSameModule ( const ModuleDecl *fromModule,
1143
- const ModuleDecl *toModule) {
1141
+ static bool isReExportedToModule ( const ValueDecl *value,
1142
+ const ModuleDecl *expectedModule) {
1143
+ const DeclContext *valueDC = value-> getDeclContext ();
1144
1144
auto fromClangModule
1145
- = dyn_cast<ClangModuleUnit>(fromModule-> getFiles (). front ());
1145
+ = dyn_cast<ClangModuleUnit>(valueDC-> getModuleScopeContext ());
1146
1146
if (!fromClangModule)
1147
1147
return false ;
1148
+ std::string exportedName = fromClangModule->getExportedModuleName ();
1148
1149
1149
1150
auto toClangModule
1150
- = dyn_cast<ClangModuleUnit>(toModule->getFiles ().front ());
1151
- if (!toClangModule)
1152
- return false ;
1153
-
1154
- return fromClangModule->getExportedModuleName () ==
1155
- toClangModule->getExportedModuleName ();
1151
+ = dyn_cast<ClangModuleUnit>(expectedModule->getFiles ().front ());
1152
+ if (toClangModule)
1153
+ return exportedName == toClangModule->getExportedModuleName ();
1154
+ return exportedName == expectedModule->getName ().str ();
1156
1155
}
1157
1156
1158
1157
// / Remove values from \p values that don't match the expected type or module.
@@ -1195,7 +1194,7 @@ static void filterValues(Type expectedTy, ModuleDecl *expectedModule,
1195
1194
// module to the original definition in a base module.
1196
1195
if (expectedModule && !value->hasClangNode () &&
1197
1196
value->getModuleContext () != expectedModule &&
1198
- !reExportedToSameModule (value-> getModuleContext () , expectedModule))
1197
+ !isReExportedToModule (value, expectedModule))
1199
1198
return true ;
1200
1199
1201
1200
// If we're expecting a member within a constrained extension with a
@@ -1349,6 +1348,7 @@ ModuleFile::resolveCrossReference(ModuleDecl *baseModule, uint32_t pathLen) {
1349
1348
if (entry.Kind != llvm::BitstreamEntry::Record)
1350
1349
return Identifier ();
1351
1350
1351
+ scratch.clear ();
1352
1352
unsigned recordID = DeclTypeCursor.readRecord (entry.ID , scratch,
1353
1353
&blobData);
1354
1354
switch (recordID) {
0 commit comments