Extend ExprInspection checker to make it possible to dump the issue hash of arbitrary expressions. This change makes it possible to make issue hash related tests more concise and also makes debugging issue hash related problems easier.
Details
Diff Detail
- Repository
- rL LLVM
Event Timeline
lib/StaticAnalyzer/Checkers/ExprInspectionChecker.cpp | ||
---|---|---|
68 ↗ | (On Diff #118779) | Since I touched this snippet I reformatted it using clang-format. Apart from adding a new case before the default all other changes are formatting changes. I will revert the formatting changes. So in general, we prefer to minimize the diffs over converging to be clang-formatted? |
I'd also include some info on how it's now possible to dump the issue hash. You introduce a new debugging function here "clang_analyzer_hashDump" but it's not mentioned in the commit message.
Thanks!
lib/StaticAnalyzer/Checkers/ExprInspectionChecker.cpp | ||
---|---|---|
68 ↗ | (On Diff #118779) | It's much easier to review when the diff does not contain formatting changes intermixed with functional changes. Looks like you can configure clang-format to only format the diff. |
lib/StaticAnalyzer/Checkers/ExprInspectionChecker.cpp | ||
---|---|---|
68 ↗ | (On Diff #118779) | I see. Unfortunately, formatting only the diff is not always a solution. The clang-format tool cannot format arbitrary source regions, it will extend the formatted region to certain units of the language, in this case to the whole variable definition which spans across multiple lines. Fortunately, it wasn't a big deal to do formatting by hand in this case. |
Hey, i just recalled that we have documentation for ExprInspection functions in docs/analyzer/DebugChecks.rst, you may want to add your function there as well :)
Indeed, thanks for pointing this out! The patch is up for review: https://reviews.llvm.org/D39543