Commit Graph

88 Commits

Author SHA1 Message Date
Stephan Bergmann
3fb587e894 Revert "Fix failure of loplugin:useuniqueptr with older compilers"
...0bf61855164af5751e78ca8626c10d604b1ab13b, which should be obsolete now:  It
speculated why 05a337e297 "loplugin:useuniqueptr
look for deleting in loops with iterators" had introduced Foo24 in
compilerplugins/clang/test/useuniqueptr.cxx wrapped in

  #if CLANG_VERSION >= 50000

and came to the conclusion that "either the old compiler lacked Clang's recent
<https://reviews.llvm.org/D50666> "Fix Stmt::ignoreImplicit" (and the above
initialization expression happens to include a CXXBindTemporaryExpr, at least
with libstdc++), or an even older compiler was used in pre-C++17 mode".  But
both of those potential reasons should be moot now, as the Clang fix got
introduced towards Clang 8, and LO requires C++17 now (except for 3rd-party
code).

Change-Id: I307afbbecc5f031bca2319c4b22d54bd467eac81
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/130116
Tested-by: Jenkins
Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2022-02-17 23:16:15 +01:00
Stephan Bergmann
d1a2b80b9d Bump compiler plugins Clang baseline to 12.0.1
...as discussed in the mail thread starting at
<https://lists.freedesktop.org/archives/libreoffice/2020-November/086234.html>
"Bump --enable-compiler-plugins Clang baseline?" (and now picked up again at
<https://lists.freedesktop.org/archives/libreoffice/2022-February/088459.html>
"Re: Bump --enable-compiler-plugins Clang baseline?"), and clean up
compilerplugins/clang/ accordingly

Change-Id: I5e81c6fdcc363aeefd6227606225b526fdf7ac16
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/129989
Tested-by: Jenkins
Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2022-02-17 21:45:06 +01:00
Caolán McNamara
2dbf36132a rename to remove the gtk3 prefix
Change-Id: I219798ed42aff11d09fd45c26ca1a018c2d22c08
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/115239
Tested-by: Jenkins
Reviewed-by: Caolán McNamara <caolanm@redhat.com>
2021-05-10 10:56:58 +02:00
Caolán McNamara
9013666c5a cid#1471346 Uncaught exception
Change-Id: I535affd6597636aa32e1cf9c6005238f9503ef6b
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/109266
Tested-by: Jenkins
Reviewed-by: Caolán McNamara <caolanm@redhat.com>
2021-01-14 20:22:35 +01:00
Thorsten Behrens
abb6c01519 replace usage of whitelist with allowlist
Background and motivation:
  https://tools.ietf.org/html/draft-knodel-terminology-02

[API CHANGE] officecfg::Office::Common::Misc::OpenCLWhiteList -> OpenCLAllowList

Change-Id: I65636b19b13e4af1e4851f70e78053f3443d6bb1
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/98181
Tested-by: Thorsten Behrens <Thorsten.Behrens@CIB.de>
Reviewed-by: Thorsten Behrens <Thorsten.Behrens@CIB.de>
2020-07-10 01:36:07 +02:00
Stephan Bergmann
38dcd3bc73 Get rid of some unnecessary llvm::StringRef -> std::string conversions
(as discussed in the commit message of ce1d8e20a7
"Adapt to '[ADT] Make StringRef's std::string conversion operator explicit'";
there are more of those that cannot easily be dropped, though).

Change-Id: Ib2e223f7de96ad8859eab165daa759b480326c7b
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/88582
Tested-by: Jenkins
Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2020-02-13 11:24:43 +01:00
Stephan Bergmann
ce1d8e20a7 Adapt to "[ADT] Make StringRef's std::string conversion operator explicit"
...<https://github.com/llvm/llvm-project/commit/
777180a32b61070a10dd330b4f038bf24e916af1>.  This is just a quick fix to get
copmilerplugins buiding again with latest LLVM/Clang trunk.  Ideally, we should
get rid of as many of those (potentially expensive) conversions from
llvm::StringRef to std::string as possible.

