Commit Graph

1932 Commits

Author SHA1 Message Date
Xisco Fauli
6f74de514e tdf#114596 compilerplugins: add exception to [loplugin:refcounting]
Change-Id: I94a1d4fcacc7907df21b05fd773d3273e1a0d6a2
Reviewed-on: https://gerrit.libreoffice.org/73147
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2019-05-31 12:22:10 +02:00
Luboš Luňák
5e075c3fbf fix compilerplugin rebuilding when system clang changes
Since Clang doesn't keep backwards binary compatibility, it's necessary
to rebuild when Clang (major version?) changes. This was broken
because e.g. check.cxx didn't include plugin.hxx, and so it didn't depend
on config_clang.h . Now simply force timestamp change if config_clang.h
changes.
This still needs re-running configure though.

Change-Id: Icbc404b37105599f1ca6c8996f5a3d45d50082db
Reviewed-on: https://gerrit.libreoffice.org/72976
Tested-by: Jenkins
Reviewed-by: Luboš Luňák <l.lunak@collabora.com>
2019-05-27 16:03:41 +02:00
Luboš Luňák
d4bb16adcd Revert "Remove broken rebuild of compilerplugins when CLANG_FULL_VERSION..."
This reverts commit efe2889549.
It is that commit that is broken. The only thing that does not work is
that not all compilerplugin sources depend on config_clang.h, the rest is fine.
So instead of reverting something that in principle works (and even complaining
in the commit message about the original problem), just fix it
(will do in next commit).

Change-Id: Ic7766a97220d5b7ef1cd195320899564140fdf1c
Reviewed-on: https://gerrit.libreoffice.org/72975
Tested-by: Jenkins
Reviewed-by: Luboš Luňák <l.lunak@collabora.com>
2019-05-27 16:03:31 +02:00
Luboš Luňák
63be55de02 fix clang version check
As 56f87dac69 says, this is about clang 9, not clang 8.

Change-Id: I2978d2235c7eb3ad438082f7b08a1bd68977ed6f
Reviewed-on: https://gerrit.libreoffice.org/72974
Tested-by: Jenkins
Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2019-05-27 08:47:59 +02:00
Stephan Bergmann
c18e2ea2a5 New loplugin:data
...following up on 1453c2c8f1 "prefer vector::data
to &vector[0]"

Change-Id: I7c113747d92d144a521d49b89384dd8bf1215c01
Reviewed-on: https://gerrit.libreoffice.org/72765
Tested-by: Jenkins
Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2019-05-22 16:35:20 +02:00
Stephan Bergmann
9c346feb33 Don't try to evaluate value of value-dependent Expr
...which causes asserts to fire since <https://github.com/llvm/llvm-project/
commit/04323c24a1ac9464471331d9f6499d3cb95d1ccd> "Added an assertion to constant
evaluation enty points that prohibits …"

Change-Id: Iafbf1cea85d15a38a71275d4cea8303bab500f6a
Reviewed-on: https://gerrit.libreoffice.org/72723
Tested-by: Jenkins
Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2019-05-22 14:46:34 +02:00
Luboš Luňák
62fb97fb41 PPCallback clang plugin should say so
Change-Id: I76148f152f57af74935c99e290b30b509511dfd8
Reviewed-on: https://gerrit.libreoffice.org/72546
Tested-by: Jenkins
Reviewed-by: Luboš Luňák <l.lunak@collabora.com>
2019-05-19 11:56:14 +02:00
Stephan Bergmann
56f87dac69 Adapt compilerplugins to Clang 9 isExplicitSpecified -> getExplicitSpecifier
see <https://github.com/llvm/llvm-project/commit/
76b9027f352a83c13c98820724071c5e3bea6232> "[c++20] Add support for
explicit(bool), as described in P0892R2."

Change-Id: Ia8a6902a64ab3377328fd5e3ed57246d214176f2
Reviewed-on: https://gerrit.libreoffice.org/72335
Tested-by: Jenkins
Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2019-05-16 12:41:36 +02:00
Caolán McNamara
fbc038cc4f an uno -> a uno
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-10 14:50:59 +02:00
Noel Grandin
7f6d5dfb22 loplugin:unusedmethods
Change-Id: I7b4d2e5e611935284e2902b0089950768dfb7717
Reviewed-on: https://gerrit.libreoffice.org/72036
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2019-05-09 14:31:12 +02:00
Noel Grandin
82d018b402 loplugin:unusedfields
Change-Id: I8dc5a6ef84f43bad0bee26592b3a8e95c58e6f22
Reviewed-on: https://gerrit.libreoffice.org/72027
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2019-05-09 12:28:03 +02:00
Noel Grandin
3a98352f7c loplugin:unnecessaryvirtual
Change-Id: I1fa8248efa16a718f273f20620281737b0da455d
Reviewed-on: https://gerrit.libreoffice.org/72024
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2019-05-09 12:27:46 +02:00
Noel Grandin
0e2cda8906 loplugin:badstatics
add some more false+

