[clang] [clang][modules] Only modulemaps of included textual headers are affecting (PR #89729)

Sam McCall via cfe-commits cfe-commits at lists.llvm.org
Tue Apr 23 11:52:44 PDT 2024


================
@@ -1441,6 +1441,10 @@ void HeaderSearch::MarkFileModuleHeader(FileEntryRef FE,
   HFI.isCompilingModuleHeader |= isCompilingModuleHeader;
 }
 
+void HeaderSearch::EnteredTextualFile(FileEntryRef File) {
+  getFileInfo(File).isCompilingModuleHeader = true;
----------------
sam-mccall wrote:

Oops, I meant to alter that description in this patch, it seems that change got lost.

At this point, `isCompilingModuleHeader` is used only for this "is affecting" check, and for a heuristic related to translating `#include` into `#import`. The latter only cares about modular headers, so it seems reasonable to change the semantics for textual headers to something more useful. (But I do need to be careful we're only setting this for textual modular headers).

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


More information about the cfe-commits mailing list