Change-Id: I18e185e0022a06fd8e3b983a3c4f80e1f3b96746
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/87682
Tested-by: Jenkins
Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2020-01-29 14:14:04 +01:00
Luboš Luňák
bef96f7a7b better name for a function in compilerplugins
The function is not just about a spelling location.

Change-Id: I96e9e9ef7e27a9763397b4b86473c1c30d0e3eeb
Reviewed-on: https://gerrit.libreoffice.org/80381
Tested-by: Jenkins
Reviewed-by: Luboš Luňák <l.lunak@collabora.com>
2019-10-08 20:46:36 +02:00
Andrea Gelmini
22ef2a15bb Fixing "...."
Change-Id: Id005a7531d546dd43de13b49bcb3e93081c5ad8d
Reviewed-on: https://gerrit.libreoffice.org/78679
Tested-by: Jenkins
Reviewed-by: Julien Nabet <serval2412@yahoo.fr>
2019-09-06 09:15:58 +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
Noel Grandin
cc26cfd379 use more hasPathnamePrefix
Change-Id: I539e6aedad61d80b6ebe80104b77d720072395bd
2019-02-11 12:37:50 +02:00
Stephan Bergmann
4d3571a309 Fix compilerplugins/clang/test/useuniqueptr.cxx for clang-cl
...where it failed with

> error: 'error' diagnostics expected but not seen:
>   File C:/lo-clang/core/compilerplugins/clang/test/useuniqueptr.cxx Line 266: rather manage this var with std::some_container<std::unique_ptr<T>> [loplugin:useuniqueptr]
>   File C:/lo-clang/core/compilerplugins/clang/test/useuniqueptr.cxx Line 275: rather manage this member with std::some_container<std::unique_ptr<T>> [loplugin:useuniqueptr]

apparently due to differences in how some std types are implemented.

Change-Id: Ib81ed1a1da867359e7f22bb6fb6ceb3e610e2b41
Reviewed-on: https://gerrit.libreoffice.org/67226
Tested-by: Jenkins
Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2019-01-31 20:23:39 +01:00
Noel Grandin
924da47e03 update useunique_ptr loplugin
with more exclusions

Change-Id: I95e7376ecf9c479d05b85c71f863d9ba40417538
Reviewed-on: https://gerrit.libreoffice.org/66552
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2019-01-18 07:51:04 +01:00
Noel Grandin
d35061b21b loplugin:useuniqueptr in svtools,toolkits
Change-Id: Ied7768293e7781772205c9e8f9fb743a584e3125
Reviewed-on: https://gerrit.libreoffice.org/64880
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2018-12-11 09:44:00 +01:00
Noel Grandin
1cd32bcf1b loplugin:useuniqueptr in vcl
Change-Id: I24eca813321fd3919bba9d37c285484f865ea2ea
Reviewed-on: https://gerrit.libreoffice.org/64877
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2018-12-11 06:26:48 +01:00
Julien Nabet
88738347f8 cppcheck: incorrectStringBooleanError
Change-Id: I7f4bce8444c6c022d856d20b06de4a4834148ea2
Reviewed-on: https://gerrit.libreoffice.org/64834
Reviewed-by: Julien Nabet <serval2412@yahoo.fr>
Tested-by: Julien Nabet <serval2412@yahoo.fr>
2018-12-10 11:46:41 +01:00
Stephan Bergmann
f23aa1a51c Bump compiler plugins Clang baseline to 5.0.2
...as discussed at
<https://lists.freedesktop.org/archives/libreoffice/2018-November/081435.html>
"minutes of ESC call ..."

