summaryrefslogtreecommitdiffstats
path: root/compilerplugins
Commit message (Collapse)AuthorAgeFilesLines
* compilerplugins: -isystem /usr/include breaks the buildMichael Stahl2016-06-301-1/+2
| | | | | | | | | | | | | ... on Fedora 24, and it's a Bad Idea in general because it breaks "#include_next" ordering of GCC's and glibc's variously distributed headers. Change-Id: I0c8b51a6d7191ec9cc5187636ea2717e8fd97715 (cherry picked from commit 11f69994b0231a760231b712d9faf6806334232f) Reviewed-on: https://gerrit.libreoffice.org/26783 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Caolán McNamara <caolanm@redhat.com> Tested-by: Caolán McNamara <caolanm@redhat.com>
* More Clang 3.4 "(anonymous namespace)" fixesStephan Bergmann2016-06-3011-76/+161
| | | | | | | | | | | | | | | | Reviewed-on: https://gerrit.libreoffice.org/26748 Reviewed-by: Stephan Bergmann <sbergman@redhat.com> Tested-by: Stephan Bergmann <sbergman@redhat.com> (cherry picked from commit 0d3738a2580d72b778547bfcdf691fdeb0eccbdd) Conflicts: compilerplugins/clang/refcounting.cxx compilerplugins/clang/weakobject.cxx Change-Id: I7cb43f915565dadd611b90ee30373e472f97efb5 Reviewed-on: https://gerrit.libreoffice.org/26779 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Caolán McNamara <caolanm@redhat.com> Tested-by: Caolán McNamara <caolanm@redhat.com>
* More adaption to Clang 3.4Stephan Bergmann2016-06-303-11/+61
| | | | | | | | | | | | ...where NmaedDecl::getQualifiedNameAsString (which is expensive and bad, anyway) apparently returns something other than "(anonymous namespace)" Change-Id: I05ef96665c48f8f596dd0d317388e91a75b8307b (cherry picked from commit c1ab6613ae7b45f2d90aafd6c6a829a471ceca55) Reviewed-on: https://gerrit.libreoffice.org/26778 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Caolán McNamara <caolanm@redhat.com> Tested-by: Caolán McNamara <caolanm@redhat.com>
* Adapt to Clang 3.4 (in preparation of a buildbot on CentOS 7)Stephan Bergmann2016-06-3010-12/+48
| | | | | | | | | | | | | | (cherry picked from commit 9308f353186fb39a02eddfc281fc72ac1026e0b6) Conflicts: compilerplugins/clang/refcounting.cxx compilerplugins/clang/singlevalfields.cxx compilerplugins/clang/weakobject.cxx Change-Id: Ie2859f03b31c57deb7fd0deba3285f782e33b239 Reviewed-on: https://gerrit.libreoffice.org/26777 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Caolán McNamara <caolanm@redhat.com> Tested-by: Caolán McNamara <caolanm@redhat.com>
* loplugin compat with clang 3.4Noel Grandin2016-06-301-1/+16
| | | | | | | | | | Change-Id: I264fe688519b8b2173d5cccd8a453847a7fb89d9 (cherry picked from commit 1aafc64b4d3ca2a01057209f047b136297c7842b) Reviewed-on: https://gerrit.libreoffice.org/26776 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Noel Grandin <noelgrandin@gmail.com> Reviewed-by: Caolán McNamara <caolanm@redhat.com> Tested-by: Caolán McNamara <caolanm@redhat.com>
* Adpat to <https://llvm.org/svn/llvm-project/cfe/trunk@273647>Stephan Bergmann2016-06-306-6/+20
| | | | | | | | | | | "Use more ArrayRefs" Change-Id: Ied0ab11dd9366b3f499100b2627f4919cca52c9c (cherry picked from commit f8a18a464eb2cd8ee7a07b8ddef0fa5d79d638ef) Reviewed-on: https://gerrit.libreoffice.org/26775 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Caolán McNamara <caolanm@redhat.com> Tested-by: Caolán McNamara <caolanm@redhat.com>
* update unusedmethods plugin to ignore externC and copy constructorsNoel Grandin2016-05-181-2/+8
| | | | Change-Id: Idf7a9403d313ba6a0e031c59601e20c880b6118b
* update vclwidgets loplugin to handle VclReferenceBaseNoel Grandin2016-05-181-18/+20
| | | | Change-Id: I447cdb8c65d880b3c5ff28b35cefdc56ff784852
* update unusedmethods plugin to deal with constructorsNoel Grandin2016-05-184-24/+31
| | | | | | | | | | and fix the operator< implementations in some of the other plugins too. Change-Id: Ie5631e0cdc8d2a994ad2af2533cdb558a6cfc035 Reviewed-on: https://gerrit.libreoffice.org/25057 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Noel Grandin <noelgrandin@gmail.com>
* fix null pointer crash in loplugin:commaoperatorNoel Grandin2016-05-161-12/+14
| | | | Change-Id: Ie077ed9a8f200b39da25938b35a3622e52cc5110
* teach passstuffbyref plugin to check for..Noel Grandin2016-05-061-24/+79
| | | | | | | | | | | | unnecessarily passing primitives by const ref. Suggested by Tor Lillqvist Change-Id: I445e220542969ca3e252581e5953fb01cb2b2be6 Reviewed-on: https://gerrit.libreoffice.org/24672 Reviewed-by: Tor Lillqvist <tml@collabora.com> Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Noel Grandin <noelgrandin@gmail.com>
* move stylepolice back to storeNoel Grandin2016-04-281-0/+0
| | | | | | recent updates did not meet with universal approval Change-Id: Ic059729797049361c7a8a4ae000cd39a5993f6af
* loplugin:stylepoliceNoel Grandin2016-04-281-0/+1
| | | | Change-Id: I151e4d94f1f5dc84ef3f91218686ca9d1b9bc36f
* teach stylepolice plugin about ref-counted-pointer namingNoel Grandin2016-04-281-11/+58
| | | | | | | Change-Id: I6e91d22fc1826038c05ddb6fc065563c6a250752 Reviewed-on: https://gerrit.libreoffice.org/24459 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Noel Grandin <noelgrandin@gmail.com>
* cppcheck: silence warnings in compilerpluginsJochen Nitschke2016-04-277-7/+7
| | | | | | | | | | | | | | | mostly missing explicit before ctors and uninitialized member vars one odd use of std::find > compilerplugins/clang/implicitboolconversion.cxx > 800 stlIfFind warning Suspicious condition. > The result of find() is an iterator, but it is not properly checked. Change-Id: Iade53494cd7fe8ddb0e110e431449ae5a517fe3b Reviewed-on: https://gerrit.libreoffice.org/24398 Reviewed-by: Stephan Bergmann <sbergman@redhat.com> Tested-by: Stephan Bergmann <sbergman@redhat.com>
* loplugin:stylepolice: adapt to libc++Stephan Bergmann2016-04-271-0/+6
| | | | Change-Id: I8a471d0fb7a206f1a235c3019ae9d07b44056e01
* Enable Clang plugin warnings in Bison source codeStephan Bergmann2016-04-262-1/+5
| | | | | | | | | | | | | | | | | | | | | | -Werror is generally suppressed in Bison-generated C/C++ code (as in all other generated code) to silence warnings from the Bison skeleton code. And the Clang plugins suppress warnings in generated WORKDIR code based on the presumed source location (i.e., taking #line directives into account). So introduce a new PLUGIN_WARNINGS_AS_ERRORS mode where warnings from Clang plugins are reported as errors even if -Werror is suppressed. That way, any warnings in the Bison skeleton code still do not lead to compilation errors, while (at least plugin- emitted) warnings in the genuine source code do. Unfortunately this cannot also be enabled for Flex source code, as at least Flex 2.5.39 generates poor code that does not properly prefix all skeleton code with appropriate #line directives, so that some skeleton code would be mistaken for genunie source code, and compilation would fail due to errors. Also, %glr-parser Bison input appears to generate no #line directives at all (at least with Bison 3.0.4), so all of connectivity/source/parse/sqlbison.y is considered generated code and plugin warnings are still suppressed throughout. Change-Id: Id746e81cbfa5f77628b0a34c7b82780948e7db08
* update loplugin stylepolice to check local pointers varsNoel Grandin2016-04-262-80/+142
| | | | | | | | | | | | are actually pointer vars. Also convert from regex to normal code, so we can enable this plugin all the time. Change-Id: Ie36a25ecba61c18f99c77c77646d6459a443cbd1 Reviewed-on: https://gerrit.libreoffice.org/24391 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Noel Grandin <noelgrandin@gmail.com>
* Lots of violations in gcc3_linux_x86-64/share.hxx, too, when using libc++Stephan Bergmann2016-04-251-8/+4
| | | | Change-Id: I6f32f7b1dcb97c9651bba2c03c495fb70448e524
* Just don't bother with Clang <= 3.6Stephan Bergmann2016-04-251-0/+2
| | | | | | | ...where Preprocessor::macros and Preprocessor::getLocalMacroDirectiveHistory would need to be done slightly differently Change-Id: Id46b05ac42012597c91a556b17ed008b6c7c5912
* loplugin:reservedidStephan Bergmann2016-04-221-0/+261
| | | | Change-Id: Ifa75d3f228db87f7a899612964bf08e9573fb5be
* Avoid reserved identifiersStephan Bergmann2016-04-221-1/+1
| | | | Change-Id: I263603fb81d368ebc8450b2d8cc01752fcd3f29d
* Avoid reserved identifiersStephan Bergmann2016-04-221-1/+1
| | | | Change-Id: I27ff0f4f0eb395d7e0a60dd604758c220a3134c4
* loplugin:salbool: sal_Bool[] -> bool[]Stephan Bergmann2016-04-211-11/+78
| | | | Change-Id: I3c5bf7a53c9ae173f8fce885ecf022f092aa43a9
* Use Sequence ctor taking initializer_listStephan Bergmann2016-04-211-0/+39
| | | | | | | | needed adapting loplugin:implicitboolconversion to not warn about Sequence<sal_Bool> arBool({true, false, true}); Change-Id: I971918aab7c958ef8f1e4e0548a84314e95f8325
* typoStephan Bergmann2016-04-211-1/+1
| | | | Change-Id: I67721e86073bd2f67bee3ffbbb81fd5d143997d8
* Better fix for 13758a3d154e8e450fdfe8bcdeb6b3a03996c53aStephan Bergmann2016-04-212-4/+22
| | | | | | | | | | | "SourceManager::isMacroArgExpansion has only one param in older Clang", which caused false positives like warning about sal_False in CPPUNIT_ASSERT_EQUAL(guard.p->m1, sal_False); in cppu/qa/cppumaker/test_cppumaker.cxx Change-Id: I1c5a67527aef381e336d71cb8fefbb87961bbf96
* move stylepolice plugin into store/Noel Grandin2016-04-211-0/+0
| | | | | | | seems std::regex is not too well supported yet, at least in libstdc++-4.8 Change-Id: Ib9feb33d2f197d40fc67dc93468aa2f7dae05bac
* SourceManager::isMacroArgExpansion has only one param in older ClangStephan Bergmann2016-04-211-3/+3
| | | | Change-Id: I5aa4f7cca70b8196263613b92c018323152411a1
* new plugin stylepoliceNoel Grandin2016-04-211-0/+80
| | | | | | | check for local variables which follow our member field naming convention, which is highly confusing Change-Id: Idacedf7145d09843e96a584237b385f7662eea10
* loplugin:salbool: Warn about uses of sal_False/TrueStephan Bergmann2016-04-201-0/+61
| | | | | | | | ...that can generally be rewritten as false/true, and sometimes could hide errors, see e.g. <5be5f00fe16b0e255b31fbaba5f119773d1cd071> "So this is apparently about right-to-left levels, not a boolean flag". Change-Id: Ib39a936a632c2aab206f24c346252e31dcbb98f3
* Use cast to bool to normalize sal_Bool valuesStephan Bergmann2016-04-201-0/+13
| | | | Change-Id: I8a886f752d2a16ec4c10656bcd0b3631647971b2
* Ignore external codeStephan Bergmann2016-04-181-1/+2
| | | | Change-Id: Ie527703e9687a42bfc39439952b9d1a83d7cad24
* tdf#99352 - Some VclPtrs leak past DeInitVCLNoel Grandin2016-04-181-6/+2
| | | | | | | Change-Id: I74b27b1d8b662a644df580ae128643b8495355f8 Reviewed-on: https://gerrit.libreoffice.org/24204 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Noel Grandin <noelgrandin@gmail.com>
* update badstatics plugin to look for VclPtr<> staticsNoel Grandin2016-04-151-0/+17
| | | | | | | | | | | maybe we should create a "StaticVclPtr<>" class that checks if VCL is still "alive" before destructing the object? Change-Id: If8619f689c29294efa19c37ec782fa07acec728d Reviewed-on: https://gerrit.libreoffice.org/24085 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Michael Meeks <michael.meeks@collabora.com> Reviewed-by: Björn Michaelsen <bjoern.michaelsen@canonical.com>
* turn on the passstuffbyref plugin againNoel Grandin2016-04-141-1/+1
| | | | | | | now that I have committed all of the changes to return types it found Change-Id: Iaee121037ce83e94001e4591d232b075dfeade7c
* update loplugin passstuffbyref to check return typesNoel Grandin2016-04-131-22/+88
| | | | | | | | | | | | | | | | | | of methods like Foo getFoo() const { return m_foo; } where we can rather do const Foo& getFoo() const { return m_foo; } and let the client code decide if it wants copy Foo. Inspired by a performance problem where we were unwittingly copy constructing a large struct repeatedly just so client code could interrogate the members of the struct. When all of the changes this plugin finds are applied, I find that 'perf stat make check' shows on average a 1.7% reduction in CPU cycles. Change-Id: Ic27b4f817aa98f2a2a009f2d4e4a962cbe9c613e
* Avoid reserved identifiersStephan Bergmann2016-04-071-1/+1
| | | | Change-Id: I438a7f28ba6bc68ec4e6244a4343e4040ab1b997
* tdf#97966 Compiler pluginWastack2016-04-011-0/+67
| | | | | | | | | Warns about redundant 'static' keywords in unnamed namespace. Change-Id: Iecab69161e24d73e39a8dd5baaba6929e12d4f29 Reviewed-on: https://gerrit.libreoffice.org/23679 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
* loplugin:nullptr: Check for more pointer typesStephan Bergmann2016-03-311-6/+11
| | | | | | (but did not turn up further matches) Change-Id: I7e4843d00a2e3b46edec46c5b56b6ba1b2e098fd
* loplugin:nullptr: Find some more cases in templatesStephan Bergmann2016-03-301-10/+62
| | | | Change-Id: I1f127d56e40b04f2b4df85c0afbcfd424d68a8cc
* Rename OfficeIPCThread to RequestHandlerStephan Bergmann2016-03-291-2/+2
| | | | Change-Id: I2076d903e83a0b8eb3aa0ce2413630e2c5415b15
* constantparam loplugin improvementsNoel Grandin2016-03-231-33/+38
| | | | | | | | | clean up the python code, filter out setter methods Change-Id: I8294dd305a30708cf0e81c5328935ec8f6cdc8d4 Reviewed-on: https://gerrit.libreoffice.org/23466 Reviewed-by: Noel Grandin <noelgrandin@gmail.com> Tested-by: Noel Grandin <noelgrandin@gmail.com>
* Ambiguity between clang:: and llvm::PointerTypeStephan Bergmann2016-03-201-9/+9
| | | | Change-Id: I2727ef17b9ab780c608878aaca9ce0fda01b9c22
* loplugin:constantparams in vcl/Noel Grandin2016-03-161-32/+83
| | | | | | | | | also some improvements to the plugin Change-Id: I0e3a519d70756e577fcb1bd47dd66864b5b4c871 Reviewed-on: https://gerrit.libreoffice.org/23289 Reviewed-by: Noel Grandin <noelgrandin@gmail.com> Tested-by: Noel Grandin <noelgrandin@gmail.com>
* loplugin:constantparamNoel Grandin2016-03-151-2/+9
| | | | Change-Id: I270e068b3c83e966e741b0a072fecce9d92d53f5
* tdf#97966: Remove 'static' keywordsWastack2016-03-118-15/+15
| | | | | | | Change-Id: Id991cead4f01830eafd9cf8dd63b519ef07c9451 Reviewed-on: https://gerrit.libreoffice.org/23134 Reviewed-by: Stephan Bergmann <sbergman@redhat.com> Tested-by: Stephan Bergmann <sbergman@redhat.com>
* MenuDispatcher::m_pMenuManager is always nullptrMaxim Monastirsky2016-03-101-2/+1
| | | | | | | | | | | | ... as shown by 7da15debe39b50255cc08b3fef7ae38185a9174f. Which means that MenuManager is unused, and MenuDispatcher does nothing useful. Change-Id: Ic85619531054a573d971d38b52609e1cbcaf780c Reviewed-on: https://gerrit.libreoffice.org/23117 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Caolán McNamara <caolanm@redhat.com> Tested-by: Caolán McNamara <caolanm@redhat.com>
* Extract checking code to its own check.cxxStephan Bergmann2016-03-081-1/+1
| | | | Change-Id: I9d5b14c374ce62ac7b970faa30c38a5a76568ed4
* TODO: Work around loplugin:salbool in cppu/source/uno/data.cxx for nowStephan Bergmann2016-03-081-5/+14
| | | | Change-Id: I1730c09669426e049aba941ef27341581ce31887