Reviewers: v.g.vassilev, teemperor
Reviewed By: teemperor
Differential Revision: https://reviews.llvm.org/D34353
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@305774
91177308-0d34-0410-b5e6-
96231b3b80d8
void constrain(std::vector<CloneDetector::CloneGroup> &Result);
};
-struct AutoGeneratedCloneConstraint {
+struct FilenamePatternConstraint {
StringRef IgnoredFilesPattern;
std::shared_ptr<llvm::Regex> IgnoredFilesRegex;
- AutoGeneratedCloneConstraint(StringRef IgnoredFilesPattern)
+ FilenamePatternConstraint(StringRef IgnoredFilesPattern)
: IgnoredFilesPattern(IgnoredFilesPattern) {
IgnoredFilesRegex = std::make_shared<llvm::Regex>("^(" +
IgnoredFilesPattern.str() + "$)");
}
}
-bool AutoGeneratedCloneConstraint::isAutoGenerated(const CloneDetector::CloneGroup &Group) {
+bool FilenamePatternConstraint::isAutoGenerated(const CloneDetector::CloneGroup &Group) {
std::string Error;
if (IgnoredFilesPattern.empty() || Group.empty() ||
!IgnoredFilesRegex->isValid(Error))
std::vector<CloneDetector::CloneGroup> AllCloneGroups;
Detector.findClones(AllCloneGroups,
- AutoGeneratedCloneConstraint(IgnoredFilesPattern),
+ FilenamePatternConstraint(IgnoredFilesPattern),
RecursiveCloneTypeIIConstraint(),
MinComplexityConstraint(MinComplexity),
MinGroupSizeConstraint(2), OnlyLargestCloneConstraint());