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(
196196 bool requireTargetSpecificModule = Ctx.LangOpts .Target .isOSDarwin ();
197197 forEachDirectoryEntryPath (searchPath, [&](StringRef path) {
198198 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)
203202 return ;
204- } else {
205- if (suffix != pathExt)
203+
204+ if (!checkTargetFiles (path)) {
205+ if (requireTargetSpecificModule)
206206 return ;
207+
207208 auto stat = fs.status (path);
208209 if (!stat || stat->isDirectory ())
209210 return ;
210211 }
212+
211213 // Extract module name.
212214 auto name = llvm::sys::path::filename (path).drop_back (pathExt.size ());
213215 names.push_back (Ctx.getIdentifier (name));
You can’t perform that action at this time.
0 commit comments