Change-Id: Ia053da171d59747984546f38e19da808825b4f79
Reviewed-on: https://gerrit.libreoffice.org/63832
Tested-by: Jenkins
Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2018-11-23 08:20:53 +01:00
Noel Grandin
0b11ce9dd2 loplugin:useuniqueptr extend to checking more local var deletes
Change-Id: I5da0f6ecd2577e92e679ed26dd42629dbac4afd4
Reviewed-on: https://gerrit.libreoffice.org/63132
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2018-11-09 06:43:34 +01:00
Noel Grandin
87e7b4bf4b loplugin:useuniqueptr more exclusions
Change-Id: I70c6d4af999965497e23ec8180eb08aa6dc648c5
Reviewed-on: https://gerrit.libreoffice.org/62221
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2018-10-23 13:18:28 +02:00
Stephan Bergmann
0bf6185516 Fix failure of loplugin:useuniqueptr with older compilers
...where CompilerTest_compilerplugins_clang failed in
compilerplugins/clang/test/useuniqueptr.cxx due to Foo24's

  HTMLAttrs::const_iterator it = m_aSetAttrTab.begin();

and either the old compiler lacked Clang's recent
<https://reviews.llvm.org/D50666> "Fix Stmt::ignoreImplicit" (and the above
initialization expression happens to include a CXXBindTemporaryExpr, at least
with libstdc++), or an even older compiler was used in pre-C++17 mode, so the
above initialization expression happens to include an elidable CXXConstructExpr
copy constructor call.

Change-Id: I757a9ad76829e399b4fe2da1c82863909b8c9657
Reviewed-on: https://gerrit.libreoffice.org/61531
Tested-by: Jenkins
Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2018-10-10 13:46:22 +02:00
Stephan Bergmann
5688cd1d9a Fix loplugin:useuniqueptr for libc++ (macOS)
...after 05a337e297 "loplugin:useuniqueptr look
for deleting in loops with iterators", where it didn't emit the warning for
Foo24 in compilerplugins/clang/test/useuniqueptr.cxx during
CompilerTest_compilerplugins_clang, because in the initialization of

  HTMLAttrs::const_iterator it = m_aSetAttrTab.begin();

the HTMLAttrs::const_iterator CXXConstructExpr happens to have a second,
defaulted argument.

Change-Id: I882a6dfb5cab1b147f790072f2545b13172c0f9a
Reviewed-on: https://gerrit.libreoffice.org/61530
Tested-by: Jenkins
Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2018-10-08 16:58:44 +02:00
Andrea Gelmini
54d82085cc Fix typo
Change-Id: I822fa325d37955583a21e4d7ce2e79a4d5b02fc5
Reviewed-on: https://gerrit.libreoffice.org/61462
Reviewed-by: Julien Nabet <serval2412@yahoo.fr>
Tested-by: Julien Nabet <serval2412@yahoo.fr>
2018-10-06 12:15:01 +02:00
Noel Grandin
05a337e297 loplugin:useuniqueptr look for deleting in loops with iterators
Change-Id: I0e5bf671ee11265c0afa8770430ec9e064e05fe3
Reviewed-on: https://gerrit.libreoffice.org/61402
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2018-10-05 16:18:57 +02:00
Noel Grandin
455ac9fb7a loplugin:useuniqueptr check more local variables
Change-Id: I8387731747ee6eb7d74037c0eff7fc9ac0b884c8
Reviewed-on: https://gerrit.libreoffice.org/60619
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2018-09-18 09:07:56 +02:00
Noel Grandin
651a2dee1c loplugin:useuniqueptr update exclusions
Change-Id: I9c741dbaba772550b4d68406fff50d8b0ac60874
Reviewed-on: https://gerrit.libreoffice.org/59923
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2018-09-03 11:03:30 +02:00
Andrea Gelmini
59a4804ce4 Fix typos
Change-Id: Ia658776bce8744e7b771559ca12b94a20923fc52
Reviewed-on: https://gerrit.libreoffice.org/59782
Tested-by: Jenkins
Reviewed-by: Jens Carl <j.carl43@gmx.de>
2018-08-30 18:36:37 +02:00
Noel Grandin
1fd27a7931 filter out AST in more plugins
I seem to have missed quite a few in

    commit 9f4d23c151
    filter out some of the AST in the plugins

This nets me another 14% improvement

Change-Id: I39b980b49ced560f768045dbedd3ddfef29306c1
Reviewed-on: https://gerrit.libreoffice.org/59501
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2018-08-23 16:34:48 +02:00
Noel Grandin
86b2f0ad77 improvements to loplugin:useuniqueptr
find more patterns of deleting member data

