Skip to content

Commit 2e59b75

Browse files
committed
Revert "[lldb] Fix po alias by printing fix-its to the console. (#68452)"
This reverts commit 606f89a while investigating bot failures.
1 parent 606f89a commit 2e59b75

File tree

8 files changed

+6
-81
lines changed

8 files changed

+6
-81
lines changed

lldb/source/Commands/CommandObjectDWIMPrint.cpp

Lines changed: 2 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -172,19 +172,8 @@ bool CommandObjectDWIMPrint::DoExecute(StringRef command,
172172
{
173173
auto *exe_scope = m_exe_ctx.GetBestExecutionContextScope();
174174
ValueObjectSP valobj_sp;
175-
std::string fixed_expression;
176-
177-
ExpressionResults expr_result = target.EvaluateExpression(
178-
expr, exe_scope, valobj_sp, eval_options, &fixed_expression);
179-
180-
// Only mention Fix-Its if the expression evaluator applied them.
181-
// Compiler errors refer to the final expression after applying Fix-It(s).
182-
if (!fixed_expression.empty() && target.GetEnableNotifyAboutFixIts()) {
183-
Stream &error_stream = result.GetErrorStream();
184-
error_stream << " Evaluated this expression after applying Fix-It(s):\n";
185-
error_stream << " " << fixed_expression << "\n";
186-
}
187-
175+
ExpressionResults expr_result =
176+
target.EvaluateExpression(expr, exe_scope, valobj_sp, eval_options);
188177
if (expr_result == eExpressionCompleted) {
189178
if (verbosity != eDWIMPrintVerbosityNone) {
190179
StringRef flags;

lldb/source/Commands/CommandObjectExpression.cpp

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -439,11 +439,11 @@ bool CommandObjectExpression::EvaluateExpression(llvm::StringRef expr,
439439
ExpressionResults success = target.EvaluateExpression(
440440
expr, frame, result_valobj_sp, eval_options, &m_fixed_expression);
441441

442-
// Only mention Fix-Its if the expression evaluator applied them.
443-
// Compiler errors refer to the final expression after applying Fix-It(s).
442+
// We only tell you about the FixIt if we applied it. The compiler errors
443+
// will suggest the FixIt if it parsed.
444444
if (!m_fixed_expression.empty() && target.GetEnableNotifyAboutFixIts()) {
445-
error_stream << " Evaluated this expression after applying Fix-It(s):\n";
446-
error_stream << " " << m_fixed_expression << "\n";
445+
error_stream.Printf(" Fix-it applied, fixed expression was: \n %s\n",
446+
m_fixed_expression.c_str());
447447
}
448448

449449
if (result_valobj_sp) {

lldb/test/API/lang/cpp/dwim-print-fixit/Makefile

Lines changed: 0 additions & 3 deletions
This file was deleted.

lldb/test/API/lang/cpp/dwim-print-fixit/TestCppDWIMPrintFixIt.py

Lines changed: 0 additions & 24 deletions
This file was deleted.

lldb/test/API/lang/cpp/dwim-print-fixit/main.cpp

Lines changed: 0 additions & 5 deletions
This file was deleted.

lldb/test/API/lang/cpp/expression-fixit/Makefile

Lines changed: 0 additions & 3 deletions
This file was deleted.

lldb/test/API/lang/cpp/expression-fixit/TestCppExpressionFixIt.py

Lines changed: 0 additions & 24 deletions
This file was deleted.

lldb/test/API/lang/cpp/expression-fixit/main.cpp

Lines changed: 0 additions & 5 deletions
This file was deleted.

0 commit comments

Comments
 (0)