[clang] [llvm] [ThinLTO] Apply -vfsoverlay to distributed backend inputs (PR #236610)

Anton Yartsev via cfe-commits cfe-commits at lists.llvm.org
Wed Nov 25 15:10:40 PST 2026


================
@@ -1610,6 +1610,22 @@ Compilation *Driver::BuildCompilation(ArrayRef<const char *> ArgList) {
     if (VFS->setCurrentWorkingDirectory(WD->getValue()))
       Diag(diag::err_drv_unable_to_set_working_directory) << WD->getValue();
 
+  // Apply VFS overlays so the driver sees the same files as -cc1.
+  for (const Arg *A :
+       Args.filtered(options::OPT_ivfsoverlay, options::OPT_vfsoverlay)) {
+    StringRef File = A->getValue();
+    llvm::ErrorOr<std::unique_ptr<llvm::MemoryBuffer>> Buffer =
+        VFS->getBufferForFile(File);
+    if (!Buffer)
+      continue;
----------------
ayartsev7 wrote:

Done in 9c6b7a7. Rather than duplicating the diagnostics, the driver now calls `createVFSFromOverlayFiles` directly (clangDriver already depends on clangFrontend) so a missing or invalid overlay gets the same diagnostics as in `-cc1`. Does this look OK?

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


More information about the cfe-commits mailing list