[clang] [clang-repl] Handle frontend options for clang-repl before calling executeAction (PR #132670)
via cfe-commits
cfe-commits at lists.llvm.org
Sun Mar 23 21:57:35 PDT 2025
github-actions[bot] wrote:
<!--LLVM CODE FORMAT COMMENT: {clang-format}-->
:warning: C/C++ code formatter, clang-format found issues in your code. :warning:
<details>
<summary>
You can test this locally with the following command:
</summary>
``````````bash
git-clang-format --diff 1019457891fda0b2f32f50ba99d6a261df12ec08 6545414a97b6458333f399c7252ae55c88a42d62 --extensions cpp -- clang/lib/Interpreter/Interpreter.cpp
``````````
</details>
<details>
<summary>
View the diff from clang-format here.
</summary>
``````````diff
diff --git a/clang/lib/Interpreter/Interpreter.cpp b/clang/lib/Interpreter/Interpreter.cpp
index 5f48117dbf..3fbfd3c746 100644
--- a/clang/lib/Interpreter/Interpreter.cpp
+++ b/clang/lib/Interpreter/Interpreter.cpp
@@ -155,17 +155,19 @@ static llvm::Error HandleFrontendOptions(const CompilerInstance &CI) {
if (FrontendOpts.ShowVersion) {
llvm::cl::PrintVersionMessage();
- return llvm::createStringError(llvm::errc::not_supported, "Version displayed");
+ return llvm::createStringError(llvm::errc::not_supported,
+ "Version displayed");
}
if (!FrontendOpts.LLVMArgs.empty()) {
unsigned NumArgs = FrontendOpts.LLVMArgs.size();
- auto Args = std::make_unique<const char*[]>(NumArgs + 2);
+ auto Args = std::make_unique<const char *[]>(NumArgs + 2);
Args[0] = "clang-repl (LLVM option parsing)";
for (unsigned i = 0; i != NumArgs; ++i)
Args[i + 1] = FrontendOpts.LLVMArgs[i].c_str();
Args[NumArgs + 1] = nullptr;
- llvm::errs() << "Parsing LLVM backend options via cl::ParseCommandLineOptions...\n";
+ llvm::errs()
+ << "Parsing LLVM backend options via cl::ParseCommandLineOptions...\n";
llvm::cl::ParseCommandLineOptions(NumArgs + 1, Args.get());
}
``````````
</details>
https://github.com/llvm/llvm-project/pull/132670
More information about the cfe-commits
mailing list