[PATCH] D23418: [analyzer] Added a reusable constraint system to the CloneDetector

Raphael Isemann via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Mon Mar 27 14:59:57 PDT 2017


teemperor updated this revision to Diff 93180.
teemperor added a comment.
Herald added a subscriber: mgorny.

Thanks for the review Artem!

Changes:

- No longer including the old LLVM hashing header.
- Fixed the messed up comment formatting when i removed all the `\brief`s...
- `CloneConstraint` is now just a collection of static methods and its no longer necessary to inherit from it. (Maybe we can just replace it in the future with a namespace in the future? I don't like free floating functions and they don't fit into the CloneDetector interface, so this felt like the least-ugly way to do it.)
- Renamed Stmt to Seq to prevent that one warning Artem mentioned.
- Added a example unittest that shows a bit how to use the API and how to create your own Constraint.
- StmtSequence now uses Decl* instead of ASTContext. We get the ASTContext over the stored Decl, but with a Decl we can do better heuristics for StmtSequence::contains and we can do fast filtering based on function name etc.


https://reviews.llvm.org/D23418

Files:
  include/clang/Analysis/CloneDetection.h
  lib/Analysis/CloneDetection.cpp
  lib/StaticAnalyzer/Checkers/CloneChecker.cpp
  unittests/Analysis/CMakeLists.txt
  unittests/Analysis/CloneDetectionTest.cpp

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D23418.93180.patch
Type: text/x-patch
Size: 73746 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20170327/9f940bc2/attachment-0001.bin>


More information about the cfe-commits mailing list