diff options
author | Csaba Dabis <dabis.csaba98@gmail.com> | 2019-05-29 19:21:59 +0000 |
---|---|---|
committer | Csaba Dabis <dabis.csaba98@gmail.com> | 2019-05-29 19:21:59 +0000 |
commit | 1d7ca677697f5b6bb40011e7fc962bb1a158e96a (patch) | |
tree | 2588a1040382f45a81ced2cf52b416a52b79117c /clang/lib/StaticAnalyzer/Core/SarifDiagnostics.cpp | |
parent | 45e8cc6639e9d7dbc900ed35fdfe46c02c4eb298 (diff) | |
download | bcm5719-llvm-1d7ca677697f5b6bb40011e7fc962bb1a158e96a.tar.gz bcm5719-llvm-1d7ca677697f5b6bb40011e7fc962bb1a158e96a.zip |
[analyzer] [NFC] PathDiagnostic: Create PathDiagnosticPopUpPiece
Summary:
This new piece is similar to our macro expansion printing in HTML reports:
On mouse-hover event it pops up on variables. Similar to note pieces it
supports `plist` diagnostics as well.
It is optional, on by default: `add-pop-up-notes=true`.
Extra: In HTML reports `background-color: LemonChiffon` was too light,
changed to `PaleGoldenRod`.
Reviewers: NoQ, alexfh
Reviewed By: NoQ
Subscribers: cfe-commits, gerazo, gsd, george.karpenkov, alexfh, xazax.hun,
baloghadamsoftware, szepet, a.sidorin, mikhail.ramalho,
Szelethus, donat.nagy, dkrupp
Tags: #clang
Differential Revision: https://reviews.llvm.org/D60670
llvm-svn: 362014
Diffstat (limited to 'clang/lib/StaticAnalyzer/Core/SarifDiagnostics.cpp')
-rw-r--r-- | clang/lib/StaticAnalyzer/Core/SarifDiagnostics.cpp | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/clang/lib/StaticAnalyzer/Core/SarifDiagnostics.cpp b/clang/lib/StaticAnalyzer/Core/SarifDiagnostics.cpp index a8f529b7d35..4233f25edb3 100644 --- a/clang/lib/StaticAnalyzer/Core/SarifDiagnostics.cpp +++ b/clang/lib/StaticAnalyzer/Core/SarifDiagnostics.cpp @@ -191,15 +191,16 @@ static json::Object createLocation(json::Object &&PhysicalLocation, static Importance calculateImportance(const PathDiagnosticPiece &Piece) { switch (Piece.getKind()) { - case PathDiagnosticPiece::Kind::Call: - case PathDiagnosticPiece::Kind::Macro: - case PathDiagnosticPiece::Kind::Note: + case PathDiagnosticPiece::Call: + case PathDiagnosticPiece::Macro: + case PathDiagnosticPiece::Note: + case PathDiagnosticPiece::PopUp: // FIXME: What should be reported here? break; - case PathDiagnosticPiece::Kind::Event: + case PathDiagnosticPiece::Event: return Piece.getTagStr() == "ConditionBRVisitor" ? Importance::Important : Importance::Essential; - case PathDiagnosticPiece::Kind::ControlFlow: + case PathDiagnosticPiece::ControlFlow: return Importance::Unimportant; } return Importance::Unimportant; |