which interestingly enough, only started showing up when I switched on
   --enable-pch=system

Change-Id: I2d52644dc3665db19b28772eb818c138e063dae4
2019-05-07 15:54:22 +02:00
Luboš Luňák
acd8ee107f avoid false warnings from oslendian clang plugin if PCH is used
Change-Id: I3ab8371b14068601995616dc9979a3297313d761
Reviewed-on: https://gerrit.libreoffice.org/71563
Tested-by: Jenkins
Reviewed-by: Luboš Luňák <l.lunak@collabora.com>
2019-05-05 17:44:48 +02:00
Andrea Gelmini
65a60e13bb Fix typo
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-05 10:14:07 +02:00
Stephan Bergmann
a010011fd3 Fix building compilerplugins with Clang trunk towards Clang 9
...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-05-03 10:21:26 +02:00
Noel Grandin
e02b9ccf58 revert part of "improve loplugin:stringconstant"
Revert part of
    commit dd8d5e5795
    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-30 09:28:40 +02:00
Noel Grandin
dd8d5e5795 improve loplugin:stringconstant
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-30 08:43:51 +02:00
Noel Grandin
22f2cf3ccc implement std::hash for css::uno::Reference and rtl::Reference
The declaration in BarChart.cxx is particularly suspicious, because it
was using a < for the KeyEqual template parameter.
Been there since:
    commit b2c3233e5f
    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-30 08:43:04 +02:00
Andrea Gelmini
46d3efff80 Fix typo
Change-Id: I6e04287504cc8d4c0e3d09632ee1c7355157e5ee
Reviewed-on: https://gerrit.libreoffice.org/71500
Tested-by: Jenkins
Reviewed-by: Julien Nabet <serval2412@yahoo.fr>
2019-04-29 07:04:48 +02:00
Andrea Gelmini
15b8ffbe0d Fix typo
Change-Id: Id6985abca7702039168381082da4e47603b9aaf3
Reviewed-on: https://gerrit.libreoffice.org/71451
Tested-by: Jenkins
Reviewed-by: Julien Nabet <serval2412@yahoo.fr>
2019-04-28 07:40:57 +02:00
Andrea Gelmini
4f3c39b395 Fix typo
Change-Id: I8c928576919c9410eda0a7f33b2120d13c3bc6bf
Reviewed-on: https://gerrit.libreoffice.org/71450
Tested-by: Jenkins
Reviewed-by: Julien Nabet <serval2412@yahoo.fr>
2019-04-28 07:40:46 +02:00
Tor Lillqvist
e1a75c1c30 There is no ImplSVMainHook()
Change-Id: Ief2636425712f60cfc6e8f68ee0d3fb01608d8ba
Reviewed-on: https://gerrit.libreoffice.org/71317
Tested-by: Jenkins
Reviewed-by: Tor Lillqvist <tml@collabora.com>
2019-04-26 08:20:09 +02:00
Andrea Gelmini
1a9bd0ee5a Fix typo
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-26 07:05:09 +02:00
Noel Grandin
bd44b3eef6 tdf#89522 PERF FILEOPEN xlsx, part 1
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-24 16:09:08 +02:00
Andrea Gelmini
c6542e7dd0 Fix typo
Change-Id: I7b94fdd366fd8e149ec6e2af458338e6a56b400c
Reviewed-on: https://gerrit.libreoffice.org/71027
Tested-by: Jenkins
Reviewed-by: Julien Nabet <serval2412@yahoo.fr>
2019-04-21 08:56:33 +02:00
Andrea Gelmini
efd0aebec9 Fix typo
Change-Id: Iaaea14851bb935e4ddfc4e6573356a2314ecd866
Reviewed-on: https://gerrit.libreoffice.org/71029
Tested-by: Jenkins
Reviewed-by: Julien Nabet <serval2412@yahoo.fr>
2019-04-21 08:56:02 +02:00
Andrea Gelmini
a7ecf4545a Fix typo
Change-Id: I925942a89d7f01c008788aeada8009a37564b02f
Reviewed-on: https://gerrit.libreoffice.org/70971
Tested-by: Jenkins
Reviewed-by: Julien Nabet <serval2412@yahoo.fr>
2019-04-19 22:57:57 +02:00
Noel Grandin
1a5b12aa5d optimise find/insert pattern
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-19 13:19:31 +02:00
Andrea Gelmini
1fee3f1da6 Removed spurious chars
Same thing as in commit e5efd197ad

