[PATCH] D31320: [analyzer] Teach CloneDetection about Qt Meta-Object Compiler

2017-06-19 Thread Raphael Isemann via Phabricator via cfe-commits
teemperor added inline comments.



Comment at: cfe/trunk/include/clang/Analysis/CloneDetection.h:324
 
+struct AutoGeneratedCloneConstraint {
+  StringRef IgnoredFilesPattern;

xiangzhai wrote:
> v.g.vassilev wrote:
> > Shouldn't the name be more generic. What this essentially does is to filter 
> > out false positives according to a regex...
> At the very beginning, it is by regex match the filename, it is still very 
> rough! but in future it is able to filter by looking for 
> `QT_BEGIN_MOC_NAMESPACE` macro or `qt_meta_ prefix` function in the 
> ASTContext? and there might be other auto-generated mechanism for different 
> framework, such as Gtk and sort of open source GUI libraries. so perhaps 
> `AutoGeneratedCloneConstraint` is better name, I am not good at naming, it is 
> difficult to name my little kid :)
Yeah, maybe we should have named this FilenamePatternConstraint or something 
like that...


Repository:
  rL LLVM

https://reviews.llvm.org/D31320



___
cfe-commits mailing list
cfe-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[PATCH] D31320: [analyzer] Teach CloneDetection about Qt Meta-Object Compiler

2017-06-19 Thread Leslie Zhai via Phabricator via cfe-commits
xiangzhai added inline comments.



Comment at: cfe/trunk/include/clang/Analysis/CloneDetection.h:324
 
+struct AutoGeneratedCloneConstraint {
+  StringRef IgnoredFilesPattern;

v.g.vassilev wrote:
> Shouldn't the name be more generic. What this essentially does is to filter 
> out false positives according to a regex...
At the very beginning, it is by regex match the filename, it is still very 
rough! but in future it is able to filter by looking for 
`QT_BEGIN_MOC_NAMESPACE` macro or `qt_meta_ prefix` function in the ASTContext? 
and there might be other auto-generated mechanism for different framework, such 
as Gtk and sort of open source GUI libraries. so perhaps 
`AutoGeneratedCloneConstraint` is better name, I am not good at naming, it is 
difficult to name my little kid :)


Repository:
  rL LLVM

https://reviews.llvm.org/D31320



___
cfe-commits mailing list
cfe-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[PATCH] D31320: [analyzer] Teach CloneDetection about Qt Meta-Object Compiler

2017-06-19 Thread Vassil Vassilev via Phabricator via cfe-commits
v.g.vassilev added inline comments.



Comment at: cfe/trunk/include/clang/Analysis/CloneDetection.h:324
 
+struct AutoGeneratedCloneConstraint {
+  StringRef IgnoredFilesPattern;

Shouldn't the name be more generic. What this essentially does is to filter out 
false positives according to a regex...


Repository:
  rL LLVM

https://reviews.llvm.org/D31320



___
cfe-commits mailing list
cfe-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[PATCH] D31320: [analyzer] Teach CloneDetection about Qt Meta-Object Compiler

2017-06-18 Thread Leslie Zhai via Phabricator via cfe-commits
This revision was automatically updated to reflect the committed changes.
Closed by commit rL305659: [analyzer] Teach CloneDetection about Qt Meta-Object 
Compiler (authored by xiangzhai).

Changed prior to commit:
  https://reviews.llvm.org/D31320?vs=102840=102984#toc

Repository:
  rL LLVM

https://reviews.llvm.org/D31320

Files:
  cfe/trunk/include/clang/Analysis/CloneDetection.h
  cfe/trunk/lib/Analysis/CloneDetection.cpp
  cfe/trunk/lib/StaticAnalyzer/Checkers/CloneChecker.cpp
  cfe/trunk/test/Analysis/copypaste/autogenerated_automoc.cpp
  cfe/trunk/test/Analysis/copypaste/dbus_autogenerated.cpp
  cfe/trunk/test/Analysis/copypaste/moc_autogenerated.cpp
  cfe/trunk/test/Analysis/copypaste/not-autogenerated.cpp
  cfe/trunk/test/Analysis/copypaste/ui_autogenerated.cpp

Index: cfe/trunk/lib/Analysis/CloneDetection.cpp
===
--- cfe/trunk/lib/Analysis/CloneDetection.cpp
+++ cfe/trunk/lib/Analysis/CloneDetection.cpp
@@ -18,9 +18,9 @@
 #include "clang/AST/Stmt.h"
 #include "clang/AST/StmtVisitor.h"
 #include "clang/Lex/Lexer.h"
-#include "llvm/ADT/StringRef.h"
 #include "llvm/Support/MD5.h"
 #include "llvm/Support/raw_ostream.h"
+#include "llvm/Support/Path.h"
 
 using namespace clang;
 
@@ -366,6 +366,23 @@
   }
 }
 
