Skip to content

Commit d8c823e

Browse files
committed
Module trace: explicitly ignore the main module
I'm not sure why this wasn't already broken, but with the changes in the next commit the multifile module trace test fails complaining that it can't get a path for the main module. But we don't /need/ a path for the main module because it's not a dependency of itself.
1 parent 3fe9333 commit d8c823e

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

lib/FrontendTool/FrontendTool.cpp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -268,6 +268,8 @@ static bool emitLoadedModuleTraceIfNeeded(ModuleDecl *mainModule,
268268
for (auto &module : ctxt.LoadedModules) {
269269
ModuleDecl *loadedDecl = module.second;
270270
assert(loadedDecl && "Expected loaded module to be non-null.");
271+
if (loadedDecl == mainModule)
272+
continue;
271273
assert(!loadedDecl->getModuleFilename().empty()
272274
&& "Don't know how to handle modules with empty names.");
273275
pathToModuleDecl.insert(

0 commit comments

Comments
 (0)