Skip to content

Commit

Permalink
[clang][deps] Disable global module index
Browse files Browse the repository at this point in the history
While scanning dependencies of a TU that depends on a PCH, the scanner basically performs mixed implicit/explicit modular compilation. (Explicit modules come from the PCH.) This seems to trip up the global module index.

This patch disables global module index in the dependency scanner.

Reviewed By: Bigcheese

Differential Revision: https://reviews.llvm.org/D118890
  • Loading branch information
jansvoboda11 committed Feb 15, 2022
1 parent d8298f0 commit c6f8704
Showing 1 changed file with 3 additions and 0 deletions.
Expand Up @@ -177,6 +177,9 @@ class DependencyScanningAction : public tooling::ToolAction {
ScanInstance.getPreprocessorOpts().AllowPCHWithDifferentModulesCachePath =
true;

ScanInstance.getFrontendOpts().GenerateGlobalModuleIndex = false;
ScanInstance.getFrontendOpts().UseGlobalModuleIndex = false;

FileMgr->getFileSystemOpts().WorkingDir = std::string(WorkingDirectory);
ScanInstance.setFileManager(FileMgr);
ScanInstance.createSourceManager(*FileMgr);
Expand Down

0 comments on commit c6f8704

Please sign in to comment.