+bool AutoGeneratedCloneConstraint::isAutoGenerated(const CloneDetector::CloneGroup ) {
+  std::string Error;
+  if (IgnoredFilesPattern.empty() || Group.empty() || 
+  !IgnoredFilesRegex->isValid(Error))
+return false;
+
+  for (const StmtSequence  : Group) {
+const SourceManager  = S.getASTContext().getSourceManager();
+StringRef Filename = llvm::sys::path::filename(SM.getFilename(
+S.getContainingDecl()->getLocation()));
+if (IgnoredFilesRegex->match(Filename))
+  return true;
+  }
+
+  return false;
+}
+
 static size_t createHash(llvm::MD5 ) {
   size_t HashCode;
 
Index: cfe/trunk/lib/StaticAnalyzer/Checkers/CloneChecker.cpp
===
--- cfe/trunk/lib/StaticAnalyzer/Checkers/CloneChecker.cpp
+++ cfe/trunk/lib/StaticAnalyzer/Checkers/CloneChecker.cpp
@@ -73,12 +73,17 @@
   bool ReportNormalClones = Mgr.getAnalyzerOptions().getBooleanOption(
   "ReportNormalClones", true, this);
 
+  StringRef IgnoredFilesPattern = Mgr.getAnalyzerOptions().getOptionAsString(
+  "IgnoredFilesPattern", "", this);
+
   // Let the CloneDetector create a list of clones from all the analyzed
   // statements. We don't filter for matching variable patterns at this point
   // because reportSuspiciousClones() wants to search them for errors.
   std::vector AllCloneGroups;
 
-  Detector.findClones(AllCloneGroups, RecursiveCloneTypeIIConstraint(),
+  Detector.findClones(AllCloneGroups,
+  AutoGeneratedCloneConstraint(IgnoredFilesPattern),
+  RecursiveCloneTypeIIConstraint(),
   MinComplexityConstraint(MinComplexity),
   MinGroupSizeConstraint(2), OnlyLargestCloneConstraint());
 
Index: cfe/trunk/include/clang/Analysis/CloneDetection.h
===
--- cfe/trunk/include/clang/Analysis/CloneDetection.h
+++ cfe/trunk/include/clang/Analysis/CloneDetection.h
@@ -17,6 +17,8 @@
 
 #include "clang/Basic/SourceLocation.h"
 #include "llvm/ADT/SmallVector.h"
+#include "llvm/ADT/StringRef.h"
+#include "llvm/Support/Regex.h"
 #include 
 
 namespace clang {
@@ -319,6 +321,26 @@
   void constrain(std::vector );
 };
 
+struct AutoGeneratedCloneConstraint {
+  StringRef IgnoredFilesPattern;
+  std::shared_ptr IgnoredFilesRegex;
+
+  AutoGeneratedCloneConstraint(StringRef IgnoredFilesPattern) 
+  : IgnoredFilesPattern(IgnoredFilesPattern) {
+IgnoredFilesRegex = std::make_shared("^(" +
+IgnoredFilesPattern.str() + "$)");
+  }
+
+  bool isAutoGenerated(const CloneDetector::CloneGroup );
+
+  void constrain(std::vector ) {
+CloneConstraint::filterGroups(
+CloneGroups, [this](const CloneDetector::CloneGroup ) {
+  return isAutoGenerated(Group);
+});
+  }
+};
+
 /// Analyzes the pattern of the referenced variables in a statement.
 class VariablePattern {
 
Index: cfe/trunk/test/Analysis/copypaste/dbus_autogenerated.cpp
===
--- cfe/trunk/test/Analysis/copypaste/dbus_autogenerated.cpp
+++ cfe/trunk/test/Analysis/copypaste/dbus_autogenerated.cpp
@@ -0,0 +1,19 @@
+// RUN: %clang_analyze_cc1 -std=c++11 -analyzer-checker=alpha.clone.CloneChecker -analyzer-config alpha.clone.CloneChecker:IgnoredFilesPattern="moc_|dbus_|.*_automoc" -verify %s
+
+// Because files that have `dbus_' in their names are most likely autogenerated,
+// we suppress copy-paste warnings here.
+
+// expected-no-diagnostics
+
+void f1() {
+  int *p1 = new int[1];
+  int *p2 = new int[1];
+  if (p1) {
+delete [] p1;
+p1 = nullptr;
+  }
+  if (p2) {
+delete [] p1; // 

[PATCH] D31320: [analyzer] Teach CloneDetection about Qt Meta-Object Compiler

2017-06-18 Thread Raphael Isemann via Phabricator via cfe-commits
teemperor accepted this revision.
teemperor added a comment.

LGTM, thanks for the patch!


Repository:
  rL LLVM

https://reviews.llvm.org/D31320



___
cfe-commits mailing list
cfe-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[PATCH] D31320: [analyzer] Teach CloneDetection about Qt Meta-Object Compiler

2017-06-16 Thread Leslie Zhai via Phabricator via cfe-commits
xiangzhai updated this revision to Diff 102840.
xiangzhai added a comment.

Dear Raphael,

I updated my patch as you suggested, may I commit it? thanks!

Regards,
Leslie Zhai


Repository:
  rL LLVM

https://reviews.llvm.org/D31320

Files:
  include/clang/Analysis/CloneDetection.h
  lib/Analysis/CloneDetection.cpp
  lib/StaticAnalyzer/Checkers/CloneChecker.cpp
  test/Analysis/copypaste/autogenerated_automoc.cpp
  test/Analysis/copypaste/dbus_autogenerated.cpp
  test/Analysis/copypaste/moc_autogenerated.cpp
  test/Analysis/copypaste/not-autogenerated.cpp
  test/Analysis/copypaste/ui_autogenerated.cpp

Index: test/Analysis/copypaste/ui_autogenerated.cpp
===
--- test/Analysis/copypaste/ui_autogenerated.cpp
+++ test/Analysis/copypaste/ui_autogenerated.cpp
@@ -0,0 +1,19 @@
+// RUN: %clang_analyze_cc1 -std=c++11 -analyzer-checker=alpha.clone.CloneChecker -analyzer-config alpha.clone.CloneChecker:IgnoredFilesPattern="moc_|ui_|.*_automoc" -verify %s
+
+// Because files that have `ui_' in their names are most likely autogenerated,
+// we suppress copy-paste warnings here.
+
+// expected-no-diagnostics
+
+void f1() {
+  int *p1 = new int[1];
+  int *p2 = new int[1];
+  if (p1) {
+delete [] p1;
+p1 = nullptr;
+  }
+  if (p2) {
+delete [] p1; // no-warning
+p2 = nullptr;
+  }
+}
Index: test/Analysis/copypaste/not-autogenerated.cpp
===
--- test/Analysis/copypaste/not-autogenerated.cpp
+++ test/Analysis/copypaste/not-autogenerated.cpp
@@ -0,0 +1,14 @@
+// RUN: %clang_analyze_cc1 -std=c++11 -analyzer-checker=alpha.clone.CloneChecker -analyzer-config alpha.clone.CloneChecker:IgnoredFilesPattern="moc_|ui_|dbus_|.*_automoc" -verify %s
+
+void f1() {
+  int *p1 = new int[1];
+  int *p2 = new int[1];
+  if (p1) {
+delete [] p1; // expected-note{{Similar code using 'p1' here}}
+p1 = nullptr;
+  }
+  if (p2) {
+delete [] p1; // expected-warning{{Potential copy-paste error; did you really mean to use 'p1' here?}}
+p2 = nullptr;
+  }
+}
Index: test/Analysis/copypaste/moc_autogenerated.cpp
===
--- test/Analysis/copypaste/moc_autogenerated.cpp
+++ test/Analysis/copypaste/moc_autogenerated.cpp
@@ -0,0 +1,19 @@
+// RUN: %clang_analyze_cc1 -std=c++11 -analyzer-checker=alpha.clone.CloneChecker -analyzer-config alpha.clone.CloneChecker:IgnoredFilesPattern="moc_|.*_automoc" -verify %s
+
+// Because files that have `moc_' in their names are most likely autogenerated,
+// we suppress copy-paste warnings here.
+
+// expected-no-diagnostics
+
+void f1() {
+  int *p1 = new int[1];
+  int *p2 = new int[1];
+  if (p1) {
+delete [] p1;
+p1 = nullptr;
+  }
+  if (p2) {
+delete [] p1; // no-warning
+p2 = nullptr;
+  }
+}
Index: test/Analysis/copypaste/dbus_autogenerated.cpp
===
--- test/Analysis/copypaste/dbus_autogenerated.cpp
+++ test/Analysis/copypaste/dbus_autogenerated.cpp
@@ -0,0 +1,19 @@
+// RUN: %clang_analyze_cc1 -std=c++11 -analyzer-checker=alpha.clone.CloneChecker -analyzer-config alpha.clone.CloneChecker:IgnoredFilesPattern="moc_|dbus_|.*_automoc" -verify %s
+
+// Because files that have `dbus_' in their names are most likely autogenerated,
+// we suppress copy-paste warnings here.
+
+// expected-no-diagnostics
+
+void f1() {
+  int *p1 = new int[1];
+  int *p2 = new int[1];
+  if (p1) {
+delete [] p1;
+p1 = nullptr;
+  }
+  if (p2) {
+delete [] p1; // no-warning
+p2 = nullptr;
+  }
+}
Index: test/Analysis/copypaste/autogenerated_automoc.cpp
===
--- test/Analysis/copypaste/autogenerated_automoc.cpp
+++ test/Analysis/copypaste/autogenerated_automoc.cpp
@@ -0,0 +1,19 @@
+// RUN: %clang_analyze_cc1 -std=c++11 -analyzer-checker=alpha.clone.CloneChecker -analyzer-config alpha.clone.CloneChecker:IgnoredFilesPattern="moc_|.*_automoc.cpp" -verify %s
+
+// Because files that have `_automoc.' in their names are most likely autogenerated,
+// we suppress copy-paste warnings here.
+
+// expected-no-diagnostics
+
+void f1() {
+  int *p1 = new int[1];
+  int *p2 = new int[1];
+  if (p1) {
+delete [] p1;
+p1 = nullptr;
+  }
+  if (p2) {
+delete [] p1; // no-warning
+p2 = nullptr;
+  }
+}
Index: lib/StaticAnalyzer/Checkers/CloneChecker.cpp
===
--- lib/StaticAnalyzer/Checkers/CloneChecker.cpp
+++ lib/StaticAnalyzer/Checkers/CloneChecker.cpp
@@ -73,12 +73,17 @@
   bool ReportNormalClones = Mgr.getAnalyzerOptions().getBooleanOption(
   "ReportNormalClones", true, this);
 
+  StringRef IgnoredFilesPattern = Mgr.getAnalyzerOptions().getOptionAsString(
+  "IgnoredFilesPattern", "", this);
+
   // Let the CloneDetector create a list of clones from all the analyzed
   // statements. We don't 

[PATCH] D31320: [analyzer] Teach CloneDetection about Qt Meta-Object Compiler

2017-06-16 Thread Leslie Zhai via Phabricator via cfe-commits
xiangzhai added a comment.

Dear Raphael,

Sorry I am not available, I am looking after my little kid, see you next week, 
rebase perhaps.

Thanks,
Leslie Zhai


Repository:
  rL LLVM

https://reviews.llvm.org/D31320



___
cfe-commits mailing list
cfe-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[PATCH] D31320: [analyzer] Teach CloneDetection about Qt Meta-Object Compiler

2017-06-16 Thread Raphael Isemann via Phabricator via cfe-commits
teemperor accepted this revision.
teemperor added a comment.
This revision is now accepted and ready to land.

Please check the last inline comment and then feel free to commit it with the 
suggested fix. And I wanted to wait for review on the other performance 
patches, so you can push this now.

Thanks for the work!




Comment at: lib/Analysis/CloneDetection.cpp:375
+  std::string Error;
+  llvm::Regex R(StringRef("^(" + IgnoredFilesPattern.str() + "$)"));
+  if (!R.isValid(Error))

Sorry, I what I wanted to suggest is: make this a member variable of the 
`AutoGeneratedCloneConstraint` class. Moving this out of the loop actually 
doesn't change anything for the checker (because the first constraint get's a 
list of single-sequence groups, so we still call this function N times for N 
functions). So something like `llvm::Regex 
AutoGeneratedCloneConstraint::IgnoredFilesRegex` :)


Repository:
  rL LLVM

https://reviews.llvm.org/D31320



___
cfe-commits mailing list
cfe-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[PATCH] D31320: [analyzer] Teach CloneDetection about Qt Meta-Object Compiler

2017-06-16 Thread Leslie Zhai via Phabricator via cfe-commits
xiangzhai updated this revision to Diff 102796.
xiangzhai added a comment.

Dear Raphael,

I updated my patch as you suggested, please review it, thanks a lot!

And I noticed that you are doing Performance optimizations for the CloneChecker 
https://reviews.llvm.org/D34182 I will rebase my patch if you kindly commit.

Regards,
Leslie Zhai


Repository:
  rL LLVM

https://reviews.llvm.org/D31320

Files:
  include/clang/Analysis/CloneDetection.h
  lib/Analysis/CloneDetection.cpp
  lib/StaticAnalyzer/Checkers/CloneChecker.cpp
  test/Analysis/copypaste/autogenerated_automoc.cpp
  test/Analysis/copypaste/dbus_autogenerated.cpp
  test/Analysis/copypaste/moc_autogenerated.cpp
  test/Analysis/copypaste/not-autogenerated.cpp
  test/Analysis/copypaste/ui_autogenerated.cpp

Index: test/Analysis/copypaste/ui_autogenerated.cpp
===
--- test/Analysis/copypaste/ui_autogenerated.cpp
+++ test/Analysis/copypaste/ui_autogenerated.cpp
@@ -0,0 +1,19 @@
+// RUN: %clang_analyze_cc1 -std=c++11 -analyzer-checker=alpha.clone.CloneChecker -analyzer-config alpha.clone.CloneChecker:IgnoredFilesPattern="moc_|ui_|.*_automoc" -verify %s
+
+// Because files that have `ui_' in their names are most likely autogenerated,
+// we suppress copy-paste warnings here.
+
+// expected-no-diagnostics
+
+void f1() {
+  int *p1 = new int[1];
+  int *p2 = new int[1];
+  if (p1) {
+delete [] p1;
+p1 = nullptr;
+  }
+  if (p2) {
+delete [] p1; // no-warning
+p2 = nullptr;
+  }
+}
Index: test/Analysis/copypaste/not-autogenerated.cpp
===
--- test/Analysis/copypaste/not-autogenerated.cpp
+++ test/Analysis/copypaste/not-autogenerated.cpp
@@ -0,0 +1,14 @@
+// RUN: %clang_analyze_cc1 -std=c++11 -analyzer-checker=alpha.clone.CloneChecker -analyzer-config alpha.clone.CloneChecker:IgnoredFilesPattern="moc_|ui_|dbus_|.*_automoc" -verify %s
+
+void f1() {
+  int *p1 = new int[1];
+  int *p2 = new int[1];
+  if (p1) {
+delete [] p1; // expected-note{{Similar code using 'p1' here}}
+p1 = nullptr;
+  }
+  if (p2) {
+delete [] p1; // expected-warning{{Potential copy-paste error; did you really mean to use 'p1' here?}}
+p2 = nullptr;
+  }
+}
Index: test/Analysis/copypaste/moc_autogenerated.cpp
===
--- test/Analysis/copypaste/moc_autogenerated.cpp
+++ test/Analysis/copypaste/moc_autogenerated.cpp
@@ -0,0 +1,19 @@
+// RUN: %clang_analyze_cc1 -std=c++11 -analyzer-checker=alpha.clone.CloneChecker -analyzer-config alpha.clone.CloneChecker:IgnoredFilesPattern="moc_|.*_automoc" -verify %s
+
+// Because files that have `moc_' in their names are most likely autogenerated,
+// we suppress copy-paste warnings here.
+
+// expected-no-diagnostics
+
+void f1() {
+  int *p1 = new int[1];
+  int *p2 = new int[1];
+  if (p1) {
+delete [] p1;
+p1 = nullptr;
+  }
+  if (p2) {
+delete [] p1; // no-warning
+p2 = nullptr;
+  }
+}
Index: test/Analysis/copypaste/dbus_autogenerated.cpp
===
--- test/Analysis/copypaste/dbus_autogenerated.cpp
+++ test/Analysis/copypaste/dbus_autogenerated.cpp
@@ -0,0 +1,19 @@
+// RUN: %clang_analyze_cc1 -std=c++11 -analyzer-checker=alpha.clone.CloneChecker -analyzer-config alpha.clone.CloneChecker:IgnoredFilesPattern="moc_|dbus_|.*_automoc" -verify %s
+
+// Because files that have `dbus_' in their names are most likely autogenerated,
+// we suppress copy-paste warnings here.
+
+// expected-no-diagnostics
+
+void f1() {
+  int *p1 = new int[1];
+  int *p2 = new int[1];
+  if (p1) {
+delete [] p1;
+p1 = nullptr;
+  }
+  if (p2) {
+delete [] p1; // no-warning
+p2 = nullptr;
+  }
+}
Index: test/Analysis/copypaste/autogenerated_automoc.cpp
===
--- test/Analysis/copypaste/autogenerated_automoc.cpp
+++ test/Analysis/copypaste/autogenerated_automoc.cpp
@@ -0,0 +1,19 @@
+// RUN: %clang_analyze_cc1 -std=c++11 -analyzer-checker=alpha.clone.CloneChecker -analyzer-config alpha.clone.CloneChecker:IgnoredFilesPattern="moc_|.*_automoc.cpp" -verify %s
+
+// Because files that have `_automoc.' in their names are most likely autogenerated,
+// we suppress copy-paste warnings here.
+
+// expected-no-diagnostics
+
+void f1() {
+  int *p1 = new int[1];
+  int *p2 = new int[1];
+  if (p1) {
+delete [] p1;
+p1 = nullptr;
+  }
+  if (p2) {
+delete [] p1; // no-warning
+p2 = nullptr;
+  }
+}
Index: lib/StaticAnalyzer/Checkers/CloneChecker.cpp
===
--- lib/StaticAnalyzer/Checkers/CloneChecker.cpp
+++ lib/StaticAnalyzer/Checkers/CloneChecker.cpp
@@ -73,12 +73,17 @@
   bool ReportNormalClones = Mgr.getAnalyzerOptions().getBooleanOption(
   "ReportNormalClones", true, this);
 
+  StringRef IgnoredFilesPattern = 

[PATCH] D31320: [analyzer] Teach CloneDetection about Qt Meta-Object Compiler

2017-06-16 Thread Raphael Isemann via Phabricator via cfe-commits
teemperor added a comment.

See my inline comments about technical changes, but otherwise this looks ready 
to land. Please update and I'll give green light ASAP. Thanks!




Comment at: lib/Analysis/CloneDetection.cpp:375
+const Decl *D = S.getContainingDecl();
+const SourceManager  = D->getASTContext().getSourceManager();
+std::string Filename = std::string(SM.getFilename(D->getLocation()));

You can skip the `const Decl *D = S.getContainingDecl();` and just do `const 
SourceManager  = S.getASTContext().getSourceManager();`



Comment at: lib/Analysis/CloneDetection.cpp:378
+// Get Basename
+const size_t LastSlash = Filename.find_last_of("\\/");
+if (LastSlash != std::string::npos)

Let's get the basename with the LLVM path class instead:
 
http://llvm.org/docs/doxygen/html/namespacellvm_1_1sys_1_1path.html#a799b002e67dcf41330fa8d6fa11823dc

E.g. `moc_test\.cpp` is a valid filename on Linux and then this code isn't 
doing the right thing.



Comment at: lib/Analysis/CloneDetection.cpp:383
+if (LastDot != std::string::npos)
+  Filename.erase(LastDot);
+llvm::Regex R(StringRef("^(" + IgnoredFilesPattern.str() + "$)"));

Hmm, we can't filter by file extension this way? Can we remove this extension 
stripping and just make people type the file extension in the filter, this 
feels more intuitive.



Comment at: lib/Analysis/CloneDetection.cpp:384
+  Filename.erase(LastDot);
+llvm::Regex R(StringRef("^(" + IgnoredFilesPattern.str() + "$)"));
+if (R.match(StringRef(Filename)))

Artem suggested we could move this Regex out of the loop, I think we should 
even make it a member of the AutoGeneratedCloneConstraint so that we only 
parse/generate the regex state machine once per invocation. Currently we 
reparse this Regex a few thousand times and performance is quite important in 
this Checker.


Repository:
  rL LLVM

https://reviews.llvm.org/D31320



___
cfe-commits mailing list
cfe-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[PATCH] D31320: [analyzer] Teach CloneDetection about Qt Meta-Object Compiler

2017-06-15 Thread Leslie Zhai via Phabricator via cfe-commits
xiangzhai updated this revision to Diff 102777.
xiangzhai added a comment.
Herald added a subscriber: xazax.hun.

Dear Raphael,

Thanks for your suggestion!

> Would it solve your use case if allow specifying file patterns via the 
> command line like this -analyzer-config

Fixed!

  /home/zhaixiang/project/llvm/build/./bin/clang -cc1 -internal-isystem 
/home/zhaixiang/project/llvm/build/lib64/clang/5.0.0/include -nostdsysteminc 
-analyze -analyzer-constraints=range -std=c++11 
-analyzer-checker=alpha.clone.CloneChecker -analyzer-config 
alpha.clone.CloneChecker:IgnoredFilesPattern="moc_|ui_|dbus_|.*_automoc" 
-verify 
/home/zhaixiang/project/llvm/tools/clang/test/Analysis/copypaste/not-autogenerated.cpp

I ran `make check-clang-analysis` and tested it for checking the real K3B 
 project's Copy-paste issue to filter Meta Object 
Compiler , User Interface Compiler 
, D-Bus XML Compiler 
, worked!

And it is able to specify the `IgnoredFilesPattern` to filter auto-generated 
files for different frameworks, please review my patch, if LGTU, may I commit 
it? thanks a lot!

Regards,
Leslie Zhai


Repository:
  rL LLVM

https://reviews.llvm.org/D31320

Files:
  include/clang/Analysis/CloneDetection.h
  lib/Analysis/CloneDetection.cpp
  lib/StaticAnalyzer/Checkers/CloneChecker.cpp
  test/Analysis/copypaste/autogenerated_automoc.cpp
  test/Analysis/copypaste/dbus_autogenerated.cpp
  test/Analysis/copypaste/moc_autogenerated.cpp
  test/Analysis/copypaste/not-autogenerated.cpp
  test/Analysis/copypaste/ui_autogenerated.cpp

Index: test/Analysis/copypaste/ui_autogenerated.cpp
===
--- test/Analysis/copypaste/ui_autogenerated.cpp
+++ test/Analysis/copypaste/ui_autogenerated.cpp
@@ -0,0 +1,19 @@
+// RUN: %clang_analyze_cc1 -std=c++11 -analyzer-checker=alpha.clone.CloneChecker -analyzer-config alpha.clone.CloneChecker:IgnoredFilesPattern="moc_|ui_|.*_automoc" -verify %s
+
+// Because files that have `ui_' in their names are most likely autogenerated,
+// we suppress copy-paste warnings here.
+
+// expected-no-diagnostics
+
+void f1() {
+  int *p1 = new int[1];
+  int *p2 = new int[1];
+  if (p1) {
+delete [] p1;
+p1 = nullptr;
+  }
+  if (p2) {
+delete [] p1; // no-warning
+p2 = nullptr;
+  }
+}
Index: test/Analysis/copypaste/not-autogenerated.cpp
===
--- test/Analysis/copypaste/not-autogenerated.cpp
+++ test/Analysis/copypaste/not-autogenerated.cpp
@@ -0,0 +1,14 @@
+// RUN: %clang_analyze_cc1 -std=c++11 -analyzer-checker=alpha.clone.CloneChecker -analyzer-config alpha.clone.CloneChecker:IgnoredFilesPattern="moc_|ui_|dbus_|.*_automoc" -verify %s
+
+void f1() {
+  int *p1 = new int[1];
+  int *p2 = new int[1];
+  if (p1) {
+delete [] p1; // expected-note{{Similar code using 'p1' here}}
+p1 = nullptr;
+  }
+  if (p2) {
+delete [] p1; // expected-warning{{Potential copy-paste error; did you really mean to use 'p1' here?}}
+p2 = nullptr;
+  }
+}
Index: test/Analysis/copypaste/moc_autogenerated.cpp
===
--- test/Analysis/copypaste/moc_autogenerated.cpp
+++ test/Analysis/copypaste/moc_autogenerated.cpp
@@ -0,0 +1,19 @@
+// RUN: %clang_analyze_cc1 -std=c++11 -analyzer-checker=alpha.clone.CloneChecker -analyzer-config alpha.clone.CloneChecker:IgnoredFilesPattern="moc_|.*_automoc" -verify %s
+
+// Because files that have `moc_' in their names are most likely autogenerated,
+// we suppress copy-paste warnings here.
+
+// expected-no-diagnostics
+
+void f1() {
+  int *p1 = new int[1];
+  int *p2 = new int[1];
+  if (p1) {
+delete [] p1;
+p1 = nullptr;
+  }
+  if (p2) {
+delete [] p1; // no-warning
+p2 = nullptr;
+  }
+}
Index: test/Analysis/copypaste/dbus_autogenerated.cpp
===
--- test/Analysis/copypaste/dbus_autogenerated.cpp
+++ test/Analysis/copypaste/dbus_autogenerated.cpp
@@ -0,0 +1,19 @@
+// RUN: %clang_analyze_cc1 -std=c++11 -analyzer-checker=alpha.clone.CloneChecker -analyzer-config alpha.clone.CloneChecker:IgnoredFilesPattern="moc_|dbus_|.*_automoc" -verify %s
+
+// Because files that have `dbus_' in their names are most likely autogenerated,
+// we suppress copy-paste warnings here.
+
+// expected-no-diagnostics
+
+void f1() {
+  int *p1 = new int[1];
+  int *p2 = new int[1];
+  if (p1) {
+delete [] p1;
+p1 = nullptr;
+  }
+  if (p2) {
+delete [] p1; // no-warning
+p2 = nullptr;
+  }
+}
Index: test/Analysis/copypaste/autogenerated_automoc.cpp
===
--- test/Analysis/copypaste/autogenerated_automoc.cpp
+++ test/Analysis/copypaste/autogenerated_automoc.cpp
@@ -0,0 +1,19 @@
+// RUN: %clang_analyze_cc1 -std=c++11 

[PATCH] D31320: [analyzer] Teach CloneDetection about Qt Meta-Object Compiler

2017-06-15 Thread Vassil Vassilev via Phabricator via cfe-commits
v.g.vassilev added a comment.

I agree with Raphael. If you need to have more fine grained control over the 
translation unit (TU) I think we can have suppressing false positives via 
comments (@Noq would know more).

Eg.

  // File.h defining moc_* yields a lot of false positives
  
  // alpha.clone.CloneChecker:Ignored: some_regex
  ...

This would affect only the TU which include File.h.


Repository:
  rL LLVM

https://reviews.llvm.org/D31320



___
cfe-commits mailing list
cfe-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[PATCH] D31320: [analyzer] Teach CloneDetection about Qt Meta-Object Compiler

2017-06-15 Thread Raphael Isemann via Phabricator via cfe-commits
teemperor requested changes to this revision.
teemperor added a comment.
This revision now requires changes to proceed.

Sorry for the delay, we got stuck because hard coding a certain file pattern 
into the clang source code doesn't seem to be a optimal solution (e.g. every 
user that has a different set of generated files needs to patch clang to hide 
his specific reports). I would prefer if we could get this into a variable that 
the user can change dynamically.

Would it solve your use case if allow specifying file patterns via the command 
line like this `-analyzer-config 
alpha.clone.CloneChecker:IgnoredFiles=moc_*;*.pb.h;*.pb.cc`? If yes, please 
update this PR accordingly and then I think this patch is good to go.

Thanks for the work!


Repository:
  rL LLVM

https://reviews.llvm.org/D31320



___
cfe-commits mailing list
cfe-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[PATCH] D31320: [analyzer] Teach CloneDetection about Qt Meta-Object Compiler

2017-06-14 Thread Leslie Zhai via Phabricator via cfe-commits
xiangzhai added a comment.

Dear Anna,

Long time no see, miss you :)

> Should this revision be "abandoned" or is the plan to iterate on it?

I wanna the plan to iterate on it, Artem reviewed the patch, and I fixed the 
issue as he suggested, ran `make check-clang-analysis` also used it for 
checking real project K3b 's Copy-paste issue, 
worked!

> Hi Vassil,



> ... Thanks for your reply! Let's do it together and Happy International Labor 
> Day :)

