[Lldb-commits] [lldb] 50f7153 - Revert "[lldb][NFC] Refactor Fix-It filter for warnings"
Davide Italiano via lldb-commits
lldb-commits at lists.llvm.org
Mon Mar 30 14:12:24 PDT 2020
Author: Davide Italiano
Date: 2020-03-30T14:12:11-07:00
New Revision: 50f7153ddb6e6dabcac6d16c8c908f1708f60d01
URL: https://github.com/llvm/llvm-project/commit/50f7153ddb6e6dabcac6d16c8c908f1708f60d01
DIFF: https://github.com/llvm/llvm-project/commit/50f7153ddb6e6dabcac6d16c8c908f1708f60d01.diff
LOG: Revert "[lldb][NFC] Refactor Fix-It filter for warnings"
This reverts commit 11a5caee2aeae2546213366e7fc54095bb8163b9 as
it broke the bots.
Added:
Modified:
lldb/source/Plugins/ExpressionParser/Clang/ClangExpressionParser.cpp
Removed:
################################################################################
diff --git a/lldb/source/Plugins/ExpressionParser/Clang/ClangExpressionParser.cpp b/lldb/source/Plugins/ExpressionParser/Clang/ClangExpressionParser.cpp
index b3880ce03b08..e5de4b4651df 100644
--- a/lldb/source/Plugins/ExpressionParser/Clang/ClangExpressionParser.cpp
+++ b/lldb/source/Plugins/ExpressionParser/Clang/ClangExpressionParser.cpp
@@ -214,12 +214,16 @@ class ClangDiagnosticManagerAdapter : public clang::DiagnosticConsumer {
auto new_diagnostic = std::make_unique<ClangDiagnostic>(
stripped_output, severity, Info.getID());
+ // Don't store away warning fixits, since the compiler doesn't have
+ // enough context in an expression for the warning to be useful.
// FIXME: Should we try to filter out FixIts that apply to our generated
// code, and not the user's expression?
- for (const clang::FixItHint &fixit : Info.getFixItHints()) {
- if (fixit.isNull())
- continue;
- new_diagnostic->AddFixitHint(fixit);
+ if (severity == eDiagnosticSeverityError) {
+ for (const clang::FixItHint &fixit : Info.getFixItHints()) {
+ if (fixit.isNull())
+ continue;
+ new_diagnostic->AddFixitHint(fixit);
+ }
}
m_manager->AddDiagnostic(std::move(new_diagnostic));
@@ -1123,10 +1127,6 @@ bool ClangExpressionParser::RewriteExpression(
continue;
if (!diagnostic->HasFixIts())
continue;
- // Don't apply warning Fix-Its, since the compiler doesn't have enough
- // context in an expression for the warning to be useful.
- if (diagnostic->GetSeverity() != eDiagnosticSeverityError)
- continue;
for (const FixItHint &fixit : diagnostic->FixIts())
ApplyFixIt(fixit, commit);
}
More information about the lldb-commits
mailing list