[clang] c6f8704 - [clang][deps] Disable global module index

Jan Svoboda via cfe-commits cfe-commits at lists.llvm.org
Tue Feb 15 00:51:51 PST 2022


Author: Jan Svoboda
Date: 2022-02-15T09:51:23+01:00
New Revision: c6f8704053ba364cf8cc9a0a966617efeda079f7

URL: https://github.com/llvm/llvm-project/commit/c6f8704053ba364cf8cc9a0a966617efeda079f7
DIFF: https://github.com/llvm/llvm-project/commit/c6f8704053ba364cf8cc9a0a966617efeda079f7.diff

LOG: [clang][deps] Disable global module index

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

Added: 
    

Modified: 
    clang/lib/Tooling/DependencyScanning/DependencyScanningWorker.cpp

Removed: 
    


################################################################################
diff  --git a/clang/lib/Tooling/DependencyScanning/DependencyScanningWorker.cpp b/clang/lib/Tooling/DependencyScanning/DependencyScanningWorker.cpp
index 70bb6c5caf87..9ae89e87c782 100644
--- a/clang/lib/Tooling/DependencyScanning/DependencyScanningWorker.cpp
+++ b/clang/lib/Tooling/DependencyScanning/DependencyScanningWorker.cpp
@@ -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);


        


More information about the cfe-commits mailing list