But Vassil and Raphael dis not reply me.

Could you kindly review it, if LGTU, may I commit it? thanks a lot!

Regards,
Leslie Zhai


Repository:
  rL LLVM

https://reviews.llvm.org/D31320



___
cfe-commits mailing list
cfe-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[PATCH] D31320: [analyzer] Teach CloneDetection about Qt Meta-Object Compiler

2017-06-14 Thread Anna Zaks via Phabricator via cfe-commits
zaks.anna added a comment.

Should this revision be "abandoned" or is the plan to iterate on it?


Repository:
  rL LLVM

https://reviews.llvm.org/D31320



___
cfe-commits mailing list
cfe-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[PATCH] D31320: [analyzer] Teach CloneDetection about Qt Meta-Object Compiler

2017-04-28 Thread Leslie Zhai via Phabricator via cfe-commits
xiangzhai added a comment.

Hi Vassil,

The first one considered about CopyPaste dection 
 Thanks for 
your reply! Let's do it together and Happy International Labor Day :)

Regards,
Leslie Zhai


Repository:
  rL LLVM

https://reviews.llvm.org/D31320



___
cfe-commits mailing list
cfe-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[PATCH] D31320: [analyzer] Teach CloneDetection about Qt Meta-Object Compiler

2017-04-28 Thread Vassil Vassilev via Phabricator via cfe-commits
v.g.vassilev added a comment.

