summaryrefslogtreecommitdiff
path: root/compilerplugins
AgeCommit message (Collapse)Author
2019-04-29Fix typoAndrea Gelmini
Change-Id: I6e04287504cc8d4c0e3d09632ee1c7355157e5ee Reviewed-on: https://gerrit.libreoffice.org/71500 Tested-by: Jenkins Reviewed-by: Julien Nabet <serval2412@yahoo.fr>
2019-04-28Fix typoAndrea Gelmini
Change-Id: Id6985abca7702039168381082da4e47603b9aaf3 Reviewed-on: https://gerrit.libreoffice.org/71451 Tested-by: Jenkins Reviewed-by: Julien Nabet <serval2412@yahoo.fr>
2019-04-28Fix typoAndrea Gelmini
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 Lillqvist
Change-Id: Ief2636425712f60cfc6e8f68ee0d3fb01608d8ba Reviewed-on: https://gerrit.libreoffice.org/71317 Tested-by: Jenkins Reviewed-by: Tor Lillqvist <tml@collabora.com>
2019-04-26Fix typoAndrea Gelmini
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 Grandin
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 Gelmini
Change-Id: I7b94fdd366fd8e149ec6e2af458338e6a56b400c Reviewed-on: https://gerrit.libreoffice.org/71027 Tested-by: Jenkins Reviewed-by: Julien Nabet <serval2412@yahoo.fr>
2019-04-21Fix typoAndrea Gelmini
Change-Id: Iaaea14851bb935e4ddfc4e6573356a2314ecd866 Reviewed-on: https://gerrit.libreoffice.org/71029 Tested-by: Jenkins Reviewed-by: Julien Nabet <serval2412@yahoo.fr>
2019-04-19Fix typoAndrea Gelmini
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 Grandin
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 Gelmini
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 Bergmann
...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 Grandin
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 Grandin
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 Grandin
Change-Id: I066b74763e45c785a9ebd7094fc33f44b8ddefb6
2019-04-12remove leftover debug dump() callsNoel Grandin
Change-Id: Ic3c854c831b5b9507e2f1a691adf6a2269b3875b
2019-04-12loplugin:unnecessaryvirtualNoel Grandin
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 Grandin
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 Bergmann
...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 Bergmann
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 Bergmann
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 Bergmann
...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 Bergmann
Change-Id: I2ed4c20ab909b79fca794fb04259018fbfcb1db5 Reviewed-on: https://gerrit.libreoffice.org/69787 Tested-by: Jenkins Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2019-03-26loplugin:unnnecessaryvirtualNoel Grandin
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 Grandin
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 Grandin
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 Grandin
Change-Id: I656d769f8cfd332172b2a73e9d8eb8a911eac2f8
2019-03-25new loplugin:unoqueryNoel Grandin
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 Illarionov
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 Bergmann
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 Bergmann
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 Bergmann
...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 Gelmini
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 Grandin
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 Grandin
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 Grandin
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 Grandin
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ňák
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ňák
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>
2019-03-11change some clang plugins to FilteringPluginsLuboš Luňák
As far as I can tell these do not need to scan everything, so the filtering (and faster) base plugin is sufficient. Change-Id: I0912a730bb5ec9670d1faa5c83f573902118cc95 Reviewed-on: https://gerrit.libreoffice.org/68872 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2019-03-11blockblock clang plugin does not do rewritingLuboš Luňák
Change-Id: Iee879980d8dbaa4cdbdf8f4f5859236367f30ccb Reviewed-on: https://gerrit.libreoffice.org/68871 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2019-03-11avoid a possible crash in loplugin's ignoreLocation()Luboš Luňák
For the built-in(?) __int128_t there's apparently no valid presumed location. Change-Id: I1b2f1a827bc914d2f288dd1e02718bf45a50dd1e Reviewed-on: https://gerrit.libreoffice.org/68870 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2019-03-11move isDerivedFrom() from a clang plugin to shared code, for reuseLuboš Luňák
Change-Id: I7b9b41a7081281214a387cdf02080866e9b9dfe7 Reviewed-on: https://gerrit.libreoffice.org/68873 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2019-03-11loplugin:constantparamNoel Grandin
Change-Id: Ibe167c208844b4cdd10df80ae804b1e5bfa6aa13 Reviewed-on: https://gerrit.libreoffice.org/68998 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2019-03-09loplugin:singlevalfieldsNoel Grandin
Change-Id: I7f9ff0fc58adf51eae7fef5ce925b91b8d1f4922 Reviewed-on: https://gerrit.libreoffice.org/68940 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2019-03-09loplugin:unusedfieldsNoel Grandin
Change-Id: Ifb2c9a2d1d7dcc0ed3e8458c1a13933ccababd4c Reviewed-on: https://gerrit.libreoffice.org/68939 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2019-03-09loplugin:unusedmethodsNoel Grandin
Change-Id: I242f56f2bc5dc8fce6db1ba8f1f8269da4fec0fa Reviewed-on: https://gerrit.libreoffice.org/68938 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2019-03-09loplugin:unnecessaryvirtualNoel Grandin
Change-Id: I1fcde14b66ce80157cbebe7f3ec8c5ced1e13143 Reviewed-on: https://gerrit.libreoffice.org/68937 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2019-03-08remove debugging leftoverNoel Grandin
Change-Id: Ia0d2a883a3bd3aca96fe4c8f72f44c694837e568
2019-03-08new loplugin constvarsNoel Grandin
detect static variables that can be made const. Thanks to mike kaganski for suggesting this. Here I introduce a new plugin feature - using markers in nearby comments to disable the plugin for specific vars. Some of this stuff was old debugging code. I removed the stuff that was older than 5 years. Change-Id: I6ec7742a7fdadf28fd128b592fcdf6da8257585c Reviewed-on: https://gerrit.libreoffice.org/68807 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>