Change-Id: I84faa989387cefef18aa25fa813890d04858f7f2
Reviewed-on: https://gerrit.libreoffice.org/68987
Tested-by: Jenkins
Reviewed-by: Julien Nabet <serval2412@yahoo.fr>
2019-04-18 10:14:00 +02:00
Stephan Bergmann
05a0c51ced New loplugin:selfinit
...to find more bugs like the one addressed in
6340daac7b "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 884ad0d1af "Split
localProcessFactory function into class with setter and getter") and five true
positives (addressed with e0ccbe72ed "Fix use of
variable before its lifetime begins" and
0e335af4d3 "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-17 21:59:53 +02:00
Noel Grandin
b52f309f2b improve loplugin simplifyconstruct
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-15 08:37:54 +02:00
Noel Grandin
3fe3bd8a90 loplugin:unusedfields
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 18:29:29 +02:00
Noel Grandin
80cb1ecb18 -Werror=unused-param
Change-Id: I066b74763e45c785a9ebd7094fc33f44b8ddefb6
2019-04-12 17:52:44 +02:00
Noel Grandin
39f6b78a74 remove leftover debug dump() calls
Change-Id: Ic3c854c831b5b9507e2f1a691adf6a2269b3875b
2019-04-12 15:19:41 +02:00
Noel Grandin
0342562261 loplugin:unnecessaryvirtual
Change-Id: Ic63efdb720c29bede43e39ee498f63fe1f17fb07
Reviewed-on: https://gerrit.libreoffice.org/70647
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2019-04-12 11:36:06 +02:00
Noel Grandin
b65f3fbb2b new loplugin sequentialassign
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-04-11 08:52:49 +02:00
Stephan Bergmann
88b076c459 Adapt to Windows sal_uIntPtr/sal_uLong typedefs
Change-Id: Ic6f269f75e2b64e0c2a53455e9ee4ccf9891cfb0
Reviewed-on: https://gerrit.libreoffice.org/69807
Tested-by: Jenkins
Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2019-03-27 14:17:39 +01:00
Stephan Bergmann
b07a990e51 loplugin:typedefparam (clang-cl)
Change-Id: I07604028845c49cc084927e21db7f21c5d053bab
Reviewed-on: https://gerrit.libreoffice.org/69796
Tested-by: Jenkins
Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2019-03-27 11:30:37 +01:00
Stephan Bergmann
b54f46a848 Adpat loplugin:typedefparam to AttributedType
...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-27 10:59:35 +01:00
Stephan Bergmann
be0655364c Improve loplugin:typedefparam error reporting
Change-Id: I2ed4c20ab909b79fca794fb04259018fbfcb1db5
Reviewed-on: https://gerrit.libreoffice.org/69787
Tested-by: Jenkins
Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2019-03-27 10:57:46 +01:00
Noel Grandin
8bb04558b9 loplugin:unnnecessaryvirtual
Change-Id: I2aa9a8f14b6db2098931a14c6eed522a9d2653ed
Reviewed-on: https://gerrit.libreoffice.org/69682
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2019-03-26 09:06:51 +01:00
Noel Grandin
7030a5860f loplugin:unusedfields
Change-Id: I31c953c8e4c1d4ec235ea318d0aa3b7cedaed1a3
Reviewed-on: https://gerrit.libreoffice.org/69683
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2019-03-26 07:30:13 +01:00
Noel Grandin
9e23683b4c loplugin:singlevalfields
Change-Id: I4a56a27ebce927b8e21cf37bb2c527caf1317bcc
Reviewed-on: https://gerrit.libreoffice.org/69681
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2019-03-26 07:30:07 +01:00
Noel Grandin
ffa07997b2 remove debugging leftover
Change-Id: I656d769f8cfd332172b2a73e9d8eb8a911eac2f8
2019-03-25 08:42:23 +02:00
Noel Grandin
b1cfdb7bee new loplugin:unoquery
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-25 07:19:13 +01:00
Arkadiy Illarionov
af19a3cc6a Resolves: tdf#122114 remove support for ~/.recently-used file
Change-Id: Ie91f0bf21e6f5c3f7a7aa4ae3d1dff6cc8e15a86
Reviewed-on: https://gerrit.libreoffice.org/69597
Tested-by: Jenkins
Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2019-03-24 18:52:22 +01:00
Stephan Bergmann
ad7e2af4ed Allow to pass additional options into generator's clang::tooling
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-22 11:38:51 +01:00
Andrea Gelmini
0c7009e751 Fix typo
Change-Id: I6f86a9f44e6d0044b66a6552fb9c1dbf21a1803c
Reviewed-on: https://gerrit.libreoffice.org/69359
Tested-by: Jenkins
Reviewed-by: Julien Nabet <serval2412@yahoo.fr>
2019-03-17 08:22:36 +01:00
Noel Grandin
4596814193 pahole changes in various
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-16 07:17:15 +01:00