In general, I think we should support such use-cases. It seems cleaner to me if 
we provide some sort of callbacks where the users can specify their custom 
false positive filters. I've discussed this in brief with Raphael and we were 
planning to write this up.


Repository:
  rL LLVM

https://reviews.llvm.org/D31320



___
cfe-commits mailing list
cfe-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[PATCH] D31320: [analyzer] Teach CloneDetection about Qt Meta-Object Compiler

2017-04-28 Thread Leslie Zhai via Phabricator via cfe-commits
xiangzhai updated this revision to Diff 97059.
xiangzhai added a comment.

Hi Artem,

Thanks for your review!

> Because LLVM's Illinois license is rather permissive than copyleft, we try to 
> avoid stuff copied from GPL/LGPL software (such as Qt or K3B) in our 
> codebase. The code doesn't seem to have been copy-pasted from a copyleft 
> project, but I guess it's better to rename the file to avoid referencing to 
> K3B.

Sorry for my mistake! I have rename the testcase to moc_autogenerated.cpp and 
autogenerated_automoc.cpp. I am the maintainer of K3B, if you find any bug when 
burning ISO please report bug to me :)

> Other LLVM contributors are free to edit this file, and i doubt it was 
> autogenerated; i believe these comments should be removed.

Sorry for my fault!

  /* This file is autogenerated, do not edit*/

