File tree Expand file tree Collapse file tree 1 file changed +8
-6
lines changed Expand file tree Collapse file tree 1 file changed +8
-6
lines changed Original file line number Diff line number Diff line change @@ -196,18 +196,20 @@ void SerializedModuleLoaderBase::collectVisibleTopLevelModuleNamesImpl(
196
196
bool requireTargetSpecificModule = Ctx.LangOpts .Target .isOSDarwin ();
197
197
forEachDirectoryEntryPath (searchPath, [&](StringRef path) {
198
198
auto pathExt = llvm::sys::path::extension (path);
199
- if (requireTargetSpecificModule) {
200
- if (pathExt != moduleSuffix)
201
- return ;
202
- if (!checkTargetFiles (path))
199
+
200
+ if (pathExt != moduleSuffix)
201
+ if (requireTargetSpecificModule || pathExt != suffix)
203
202
return ;
204
- } else {
205
- if (suffix != pathExt)
203
+
204
+ if (!checkTargetFiles (path)) {
205
+ if (requireTargetSpecificModule)
206
206
return ;
207
+
207
208
auto stat = fs.status (path);
208
209
if (!stat || stat->isDirectory ())
209
210
return ;
210
211
}
212
+
211
213
// Extract module name.
212
214
auto name = llvm::sys::path::filename (path).drop_back (pathExt.size ());
213
215
names.push_back (Ctx.getIdentifier (name));
You can’t perform that action at this time.
0 commit comments