[PATCH] D64991: [analyzer][WIP] Implement a primitive reaching definitions analysis

Kristóf Umann via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Mon Jul 22 09:04:42 PDT 2019


Szelethus updated this revision to Diff 211119.
Szelethus added a comment.

I plan to split this patch up eventually, but here's where I'm standing right now:

- Correct the algorithm that by accident did this: `GEN[B] = GEN[B] union (IN[B] - KILL[B])` instead of this: `OUT[B] = GEN[B] union (IN[B] - KILL[B])`
- Realize that `llvm::SmallSet` uses both `operator==` and `operator<`, and since for a reaching definition set I'd like to sort by `VarDecl`, but for the kill set that AND the `CFGElementRef`, give up on it and use `std::set` instead with two different comparators
- Collect all non-local variables and regard all function calls as definitions to them
- Collect parameter declarations as well, add them to `GEN[entry block]`
- Plenty more test cases


CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D64991/new/

https://reviews.llvm.org/D64991

Files:
  clang/include/clang/Analysis/Analyses/ReachingDefinitions.h
  clang/include/clang/StaticAnalyzer/Checkers/Checkers.td
  clang/lib/Analysis/CMakeLists.txt
  clang/lib/Analysis/ReachingDefinitions.cpp
  clang/lib/StaticAnalyzer/Checkers/DebugCheckers.cpp
  clang/test/Analysis/dump-definitions.cpp

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D64991.211119.patch
Type: text/x-patch
Size: 27453 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20190722/62c6804e/attachment-0001.bin>


More information about the cfe-commits mailing list