it is autogenerated by MOC, I removed it!

And I use a single line LLVM regex instead of std::string functions, please 
review my patch, thanks a lot!

Regards,
Leslie Zhai


Repository:
  rL LLVM

https://reviews.llvm.org/D31320

Files:
  include/clang/Analysis/CloneDetection.h
  lib/Analysis/CloneDetection.cpp
  lib/StaticAnalyzer/Checkers/CloneChecker.cpp
  test/Analysis/copypaste/autogenerated_automoc.cpp
  test/Analysis/copypaste/moc_autogenerated.cpp

Index: test/Analysis/copypaste/autogenerated_automoc.cpp
===
--- test/Analysis/copypaste/autogenerated_automoc.cpp
+++ test/Analysis/copypaste/autogenerated_automoc.cpp
@@ -0,0 +1,19 @@
+// RUN: %clang_analyze_cc1 -std=c++11 -analyzer-checker=alpha.clone.CloneChecker -verify %s
+
+// Because files that have `_automoc.' in their names are most likely autogenerated,
+// we suppress copy-paste warnings here.
+
+// expected-no-diagnostics
+
+void f1() {
+  int *p1 = new int[1];
+  int *p2 = new int[1];
+  if (p1) {
+delete [] p1;
+p1 = nullptr;
+  }
+  if (p2) {
+delete [] p1; // no-warning
+p2 = nullptr;
+  }
+}
Index: test/Analysis/copypaste/moc_autogenerated.cpp
===
--- test/Analysis/copypaste/moc_autogenerated.cpp
+++ test/Analysis/copypaste/moc_autogenerated.cpp
@@ -0,0 +1,19 @@
+// RUN: %clang_analyze_cc1 -std=c++11 -analyzer-checker=alpha.clone.CloneChecker -verify %s
+
+// Because files that have `moc_' in their names are most likely autogenerated,
+// we suppress copy-paste warnings here.
+
+// expected-no-diagnostics
+
+void f1() {
+  int *p1 = new int[1];
+  int *p2 = new int[1];
+  if (p1) {
+delete [] p1;
+p1 = nullptr;
+  }
+  if (p2) {
+delete [] p1; // no-warning
+p2 = nullptr;
+  }
+}
Index: lib/StaticAnalyzer/Checkers/CloneChecker.cpp
===
--- lib/StaticAnalyzer/Checkers/CloneChecker.cpp
+++ lib/StaticAnalyzer/Checkers/CloneChecker.cpp
@@ -78,7 +78,8 @@
   // because reportSuspiciousClones() wants to search them for errors.
   std::vector AllCloneGroups;
 
