Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 10 additions & 5 deletions lib/FrontendTool/FrontendTool.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -419,11 +419,16 @@ static bool emitLoadedModuleTraceIfNeeded(ModuleDecl *mainModule,
llvm::report_fatal_error("Expected loaded modules to be non-null.");
if (loadedDecl == mainModule)
continue;
if (loadedDecl->getModuleFilename().empty())
llvm::report_fatal_error(
"Don't know how to handle modules with empty names."
" One potential reason for getting an empty module name might"
" be that the module could not be deserialized correctly.");
if (loadedDecl->getModuleFilename().empty()) {
// FIXME: rdar://problem/59853077
// Ideally, this shouldn't happen. As a temporary workaround, avoid
// crashing with a message while we investigate the problem.
llvm::errs() << "WARNING: Module '" << loadedDecl->getName().str()
<< "' has an empty filename. This is probably an "
<< "invariant violation.\n"
<< "Please report it as a compiler bug.\n";
continue;
}
pathToModuleDecl.insert(
std::make_pair(loadedDecl->getModuleFilename(), loadedDecl));
}
Expand Down