summaryrefslogtreecommitdiff
path: root/compilerplugins
AgeCommit message (Collapse)AuthorFilesLines
2019-05-10an uno -> a unoCaolán McNamara2-2/+2
Change-Id: I538db88f8477dd2d2ad25c372928fec6c11d979d Reviewed-on: https://gerrit.libreoffice.org/72105 Tested-by: Jenkins Reviewed-by: Caolán McNamara <caolanm@redhat.com> Tested-by: Caolán McNamara <caolanm@redhat.com>
2019-05-09loplugin:unusedmethodsNoel Grandin2-229/+405
Change-Id: I7b4d2e5e611935284e2902b0089950768dfb7717 Reviewed-on: https://gerrit.libreoffice.org/72036 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2019-05-09loplugin:unusedfieldsNoel Grandin4-179/+203
Change-Id: I8dc5a6ef84f43bad0bee26592b3a8e95c58e6f22 Reviewed-on: https://gerrit.libreoffice.org/72027 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2019-05-09loplugin:unnecessaryvirtualNoel Grandin1-13/+13
Change-Id: I1fa8248efa16a718f273f20620281737b0da455d Reviewed-on: https://gerrit.libreoffice.org/72024 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2019-05-07loplugin:badstaticsNoel Grandin1-0/+2
add some more false+ which interestingly enough, only started showing up when I switched on --enable-pch=system Change-Id: I2d52644dc3665db19b28772eb818c138e063dae4
2019-05-05avoid false warnings from oslendian clang plugin if PCH is usedLuboš Luňák1-0/+17
Change-Id: I3ab8371b14068601995616dc9979a3297313d761 Reviewed-on: https://gerrit.libreoffice.org/71563 Tested-by: Jenkins Reviewed-by: Luboš Luňák <l.lunak@collabora.com>
2019-05-05Fix typoAndrea Gelmini2-2/+2
Change-Id: I87fa75d2aab64031426ce0560344908bd81d413c Reviewed-on: https://gerrit.libreoffice.org/71816 Reviewed-by: Julien Nabet <serval2412@yahoo.fr> Tested-by: Julien Nabet <serval2412@yahoo.fr>
2019-05-03Fix building compilerplugins with Clang trunk towards Clang 9Stephan Bergmann5-0/+16
...after <https://github.com/llvm/llvm-project/commit/ f19a8b05171a67a290e7d3bd6eba0c95c7b3259c> "Replace ad-hoc tracking of pattern for an instantiated class-scope" removed ASTContext::getClassScopeSpecializationPattern. None of the affected plugins are enabled by default (nor checked by solenv/CompilerTest_compilerplugins_clang.mk), so just make sure they still compile, leaving any potentially necessary adaptions to another commit. Change-Id: I7102851409e78eff284b50337f7ad0f721e1e548 Reviewed-on: https://gerrit.libreoffice.org/71702 Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk> Tested-by: Jenkins Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2019-04-30revert part of "improve loplugin:stringconstant"Noel Grandin2-76/+45
Revert part of commit dd8d5e5795358d732a9f7a8af7c35f662321e332 Date: Mon Apr 29 11:18:21 2019 +0200 improve loplugin:stringconstant sberg's original gerrit comment: but there can also be other problematic overloads for parameters like `void const *` or `std::string_view`. I'm not sure this change is worth the potential false positives. and continuing IRC discussion: <noelgrandin> I'll revert the compilerplugins/ part <sberg> noelgrandin, my main concern is that /if/ somebody eventually runs into such an overload situation, it's really hard to get the warnings/errors fixed for those people, short of going into the plugin itself Change-Id: I4916ce8943c4319d7ef9084e22d6a0eeb430b15c
2019-04-30improve loplugin:stringconstantNoel Grandin2-45/+76
to find more places we can elide the OUString() constructor at call sites Change-Id: Ie09f3c61f2c4b4959c97dc98ebcbaf7c51d5d713 Reviewed-on: https://gerrit.libreoffice.org/71514 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2019-04-30implement std::hash for css::uno::Reference and rtl::ReferenceNoel Grandin1-2/+0
The declaration in BarChart.cxx is particularly suspicious, because it was using a < for the KeyEqual template parameter. Been there since: commit b2c3233e5f267b5d244d722a94424a3b224b3314 Date: Thu Dec 21 20:08:33 2017 +0900 chart2: suspend/resume setting rects dirty for 3D shapes comphelper::OInterfaceCompare is no longer necessary Change-Id: I8278c4a3d9113a18570ca237cd05d553ec8f3975 Reviewed-on: https://gerrit.libreoffice.org/71537 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2019-04-29Fix typoAndrea Gelmini1-14/+14
Change-Id: I6e04287504cc8d4c0e3d09632ee1c7355157e5ee Reviewed-on: https://gerrit.libreoffice.org/71500 Tested-by: Jenkins Reviewed-by: Julien Nabet <serval2412@yahoo.fr>
2019-04-28Fix typoAndrea Gelmini1-1/+1
Change-Id: Id6985abca7702039168381082da4e47603b9aaf3 Reviewed-on: https://gerrit.libreoffice.org/71451 Tested-by: Jenkins Reviewed-by: Julien Nabet <serval2412@yahoo.fr>
2019-04-28Fix typoAndrea Gelmini1-1/+1
Change-Id: I8c928576919c9410eda0a7f33b2120d13c3bc6bf Reviewed-on: https://gerrit.libreoffice.org/71450 Tested-by: Jenkins Reviewed-by: Julien Nabet <serval2412@yahoo.fr>
2019-04-26There is no ImplSVMainHook()Tor Lillqvist2-6/+0
Change-Id: Ief2636425712f60cfc6e8f68ee0d3fb01608d8ba Reviewed-on: https://gerrit.libreoffice.org/71317 Tested-by: Jenkins Reviewed-by: Tor Lillqvist <tml@collabora.com>
2019-04-26Fix typoAndrea Gelmini1-1/+1
Change-Id: Ie687feebfccf27c366922acfc29ff12cdfa325ba Reviewed-on: https://gerrit.libreoffice.org/71338 Reviewed-by: Julien Nabet <serval2412@yahoo.fr> Tested-by: Julien Nabet <serval2412@yahoo.fr>
2019-04-24tdf#89522 PERF FILEOPEN xlsx, part 1Noel Grandin2-0/+144
Inherit from tools::WeakBase non-virtually, so that we can use a static_cast in tools::WeakReference::get instead of a dynamic_cast. This takes the file-open time from 1m21 to 40s for me. Add a clang plugin to make sure we don't accidentally end up inheriting from tools::WeakBase more than once. Change-Id: I9c7c36403333f99094e1f9d8cce2ecd9200377f9 Reviewed-on: https://gerrit.libreoffice.org/71231 Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk> Tested-by: Noel Grandin <noel.grandin@collabora.co.uk>
2019-04-21Fix typoAndrea Gelmini1-1/+1
Change-Id: I7b94fdd366fd8e149ec6e2af458338e6a56b400c Reviewed-on: https://gerrit.libreoffice.org/71027 Tested-by: Jenkins Reviewed-by: Julien Nabet <serval2412@yahoo.fr>
2019-04-21Fix typoAndrea Gelmini1-1/+1
Change-Id: Iaaea14851bb935e4ddfc4e6573356a2314ecd866 Reviewed-on: https://gerrit.libreoffice.org/71029 Tested-by: Jenkins Reviewed-by: Julien Nabet <serval2412@yahoo.fr>
2019-04-19Fix typoAndrea Gelmini1-1/+1
Change-Id: I925942a89d7f01c008788aeada8009a37564b02f Reviewed-on: https://gerrit.libreoffice.org/70971 Tested-by: Jenkins Reviewed-by: Julien Nabet <serval2412@yahoo.fr>
2019-04-19optimise find/insert patternNoel Grandin2-6/+3
if we're doing a find/insert on a set or a map, it is better to just do a conditional insert/emplace operation than triggering two lookups. Change-Id: I80da5097f5a89fe30fa348ce5b6e747c34287a8d Reviewed-on: https://gerrit.libreoffice.org/70937 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2019-04-18Removed spurious charsAndrea Gelmini1-9/+4
Same thing as in commit e5efd197ad403619ac274c88e2e3be648886aa3d Change-Id: I84faa989387cefef18aa25fa813890d04858f7f2 Reviewed-on: https://gerrit.libreoffice.org/68987 Tested-by: Jenkins Reviewed-by: Julien Nabet <serval2412@yahoo.fr>
2019-04-17New loplugin:selfinitStephan Bergmann2-0/+121
...to find more bugs like the one addressed in 6340daac7b99c65249363a4bb61c492de31ef5d6 "Revert broken loplugin:sequentialassign change". What it does is: "Warn when a variable is referenced from its own initializer. This is not invalid in general (see C++17 [basic.life]), but is at least suspicious." It found one false positive (addressed with 884ad0d1af88f9985d30ef0dfe92d89e82f8e576 "Split localProcessFactory function into class with setter and getter") and five true positives (addressed with e0ccbe72ed6eb0d309ed272a78fd67a512acff5d "Fix use of variable before its lifetime begins" and 0e335af4d3f044511551fa2ede20911beaee9b41 "Fix uses of variables before their lifetimes begin"). Change-Id: I4c45cceaa042e93b37ad24a54784c027f6ca1f87 Reviewed-on: https://gerrit.libreoffice.org/70897 Tested-by: Jenkins Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2019-04-15improve loplugin simplifyconstructNoel Grandin3-0/+73
to find stuff like OUString s = OUString("xxx") Change-Id: Ie7ed074c1ae012734c67a2a89c564c1900a4ab04 Reviewed-on: https://gerrit.libreoffice.org/70697 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2019-04-12loplugin:unusedfieldsNoel Grandin4-349/+395
Change-Id: I321c8eefdc43979ef5fd3774c7094ac0dbcac417 Reviewed-on: https://gerrit.libreoffice.org/70657 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2019-04-12-Werror=unused-paramNoel Grandin1-4/+3
Change-Id: I066b74763e45c785a9ebd7094fc33f44b8ddefb6
2019-04-12remove leftover debug dump() callsNoel Grandin1-2/+0
Change-Id: Ic3c854c831b5b9507e2f1a691adf6a2269b3875b
2019-04-12loplugin:unnecessaryvirtualNoel Grandin1-8/+12
Change-Id: Ic63efdb720c29bede43e39ee498f63fe1f17fb07 Reviewed-on: https://gerrit.libreoffice.org/70647 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2019-04-11new loplugin sequentialassignNoel Grandin2-0/+426
Look for places we are assigning to the same variable twice in succession, which means we can simplify that to a single assign Change-Id: I499d20e28f5595e81e927bef8e1bf364eea8ba91 Reviewed-on: https://gerrit.libreoffice.org/70531 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2019-03-27Disable LO_CLANG_SHARED_PLUGINS on Windows for nowStephan Bergmann1-0/+4
...needs some more modifications to make it work with clang-cl Change-Id: I6e2f8c9651b0532e21ec5acf94e8bae0a0f8f06e Reviewed-on: https://gerrit.libreoffice.org/69808 Tested-by: Jenkins Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2019-03-27Adapt to Windows sal_uIntPtr/sal_uLong typedefsStephan Bergmann1-4/+4
Change-Id: Ic6f269f75e2b64e0c2a53455e9ee4ccf9891cfb0 Reviewed-on: https://gerrit.libreoffice.org/69807 Tested-by: Jenkins Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2019-03-27loplugin:typedefparam (clang-cl)Stephan Bergmann1-0/+14
Change-Id: I07604028845c49cc084927e21db7f21c5d053bab Reviewed-on: https://gerrit.libreoffice.org/69796 Tested-by: Jenkins Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2019-03-27Adpat loplugin:typedefparam to AttributedTypeStephan Bergmann1-0/+7
...as seen by clang-cl when there are function parameters of function pointer type involving SAL_CALL Change-Id: Ie35f00d4e15ca777b14dd5968cdbd97e43bca1a1 Reviewed-on: https://gerrit.libreoffice.org/69789 Tested-by: Jenkins Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2019-03-27Improve loplugin:typedefparam error reportingStephan Bergmann2-9/+8
Change-Id: I2ed4c20ab909b79fca794fb04259018fbfcb1db5 Reviewed-on: https://gerrit.libreoffice.org/69787 Tested-by: Jenkins Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2019-03-26loplugin:unnnecessaryvirtualNoel Grandin2-11/+13
Change-Id: I2aa9a8f14b6db2098931a14c6eed522a9d2653ed Reviewed-on: https://gerrit.libreoffice.org/69682 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2019-03-26loplugin:unusedfieldsNoel Grandin4-109/+75
Change-Id: I31c953c8e4c1d4ec235ea318d0aa3b7cedaed1a3 Reviewed-on: https://gerrit.libreoffice.org/69683 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2019-03-26loplugin:singlevalfieldsNoel Grandin2-48/+39
Change-Id: I4a56a27ebce927b8e21cf37bb2c527caf1317bcc Reviewed-on: https://gerrit.libreoffice.org/69681 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2019-03-25remove debugging leftoverNoel Grandin1-2/+0
Change-Id: I656d769f8cfd332172b2a73e9d8eb8a911eac2f8
2019-03-25new loplugin:unoqueryNoel Grandin2-0/+106
look for places we are doing code like: Reference<XProperty>(model, css::uno::UNO_QUERY)->getAsProperty() which might result in a SIGSEGV is the query fails Change-Id: I5cbdbc9e64bd0bed588297c512bf60cbacb9442e Reviewed-on: https://gerrit.libreoffice.org/69044 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2019-03-24Resolves: tdf#122114 remove support for ~/.recently-used fileArkadiy Illarionov3-11/+0
Change-Id: Ie91f0bf21e6f5c3f7a7aa4ae3d1dff6cc8e15a86 Reviewed-on: https://gerrit.libreoffice.org/69597 Tested-by: Jenkins Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2019-03-23Consistently make generator invocation $(QUIET) tooStephan Bergmann1-1/+1
Change-Id: I5251f130aafdebdb4698ef4513b1dcf9f3bdf454 Reviewed-on: https://gerrit.libreoffice.org/69571 Tested-by: Jenkins Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2019-03-22Allow to pass additional options into generator's clang::toolingStephan Bergmann2-7/+23
In my macOS build, that clang::tooling::runToolOnCodeWithArgs invocation failed to find headers like cassert and assert.h, which works now with COMPILER_PLUGINS_TOOLING_ARGS=-isysroot /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.14.sdk -isystem /Users/stephan/Software/llvm/inst/include/c++/v1 added to my autogen.input (I build against my Clang trunk libc++ whose headers are at /Users/stephan/Software/llvm/inst/include/c++/v1). Change-Id: Idbffa39c9fd4a88743fd498b8f7b6c9c56d7630d Reviewed-on: https://gerrit.libreoffice.org/69538 Tested-by: Jenkins Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2019-03-18It is building the generator exe that depends on $(CLANGOUTDIR)/sharedvisitorStephan Bergmann1-3/+2
...or else -MF $(CLANGOUTDIR)/sharedvisitor/generator.d in the command line for building the generator exe could produce a failure because the dir does not exist yet. (The dependency of compilerplugins-build on $(CLANGOUTDIR)/sharedvisitor had been added with adb08e892b37ea9e155abbdee4e0c9951a1d163b "make (some) clang plugins share the same RecursiveASTVisitor" for reasons that are not clear to me.) Change-Id: I124b95be5e8ba36dc5d7502208c61ccf045516f5 Reviewed-on: https://gerrit.libreoffice.org/69307 Tested-by: Jenkins Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2019-03-17Fix typoAndrea Gelmini1-2/+2
Change-Id: I6f86a9f44e6d0044b66a6552fb9c1dbf21a1803c Reviewed-on: https://gerrit.libreoffice.org/69359 Tested-by: Jenkins Reviewed-by: Julien Nabet <serval2412@yahoo.fr>
2019-03-16pahole changes in variousNoel Grandin2-94/+38
I'm not seeing as much as I would expect here, mostly because pahole seems to be having trouble parsing quite a few of our structures, and consequently producing useless data than I then ignore. XDash 24bytes -> 20bytes vcl::font::FeatureDefinition 64bytes -> 56bytes SvXMLTokenMapEntry 16bytes -> 12bytes SvXMLItemMapEntry 16bytes -> 12bytes SwContentAtPos 40bytes -> 32bytes Change-Id: I74c8b93f74b8352f48ef552d7d4239aa7f4237d4 Reviewed-on: https://gerrit.libreoffice.org/69304 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2019-03-15new pahole-all-classes script, and update a couple of sc/ structsNoel Grandin2-0/+189
Create a new script to scan our codebase for holes in our structures. Implemented a couple of the things I found ScSortKeyState 12bytes -> 8bytes sc::MultiDataCellState 12bytes -> 8bytes Change-Id: I139dda36aedf02b7f19be121eb312e5552142b87
2019-03-14loplugin:unusedmethodsNoel Grandin2-122/+86
Change-Id: Ief7cdb14e2c0fe4b0332cd90e063d649065bf3b6 Reviewed-on: https://gerrit.libreoffice.org/69171 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2019-03-14loplugin:unusedfieldsNoel Grandin4-82/+64
Change-Id: Id6792f0955a25533d33f6da6ed8c3e993f578c3f Reviewed-on: https://gerrit.libreoffice.org/69170 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2019-03-13warn if sharedvisitor generator cannot find code in a source fileLuboš Luňák1-0/+11
Just in case there's a typo or something, without this that source would not be compiled but shared visitor would not include that functionality either. Change-Id: I5d9fad129b83f24fed2613bc071cb33e149c1db3 Reviewed-on: https://gerrit.libreoffice.org/69093 Tested-by: Jenkins Reviewed-by: Luboš Luňák <l.lunak@collabora.com>
2019-03-12make (some) clang plugins share the same RecursiveASTVisitorLuboš Luňák36-81/+1860
Each plugin currently uses its own recursive AST run, which adds up. This patch adds another shared plugin which internally contains all (suitable) plugins and dispatches to them from the same one recursive run. This patch converts ~25 plugins and for starmath's accessibility.cxx reduces clang build time from 5.43s to 5.14s (and it's 4.39s without any plugins). As there are almost 50 more plugins to go, this can theoretically result in 4.56s final time, although probably not all plugins can be that easily converted, if at all. This mostly requires very little change in many plugins (see e.g. BadStatics), some even work without any functionality change (e.g. CharRightShift). Traverse* calls require some changes but are often not that difficult. WalkUp* probably can't be supported, although some plugins can(?) possibly be adjusted to not rely on them. And of course some plugins can be left as they are, using their own recursive run. See description at the top of generator.cxx for description of how to convert a plugin. The sharedvisitor.cxx source is generated based on scanning relevant plugin sources using a clang-based scanner/generator. The generated source is intentionally included instead of getting always generated, as the generating currently takes some time, so it should get updated in git whenever a change in a plugin triggers a source change in it. Change-Id: Ia0d2e3a5a464659503dbb4ed6c20b6cc89b4de01 Reviewed-on: https://gerrit.libreoffice.org/68026 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk> Reviewed-by: Luboš Luňák <l.lunak@collabora.com>