-  Detector.findClones(AllCloneGroups, RecursiveCloneTypeIIConstraint(),
+  Detector.findClones(AllCloneGroups, AutoGeneratedCloneConstraint(), 
+  RecursiveCloneTypeIIConstraint(),
   MinComplexityConstraint(MinComplexity),
   MinGroupSizeConstraint(2), OnlyLargestCloneConstraint());
 
Index: lib/Analysis/CloneDetection.cpp
===
--- lib/Analysis/CloneDetection.cpp
+++ lib/Analysis/CloneDetection.cpp
@@ -21,6 +21,7 @@
 #include "llvm/ADT/StringRef.h"
 #include "llvm/Support/MD5.h"
 #include "llvm/Support/raw_ostream.h"
+#include "llvm/Support/Regex.h"
 
 using namespace clang;
 
@@ -366,6 +367,29 @@
   }
 }
 
+bool AutoGeneratedCloneConstraint::isAutoGenerated(const CloneDetector::CloneGroup ) {
+  if (Group.empty())
+return false;
+
+  for (const StmtSequence  : Group) {
+const Decl *D = S.getContainingDecl();
+const SourceManager  = D->getASTContext().getSourceManager();
+std::string Filename = std::string(SM.getFilename(D->getLocation()));
+// Get Basename
+const size_t LastSlash = Filename.find_last_of("\\/");
+if (LastSlash != std::string::npos)
+  Filename.erase(0, LastSlash + 1);
+const size_t LastDot = Filename.rfind('.');
+if (LastDot != std::string::npos)
+  Filename.erase(LastDot);
+llvm::Regex R(StringRef("^(moc_|.*_automoc$)"));
+if (R.match(StringRef(Filename)))
+  return true;
+  }
+
+  return false;
+}
+
 static size_t createHash(llvm::MD5 ) {
   size_t HashCode;
 
Index: include/clang/Analysis/CloneDetection.h
===
--- include/clang/Analysis/CloneDetection.h
+++ include/clang/Analysis/CloneDetection.h
@@ -319,6 +319,17 @@
   void constrain(std::vector );
 };
 
