[Lldb-commits] [lldb] [lldb] Fix `po` alias by printing fix-its to the console. (PR #68452)
via lldb-commits
lldb-commits at lists.llvm.org
Fri Oct 6 14:30:49 PDT 2023
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 daca97216cf132d733513f992d49e3c722aabf40 1d0ac08d38a33ae70687f7b125367c39fbcf92f3 -- lldb/test/API/lang/cpp/dwim-print-fixit/main.cpp lldb/test/API/lang/cpp/expression-fixit/main.cpp lldb/source/Commands/CommandObjectDWIMPrint.cpp lldb/source/Commands/CommandObjectDWIMPrint.h lldb/source/Commands/CommandObjectExpression.cpp lldb/source/Commands/CommandObjectExpression.h
``````````
</details>
<details>
<summary>
View the diff from clang-format here.
</summary>
``````````diff
diff --git a/lldb/source/Commands/CommandObjectDWIMPrint.cpp b/lldb/source/Commands/CommandObjectDWIMPrint.cpp
index 8a5be3e1cd1c..1f07cdf4c8a1 100644
--- a/lldb/source/Commands/CommandObjectDWIMPrint.cpp
+++ b/lldb/source/Commands/CommandObjectDWIMPrint.cpp
@@ -172,15 +172,17 @@ bool CommandObjectDWIMPrint::DoExecute(StringRef command,
{
auto *exe_scope = m_exe_ctx.GetBestExecutionContextScope();
ValueObjectSP valobj_sp;
- ExpressionResults expr_result =
- target.EvaluateExpression(expr, exe_scope, valobj_sp, eval_options, &m_fixed_expression);
-
+ ExpressionResults expr_result = target.EvaluateExpression(
+ expr, exe_scope, valobj_sp, eval_options, &m_fixed_expression);
+
// Only mention Fix-Its if the command applies them.
- // The compiler errors can address any parsing issues after applying Fix-It(s).
+ // The compiler errors can address any parsing issues after applying
+ // Fix-It(s).
if (!m_fixed_expression.empty() && target.GetEnableNotifyAboutFixIts()) {
Stream &error_stream = result.GetErrorStream();
- error_stream.Printf(" Applying Fix-It to expression, changing it to:\n %s\n",
- m_fixed_expression.c_str());
+ error_stream.Printf(
+ " Applying Fix-It to expression, changing it to:\n %s\n",
+ m_fixed_expression.c_str());
}
if (expr_result == eExpressionCompleted) {
diff --git a/lldb/source/Commands/CommandObjectExpression.cpp b/lldb/source/Commands/CommandObjectExpression.cpp
index 82283d0fe6a0..72617f9a8bf7 100644
--- a/lldb/source/Commands/CommandObjectExpression.cpp
+++ b/lldb/source/Commands/CommandObjectExpression.cpp
@@ -440,10 +440,12 @@ bool CommandObjectExpression::EvaluateExpression(llvm::StringRef expr,
expr, frame, result_valobj_sp, eval_options, &m_fixed_expression);
// Only mention Fix-Its if the command applies them.
- // The compiler errors can address any parsing issues after applying Fix-It(s).
+ // The compiler errors can address any parsing issues after applying
+ // Fix-It(s).
if (!m_fixed_expression.empty() && target.GetEnableNotifyAboutFixIts()) {
- error_stream.Printf(" Applying Fix-It to expression, changing it to:\n %s\n",
- m_fixed_expression.c_str());
+ error_stream.Printf(
+ " Applying Fix-It to expression, changing it to:\n %s\n",
+ m_fixed_expression.c_str());
}
if (result_valobj_sp) {
diff --git a/lldb/test/API/lang/cpp/dwim-print-fixit/main.cpp b/lldb/test/API/lang/cpp/dwim-print-fixit/main.cpp
index 3ead9e4957a6..e9cf11d18a65 100644
--- a/lldb/test/API/lang/cpp/dwim-print-fixit/main.cpp
+++ b/lldb/test/API/lang/cpp/dwim-print-fixit/main.cpp
@@ -1,5 +1,4 @@
-int main()
-{
+int main() {
long foo = 1234;
return 0; // break here
diff --git a/lldb/test/API/lang/cpp/expression-fixit/main.cpp b/lldb/test/API/lang/cpp/expression-fixit/main.cpp
index 3ead9e4957a6..e9cf11d18a65 100644
--- a/lldb/test/API/lang/cpp/expression-fixit/main.cpp
+++ b/lldb/test/API/lang/cpp/expression-fixit/main.cpp
@@ -1,5 +1,4 @@
-int main()
-{
+int main() {
long foo = 1234;
return 0; // break here
``````````
</details>
https://github.com/llvm/llvm-project/pull/68452
More information about the lldb-commits
mailing list