summaryrefslogtreecommitdiff
path: root/compilerplugins
AgeCommit message (Collapse)Author
2021-04-14loplugin:unusedmethodsNoel Grandin
Change-Id: I9c1c6f27e35a66d8e3623c3ebb1618dceda60e24 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/113988 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2021-04-13loplugin:singlevalfieldsNoel Grandin
Change-Id: I429e2e947f426ad16e22d3b99d48714aba96417d Reviewed-on: https://gerrit.libreoffice.org/c/core/+/114033 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2021-04-12convert few more clang plugins to sharedLuboš Luňák
Change-Id: If8ee55d36f1fd2b2dee8c0a1596dee0c7d05eb6f Reviewed-on: https://gerrit.libreoffice.org/c/core/+/113886 Tested-by: Jenkins Reviewed-by: Luboš Luňák <l.lunak@collabora.com>
2021-04-09remove vcl/waitobj.hxxCaolán McNamara
create vcl/locktoplevels.hxx for the utility to set all toplevel windows modally locked Change-Id: I964484d238852e830e1e5c0b86b3bebb3b41a6b3 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/113889 Tested-by: Jenkins Reviewed-by: Caolán McNamara <caolanm@redhat.com>
2021-04-09do not #error in clangplugins with --disable-pchLuboš Luňák
I missed that -building-pch-with-obj is checked by configure (and used) only if PCHs are used. So remove the error checking and hope that it gets checked whenever somebody does changes related to the flag. Change-Id: Ibdf991169f023dae48dad0dd2929215fb048d57d Reviewed-on: https://gerrit.libreoffice.org/c/core/+/113841 Tested-by: Jenkins Reviewed-by: Luboš Luňák <l.lunak@collabora.com>
2021-04-09make clang plugin check code in headers only once if in PCHLuboš Luňák
When using Clang PCHs, we know for certain that the content of a PCH will be used once by the PCH's dedicated source file. So it is not necessary to let clang plugin check locations coming from a PCH every time, but just once when compiling that dedicated source. For starmath's parse.cxx this reduces compilation time 0.94s->0.4s (0.1s when not using plugins at all), for sc's document.cxx it is 5.9s->5.0s (4.0s without plugins). For reference, without PCHs the numbers are (with/without plugins) 2.1s/1.9s for parse.cxx and 11.2s/10.3s for document.cxx. Change-Id: Ie39787e65d7951187941dcff4899d053da63cbdd Reviewed-on: https://gerrit.libreoffice.org/c/core/+/113817 Tested-by: Jenkins Reviewed-by: Luboš Luňák <l.lunak@collabora.com>
2021-04-08Adapt loplugin:unnecessaryparen to CXXRewrittenBinaryOperatorStephan Bergmann
...as debuted in Clang with <https://github.com/llvm/llvm-project/commit/778dc0f1d49230f53401ae0c190fe460bda4ffd1> "[c++20] Add CXXRewrittenBinaryOperator to represent a comparison operator that is rewritten as a call to multiple other operators" towards Clang 10, and would have caused a false > xmloff/source/style/XMLRtlGutterPropertyHandler.cxx:40:16: error: parentheses immediately inside assignment [loplugin:unnecessaryparen] > rValue <<= (it != aRtlModes.end()); > ^~~~~~~~~~~~~~~~~~~~~~~ with --with-latest-c++ and an appropriate libstdc++. Change-Id: Iede63144dff1e1c833a1da7090b599e792351926 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/113744 Tested-by: Jenkins Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2021-04-07Updated README.md files to represent current code / use Markdown formatHossein
Previously, all of the README files have been renamed to README.md and now, the contents of these files were changed to use Markdown format. Other than format inconsistency, some README.md files lacked information about modules, or were out of date. By using LibreOffice / OpenOffice wiki and other documentation websites, these files were updated. Now every README.md file has a title, and some description. The top-level README.md file is changed to add links to the modules. The result of processing the Markdown format README.md files can be seen at: https://docs.libreoffice.org/ Change-Id: Ic3b0c3c064a2498d6a435253b041df010cd7797a Reviewed-on: https://gerrit.libreoffice.org/c/core/+/113424 Tested-by: Jenkins Reviewed-by: Michael Stahl <michael.stahl@allotropia.de> Reviewed-by: Adolfo Jayme Barrientos <fitojb@ubuntu.com>
2021-04-07loplugin:casttovoid: Fix VisitReturnStmt in lambda bodiesStephan Bergmann
...as caused the assert(!returnTypes_.empty()); in VisitReturnStmt to hit for the return statement in the permutation2D lambda body (which does not happen to be nested within any other function declaration) in patch sets 1 and 2 of <https://gerrit.libreoffice.org/c/core/+/113522> "Compute permutation2D at compile time". Change-Id: Ic4aa55bef4361e40c2cd6247b5646f7b1ba82e6d Reviewed-on: https://gerrit.libreoffice.org/c/core/+/113699 Tested-by: Jenkins Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2021-04-01tdf#124176 Use pragma once instead of include guardsrounak
Change-Id: I778393686b9a51df6437c61a814e5c62a34302de Reviewed-on: https://gerrit.libreoffice.org/c/core/+/113433 Tested-by: Jenkins Reviewed-by: Julien Nabet <serval2412@yahoo.fr>
2021-03-25loplugin:unusedvarsglobalNoel
Change-Id: Ie73c8bec0196c680311b0959f3a17c3af900ce88 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/113084 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2021-03-25compilerplugins: fix clang plugin allowlists for sccache-distMichael Stahl
While icecream passes preprocessed (via -frewrite-includes) input to the compiler on stdin, sccache-dist writes it to a file at the same location as the source file in its sandbox. So we need a new heuristic to detect that the input has -frewrite-includes applied; there is not any variable that sccache sets, users could have SCCACHE_CACHE_SIZE set but only if they use the disk cache, so check CXX for now. Also set SCCACHE_EXTRAFILES to include log-areas.dox required by plugin. Change-Id: I4e00bfb0db7dab28f228fc0e85d753506e2c86b1 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/112480 Tested-by: Jenkins Reviewed-by: Michael Stahl <michael.stahl@allotropia.de>
2021-03-24loplugin:unnecessaryvirtualNoel
Change-Id: Ic414b72299b5c5c19e5b37156ac6dec4bedadf65 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/113038 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2021-03-24loplugin:unusedmethodsNoel
Change-Id: Id54e7545b3a69e03c29daf9d372bbf605312f547 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/113036 Reviewed-by: Tomaž Vajngerl <quikee@gmail.com> Reviewed-by: Caolán McNamara <caolanm@redhat.com> Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk> Tested-by: Jenkins
2021-03-24Using .md extension/Markdown syntax for modules READMEHossein
Renaming all README files for all top level modules to README.md, applying no content change at this stage to be able to track history of the files. These files should be edited to use correct Markdown syntax later. Change-Id: I542fa3f3d32072156f16eaad2211a397cc212665 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/112977 Tested-by: Jenkins Reviewed-by: Christian Lohmaier <lohmaier+LibreOffice@googlemail.com>
2021-03-16systools is no longer part of the URE interfaceStephan Bergmann
...since de030cd7a234fd9191364647deb1a4836ca992cb "gbuild: Remove MSVC 2013 legacy code", so no longer treat it as such in compilerplugins. (Which caused a few loplugin:includeform and loplugin:nullptr warnings.) Change-Id: I99b42e76992e31aff56b417c05738d4d29e3faf9 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/112575 Tested-by: Jenkins Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2021-03-15drop PrintWindowSubTree that is only callable by itselfCaolán McNamara
Change-Id: I14ec71ca429e60f7e350c92534db6d983a559c61 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/112536 Tested-by: Jenkins Reviewed-by: Caolán McNamara <caolanm@redhat.com>
2021-03-14loplugin:unusedmethodsNoel
Change-Id: I851eba4ca80eac9ee5896df53fbcd0f5ad125763 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/112433 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2021-03-13loplugin:unusedfieldsNoel
Change-Id: Ic40d908c3063cc2537bc1746421fb76f070e5bc8 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/112432 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2021-03-11drop newly unused code and macrosCaolán McNamara
Change-Id: I4b3fe1d7a62305f04589bd05a80aa771910a4f98 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/112246 Tested-by: Jenkins Reviewed-by: Caolán McNamara <caolanm@redhat.com>
2021-03-08loplugin:refcounting check for one more caseNoel
where we might be holding something newly created by pointer instead of by *::Reference Change-Id: Ife6f7acae4252bf56dcdeb95d72e43c523444f97 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/112138 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2021-03-07loplugin:staticdynamic now with extra saltNoel
because it wasn't quite there yet - now checks for casts with and without const, because const doesn't really matter here. Change-Id: I319025b2095a803fcaad2a7a696d2730b7fd2f81 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/112098 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2021-03-06loplugin:staticdynamic look for static after dynamicNoel
Change-Id: Ic3066d9a9441e369370cc6aa0fbffb9a321bc928 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/111985 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2021-03-05loplugin:refcounting return objects properlyNoel
check that when we return ref-counted objects, we do so using rtl::Reference, so that the object actually has a non-zero ref count. Change-Id: Ib3ffae0d2502f6d117550c82fde5449729c27324 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/111487 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2021-03-03vcl/floatwin.hxx can be toolkit only nowCaolán McNamara
Change-Id: Ifd8f58771ea6f9212a0dca7d4550c86ebecd9333 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/111814 Tested-by: Caolán McNamara <caolanm@redhat.com> Reviewed-by: Caolán McNamara <caolanm@redhat.com>
2021-03-01new loplugin:staticdynamicNoel
look for places we are dynamic_cast'ing after static_cast'ing, which means the dynamic_cast is a waste of time. Change-Id: Ife11bb675020738040646230bbd038278d84f7f2 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/111631 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2021-02-27loplugin:unusedfieldsNoel
Change-Id: Ie82cfbc8294ffb6b07e66f6cf15fd326bd551d91 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/111625 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2021-02-27loplugin:unnecessaryvirtualNoel
Change-Id: I99f5302ec5727aae3fad6767b9b477d37beb573b Reviewed-on: https://gerrit.libreoffice.org/c/core/+/111624 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2021-02-23loplugin:unusedmethodsNoel
Change-Id: Ie0534244cc7a30ad006e65baf125c59757c90d50 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/111388 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2021-02-23loplugin:constantparamNoel
Change-Id: Ieaee9a3e3ef4aa9bc390ddb198ee1718f635bcbf Reviewed-on: https://gerrit.libreoffice.org/c/core/+/111391 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2021-02-23loplugin:unnecessaryvirtualNoel
Change-Id: I792a717306c232cf200940f9e3944f91885e426a Reviewed-on: https://gerrit.libreoffice.org/c/core/+/111387 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2021-02-23loplugin:unusedfieldsNoel
Change-Id: Ieb1b890040964e755de5bdf5f8576d4d3bd8a407 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/111386 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2021-02-23loplugin:refcounting check for managing OWeakObject with raw pointerNoel
Change-Id: I7471725f1e658940b5e6993361c327be6ccf0d31 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/111064 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2021-02-22Avoid loplugin:refounting in uninstantiated template codeStephan Bergmann
...causing e.g. false positive > In file included from shell/source/win32/spsupp/COMOpenDocuments_x64.cxx:11: > In file included from shell/source/win32/spsupp/COMOpenDocuments.cxx:16: > In file included from shell/inc/spsupp\COMOpenDocuments.hpp:21: > shell/inc/spsupp/COMRefCounted.hpp(35,13): error: cppu::OWeakObject subclass 'COMRefCounted<Interfaces...>' being deleted via delete, should be managed via rtl::Reference [loplugin:refcounting] > delete this; > ^~~~~~~~~~~ with clang-cl on Windows. (Ideally, this would be made up for with setting this plugins' shouldVisitTemplateInstantiations() to true, see the TODO added in compilerplugins/clang/test/refcounting.cxx, but that would cause lots of other findings, so is left out for now.) Change-Id: Ia52b13498a0c7169b37ecf4882ce84c3cc1d2cc4 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/111339 Tested-by: Jenkins Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2021-02-19compilerplugins: fix referencecasting for clang 7.0.1Miklos Vajna
The error was: error: 'error' diagnostics seen but not expected: File /libreoffice/master-clang/compilerplugins/clang/test/referencecasting.cxx Line 113: unnecessary get() call [loplugin:referencecasting] 1 error generated. I.e. it seems clang7 has the same problem as clang5 that it emits multiple diagnostics for that problematic code line. Adapt the ifdef accordingly. Change-Id: I232ff9a158663e2cb3030e51f655249ff315361e Reviewed-on: https://gerrit.libreoffice.org/c/core/+/111196 Tested-by: Jenkins Reviewed-by: Miklos Vajna <vmiklos@collabora.com>
2021-02-18loplugin:referencecasting add check for new rtl::Reference operatorNoel
rtl::Reference now has a conversion operator to uno::Reference, so look for places where we can simplify the code and use that. Change-Id: Ic81db50d670bed5e875300577d4bf5f3599cc2c4 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/110798 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2021-02-18Move GIF writer from filter module into VCLTomaž Vajngerl
Change-Id: I8db3ca0f7953b44791bda47534220902931fab8d Reviewed-on: https://gerrit.libreoffice.org/c/core/+/111023 Tested-by: Jenkins Reviewed-by: Tomaž Vajngerl <quikee@gmail.com>
2021-02-12loplugin:refcounting check for calling deleteNoel
Change-Id: I5b723d4d2376a28777e3ee7e9706e5f54fcb55e3 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/110809 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2021-02-11loplugin:refcounting generalise type checkingNoel
Change-Id: Ia013878ac9c2918d8eaf9aab16b291d8211e708f Reviewed-on: https://gerrit.libreoffice.org/c/core/+/110700 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2021-02-10Fix loplugin:stringliteralvarStephan Bergmann
...detection of OUString( const sal_Unicode * value, sal_Int32 length ) ctor. (On platforms where sal_Int32 is a typedef for int, an argument that already is of type int will not be wrapped in an ImplicitCastExpr to the sal_Int32 typedef.) Change-Id: Ifc5456a62d42c1acad76ea949549dc24bd67201a Reviewed-on: https://gerrit.libreoffice.org/c/core/+/110654 Tested-by: Jenkins Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2021-02-10loplugin:refcounting also check OWeakObject subclassesNoel
Change-Id: I2d89085a22d7424c6f8f7662307433ce50fc61d2 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/110666 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2021-02-09loplugin:referencecasting check for Reference::queryNoel
Change-Id: I008d16d933c70df132699872ac4c39a5c1f87b34 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/110592 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2021-02-08Improve loplugin:cppunitassertequal for CPPUNIT_ASSERT(a && b)Stephan Bergmann
...by re-enabling the code temporarily #if'ed-out in a528392e71bc70136021be4e3d83732fccbb885e "Fixed/improved loplugin:cppunitassertequals" (and which then triggers lots of other lopglugin:cppunitassertequal CPPUNIT_ASSERT -> CPPUNIT_ASSERT_EQUAL warnings). For two css::uno::Reference equality comparisons in cppu/qa/test_any.cxx, it was more straightforward to rewrite them with an explicit call to operator == (which silences loplugin:cppunitassertequal) than to adapt them to CPPUNIT_ASSERT_EQUAL's requirement for arguments of identical types. In sc/qa/unit/ucalc_pivottable.cxx, ScDPItemData needs toString, which has been implemented trivially for now, but might want to combine that with the DEBUG_PIVOT_TABLE-only ScDPItemData::Dump. Change-Id: Iae6d09cf69bd4e52fe4411bba9e50c48e696291c Reviewed-on: https://gerrit.libreoffice.org/c/core/+/110546 Tested-by: Jenkins Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2021-02-05Make loplugin:cppunitassetequals diagnostic more informativeStephan Bergmann
...which will come in handy for a later improvement of that plugin Change-Id: I548b9388bee60b381c0a2c820f20f596aa0072f4 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/110453 Tested-by: Jenkins Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2021-02-03Clean up SmColorTokenTableEntrydante
Remove useless member SmColorTokenTableEntry::cIdent aColorTokenTableDVIPS renamed (make the loop enter in one line) removed redundant code in visitors (related to color) removed temporal variables on visitors (related to color) removed temporal variables on mthmlexport (related to color) removed redundant code in mathmlexport (related to color) Since SmColorTokenTableEntry is used as pointer remove useless operators Change-Id: Icef831711c95e4f9c23b29a3a3606dd9d6fcf6c8 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/110321 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2021-02-02Avoid --disable-assert-always-abort loplugin:stringviewparam false positivesStephan Bergmann
...like > l10ntools/source/helper.cxx:19:69: error: replace function parameter of type 'const rtl::OString &' with 'std::string_view' [loplugin:stringviewparam] > const OString& rText, const OString& rUnEscaped, const OString& rEscaped ) > ~~~~~~~~~~~~~~~^~~~~~~~ where the call to rEscaped.getLength(), which would otherwise suppress the warning, is hidden inside an assert. (Similar to aab0322580c87864a4f0c0af1fed07282c8dccbb "Disable loplugin:casttovoid when --disable-assert-always-abort".) Change-Id: Ie054f75317707757b1c6243c593f539d445a9fee Reviewed-on: https://gerrit.libreoffice.org/c/core/+/110331 Tested-by: Jenkins Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2021-02-02loplugin:redundantcast catch more dynamic_castNoel
Change-Id: Ia28e58217cefa306567b53688d851fa210b7821c Reviewed-on: https://gerrit.libreoffice.org/c/core/+/110287 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2021-01-29loplugin:stringviewparam extend to new..Noel
O[U]StringBuffer methods Change-Id: I0ffbc33d54ae7c98b5652434f3370ee4f819f6f4 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/110090 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2021-01-28add string_view variants of methods to O[U]StringBufferNoel
and update the stringview loplugin to detect cases where we can use these new methods. Change-Id: I998efe02e35c8efcb3abfb4d7186165bbe6dfb2c Reviewed-on: https://gerrit.libreoffice.org/c/core/+/110046 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2021-01-27Improve loplugin:stringliteralvarStephan Bergmann
...to also consider O[U]String ctors taking pointer and length Change-Id: Iea5041634bfbf5054a1317701e30b56f72e940fb Reviewed-on: https://gerrit.libreoffice.org/c/core/+/110025 Tested-by: Jenkins Reviewed-by: Stephan Bergmann <sbergman@redhat.com>