[clang] [clang][modules] HeaderSearch::MarkFileModuleHeader creates extra HeaderFileInfo, breaks PCM reuse (PR #89005)

Ian Anderson via cfe-commits cfe-commits at lists.llvm.org
Wed Apr 17 12:52:48 PDT 2024


================
@@ -84,7 +84,9 @@ struct HeaderFileInfo {
   LLVM_PREFERRED_TYPE(bool)
   unsigned isModuleHeader : 1;
 
-  /// Whether this header is a `textual header` in a module.
+  /// Whether this header is a `textual header` in a module. If a header is
+  /// textual in one module and normal in another module, this bit will not be
+  /// set, only `isModuleHeader`.
----------------
ian-twilightcoder wrote:

Maybe this behavior is weird? Maybe both bits should be set in this scenario? `HeaderSearch::ShouldEnterIncludeFile` -> `MaybeReenterImportedFile` could change its check to `!FileInfo. isModuleHeader && FileInfo.isTextualModuleHeader`

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


More information about the cfe-commits mailing list