[clang] [clang][modules] Preserve the module map that allowed inferring (PR #113389)
Ben Langmuir via cfe-commits
cfe-commits at lists.llvm.org
Mon Oct 28 10:40:47 PDT 2024
================
@@ -3018,13 +3019,19 @@ void ASTWriter::WriteSubmodules(Module *WritingModule) {
SourceLocationEncoding::RawLocEncoding DefinitionLoc =
getRawSourceLocationEncoding(getAdjustedLocation(Mod->DefinitionLoc));
+ ModuleMap &ModMap = PP->getHeaderSearchInfo().getModuleMap();
+ FileID InferredFID =
+ Mod->IsInferred ? ModMap.getModuleMapFileIDForUniquing(Mod) : FileID();
+ int Inferred = getAdjustedFileID(InferredFID).getOpaqueValue();
----------------
benlangmuir wrote:
Nit: I would name this something less generic like "InferredAdjustedFID"
https://github.com/llvm/llvm-project/pull/113389
More information about the cfe-commits
mailing list