[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 09:29:51 PDT 2017


xiangzhai created this revision.
Herald added a subscriber: xazax.hun.

Hi LLVM developers,

As Raphael suggested in https://reviews.llvm.org/D31320 I renamed `AutoGeneratedCloneConstraint` to `FilenamePatternConstraint`, please review it, thanks a lot!

Regards,
Leslie Zhai


Repository:
  rL LLVM

https://reviews.llvm.org/D34353

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


Index: lib/StaticAnalyzer/Checkers/CloneChecker.cpp
===================================================================
--- lib/StaticAnalyzer/Checkers/CloneChecker.cpp
+++ 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: lib/Analysis/CloneDetection.cpp
===================================================================
--- lib/Analysis/CloneDetection.cpp
+++ 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))
Index: include/clang/Analysis/CloneDetection.h
===================================================================
--- include/clang/Analysis/CloneDetection.h
+++ 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() + "$)");


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D34353.103063.patch
Type: text/x-patch
Size: 1939 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20170619/4272b128/attachment-0001.bin>


More information about the cfe-commits mailing list