[clang] [clang][modules] Allow module maps with textual headers to be non-affecting (PR #89441)

Sam McCall via cfe-commits cfe-commits at lists.llvm.org
Tue Apr 23 12:27:27 PDT 2024


================
@@ -187,7 +187,8 @@ GetAffectingModuleMaps(const Preprocessor &PP, Module *RootModule) {
       continue;
 
     const HeaderFileInfo *HFI = HS.getExistingLocalFileInfo(*File);
-    if (!HFI || (HFI->isModuleHeader && !HFI->isCompilingModuleHeader))
+    if (!HFI || (HFI->isModuleHeader && !HFI->isCompilingModuleHeader) ||
+        (HFI->isTextualModuleHeader && !PP.alreadyIncluded(*File)))
----------------
sam-mccall wrote:

That makes sense, I don't have any intuition for whether it's necessary or not.

Shortcutting this analysis seems like a useful change of possible, but I think restoring the previous behavior is a helpful starting point.

https://github.com/llvm/llvm-project/pull/89441


More information about the cfe-commits mailing list