[PATCH] D34353: [analyzer] Teach CloneDetection about Qt Meta-Object Compiler to filter auto generated files

Leslie Zhai via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Mon Jun 19 23:45:36 PDT 2017


This revision was automatically updated to reflect the committed changes.
Closed by commit rL305774: [analyzer] Teach CloneDetection about Qt Meta-Object Compiler to filter auto… (authored by xiangzhai).

Changed prior to commit:
  https://reviews.llvm.org/D34353?vs=103063&id=103162#toc

Repository:
  rL LLVM

https://reviews.llvm.org/D34353

Files:
  cfe/trunk/include/clang/Analysis/CloneDetection.h
  cfe/trunk/lib/Analysis/CloneDetection.cpp
  cfe/trunk/lib/StaticAnalyzer/Checkers/CloneChecker.cpp


Index: cfe/trunk/include/clang/Analysis/CloneDetection.h
===================================================================
--- cfe/trunk/include/clang/Analysis/CloneDetection.h
+++ cfe/trunk/include/clang/Analysis/CloneDetection.h
@@ -321,11 +321,11 @@
   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() + "$)");
Index: cfe/trunk/lib/StaticAnalyzer/Checkers/CloneChecker.cpp
===================================================================
--- cfe/trunk/lib/StaticAnalyzer/Checkers/CloneChecker.cpp
+++ cfe/trunk/lib/StaticAnalyzer/Checkers/CloneChecker.cpp
@@ -82,7 +82,7 @@
   std::vector<CloneDetector::CloneGroup> AllCloneGroups;
 
   Detector.findClones(AllCloneGroups,
-                      AutoGeneratedCloneConstraint(IgnoredFilesPattern),
+                      FilenamePatternConstraint(IgnoredFilesPattern),
                       RecursiveCloneTypeIIConstraint(),
                       MinComplexityConstraint(MinComplexity),
                       MinGroupSizeConstraint(2), OnlyLargestCloneConstraint());
Index: cfe/trunk/lib/Analysis/CloneDetection.cpp
===================================================================
--- cfe/trunk/lib/Analysis/CloneDetection.cpp
+++ cfe/trunk/lib/Analysis/CloneDetection.cpp
@@ -366,7 +366,7 @@
   }
 }
 
-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))


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D34353.103162.patch
Type: text/x-patch
Size: 2029 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20170620/a7516862/attachment.bin>


More information about the cfe-commits mailing list