[clang] [clang][modules] Preserve the module map that allowed inferring (PR #113389)

Jan Svoboda via cfe-commits cfe-commits at lists.llvm.org
Mon Oct 28 11:24:27 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();
----------------
jansvoboda11 wrote:

I don't want to make it that long, since I'd need to wrap the entire `Record` initializer list and cause downstream merge conflict. In the end, I renamed `InferredFID` to `UnadjustedInferredFID` and `Inferred` to `InferredFID`.

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


More information about the cfe-commits mailing list