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

via cfe-commits cfe-commits at lists.llvm.org
Tue Mar 3 19:49:16 PST 2026


Author: Jan Svoboda
Date: 2026-03-03T19:49:12-08:00
New Revision: a6bbe463ce67c52dc120f5ea4c9f1a94e1d4988c

URL: https://github.com/llvm/llvm-project/commit/a6bbe463ce67c52dc120f5ea4c9f1a94e1d4988c
DIFF: https://github.com/llvm/llvm-project/commit/a6bbe463ce67c52dc120f5ea4c9f1a94e1d4988c.diff

LOG: [clang][CIR] Pass VFS to command-line parsing (#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.

Added: 
    

Modified: 
    clang/lib/FrontendTool/ExecuteCompilerInvocation.cpp

Removed: 
    


################################################################################
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