Change-Id: I8913e364200dad8405bac30dd8cab2a68c8bee8f
Reviewed-on: https://gerrit.libreoffice.org/59233
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2018-08-22 08:26:30 +02:00
Noel Grandin
be806964a1 loplugin useuniqueptr improvement
passing owning pointers to constructors

Change-Id: I4e64cabbf449393b77162a845b3138be415e2dc9
Reviewed-on: https://gerrit.libreoffice.org/59346
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Tested-by: Noel Grandin <noel.grandin@collabora.co.uk>
2018-08-21 09:34:09 +02:00
Stephan Bergmann
3cc5149a84 Avoid -Werror=deprecated-declarations with recent Clang trunk
...which first added alternative names to and then deprecated getLocBegin/End

Change-Id: Iaefb8ce259057abfa6cd20f0b63c0ef2949a96b2
Reviewed-on: https://gerrit.libreoffice.org/58820
Tested-by: Jenkins
Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2018-08-10 15:14:03 +02:00
Noel Grandin
cfe896e7b8 loplugin:useuniqueptr in SwGrfExtPage
Change-Id: Ic71cf09b6a443f6918b074010fe53ea0843bf246
Reviewed-on: https://gerrit.libreoffice.org/58238
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2018-07-30 08:21:01 +02:00
Noel Grandin
8a592a5c6a loplugin:useuniqueptr in rptui::Condition
Change-Id: I1197be1f7ea8b621dedef41fdd0a664cb6d90374
Reviewed-on: https://gerrit.libreoffice.org/57879
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2018-07-24 10:48:08 +02:00
Noel Grandin
4089e1d9f6 loplugin:useuniqueptr fix check for DELETEZ inside compound stmt
Change-Id: Id748b8b0c9cfe8c288dfafb5d0c2a83a8de2c91c
Reviewed-on: https://gerrit.libreoffice.org/57871
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2018-07-24 08:34:32 +02:00
Noel Grandin
dba5dccfc5 loplugin:useuniqueptr in SwHTMLWriter
Change-Id: I67f3dd615e798f8ac865b57332f6153530d81929
Reviewed-on: https://gerrit.libreoffice.org/57863
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2018-07-24 08:32:56 +02:00
Noel Grandin
a98d071d32 loplugin:useuniqueptr in HTMLTable
Change-Id: I46ece073659444e802bf480996a5797c9f1ec9e8
Reviewed-on: https://gerrit.libreoffice.org/57754
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2018-07-20 15:24:27 +02:00
Noel Grandin
82a2a8f29e loplugin:useuniqueptr in XclObj
Change-Id: I2995dfe5fb39ae2e7f3c37992cb3e2147381784e
Reviewed-on: https://gerrit.libreoffice.org/57753
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2018-07-20 09:00:02 +02:00
Noel Grandin
8a939de0e1 loplugin:useuniqueptr in SwUndoTableMerge
Change-Id: I0c528c2b12d219f37a2c2fdf2211fce3c51ad9e4
Reviewed-on: https://gerrit.libreoffice.org/57688
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2018-07-19 08:13:50 +02:00
Noel Grandin
4c2d0b0d85 loplugin:useuniqueptr in ScTabView
Change-Id: Ic506f5d350abbbbb5912e3ebf753e02821c76841
Reviewed-on: https://gerrit.libreoffice.org/57523
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2018-07-17 14:03:19 +02:00
Noel Grandin
011c6c719f loplugin:useuniqueptr in SwHTMLWriter
Change-Id: I4802e6502addce96bff4831598e852e4fe673af4
Reviewed-on: https://gerrit.libreoffice.org/57521
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2018-07-17 12:19:14 +02:00
Noel Grandin
e7a252166e loplugin:useuniqueptr in UndoTransliterate_Data
Change-Id: I1c6e865a6f59ce7f31c42d28b2b463a577b3cc28
Reviewed-on: https://gerrit.libreoffice.org/57421
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2018-07-16 08:38:38 +02:00
Noel Grandin
dbf8ad9bc3 loplugin:useuniqueptr in SbUnoStructRefObject
now that we have upgraded to VS2017, we can use std::unique_ptr in
std::map

