[clang] [clang][CIR] Pass VFS to command-line parsing (PR #184226)
via cfe-commits
cfe-commits at lists.llvm.org
Mon Mar 2 12:56:31 PST 2026
llvmbot wrote:
<!--LLVM PR SUMMARY COMMENT-->
@llvm/pr-subscribers-clang
Author: Jan Svoboda (jansvoboda11)
<details>
<summary>Changes</summary>
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.
---
Full diff: https://github.com/llvm/llvm-project/pull/184226.diff
1 Files Affected:
- (modified) clang/lib/FrontendTool/ExecuteCompilerInvocation.cpp (+3-1)
``````````diff
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
``````````
</details>
https://github.com/llvm/llvm-project/pull/184226
More information about the cfe-commits
mailing list