[clang] [clang][modules] Non-modular #import Should Respect Submodule Visibility (PR #170215)

Qiongsi Wu via cfe-commits cfe-commits at lists.llvm.org
Mon Apr 27 15:53:28 PDT 2026


================
@@ -1376,6 +1376,8 @@ void Preprocessor::makeModuleVisible(Module *M, SourceLocation Loc,
             << Message;
       });
 
+  CurSubmoduleState->IncludedFiles.insert_range(M->Includes);
----------------
qiongsiwu wrote:

This code is no longer needed. https://github.com/llvm/llvm-project/pull/170215/changes#diff-d80edc2f8b14e8ad634b54bc14c780e34a3d7c716b8b9811d1f831135b470f5eR1591 covers the case. When we load header info, we are already aware of the visibility of the submodules - I am not sure if this may change if we lazily load the submodules though. 

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


More information about the cfe-commits mailing list