aboutsummaryrefslogtreecommitdiff
path: root/llvm/lib/Bitcode/Reader/BitcodeAnalyzer.cpp
diff options
context:
space:
mode:
authorRaphael Isemann <teemperor@gmail.com>2020-04-06 09:44:04 +0200
committerRaphael Isemann <teemperor@gmail.com>2020-04-06 10:37:33 +0200
commit3c2dc28d812c917e01f46b3bcf5b5e0a2a803276 (patch)
treeaeff1923101864529db66abd55a8fb48f7f49e15 /llvm/lib/Bitcode/Reader/BitcodeAnalyzer.cpp
parent4f644ff9e8738b5fde4825b929ec69d0b78ed2ea (diff)
downloadllvm-3c2dc28d812c917e01f46b3bcf5b5e0a2a803276.zip
llvm-3c2dc28d812c917e01f46b3bcf5b5e0a2a803276.tar.gz
llvm-3c2dc28d812c917e01f46b3bcf5b5e0a2a803276.tar.bz2
[lldb] Also apply Fix-Its in "note:" diagnostics that belong to an error diagnostic
Summary: LLDB currently applies Fix-Its if they are attached to a Clang diagnostic that has the severity "error". Fix-Its connected to warnings and other severities are supposed to be ignored as LLDB doesn't seem to trust Clang Fix-Its in these situations. However, LLDB also ignores all Fix-Its coming from "note:" diagnostics. These diagnostics are usually emitted alongside other diagnostics (both warnings and errors), either to keep a single diagnostic message shorter or because the Fix-It is in a different source line. As they are technically their own (non-error) diagnostics, we currently are ignoring all Fix-Its associated with them. For example, this is a possible Clang diagnostic with a Fix-It that is currently ignored: ``` error: <user expression 1>:2:10: too many arguments provided to function-like macro invocation ToStr(0, {,}) ^ <user expression 1>:1:9: macro 'ToStr' defined here #define ToStr(x) #x ^ <user expression 1>:2:1: cannot use initializer list at the beginning of a macro argument ToStr(0, {,}) ^ ~~~~ ``` We also don't store "note:" diagnostics at all, as LLDB's abstraction around the whole diagnostic concept doesn't have such a concept. The text of "note:" diagnostics is instead appended to the last non-note diagnostic (which is causing that there is no "note:" text in the diagnostic above, as all the "note:" diagnostics have been appended to the first "error: ..." text). This patch fixes the ignored Fix-Its in note-diagnostics by appending them to the last non-note diagnostic, similar to the way we handle the text in these diagnostics. Reviewers: JDevlieghere, jingham Reviewed By: JDevlieghere Subscribers: abidh Differential Revision: https://reviews.llvm.org/D77055
Diffstat (limited to 'llvm/lib/Bitcode/Reader/BitcodeAnalyzer.cpp')
0 files changed, 0 insertions, 0 deletions