+struct AutoGeneratedCloneConstraint {
+  bool isAutoGenerated(const CloneDetector::CloneGroup );
+
+  void constrain(std::vector ) {
+

[PATCH] D31320: [analyzer] Teach CloneDetection about Qt Meta-Object Compiler

2017-04-28 Thread Artem Dergachev via Phabricator via cfe-commits
NoQ added a comment.

Thanks! Because LLVM's Illinois license is rather permissive than copyleft, we 
try to avoid stuff copied from GPL/LGPL software (such as Qt or K3B) in our 
codebase. The code doesn't seem to have been copy-pasted from a copyleft 
project, but I guess it's better to rename the file to avoid referencing to 
K3B, and i added inline comments regarding `moc` intro comments.




Comment at: lib/Analysis/CloneDetection.cpp:377
+StringRef Filename = SM.getFilename(D->getLocation());
+if (Filename.find(StringRef("moc_")) != StringRef::npos ||
+Filename.find(StringRef("_automoc.")) != StringRef::npos ||

Maybe `.startswith("moc_")` would be more accurate?

In fact, you could also try to use a single LLVM regex here.



Comment at: test/Analysis/copypaste/k3blib_automoc.cpp:5-7
+/* This file is autogenerated, do not edit*/
+
+// clang -E RealMetaObjectCompiler_automoc.cpp > ~/PreprocessedMOC_automoc.cpp

Other LLVM contributors are free to edit this file, and i doubt it was 
autogenerated; i believe these comments should be removed.

That said, there should be a comment explaining why the file has no warning. 
Eg.:
```
// Because files that have `_automoc' in their names are most likely 
autogenerated,
// we suppress copy-paste warnings here.

// expected-no-diagnostics
```

(same in the other file)



Comment at: test/Analysis/copypaste/k3blib_automoc.cpp:16
+  }
+  // Copy-paste above block but careless forget to change something
+  if (p2) {

My idea regarding the comment above would make this comment unnecessary. (same 
in the other file)



Comment at: test/Analysis/copypaste/moc_k3bactivepipe.cpp:5-13
+/
+** Meta object code from reading C++ file 'k3bactivepipe.h'
+**
+** Created by: The Qt Meta Object Compiler version 67 (Qt 5.8.0)
+**
+** WARNING! All changes made in this file will be lost!
+*/

This file wasn't in fact created by `moc`, does not seem to be anyhow related 
to `k3b`; i believe these comments should be removed.


Repository:
  rL LLVM

https://reviews.llvm.org/D31320



___
cfe-commits mailing list
cfe-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[PATCH] D31320: [analyzer] Teach CloneDetection about Qt Meta-Object Compiler

2017-04-28 Thread Leslie Zhai via Phabricator via cfe-commits
xiangzhai updated this revision to Diff 97047.
xiangzhai added a subscriber: cfe-commits.
xiangzhai added a comment.

Hi Artem,

Please review my updated patch, I use SourceManager's getFilename and add some 
testcases, thanks a lot!

Regards,
Leslie Zhai


Repository:
  rL LLVM

https://reviews.llvm.org/D31320

Files:
  include/clang/Analysis/CloneDetection.h
  lib/Analysis/CloneDetection.cpp
  lib/StaticAnalyzer/Checkers/CloneChecker.cpp
  test/Analysis/copypaste/k3blib_automoc.cpp
  test/Analysis/copypaste/moc_k3bactivepipe.cpp

Index: test/Analysis/copypaste/k3blib_automoc.cpp
===
--- test/Analysis/copypaste/k3blib_automoc.cpp
+++ test/Analysis/copypaste/k3blib_automoc.cpp
@@ -0,0 +1,21 @@
+// RUN: %clang_analyze_cc1 -std=c++11 -analyzer-checker=alpha.clone.CloneChecker -verify %s
+
+// expected-no-diagnostics
+
+/* This file is autogenerated, do not edit*/
+
+// clang -E RealMetaObjectCompiler_automoc.cpp > ~/PreprocessedMOC_automoc.cpp
+
+void f1() {
+  int *p1 = new int[1];
+  int *p2 = new int[1];
+  if (p1) {
+delete [] p1;
+p1 = nullptr;
+  }
+  // Copy-paste above block but careless forget to change something
+  if (p2) {
+delete [] p1; // no-warning
+p2 = nullptr;
+  }
+}
Index: test/Analysis/copypaste/moc_k3bactivepipe.cpp
===
--- test/Analysis/copypaste/moc_k3bactivepipe.cpp
+++ test/Analysis/copypaste/moc_k3bactivepipe.cpp
@@ -0,0 +1,27 @@
+// RUN: %clang_analyze_cc1 -std=c++11 -analyzer-checker=alpha.clone.CloneChecker -verify %s
+
+// expected-no-diagnostics
+
+/
+** Meta object code from reading C++ file 'k3bactivepipe.h'
+**
+** Created by: The Qt Meta Object Compiler version 67 (Qt 5.8.0)
+**
+** WARNING! All changes made in this file will be lost!
+*/
+
+// clang -E moc_RealMetaObjectCompiler.cpp > ~/moc_PreprocessedMOC.cpp
+
+void f1() {
+  int *p1 = new int[1];
+  int *p2 = new int[1];
+  if (p1) {
+delete [] p1;
+p1 = nullptr;
+  }
+  // Copy-paste above block but careless forget to change something
+  if (p2) {
+delete [] p1; // no-warning
+p2 = nullptr;
+  }
+}
Index: lib/StaticAnalyzer/Checkers/CloneChecker.cpp
===
--- lib/StaticAnalyzer/Checkers/CloneChecker.cpp
+++ lib/StaticAnalyzer/Checkers/CloneChecker.cpp
@@ -78,7 +78,8 @@
   // because reportSuspiciousClones() wants to search them for errors.
   std::vector AllCloneGroups;
 
-  Detector.findClones(AllCloneGroups, RecursiveCloneTypeIIConstraint(),
+  Detector.findClones(AllCloneGroups, AutoGeneratedCloneConstraint(), 
+  RecursiveCloneTypeIIConstraint(),
   MinComplexityConstraint(MinComplexity),
   MinGroupSizeConstraint(2), OnlyLargestCloneConstraint());
 
Index: lib/Analysis/CloneDetection.cpp
===
--- lib/Analysis/CloneDetection.cpp
+++ lib/Analysis/CloneDetection.cpp
@@ -366,6 +366,24 @@
   }
 }
 
+bool AutoGeneratedCloneConstraint::isAutoGenerated(const CloneDetector::CloneGroup ) {
+  if (Group.empty())
+return false;
+
+  for (const StmtSequence  : Group) {
+const Decl *D = S.getContainingDecl();
+const SourceManager  = D->getASTContext().getSourceManager();
+StringRef Filename = SM.getFilename(D->getLocation());
+if (Filename.find(StringRef("moc_")) != StringRef::npos ||
+Filename.find(StringRef("_automoc.")) != StringRef::npos ||
+Filename.find(StringRef(".moc")) != StringRef::npos) {
+  return true;
+}
+  }
+
+  return false;
+}
+
 static size_t createHash(llvm::MD5 ) {
   size_t HashCode;
 
Index: include/clang/Analysis/CloneDetection.h
===
--- include/clang/Analysis/CloneDetection.h
+++ include/clang/Analysis/CloneDetection.h
@@ -319,6 +319,17 @@
   void constrain(std::vector );
 };
 
+struct AutoGeneratedCloneConstraint {
+  bool isAutoGenerated(const CloneDetector::CloneGroup );
+
+  void constrain(std::vector ) {
+CloneConstraint::filterGroups(
+CloneGroups, [this](const CloneDetector::CloneGroup ) {
+  return isAutoGenerated(Group);
+});
+  }
+};
+
 /// Analyzes the pattern of the referenced variables in a statement.
 class VariablePattern {
 
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits