================
@@ -1018,13 +1018,22 @@ bool FrontendAction::BeginSourceFile(CompilerInstance 
&CI,
     return true;
   }
 
-  // If the implicit PCH include is actually a directory, rather than
-  // a single file, search for a suitable PCH file in that directory.
   if (!CI.getPreprocessorOpts().ImplicitPCHInclude.empty()) {
     FileManager &FileMgr = CI.getFileManager();
     PreprocessorOptions &PPOpts = CI.getPreprocessorOpts();
+
+    // Canonicalize ImplicitPCHInclude. This way, all the downstream code,
+    // including the ASTWriter, will receive the absolute path to the included
+    // PCH. This way we can avoid reasoning about absolute path or relative
+    // paths later on during serialization.
+    SmallString<128> PCHIncludePath(PPOpts.ImplicitPCHInclude);
+    FileMgr.makeAbsolutePath(PCHIncludePath);
----------------
jansvoboda11 wrote:

IIRC there's some logic in `ASTWriter` to relativize paths. How does this 
interact with that?

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

Reply via email to