[PATCH] D118890: [clang][deps] Disable global module index

Jan Svoboda via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Thu Feb 3 04:45:56 PST 2022


jansvoboda11 created this revision.
Herald added a subscriber: arphaman.
jansvoboda11 requested review of this revision.
Herald added a project: clang.
Herald added a subscriber: cfe-commits.

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.

TODO: Provide a test case.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D118890

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


Index: clang/lib/Tooling/DependencyScanning/DependencyScanningWorker.cpp
===================================================================
--- clang/lib/Tooling/DependencyScanning/DependencyScanningWorker.cpp
+++ clang/lib/Tooling/DependencyScanning/DependencyScanningWorker.cpp
@@ -177,6 +177,9 @@
     ScanInstance.getPreprocessorOpts().AllowPCHWithDifferentModulesCachePath =
         true;
 
+    ScanInstance.getFrontendOpts().GenerateGlobalModuleIndex = false;
+    ScanInstance.getFrontendOpts().UseGlobalModuleIndex = false;
+
     FileMgr->getFileSystemOpts().WorkingDir = std::string(WorkingDirectory);
     ScanInstance.setFileManager(FileMgr);
     ScanInstance.createSourceManager(*FileMgr);


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D118890.405582.patch
Type: text/x-patch
Size: 707 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20220203/a21ede75/attachment.bin>


More information about the cfe-commits mailing list