summaryrefslogtreecommitdiff
path: root/compilerplugins
AgeCommit message (Collapse)Author
2020-08-28Change OUStringLiteral from char[] to char16_t[]Stephan Bergmann
This is a prerequisite for making conversion from OUStringLiteral to OUString more efficient at least for C++20 (by replacing its internals with a constexpr- generated sal_uString-compatible layout with a SAL_STRING_STATIC_FLAG refCount, conditionally for C++20 for now). For a configure-wise bare-bones build on Linux, size reported by `du -bs instdir` grew by 118792 bytes from 1155636636 to 1155755428. In most places just a u"..." string literal prefix had to be added. In some places char const a[] = "..."; variables have been changed to char16_t, and a few places required even further changes to code (which prompted the addition of include/o3tl/string_view.hxx helper function o3tl::equalsIgnoreAsciiCase and the additional OUString::createFromAscii overload). For all uses of macros expanding to string literals, the relevant uses have been rewritten as u"" MACRO instead of changing the macro definitions. It should be possible to change at least some of those macro definitions (and drop the u"" from their call sites) in follow-up commits. Change-Id: Iec4ef1a057d412d22443312d40c6a8a290dc6144 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/101483 Tested-by: Jenkins Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2020-08-27SvtIconChoiceCtrl can move into toolkit only headersCaolán McNamara
Change-Id: Ice3c01019d3e961c0ef1dce7d3eaf4f602269fff Reviewed-on: https://gerrit.libreoffice.org/c/core/+/101488 Tested-by: Jenkins Reviewed-by: Caolán McNamara <caolanm@redhat.com>
2020-08-26[API CHANGE] Drop OSL_THIS_FUNC, directly use C++11 __func__Stephan Bergmann
It had been documented as "the macro OSL_THIS_FUNC is intended to be an office internal macro for now", so take the liberty of removing it, even if technically that can be considered an incompatible API change. Change-Id: I7580a932e1da54845934378a650e894f3f3a9062 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/101406 Tested-by: Jenkins Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2020-08-24remove unused XIM.hCaolán McNamara
Change-Id: Icf15604a2d449159fceb212717264952e8cacb33 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/101282 Tested-by: Caolán McNamara <caolanm@redhat.com> Reviewed-by: Caolán McNamara <caolanm@redhat.com>
2020-08-21Silence some clang-cl loplugin:stringstaticStephan Bergmann
For one, do not warn about global declarations in included files, as generally not all uses of the variable are seen to decided whether it would be good to replace. That covers cases like > In file included from dtrans/source/win32/dtobj/DataFmtTransl.cxx:26: > dtrans/source/win32/dtobj/MimeAttrib.hxx(29,16): error: rather declare this using OUStringLiteral/OStringLiteral/char[] [loplugin:stringstatic] > const OUString CHARSET_UTF16 ("utf-16"); > ~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ For another, do not warn about variables whose pData member is used. That covers cases like > sal/osl/w32/procimpl.cxx(347,20): error: rather declare this using OUStringLiteral/OStringLiteral/char[] [loplugin:stringstatic] > const OUString ENV_COMSPEC ("COMSPEC"); > ~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~ Change-Id: I75c1048098b63164bdb583695951f73964cb24f8 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/101134 Tested-by: Jenkins Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2020-08-20loplugin:singlevalfieldsNoel Grandin
Change-Id: I4cd20d1a449196b68c7dbe153c60e68b9563bea9 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/101049 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2020-08-20loplugin:virtualdeadNoel Grandin
Change-Id: Ib41d80d1e068d66edabdfb36061dd382dc34b04c Reviewed-on: https://gerrit.libreoffice.org/c/core/+/101046 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2020-08-20loplugin:constantparamNoel Grandin
Change-Id: I59a37e1d37fa749cba5159daa23fe663bcc55435 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/101045 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2020-08-19isStaticLocal should imply hasGlobalStorageStephan Bergmann
(See documentation of clang::VarDecl::hasGlobalStorage: "This includes all global variables as well as static variables declared within a function.") Change-Id: I59d9e9e946033b6d4c52e80cfeaf59a9b036b349 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/100995 Tested-by: Jenkins Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2020-08-19Remove unused includeStephan Bergmann
Change-Id: I019148e0823e68ccbb1cf60f6eac9e69b634515b Reviewed-on: https://gerrit.libreoffice.org/c/core/+/100973 Tested-by: Jenkins Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2020-08-18loplugin:unusedvarsglobalNoel Grandin
tackle some read-only vars. Mark some of them const to make it obvious they are not really used, and to make the constantparam plugin see more data. Change-Id: Ia25927745866746aa1aa9d5affd5857ad9f9ee24 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/100895 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2020-08-18new loplugin:unusedvarsglobalNoel Grandin
I copied and modified the unusedfields plugin to find unused variables. Change-Id: I18ed6daa202da70a2e564e4fe4760aed7ce070ba Reviewed-on: https://gerrit.libreoffice.org/c/core/+/100891 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2020-08-18remove newly unused ExtMultiLineEditCaolán McNamara
Change-Id: If9a1639d28aa7a540f301657387a04309ba82580 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/100873 Tested-by: Jenkins Reviewed-by: Caolán McNamara <caolanm@redhat.com>
2020-08-17loplugin:unusedmethodsNoel Grandin
Change-Id: I31002cc322c43498ef8c37f6b7f94ae1a8278ba9 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/100857 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2020-08-17Move compilerplugins-related .gitignore content to compilerplugins/.gitignoreStephan Bergmann
...and expand it to precisely match the three .dwo files, like had already been done for the corresponding .o files. (Those .dwo files are generated when -gsplit-dwarf is added to CLANGCXXFLAGS when manually overriding CLANGDEBUG=1.) Change-Id: Ib6f1c505c754d54201273f08f987a9451af75bc4 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/100855 Tested-by: Jenkins Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2020-08-16loplugin:singlevalfieldsNoel Grandin
Change-Id: Ia5d4de61ecf77477e86032b86d67d6ffd011913e Reviewed-on: https://gerrit.libreoffice.org/c/core/+/100819 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2020-08-16loplugin:unusedfieldsNoel Grandin
Change-Id: I61fe1c43f4235eddfca80f2a8392c58d4b1380e8 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/100818 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2020-08-16loplugin:unnecessaryvirtualNoel Grandin
Change-Id: Iafad1df533d5fefd335066427a0fb9e2d8bfa91d Reviewed-on: https://gerrit.libreoffice.org/c/core/+/100817 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2020-08-16loplugin:virtualdeadNoel Grandin
Change-Id: Ic002692801113de5778826db5e3faf9869a48307 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/100816 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2020-08-14loplugin:simplifybool moreNoel Grandin
look for expressions like !(a && !b) which can be expanded out Change-Id: I72515a9638762b050f9a258c08da39ebfa2ef8e7 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/100579 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2020-08-14One toolbar generic controller is enoughMaxim Monastirsky
The one from framework is more feature complete, so use that one. Change-Id: I499f0ae1d20c588cfc04beebc643819559325882 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/100726 Tested-by: Jenkins Reviewed-by: Maxim Monastirsky <momonasmon@gmail.com>
2020-08-14rename nmspmap.hxx -> namespacemap.hxxNoel Grandin
we're not in DOS anymore, Dorothy Change-Id: I79926e0d694163940ba7ebf20419724dd0a486f5 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/100721 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2020-08-13loplugin:stringstatic also look for local staticsNoel Grandin
Add some API to O*StringLiteral, to make it easier to use in some places that were using O*String Change-Id: I1fb93bd47ac2065c9220d509aad3f4320326d99e Reviewed-on: https://gerrit.libreoffice.org/c/core/+/100270 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2020-08-12use unique_ptr for ScGlobal::pFieldEditEngineNoel Grandin
Change-Id: Ic9894f9fb77ee270a3c09c0a3b5a008331016295 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/100562 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2020-08-08loplugin:unusedmethodsNoel Grandin
Change-Id: I58819edd0965ff52c3fc6c20d84bc5951a79bbe2 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/100381 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2020-08-08loplugin:unnecessaryvirtualNoel Grandin
Change-Id: Idcb25f62f0371178222fb05fb8e3ec9fd335305b Reviewed-on: https://gerrit.libreoffice.org/c/core/+/100379 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2020-08-08merge dbaui::OMarkableTreeListBox with dbaui::OTableTreeListBoxCaolán McNamara
Change-Id: I5cde5c453493e5287faa770eede2e42b21075477 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/100330 Tested-by: Jenkins Reviewed-by: Caolán McNamara <caolanm@redhat.com>
2020-08-08loplugin:unusedfieldsNoel Grandin
Change-Id: I9fd1e742fea5d2f6c45fb2086df79b420d514e98 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/100380 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2020-08-08loplugin:virtualdeadNoel Grandin
Change-Id: Ib2a4ebad50e9c6f0d71a9ac3a1bc8ac11e775496 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/100378 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2020-08-05Silence loplugin:staticmethods when the definition involves preprocessingStephan Bergmann
...to help avoid false positives. (Another option to silence such warnings is to add (void) this; to false-positive function bodies, but this new approach may be more natural in certain cases.) Change-Id: Ie6ea908730c596dbfb62ff42ae60dbd0a00a8fc9 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/100152 Tested-by: Jenkins Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2020-08-05Adapt to --disable-assert-always-abortStephan Bergmann
Change-Id: Ib578c5d8c82ca763770d316384c6753534dbfee3 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/100141 Tested-by: Jenkins Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2020-08-04Avoid some unhelpful loplugin:makesharedStephan Bergmann
...like > canvas/source/directx/dx_impltools.cxx(137,31): error: rather use make_shared than constructing from 'Gdiplus::Graphics *' [loplugin:makeshared] > GraphicsSharedPtr pRet(Gdiplus::Graphics::FromImage(rBitmap.get())); > ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ on Windows, where those functions like FromImage are provided by Windows (so we can't help it that they are returning pointers) Change-Id: Iae5c4b20d64cc6b38ff66409519fbd25f6e509cd Reviewed-on: https://gerrit.libreoffice.org/c/core/+/100095 Tested-by: Jenkins Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2020-08-04loplugin:unusedmethodsNoel Grandin
Change-Id: I5fa2bbeff17a9933ff55afb0c3544d025d096a63 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/100085 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2020-08-04remove some debug codeNoel Grandin
Change-Id: I6aff84ce7b9d4fed27d8442d1366bcf14bc44f86 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/100084 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2020-08-04Adapt compilerplugins/clang/test/makeshared.cxx to MSVC standard libraryStephan Bergmann
> error: 'error' diagnostics seen but not expected: > File compilerplugins/clang/test/makeshared.cxx Line 47: rather use make_shared than constructing from 'unique_ptr<int>' [loplugin:makeshared] > File compilerplugins/clang/test/makeshared.cxx Line 49: rather use make_shared than constructing from 'unique_ptr<int>' [loplugin:makeshared] > File compilerplugins/clang/test/makeshared.cxx Line 53: rather use make_shared than constructing from 'unique_ptr<int>' [loplugin:makeshared] Change-Id: I5d2d1b129c9d0fee496eceb4e2cf14f5853ba00b Reviewed-on: https://gerrit.libreoffice.org/c/core/+/100074 Tested-by: Jenkins Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2020-08-04Adapt compilerplugins/clang/test/getstr.cxx to latest MSVC standard libraryStephan Bergmann
...that now defines the wide-character-to-narrow-stream inserters as deleted too, at least in C++20 mode. Change-Id: I554f2530d5905e46343bf0d8bf12a6feb3d63075 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/100073 Tested-by: Jenkins Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2020-08-04loplugin:simplifybool a little more aggressiveNoel Grandin
with expressions like !(a && b) Change-Id: Id2acec2a8d0eaaa8e5e37dbd2cae7281be36572e Reviewed-on: https://gerrit.libreoffice.org/c/core/+/100040 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2020-08-03Revert "Adapt to changed clang::ASTContext::getParents behavior on Clang 11 ↵Stephan Bergmann
trunk" This reverts commit 09aa5a9be8b9b3c88cf25b85e0eda28c5ef19aa4, now that <https://github.com/llvm/llvm-project/commit/ 551092bc3dfb86f1e11a55f3bee0c8ee1be6fdd6> "Revert AST Matchers default to AsIs mode" reverted the Clang commit that prompted this compilerplugins change. Change-Id: I75c8b4cb2894cd67a791db460f2886a783856c73 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/100026 Tested-by: Jenkins Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2020-07-31loplugin:unusedmethodsNoel Grandin
Change-Id: I0d888b565b0b53b318b790926667d7ba49504411 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/99854 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2020-07-30loplugin:unusedmethodsNoel Grandin
and tweak the plugin a little to speed it up Change-Id: Ia59456232602184c4f1b5d1d75ad94a9a2e2d0be Reviewed-on: https://gerrit.libreoffice.org/c/core/+/99799 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2020-07-30loplugin:flatten in sw/uibase/utl..sw/uibase/wrtshNoel Grandin
Change-Id: I9010524952ce3b99a62e53dbf715a72c86a89b01 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/99766 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2020-07-29replace and drop SvtPrintWarningOptionsCaolán McNamara
Change-Id: I17fd4156eb940fbdc925d9761301096e5349135f Reviewed-on: https://gerrit.libreoffice.org/c/core/+/99674 Tested-by: Jenkins Reviewed-by: Caolán McNamara <caolanm@redhat.com>
2020-07-29drop newly unused SvtFontOptionsCaolán McNamara
Change-Id: Iaab664770d96a7d197354949bbe6d82c248f1037 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/99648 Tested-by: Jenkins Reviewed-by: Caolán McNamara <caolanm@redhat.com>
2020-07-28Adapt to Clang 12 trunk Expr::getIntegerConstantExpressionStephan Bergmann
<https://github.com/llvm/llvm-project/commit/ 36036aa70ec1df7b51b5d30b2dd8090ad2b6e783> "Reapply 'Rename/refactor isIntegerConstantExpression to getIntegerConstantExpression'" Change-Id: I99277601fe7ffa3e0e5d22a4b3aaca4f51551ab3 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/99570 Tested-by: Jenkins Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2020-07-25loplugin:constantparamNoel Grandin
Change-Id: Ic0079cf1d5d2463963b1be08a59cb93db6f12870 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/99417 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2020-07-25loplugin:unusedmethodsNoel Grandin
Change-Id: I3a35c988b1c55b16958172ed5ef4e2d5cb410e55 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/99413 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2020-07-25loplugin:unusedfieldsNoel Grandin
Change-Id: Ia2fb09dcd6f266e7eab04fceb893839531ab3e00 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/99412 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2020-07-21loplugin:unusedmethodsNoel Grandin
Change-Id: I3520c2e97bb5b1611dcce77ca9f8393b29e75a1f Reviewed-on: https://gerrit.libreoffice.org/c/core/+/99110 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2020-07-21loplugin:constantparamNoel Grandin
Change-Id: Id5144e95ac0120b3125258cdde46e4f7f6e1690b Reviewed-on: https://gerrit.libreoffice.org/c/core/+/99109 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2020-07-21loplugin:unusedfieldsNoel Grandin
Change-Id: I933d9a82bb6ad5f5b946e28abcc2dae30126c720 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/99108 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>