summaryrefslogtreecommitdiff
path: root/compilerplugins
AgeCommit message (Collapse)Author
2015-03-03Improve loplugin:passstuffbyrefStephan Bergmann
Change-Id: I88ab4c51ff59312127681d3087d22b9c79192b94
2015-03-02Missing initializationStephan Bergmann
Change-Id: I45eabbe9d1a4e3f85f16c2869c4031fc06f5ef31
2015-03-02plugin:literaltoboolconversion: Recurse into comma operator's rhsStephan Bergmann
...inspired by <http://www.viva64.com/en/b/0308/#ID0EE4BI>'s V639 finding. Change-Id: I3b49f00dd4a593ed0b94d81398fa89ff64f6c79b
2015-02-26Adapt compilerplugins to Clang trunk towards 3.7Stephan Bergmann
Change-Id: I5b41039bf63a4c2f313fe7a57c0f6934dcb0752d
2015-02-09Adapt loplugin:passstuffbyref to Clang 3.2Stephan Bergmann
Change-Id: I24d0b7531feba32f86f761daf18170397cfe5d2f
2015-02-07loplugin:deletedspecial (Mac OS X)Stephan Bergmann
Change-Id: Ia09e2e7b3e40bd04da64b52fe29258017b90b156
2015-02-07loplugin:deletedspecial to help add SAL_DELETED_FUNCTION annotationsStephan Bergmann
...to special member function declarations that were left undefined. Helps compilers do a better job at identifiying unused class members. This plugin uses heuristics and whitelists do identify applicable declarations, but is not appropriate for "unattended" use so is placed into store/. The following commits contain the results of running this plugin, per module: * Declarations of undefined special member functions are mmarked SAL_DELETED_FUNCTION (aka "= delete", which is deemed superior to deriving the class from boost::noncopyable, cf. Howard Hinnant's reply to <http://stackoverflow.com/questions/7823990/what-are-the-advantages-of-boostnoncopyable>. * Any redundant "explicit" or SAL_DLLPRIVATE markers are removed from the deleted definitions. * Some redundant declarations of undefined default ctors are simply removed; smelled like clueless cargo-cult to have them declared at all. * Some declarations of undefined operator == etc. are left in (and marked SAL_DELETED_FUNCTION) for now, to be on the safe side, though they are likely clueless cargo-cult, too. * Most "static-only" classes are replaced with namespaces (and some where that would be non-trivial due to private members are marked TODO for later). * Newly identified unused class members are removed. Change-Id: Ibeaae4fd579d7a0971a2c2a654a2263acd13414a
2015-02-05Extend loplugin:passstuffbyref to handle lambdasStephan Bergmann
...even if it is known to be dangerous Change-Id: Ied96284e33b966bf072d0961054479ec7f891dea
2015-01-29Extract loplugin:redundantcast from loplugin:cstylecastStephan Bergmann
Change-Id: I08f17dd9cc092206083ff41bbbc178e0322e86d0
2015-01-28Some more loplugin:cstylecast clean-upStephan Bergmann
Change-Id: I132d22e2af3cf673c17d8964f690d48990834884
2015-01-26move these plugins into /storeNoel Grandin
we don't need to run them on an ongoing basis, and the current code does not compile with older versions of clang. Change-Id: I07ccacf7ff7b00e8e2453fff91a3f487dd5abed9
2015-01-26new loplugin: change virtual methods to non-virtualNoel Grandin
Where we can prove that the virtual method is never overriden. In the case of pure-virtual methods, we remove the method entirely. Sometimes this leads to entire methods and fields being eliminated. Change-Id: I138ef81c95f115dbd8c023a83cfc7e9d5d6d14ae
2015-01-22loplugin:cstylecast: Warn about more of the potentially suspicious onesStephan Bergmann
Change-Id: Id7a596344c21e9265e35188c477e60ce510bcc6e
2015-01-09loplugin:cstylecast: warn about certain redundant reinterpret_castsStephan Bergmann
Change-Id: Iaa46849742c215798722d03d9ee59bb39d8033f7
2015-01-08Fix typoTor Lillqvist
Change-Id: Ifdbcbcc51c29dc14b2a3b4c845481b45300313d6
2015-01-08loplugin:cstylecast: improve detection of C codeStephan Bergmann
Change-Id: Id5dd1ee1a29c4e1c7cb2b58419d6ccb1f032bffe
2015-01-07loplugin:cstylecast: No need to exclude include/cppuhelperStephan Bergmann
Change-Id: Ie74be926c1e071fa9b311920b1cf1d4dd5bbd30d
2015-01-07tools/solar.h already filtered out via filename.endsWith(".h")Stephan Bergmann
Change-Id: I8a4483a6425f51fea0eae5c809c6c41ef56388a2
2015-01-07loplugin:cstylecast: bridgesStephan Bergmann
Change-Id: I7c41b90c9af045fd452ee62ed0c5d9b261236855
2015-01-07loplugin:cstylecast: salStephan Bergmann
Change-Id: I0ad9681a8b31d78cefce5b66040415154a1c7a99
2015-01-07Minor beautificationStephan Bergmann
Change-Id: I1300d1d696878c1b646decc2841f13d489d3cadc
2015-01-07loplugin:cstylecast: Exclude only sal, not salhelperStephan Bergmann
Change-Id: Ib09f2b794ce7a1e650275750a67c6c8ad5d7c808
2015-01-06Work around loplugin:cstylecast under -fsanitize=*Stephan Bergmann
Change-Id: I467d032296607d22e850c95e56c452fe7e62cebe
2015-01-05Improve loplugin:revisibilityStephan Bergmann
(for non-Windows--only code, as MSVC would complain about such cases anyway) Change-Id: Id6daf61b79bd31529bdaeb7c6df4f354731ae7d7
2015-01-05Some loplugin:revisibility clean-upStephan Bergmann
Stumbled across such redundant visibility re-specifications when looking at the odd case of cppu_unsatisfied_iquery_msg declared CPPU_DLLPUBLIC in cppu/source/cppu/cppu_opt.cxx and used in inline code in include/com/sun/star/uno/Reference.hxx with only a declaration lacking CPPU_DLLPUBLIC visible, and wondering how that actually works on Windows. However, this plugin is probably not worth it being run all the time, so committing it to compilerplugins/clang/store/. Change-Id: Ibc3c4e7499213de1b419ce7eb85455cb832e1510
2014-12-21Don't call isIntegerConstantExpr if isValueDependentStephan Bergmann
...some paths trough clang::Expr::isIntegerConstantExpr (esp. if non-CPlusPlus11) assert the assumption that the given expr is not value-dependent, so it appears to be a prereq Change-Id: Ibc5fe472ea3f91b31c8cb7f06c4b7c7f4d6831a3
2014-12-19Extend loplugin:literalalternative to loplugin:stringconstantStephan Bergmann
Change-Id: Ie425af19019126b6a15ac03f52e32d186a46db35
2014-12-18loplugin:saloverride does not make sense for external codeStephan Bergmann
...where SAL_OVERRIDE is not available Change-Id: I49d447ba90516f4f744c21302607bff97ad3c4d5
2014-12-07loplugin:cstylecast: warn about casts involving incomplete typesStephan Bergmann
...the worst kind of all Change-Id: I6b98a324735a79ed9060003b491acce733f74f06
2014-12-04move the cstylecast clang plugin out of /storeNoel Grandin
Change-Id: Iee78bd688ddb3e02deb1a3636d6a604838e97b09
2014-12-04Problematic casts in gendata.hxx are already under controlStephan Bergmann
Change-Id: If3b0f667b379b7973364c93be4b88347e5768223
2014-12-04cstylecast plugin - exclude some more filesNoel Grandin
Change-Id: I4dc6cc7f461fa11d12bf6fd9700befe4bbdac62c
2014-12-04Run loplugin:cstylecast on C++ and Ojbective C++ codeStephan Bergmann
Change-Id: I4035318d35d468fa93d4dcfe56f9b0434fd1dfe7
2014-11-20also look for cascading assignmentsBjoern Michaelsen
Change-Id: I7fa18403698530eec379589c76631f0aa367b215 Reviewed-on: https://gerrit.libreoffice.org/12991 Reviewed-by: Björn Michaelsen <bjoern.michaelsen@canonical.com> Tested-by: Björn Michaelsen <bjoern.michaelsen@canonical.com>
2014-11-20cascading conditional operators, give a hint on complexityBjoern Michaelsen
Change-Id: Ie9d0b07a32cc17705db735ea18f70f28d57badd4 Reviewed-on: https://gerrit.libreoffice.org/12990 Reviewed-by: Björn Michaelsen <bjoern.michaelsen@canonical.com> Tested-by: Björn Michaelsen <bjoern.michaelsen@canonical.com>
2014-11-19add clang plugin for detecting cascading condopsBjoern Michaelsen
Change-Id: I1b782bb04b09bee5c3db2261f9390a7b2edf4564 Reviewed-on: https://gerrit.libreoffice.org/12967 Reviewed-by: Björn Michaelsen <bjoern.michaelsen@canonical.com> Tested-by: Björn Michaelsen <bjoern.michaelsen@canonical.com>
2014-11-12Fix common typos. No automatic tools. Handmade…Andrea Gelmini
Change-Id: I1ab4e23b0539f8d39974787f226e57a21f96e959 Reviewed-on: https://gerrit.libreoffice.org/12164 Reviewed-by: Noel Grandin <noelgrandin@gmail.com> Tested-by: Noel Grandin <noelgrandin@gmail.com>
2014-11-05new loplugin: use more efficient find() methodsNoel Grandin
(Original idea from Kendy) Look for code that is calling std::find on a sorted container (set/map/vector) and warn about it - the code should be using the find method on the container itself, since that is considerably faster. Change-Id: Ib74e5d3faa836eeb0df16a736d202696626bdfd2
2014-10-01Remove excess [%1 %2] that doesn't match any argumentsStephan Bergmann
...and is apparently a leftover from temporary debug output in e36badb98d0bb5866a297cb51c3e95cdce62d8da "Fix workaround for bug in Clang 3.2 FunctionDecl::isInlined." Change-Id: I3213981c5d236a7b67083014692566f75a2bcd51
2014-09-30compilerplugins: get rid of std::auto_ptr in commentStephan Bergmann
Change-Id: Ia2b1bc97f3476da7bfbe659e5160cd5c73c01ce5
2014-09-29cstylecast plugin: ignore templates, improve messageNoel Grandin
Change-Id: I8347010d5607dc2cbb113b33f1cb2cc78ec106d2
2014-09-25loplugin:nullptrStephan Bergmann
A plugin to warn about and rewrite null pointer constants that are not written as nullptr (in C++11 code) resp. NULL (in C and C++03 code). It is not activated for the following reasons: * At least the call to pImpl->aFmtNms.insert(pImpl->aFmtNms.begin() + nPos, nullptr); in svx/source/items/clipfmtitem.cxx would require <https://svn.boost.org/trac/boost/ticket/10540> "missing std::nullptr_t support in boost/type_traits/is_pointer.hpp" to be fixed first. * Additions of code that violate the plugin would probably be frequent, causing unnecessary grief for those building with plugins enabled. * It did not find anything interesting, apart from the above Boost bug and the mildly interesting 1da153b617b80887680be65c1854ef8080c2e1c9 "Consistently use APP_WRITER as an integer, never as a nullptr." Anyway, until make -O -j4 -k check; do make -O -j1 -k check \ COMPILER_PLUGIN_TOOL=nullptr UPDATE_FILES=all; done sucessfully executed on a recent master and resulted in 6798 files changed, 60919 insertions(+), 60919 deletions(-) Change-Id: I1260227949868e73fcb63fda13d83e79fde685d7
2014-09-23Adapt compilerplugins to Clang trunk towards 3.6Stephan Bergmann
Change-Id: If6ee343bb4d4004e7a95fe1c5adc97210fc0abd0
2014-09-23fdo#82577: Handle WindowNoel Grandin
Put the VCL Window class in the vcl namespace. Avoids clash with the X11 Window typedef. Change-Id: Ib1beb7ab4ad75562a42aeb252732a073d25eff1a
2014-09-21Revert "new loplugin: VCL widget reference checker"Stephan Bergmann
This gerrit patch was apparently not ready yet for integration. This reverts commit 44a432e9073b3d39b1bdd34b65cfd91d5541f324.
2014-09-21new loplugin: VCL widget reference checkerNoel Grandin
First stage of new VCL widget reference checker Change-Id: I63a2108a26b3c0e0a896d13672b1daa6f8e60b3a Reviewed-on: https://gerrit.libreoffice.org/10427 Reviewed-by: Chris Sherlock <chris.sherlock79@gmail.com> Tested-by: Chris Sherlock <chris.sherlock79@gmail.com>
2014-09-16...and anotherStephan Bergmann
Change-Id: If9d85236177c819c159d1b836e806fc2b03da45c
2014-09-16Fix workaround for bug in Clang 3.2 FunctionDecl::isInlinedStephan Bergmann
Change-Id: I9b0b6affc60ae030b644fdd13eecfb1aed1f472a
2014-09-15Work around bug in Clang 3.2 FunctionDecl::isInlinedStephan Bergmann
Change-Id: I214a9745f27c27868b3e74785cf7138fc1db1943
2014-09-15do not warn about "null pointer conversions" from integers in C++98 modeLuboš Luňák
Change-Id: I15c7f52c542549ad131400c9b5395a06a4777687