summaryrefslogtreecommitdiff
path: root/compilerplugins
AgeCommit message (Collapse)AuthorFilesLines
2018-04-28loplugin:countusersofdefaultparamsNoel Grandin1-8/+0
Change-Id: I84868b3115c534a8240394283cc3beedf8cb3a80 Reviewed-on: https://gerrit.libreoffice.org/53543 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2018-04-27Related: tdf#117178 rollover is always done in visually released button modeCaolán McNamara1-2/+0
a quirk of the menutogglebutton is that in rollover it always gets drawn as if its released, so refactor confusing stuff to take visual mode from a DrawButtonFlags, allowing the dropping of DrawFlags::NoRollover Change-Id: I14225bd0d2fbc8276a2b0a26c20673df0105891c Reviewed-on: https://gerrit.libreoffice.org/53562 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Caolán McNamara <caolanm@redhat.com> Tested-by: Caolán McNamara <caolanm@redhat.com>
2018-04-23Don't warn about multiplication by zero in loplugin:expressionalwayszeroStephan Bergmann1-18/+4
That specific warning (added with 862dc17e437f0972223e18555110dc875d2ffa44 "loplugin:expressionalwayszero improvements", together with other improvements) already looked somewhat unhelpful to me in 4cb78942f25e9ea2e9a8445825438cd67b1c00f9 "loplugin:expressionalwayszero (clang-cl)", but now started to generate > [CXX] vcl/source/bitmap/BitmapSobelGreyFilter.cxx > /data/sbergman/lo-clang2/core/vcl/source/bitmap/BitmapSobelGreyFilter.cxx:92:34: error: expression always evaluates to zero, lhs=0 rhs=unknown [loplugin:expressionalwayszero] > nSum1 += nMask121 * nGrey12; > ^~~~~~~~~~~~~~~~~~ > /data/sbergman/lo-clang2/core/vcl/source/bitmap/BitmapSobelGreyFilter.cxx:99:34: error: expression always evaluates to zero, lhs=0 rhs=unknown [loplugin:expressionalwayszero] > nSum2 += nMask212 * nGrey21; > ^~~~~~~~~~~~~~~~~~ > /data/sbergman/lo-clang2/core/vcl/source/bitmap/BitmapSobelGreyFilter.cxx:101:34: error: expression always evaluates to zero, lhs=0 rhs=unknown [loplugin:expressionalwayszero] > nSum1 += nMask221 * nGrey22; > ^~~~~~~~~~~~~~~~~~ > /data/sbergman/lo-clang2/core/vcl/source/bitmap/BitmapSobelGreyFilter.cxx:102:34: error: expression always evaluates to zero, lhs=0 rhs=unknown [loplugin:expressionalwayszero] > nSum2 += nMask222 * nGrey22; > ^~~~~~~~~~~~~~~~~~ > /data/sbergman/lo-clang2/core/vcl/source/bitmap/BitmapSobelGreyFilter.cxx:105:34: error: expression always evaluates to zero, lhs=0 rhs=unknown [loplugin:expressionalwayszero] > nSum2 += nMask232 * nGrey23; > ^~~~~~~~~~~~~~~~~~ > /data/sbergman/lo-clang2/core/vcl/source/bitmap/BitmapSobelGreyFilter.cxx:110:34: error: expression always evaluates to zero, lhs=0 rhs=unknown [loplugin:expressionalwayszero] > nSum1 += nMask321 * nGrey32; > ^~~~~~~~~~~~~~~~~~ > 6 errors generated. (where all those nMask* are zero constants; and which even passed Gerrit/Jenkins as loplugin:expressionalwayszero is only active for Clang >= 3.9). Lets just remove that specific check again. Change-Id: Ia8710f83b16d6e6949439d3941e17b8a0959aa8b
2018-04-23loplugin:singlevalfields improve unaryoperatorNoel Grandin2-6/+36
when we see a unaryoperator, unless it's one of a small set, we can know (mostly) that the field will not be written. there is still a small risk of false+ with code taking references via conditional expressions. Change-Id: I96fa808067576a50e5eaf425338e225b4e0bdd4e Reviewed-on: https://gerrit.libreoffice.org/53263 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2018-04-23loplugin:useuniqueptr in Inflater,DeflaterNoel Grandin1-0/+3
Change-Id: I55833664a6e76d781908b8f1f721dd9a4946e35f Reviewed-on: https://gerrit.libreoffice.org/53224 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2018-04-20loplugin:singlevalfieldsNoel Grandin1-39/+33
Change-Id: I8f3bad622daa3ce118d20c5be12294a3fab85c2a Reviewed-on: https://gerrit.libreoffice.org/53166 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2018-04-20loplugin:unnecessaryvirtualNoel Grandin1-42/+8
Change-Id: Ieecb426f4f839bb1f94e58e45a99643a74ec3009 Reviewed-on: https://gerrit.libreoffice.org/53165 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2018-04-17More containsPreprocessingConditionalInclusion checking in loplugin:casttovoidStephan Bergmann1-0/+5
...to avoid false positive with --disable-dbgutil in SfxApplication ctor (sfx2/source/appl/app.cxx), which contains bool bOk = InitializeDde(); #ifdef DBG_UTIL ... #else (void)bOk; #endif Change-Id: I4de6322a848a9c6aea3057e4598b2161888dee6a Reviewed-on: https://gerrit.libreoffice.org/53051 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2018-04-16loplugin:useuniqueptr in OStorePageBIOSNoel Grandin1-31/+31
update the plugin to check all methods for deleting fields. Also remove the dead checks for new failing here, can never have worked, because it is not calling the std::nothrow variant. Change-Id: I139410e42f83ae2db0cd38ceee81c8b4c310268c Reviewed-on: https://gerrit.libreoffice.org/52881 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2018-04-12vcl: Add a internal (memory) manager for Graphic objectsTomaž Vajngerl1-0/+1
This adds vcl::graphic::Manager which is a manager singleton that tracks all the creation fo graphic objects and swaps them out on a time and allocation basis. Time based - every number of seconds it looks for Graphics that weren't used for a time. Allocation based - when creating a new Graphic and the total of Graphic uses more than the total amount of memory for Graphics defined in configuration, it tries to release the Graphics that weren't used for a time. Change-Id: I5dbf74db4a6455d32c4abcbad7be21c7f0534642 Reviewed-on: https://gerrit.libreoffice.org/52396 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Tomaž Vajngerl <quikee@gmail.com>
2018-04-11remove some debug codeNoel Grandin1-3/+3
Change-Id: I9098ecbd3e7f96db2206d7c117cf28d0d2d5465f
2018-04-11new loplugin:unusedvariablemoreNoel Grandin2-0/+405
collection of heuristics to look for local variables that are never read from i.e. do not contribute to the surrounding logic This is an expensive plugin, since it walks up the parent tree, so it is off by default. Change-Id: Ib8ba292241bd16adf299e8bba4502cb473513a06 Reviewed-on: https://gerrit.libreoffice.org/52450 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2018-04-10put the loplugin output files in the workdirNoel Grandin24-24/+24
so that the next time I accidentally leave one turned on, and commit it, the buildbots will clean up naturally the next time they run 'make clean' Change-Id: Ia09dea9c272c322c7e2773c5458cb54aceb50dd1
2018-04-10darn, unusedfields loplugin was left enabledNoel Grandin1-1/+1
Change-Id: I343262e0c61e9ecde5395f13732c212197e7fd03
2018-04-10loplugin:unusedfield improvementsNoel Grandin5-61/+147
improve the read-only check to ignore reads from fields that are guarded by a boolean check, something like: if (field) field.foo(); this produces some false positives at the moment because I'm not correctly handling the else block, but also some useful new dead code. Change-Id: Id21fa1a56c171d09d979769b978b6eef14e8b695 Reviewed-on: https://gerrit.libreoffice.org/52664 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2018-04-06loplugin:useuniqueptr in ScXMLTableRowCellContextNoel Grandin1-0/+11
Change-Id: Ie2c50b08eed674c129f0f66eae502c61e565a7f8 Reviewed-on: https://gerrit.libreoffice.org/52495 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2018-04-04loplugin:unusedmethodsNoel Grandin2-80/+82
Change-Id: If88b11419fc6d483ef689d2199a347c00622e01c Reviewed-on: https://gerrit.libreoffice.org/52358 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2018-04-03new loplugin:dbgunhandledexceptionNoel Grandin2-0/+144
enforce that DBG_UNHANDLED_EXCEPTION is called first in a catch block, otherwise it cannot do it's job properly Change-Id: I906436c6861212c44f8f21552ccbceb54f15c6e1 Reviewed-on: https://gerrit.libreoffice.org/52303 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2018-04-03pass area param to DBG_UNHANDLED_EXCEPTIONNoel Grandin2-3/+1
and update sallogareas plugin to enforce this Change-Id: Id0782c8a1f619372e10d931aec3c6a4743a4c86a Reviewed-on: https://gerrit.libreoffice.org/52249 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2018-04-02give DBG_UNHANDLED_EXCEPTION_WHEN an area parameterNoel Grandin2-44/+121
and rename it to DBG_UNHANDLED_EXCEPTION, to make it more like the SAL_WARN-type macros. Use some macro magic to deal with different numbers of arguments. Update the sallogareas plugin to check the area parameter of DBG_UNHANDLED_EXCEPTION. Change-Id: Ie790223244c3484f41acb3679c043fb9b438e7c4 Reviewed-on: https://gerrit.libreoffice.org/52073 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2018-03-31loplugin:unusedfieldsNoel Grandin3-82/+102
Change-Id: Id2dea1d3a56d5d3be03c5a2a4f2ef530a05f9b19 Reviewed-on: https://gerrit.libreoffice.org/52185 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2018-03-31loplugin:unusedmethodsNoel Grandin2-66/+16
Change-Id: Idca950f341a8a0521ea2fa3d705164fcf2481027 Reviewed-on: https://gerrit.libreoffice.org/52183 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2018-03-31loplugin:unnecessaryvirtual improve result outputNoel Grandin4-306/+224
and merge some of the template function results Change-Id: I9a7855ce6720d022ea5b988d68f0d59ff81ee5b9 Reviewed-on: https://gerrit.libreoffice.org/51985 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2018-03-29loplugin:unnecessaryvirtualNoel Grandin1-55/+143
Change-Id: Ic044a6e4568e707022d87bc5712205fbdf084ba2 Reviewed-on: https://gerrit.libreoffice.org/52067 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2018-03-29loplugin:unusedmethodsNoel Grandin2-138/+154
Change-Id: I7805ac9bc6f8c0aa5ba4804777e7d7c2c29a78f3 Reviewed-on: https://gerrit.libreoffice.org/52066 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2018-03-29disable expressionalwayszero loplugin on clang-3.8Noel Grandin1-0/+5
can generate OOM Change-Id: Ie9fbed147687c06727a702616764a18d91b38e9c Reviewed-on: https://gerrit.libreoffice.org/52052 Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk> Tested-by: Noel Grandin <noel.grandin@collabora.co.uk>
2018-03-28new loplugin virtualdownNoel Grandin2-0/+272
Look for virtual methods where we can push their definition "down" i.e. the base virtual method does not need to exist at all, because all the call-sites are calling the more specific overrides. Change-Id: Ib8e82637bfb6bc2a06df45de0e289d27344fb3ab Reviewed-on: https://gerrit.libreoffice.org/51986 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2018-03-27loplugin:expressionalwayszero improvementsNoel Grandin2-8/+71
Change-Id: I00bdbc58d2295a0be30b47c85eae6b9abfec17b2 Reviewed-on: https://gerrit.libreoffice.org/51868 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2018-03-27Let prefix arguments to hasPathnamePrefix end in slashStephan Bergmann7-15/+15
...for better precision Change-Id: I5f273b7c66ba931647805c415622b5ac767ff987
2018-03-27Use isSamePathname instead of hasPathnamePrefix, where appropriateStephan Bergmann6-24/+24
Change-Id: I75f32fc66877c0fb1e71be3b5e8b6d6c1b9c4d36
2018-03-23...in which case .. path segments need to be resolved in SearchPath, tooStephan Bergmann1-3/+5
...for cases like > In file included from vcl/source/outdev/hatch.cxx:32: > vcl/source/outdev/../gdi/pdfwriter_impl.hxx:47:10: error: replace "..." include form with <...> for inclusion of a source file not next to the current source file, or a header, vcl/source/outdev/../gdi/pdffontcache.hxx [loplugin:includeform] > #include "pdffontcache.hxx" > ^~~~~~~~~~~~~~~~~~ Change-Id: Ib486e0cf16a157b90f838536a15c40c2a34ef72b
2018-03-23Check isOkToRemoveArithmeticCast in loplugin:redundantfcast tooStephan Bergmann4-48/+65
...to avoid warnings like > C:/lo64/core/svx/source/table/accessiblecell.cxx(400,12): error: redundant functional cast from 'long' to 'sal_Int32' (aka 'long') [loplugin:redundantfcast] > return sal_Int32(0x0ffffffL); > ^~~~~~~~~~~~~~~~~~~~~ with clang-cl Change-Id: I4a48a9f10ad75f76a3c6ab6152ab279df9a3fbcc Reviewed-on: https://gerrit.libreoffice.org/51780 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2018-03-23Handle .. path segments in loplugin:includeform againStephan Bergmann1-1/+2
...after 119d8137695e38c16e9fad9f3ce8a774f58e4b9a "Revert 'Allow compiler plugins for online'", to fix cases like > In file included from vcl/unx/gtk3_kde5/gtk3_kde5_cairo.cxx:20: > vcl/unx/gtk3_kde5/../gtk3/cairo_gtk3_cairo.cxx:12:10: error: replace "..." include form with <...> for inclusion of a source file not next to the current source file, or a header, vcl/unx/gtk3/cairo_gtk3_cairo.hxx [loplugin:includeform] > #include "cairo_gtk3_cairo.hxx" > ^~~~~~~~~~~~~~~~~~~~~~ Change-Id: I12b3049862825f10834333b154c9343a3e3bec6d
2018-03-23Revert "Allow compiler plugins for online"Stephan Bergmann4-34/+2
This reverts commit b39e627be45f847554f11fdac040b6f4da4054ba. The assumed (see comment at <https://gerrit.libreoffice.org/#/c/46769/4/compilerplugins/clang/ plugin.cxx@633>) performance bottleneck of isSamePathname -> getAbsolutePath does show up in Flamegraph inspections of LO builds. But changing (non-member function) isSamePathname to only call getAbsolutePath if (PluginHandlder member function) isLOOLMode is true would need some code reorg, and Online development doesn't seem to make too much actual use of the plugin, so conclusion on IRC was to revert. Change-Id: I0f04fdcc87087dac516630ed5e48361f5ea332ca Reviewed-on: https://gerrit.libreoffice.org/51774 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2018-03-15loplugin:unusedmethodsNoel Grandin2-127/+111
Change-Id: Ice171112d3e737cf0e0edabbc59a1307a4a4f5ad Reviewed-on: https://gerrit.libreoffice.org/51282 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2018-03-14loplugin:unusedmethodsNoel Grandin1-3/+0
Change-Id: I7c780be3e2740fd9b03c39ebe16935d61caf4f7e Reviewed-on: https://gerrit.libreoffice.org/51257 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2018-03-13loplugin:unusedmethods remove unused code from canvasNoel Grandin1-6/+0
which my plugin had previously been ignoring. Since that time, the plugin has gotten a little smarter, and makes less mistakes. Change-Id: Id791c932fd056ae7da833436c4dd2600b69a0bfa Reviewed-on: https://gerrit.libreoffice.org/51212 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2018-03-12loplugin:redundantfcast look for redundant copies in return statementsNoel Grandin2-0/+49
Change-Id: I5f416c865dfe1c36018784246a8007452eb42008 Reviewed-on: https://gerrit.libreoffice.org/50996 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2018-03-12loplugin:unusedmethodsNoel Grandin2-141/+85
Change-Id: I027adbe65edd5f07534bb36f9f54c55f30ba516e Reviewed-on: https://gerrit.libreoffice.org/50998 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2018-03-11weld color pickerCaolán McNamara1-2/+0
Change-Id: I487b9a0cc13b2b60a0f1e28667773b5d3b5c66cc Reviewed-on: https://gerrit.libreoffice.org/51001 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Caolán McNamara <caolanm@redhat.com> Tested-by: Caolán McNamara <caolanm@redhat.com>
2018-03-10loplugin:unusedfieldsNoel Grandin3-15/+7
Change-Id: Idd0cdd38718c3822db4d4b94ca2315a416bc27bb Reviewed-on: https://gerrit.libreoffice.org/50997 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2018-03-09loplugin:redundantfcast look for unnecessary temporariesNoel Grandin2-4/+66
when calling methods that take a const& Change-Id: Idf45dfd9fea0de6fae0b1f89550f2f7fc302aa15 Reviewed-on: https://gerrit.libreoffice.org/50970 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2018-03-08loplugin:constantparam ignore some SFX macro generated codeNoel Grandin1-0/+5
Change-Id: Ic5d9a17aeec51d59e26c49bbdf5719e6d8f6486f
2018-03-08loplugin:unusedmethodsNoel Grandin2-501/+353
Change-Id: Id6b4edd265cb6bef31c72e2a0a440211d51c7c33 Reviewed-on: https://gerrit.libreoffice.org/50900 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2018-03-08loplugin:unusedfieldsNoel Grandin3-140/+134
Change-Id: Id332557cbe7fb42d3d794612f26aa3ac161548d9 Reviewed-on: https://gerrit.libreoffice.org/50902 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2018-03-04finalclasses : correct the comments with name in downcaseArnaud Versini1-1/+1
Change-Id: Iad623ff608d015e95fe226babff18241488dabf0 Reviewed-on: https://gerrit.libreoffice.org/50730 Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk> Tested-by: Noel Grandin <noel.grandin@collabora.co.uk>
2018-02-26loplugin:oncevar extend to tools/gen.hxx typesNoel Grandin1-1/+8
Change-Id: I5c75875da44334569c02e2ff039b33c38397a0a2 Reviewed-on: https://gerrit.libreoffice.org/50283 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2018-02-25Improve loplugin:dyncastvisibility a bitStephan Bergmann1-0/+38
Change-Id: Iab9d333d08a8b90a69f3a096e5f39baf3e7bb638 Reviewed-on: https://gerrit.libreoffice.org/50279 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2018-02-23new loplugin:doubleconvert to with ColorData workNoel Grandin2-0/+106
Change-Id: Ib8f2ef485f548645c4b0e7cf080b72b28c4e278d Reviewed-on: https://gerrit.libreoffice.org/50226 Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk> Tested-by: Noel Grandin <noel.grandin@collabora.co.uk>
2018-02-22drop unused button mask enumCaolán McNamara1-4/+0
Change-Id: Id94c6ecdfc642888eea8c13e55d38326b2d7ad12 Reviewed-on: https://gerrit.libreoffice.org/50145 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Caolán McNamara <caolanm@redhat.com> Tested-by: Caolán McNamara <caolanm@redhat.com>