[PATCH] D52133: [analyzer] A testing facility for testing relationships between symbols.

Artem Dergachev via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Fri Sep 14 20:28:36 PDT 2018


NoQ created this revision.
NoQ added reviewers: dcoughlin, xazax.hun, a.sidorin, george.karpenkov, szepet, rnkovacs, baloghadamsoftware.
Herald added subscribers: cfe-commits, Szelethus, jfb, mikhail.ramalho.

A test introduced in https://reviews.llvm.org/rC329780 was disabled in https://reviews.llvm.org/rC342317 for the reason explained in https://reviews.llvm.org/D41938?id=130403#inline-371070 - tests shouldn't test dump infrastructure when all they care about is how symbols relate to each other.

Add a new feature to ExprInspection: `clang_analyzer_denote()` and `clang_analyzer_explain()`. The former adds a notation to a symbol, the latter expresses another symbol in terms of previously denoted symbols.

It's currently a bit wonky - doesn't print parentheses and only supports denoting atomic symbols. But it's even more readable that way.

I also noticed that an important use case was omitted in these tests. Namely, tests for unsigned integer rearrangement are done with signed-type symbols stored in unsigned variables and we also need to test unsigned symbols stored in unsigned variables (and ideally also unsigned symbols stored in signed variables).


Repository:
  rC Clang

https://reviews.llvm.org/D52133

Files:
  docs/analyzer/DebugChecks.rst
  lib/StaticAnalyzer/Checkers/ExprInspectionChecker.cpp
  test/Analysis/svalbuilder-rearrange-comparisons.c

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D52133.165635.patch
Type: text/x-patch
Size: 66924 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20180915/40582f38/attachment-0001.bin>


More information about the cfe-commits mailing list