Skip to content

Commit

Permalink
Revert "[lldb] Fix po alias by printing fix-its to the console. (#6…
Browse files Browse the repository at this point in the history
…8452)"

This reverts commit 606f89a while investigating bot failures.
  • Loading branch information
adrian-prantl committed Oct 10, 2023
1 parent 606f89a commit 2e59b75
Show file tree
Hide file tree
Showing 8 changed files with 6 additions and 81 deletions.
15 changes: 2 additions & 13 deletions lldb/source/Commands/CommandObjectDWIMPrint.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -172,19 +172,8 @@ bool CommandObjectDWIMPrint::DoExecute(StringRef command,
{
auto *exe_scope = m_exe_ctx.GetBestExecutionContextScope();
ValueObjectSP valobj_sp;
std::string fixed_expression;

ExpressionResults expr_result = target.EvaluateExpression(
expr, exe_scope, valobj_sp, eval_options, &fixed_expression);

// Only mention Fix-Its if the expression evaluator applied them.
// Compiler errors refer to the final expression after applying Fix-It(s).
if (!fixed_expression.empty() && target.GetEnableNotifyAboutFixIts()) {
Stream &error_stream = result.GetErrorStream();
error_stream << " Evaluated this expression after applying Fix-It(s):\n";
error_stream << " " << fixed_expression << "\n";
}

ExpressionResults expr_result =
target.EvaluateExpression(expr, exe_scope, valobj_sp, eval_options);
if (expr_result == eExpressionCompleted) {
if (verbosity != eDWIMPrintVerbosityNone) {
StringRef flags;
Expand Down
8 changes: 4 additions & 4 deletions lldb/source/Commands/CommandObjectExpression.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -439,11 +439,11 @@ bool CommandObjectExpression::EvaluateExpression(llvm::StringRef expr,
ExpressionResults success = target.EvaluateExpression(
expr, frame, result_valobj_sp, eval_options, &m_fixed_expression);

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

if (result_valobj_sp) {
Expand Down
3 changes: 0 additions & 3 deletions lldb/test/API/lang/cpp/dwim-print-fixit/Makefile

This file was deleted.

24 changes: 0 additions & 24 deletions lldb/test/API/lang/cpp/dwim-print-fixit/TestCppDWIMPrintFixIt.py

This file was deleted.

5 changes: 0 additions & 5 deletions lldb/test/API/lang/cpp/dwim-print-fixit/main.cpp

This file was deleted.

3 changes: 0 additions & 3 deletions lldb/test/API/lang/cpp/expression-fixit/Makefile

This file was deleted.

24 changes: 0 additions & 24 deletions lldb/test/API/lang/cpp/expression-fixit/TestCppExpressionFixIt.py

This file was deleted.

5 changes: 0 additions & 5 deletions lldb/test/API/lang/cpp/expression-fixit/main.cpp

This file was deleted.

0 comments on commit 2e59b75

Please sign in to comment.