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

Leslie Zhai via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Thu Jun 15 20:40:27 PDT 2017


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 <https://github.com/KDE/k3b> project's Copy-paste issue to filter Meta Object Compiler <http://doc.qt.io/qt-5/moc.html>, User Interface Compiler <http://doc.qt.io/qt-5/uic.html>, D-Bus XML Compiler <http://doc.qt.io/qt-5/qdbusxml2cpp.html>, 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

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D31320.102777.patch
Type: text/x-patch
Size: 7421 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20170616/83e7b934/attachment.bin>


More information about the cfe-commits mailing list