HomePhabricator

[analyzer] Add basic capabilities to detect source code clones.

Description

[analyzer] Add basic capabilities to detect source code clones.

This patch adds the CloneDetector class which allows searching source code
for clones.

For every statement or group of statements within a compound statement,
CloneDetector computes a hash value, and finds clones by detecting
identical hash values.

This initial patch only provides a simple hashing mechanism
that hashes the kind of each sub-statement.

This patch also adds CloneChecker - a simple static analyzer checker
that uses CloneDetector to report copy-pasted code.

Patch by Raphael Isemann!

Differential Revision: https://reviews.llvm.org/D20795

Details

Committed
dergachevJul 26 2016, 11:13 AM
Differential Revision
D20795: Added basic capabilities to detect source code clones.
Parents
rL276781: [CMAKE] Find ld64 using xcrun
Branches
Unknown
Tags
Unknown