Change-Id: Id01af07ccae7447405b8f0bc44b08043f453e54b
Reviewed-on: https://gerrit.libreoffice.org/57384
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2018-07-13 11:58:10 +02:00
Noel Grandin
c75f597722 loplugin:useuniqueptr in SwGrammarContact
Change-Id: I1e6a2ca8f00d6130cfa6d2c18139bf61ada10630
Reviewed-on: https://gerrit.libreoffice.org/57363
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2018-07-13 08:40:54 +02:00
Michael Stahl
ff002524c1 compilerplugins: try to make these work with icecream
There are some problems here, this should fix one of them: the
getFilename function returns "<stdin>" for spelling locations, because
the input to clang is sort of preprocessed via -frewrite-includes if
icecream is used and the file is built on a remote host (whereas it's
apparently not preprocessed if the file is compiled locally by icecream).

Using getPresumedLoc() uses the #line directives in the preprocessed
input, which avoids the problem but is more expensive, so try to use it
only when necessary.

The getFileEntry(getMainFileID())->getName() pattern will also result
in "<stdin>", but fortunately icecream passes -main-file-name,
which oddly enough isn't used by the SourceManager's spelling locations,
but is available separately via CodeGenOptions.

This builds everything successfully with clang version 6.0.0:
ICECC_PREFERRED_HOST=myremote make check gb_SUPPRESS_TESTS=t

Change-Id: Ic121511683e5302d7b9d85186c8b9c4a5443fa1b
Reviewed-on: https://gerrit.libreoffice.org/54993
Tested-by: Jenkins
Reviewed-by: Thorsten Behrens <Thorsten.Behrens@CIB.de>
2018-07-06 14:12:58 +02:00
Noel Grandin
38733c7daa loplugin:useuniqueptr in ScSimpleEditSourceHelper
Change-Id: Iebe62753d9e6f83f985e4c55fb938d5861613898
Reviewed-on: https://gerrit.libreoffice.org/56903
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2018-07-04 08:35:22 +02:00
Noel Grandin
35c165e46a loplugin:useuniqueptr in SwTextAPIObject
Change-Id: Ied235aefe2cc2ce5e88487503c17e1a54d25ac52
Reviewed-on: https://gerrit.libreoffice.org/56624
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2018-06-29 08:40:31 +02:00
Noel Grandin
bf82016b20 loplugin:useuniqueptr in SwDoc
Change-Id: Ic895c7b79a25a0766cc6d352c5ed75873004fddb
Reviewed-on: https://gerrit.libreoffice.org/56496
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2018-06-27 08:34:48 +02:00
Noel Grandin
200ca38824 teach useuniqueptr loplugin about calling delete on a param
which is often a useful indicator that the callers can be made to use
std::unique_ptr

Change-Id: Idb1745d1f58dbcf389c9f60f1a5728d7d092ade5
Reviewed-on: https://gerrit.libreoffice.org/56238
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2018-06-22 20:11:50 +02:00
Noel Grandin
f66510f1da loplugin:useuniqueptr in ODbTypeWizDialog
Change-Id: I4c364ddbad4881cc8a70a1827d7c51e7cc9313f1
Reviewed-on: https://gerrit.libreoffice.org/54850
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2018-05-28 13:54:42 +02:00
Noel Grandin
0f30c9a1ef loplugin:useuniqueptr in GridWindow
Change-Id: I9fd6d8ac159994c894739afbb3dccb72576dccfb
Reviewed-on: https://gerrit.libreoffice.org/54844
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2018-05-28 08:45:33 +02:00
Andrea Gelmini
2985319ebd Fix typos
Change-Id: Ibe94c7379a9389a0506c33666bf2bfb033f96f08
Reviewed-on: https://gerrit.libreoffice.org/54670
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Jens Carl <j.carl43@gmx.de>
2018-05-23 06:52:55 +02:00