summaryrefslogtreecommitdiffstats
path: root/clang/lib/StaticAnalyzer/Checkers/CloneChecker.cpp
diff options
context:
space:
mode:
authorArtem Dergachev <artem.dergachev@gmail.com>2016-08-20 17:35:53 +0000
committerArtem Dergachev <artem.dergachev@gmail.com>2016-08-20 17:35:53 +0000
commit5657486854d03116660ada0f07f315ac1b54827c (patch)
tree3b8ac918364c806f1b8f0d556d07d2188812d68b /clang/lib/StaticAnalyzer/Checkers/CloneChecker.cpp
parent8176ee9b5dda38504f0048cfe6df95fc13df3ec4 (diff)
downloadbcm5719-llvm-5657486854d03116660ada0f07f315ac1b54827c.tar.gz
bcm5719-llvm-5657486854d03116660ada0f07f315ac1b54827c.zip
[analyzer] Use faster hashing (MD5) in CloneDetector.
This replaces the old approach of fingerprinting every AST node into a string, which avoided collisions and was simple to implement, but turned out to be extremely ineffective with respect to both performance and memory. The collisions are now dealt with in a separate pass, which no longer causes performance problems because collisions are rare. Patch by Raphael Isemann! Differential Revision: https://reviews.llvm.org/D22515 llvm-svn: 279378
Diffstat (limited to 'clang/lib/StaticAnalyzer/Checkers/CloneChecker.cpp')
-rw-r--r--clang/lib/StaticAnalyzer/Checkers/CloneChecker.cpp9
1 files changed, 0 insertions, 9 deletions
diff --git a/clang/lib/StaticAnalyzer/Checkers/CloneChecker.cpp b/clang/lib/StaticAnalyzer/Checkers/CloneChecker.cpp
index 3b4b78b422a..b4ac223c022 100644
--- a/clang/lib/StaticAnalyzer/Checkers/CloneChecker.cpp
+++ b/clang/lib/StaticAnalyzer/Checkers/CloneChecker.cpp
@@ -91,15 +91,6 @@ void CloneChecker::reportClones(SourceManager &SM, AnalysisManager &Mgr,
"Related code clone is here.");
for (CloneDetector::CloneGroup &Group : CloneGroups) {
- // For readability reasons we sort the clones by line numbers.
- std::sort(Group.Sequences.begin(), Group.Sequences.end(),
- [&SM](const StmtSequence &LHS, const StmtSequence &RHS) {
- return SM.isBeforeInTranslationUnit(LHS.getStartLoc(),
- RHS.getStartLoc()) &&
- SM.isBeforeInTranslationUnit(LHS.getEndLoc(),
- RHS.getEndLoc());
- });
-
// We group the clones by printing the first as a warning and all others
// as a note.
DiagEngine.Report(Group.Sequences.front().getStartLoc(), WarnID);
OpenPOWER on IntegriCloud