================
@@ -1488,6 +1488,18 @@ static bool compileModuleImpl(CompilerInstance 
&ImportingInstance,
     ImportingInstance.getModuleCache().updateModuleTimestamp(ModuleFileName);
   }
 
+  // This isn't strictly necessary, but it's more efficient to extract the AST
+  // file (which may be wrapped in an object file) now rather than doing so
+  // repeatedly in the readers.
+  const PCHContainerReader &Rdr = ImportingInstance.getPCHContainerReader();
+  StringRef ExtractedBuffer = Rdr.ExtractPCH(*Buffer);
----------------
cyndyishida wrote:

A patch to find/replace `PCHContainerReader` with e.g. `ASTFileContainerReader` 
and `ExtractPCH` to `ExtractASTFile`. It's yet another place where the code 
reads in a different way than what it is actually doing. For example, it took 
me a little longer to reason about the relationship of the `ModuleFileName` and 
`Buffer` in this diff because it wasn't obvious that `ExtractPCH` isn't 
strictly for PCHs. The interaction between `ExtractPCH` & `addBuiltPCM` also 
takes some more work to reason about. 

https://github.com/llvm/llvm-project/pull/190062
_______________________________________________
cfe-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to