diff options
author | Jan Svoboda <jan_svoboda@apple.com> | 2024-10-28 11:24:27 -0700 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-10-28 11:24:27 -0700 |
commit | da1a16ae10177494c7cae929bec987e90a160403 (patch) | |
tree | 1f7a954c5a3726604404b5dcd2b209b2133cac16 /clang/lib/Frontend/FrontendAction.cpp | |
parent | 19c0a74ad6baa9eb38dbe0a20af7c67999c41821 (diff) | |
download | llvm-da1a16ae10177494c7cae929bec987e90a160403.zip llvm-da1a16ae10177494c7cae929bec987e90a160403.tar.gz llvm-da1a16ae10177494c7cae929bec987e90a160403.tar.bz2 |
[clang][modules] Preserve the module map that allowed inferring (#113389)
With inferred modules, the dependency scanner takes care to replace the
fake "__inferred_module.map" path with the file that allowed the module
to be inferred. However, this only worked when such a module was
imported directly in the TU. Whenever such module got loaded
transitively, the scanner would fail to perform the replacement. This is
caused by the fact that PCM files are lossy and drop this information.
This patch makes sure that PCMs include this file for each submodule (in
the `SUBMODULE_DEFINITION` record), fixes one existing test with an
incorrect assertion, and does a little drive-by refactoring of
`ModuleMap`.
Diffstat (limited to 'clang/lib/Frontend/FrontendAction.cpp')
-rw-r--r-- | clang/lib/Frontend/FrontendAction.cpp | 1 |
1 files changed, 0 insertions, 1 deletions
diff --git a/clang/lib/Frontend/FrontendAction.cpp b/clang/lib/Frontend/FrontendAction.cpp index 8264bd70..9a50e745 100644 --- a/clang/lib/Frontend/FrontendAction.cpp +++ b/clang/lib/Frontend/FrontendAction.cpp @@ -534,7 +534,6 @@ static Module *prepareToBuildModule(CompilerInstance &CI, } if (*OriginalModuleMap != CI.getSourceManager().getFileEntryRefForID( CI.getSourceManager().getMainFileID())) { - M->IsInferred = true; auto FileCharacter = M->IsSystem ? SrcMgr::C_System_ModuleMap : SrcMgr::C_User_ModuleMap; FileID OriginalModuleMapFID = CI.getSourceManager().getOrCreateFileID( |