[clang] [clang][CIR] Pass VFS to command-line parsing (PR #184226)

Jan Svoboda via cfe-commits cfe-commits at lists.llvm.org
Mon Mar 2 12:55:53 PST 2026


https://github.com/jansvoboda11 created https://github.com/llvm/llvm-project/pull/184226

This explicitly passes Clang's VFS to MLIR command-line parsing that runs when ClangIR is enabled. This matches the rest of Clang and fixes a sandbox violation.

>From 330211acb2ceb93d92565a5acee4bc7cd8212de5 Mon Sep 17 00:00:00 2001
From: Jan Svoboda <jan_svoboda at apple.com>
Date: Mon, 2 Mar 2026 12:51:34 -0800
Subject: [PATCH] [clang][CIR] Pass VFS to command-line parsing

---
 clang/lib/FrontendTool/ExecuteCompilerInvocation.cpp | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/clang/lib/FrontendTool/ExecuteCompilerInvocation.cpp b/clang/lib/FrontendTool/ExecuteCompilerInvocation.cpp
index 05f646b43e3c4..c8ad63bc989a4 100644
--- a/clang/lib/FrontendTool/ExecuteCompilerInvocation.cpp
+++ b/clang/lib/FrontendTool/ExecuteCompilerInvocation.cpp
@@ -293,7 +293,9 @@ bool ExecuteCompilerInvocation(CompilerInstance *Clang) {
     for (unsigned i = 0; i != NumArgs; ++i)
       Args[i + 1] = Clang->getFrontendOpts().MLIRArgs[i].c_str();
     Args[NumArgs + 1] = nullptr;
-    llvm::cl::ParseCommandLineOptions(NumArgs + 1, Args.get());
+    llvm::cl::ParseCommandLineOptions(NumArgs + 1, Args.get(),
+                                      /*Description=*/"", /*Errs=*/nullptr,
+                                      &Clang->getVirtualFileSystem());
   }
 #endif
 



More information about the cfe-commits mailing list