42 Commits

Author SHA1 Message Date
Stephan Bergmann
c0f241e80f SourceManager::getFilename returns StringRef
Change-Id: I77db8565efe2e0d366afc8470308d7801a2a7337
2017-02-11 20:31:37 +01:00
Stephan Bergmann
57a505e8e9 Remove unnecessary blacklists from loplugin:stringconstant
Change-Id: I866a421a2b3e8830aaa7096adaef945a2264195e
2017-02-10 17:49:45 +01:00
Stephan Bergmann
6abbbe7015 Fix copy/move ctor check
Change-Id: I2993d5809204098e29a7560d666fa1aafb024a89
2017-02-02 11:49:20 +01:00
Noel Grandin
02957bc3b7 loplugin:stringconstant, this should be a break
after commit dce867e8c4863c969eea3515a988630b74708a43
"loplugin:stringconstant handle calls to constructors with one arg"

Change-Id: Ib572d904a95aa96aab3c799f9b7cfb505fcee5e6
2017-02-02 11:35:06 +02:00
Stephan Bergmann
836b74aead Fix ctor check
Change-Id: Ie261d5412c510c045b4d93a6bf1a3d4cf4371897
2017-02-01 15:31:37 +01:00
Noel Grandin
994e38e336 loplugin: use TypeCheck instead of getQualifiedNameAsString
since the latter is rather slow

Change-Id: Ib73cdb923585580777c2265b561c1808e93b2baa
Reviewed-on: https://gerrit.libreoffice.org/33585
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2017-02-01 12:49:42 +00:00
Noel Grandin
dce867e8c4 loplugin:stringconstant handle calls to constructors with one arg
Change-Id: Ide9148a908bef46ba14640dfa6f556beaf6e3f60
Reviewed-on: https://gerrit.libreoffice.org/33772
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2017-02-01 07:57:16 +00:00
Noel Grandin
1c3e84d819 teach lolugin:stringconstant about calling constructors
so we can remove unnecessary calls to the OUString(literal) constructor
when calling constructors like this:
   Foo(OUString("xxx"), 1)

Change-Id: I1de60ef561437c86b27dc9cb095a5deb2e103b36
Reviewed-on: https://gerrit.libreoffice.org/33698
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2017-01-31 08:56:20 +00:00
Noel Grandin
f1d83ac45f loplugin:stringconstant check for unnecessary OUString constructor..
..calls when creating exceptions

Change-Id: I3bc58a5aa4dc6f0508ecb88b3a843b96b8c7ebfe
Reviewed-on: https://gerrit.libreoffice.org/33617
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2017-01-28 09:22:55 +00:00
Noel Grandin
2d506f4c3d fix spelling containging->containing
Change-Id: I49f736c049735e89ce9f71740f5c308120378a9a
2017-01-27 12:43:41 +02:00
Stephan Bergmann
236f69e710 Minor loplugin:stringconstant improvements
Change-Id: I0b39526c0f0854ddbb29e77ece303cf2bdd842c4
2017-01-25 07:58:10 +01:00
Stephan Bergmann
b820de995d Remove leftover code
Change-Id: I3f6e9ec0343074b506cb07b1ad5c9b3e1ef20b5e
2017-01-11 16:57:21 +01:00
Stephan Bergmann
584262fed1 loplugin:stringconstant: handle OStringBuffer::append
Change-Id: I283da52c0ee2b63c19e31e9a61ab24997c037a6a
2017-01-11 16:39:43 +01:00
Stephan Bergmann
618785dfd2 Some loplugin:conststringvar/stringconstant improvements
Change-Id: I73f694e6dedb84b3fb3b63ffb9dcda2481bc403c
2017-01-11 11:27:40 +01:00
Stephan Bergmann
0d2ac4afe9 New loplugin:conststringvar
Change-Id: I16648b018ed0f69a085322cfb88481ee2a0c27ca
2017-01-10 08:12:52 +01:00
Stephan Bergmann
83ff2a4f38 loplugin:stringconstant: Adapt to definition of OSL_THIS_FUNC on Windows
Change-Id: I93a23799ad9a76ed9f4f86d69adb610d0962da20
2016-12-18 22:43:29 +01:00
Stephan Bergmann
ec0665ac8b Rename cdecl -> classdecl (MSVC treats the former like a keyword)
Change-Id: I1859a92c996b907b8d511cddba25c00c9a52f398
2016-12-18 22:43:26 +01:00
Stephan Bergmann
4e9dd6e1b7 Disambiguate clang::StringLiteral
...vs. recently introduced llvm::StringLiteral (llvm/ADT/StringRef.h)

Change-Id: I4d74546b0d1401a74b0c15368bbc93794ecd0b1d
2016-12-14 15:52:33 +01:00
Stephan Bergmann
1800862c70 loplugin:stringconstant: look into 'char const * const var = "..."'
Change-Id: I52a97b8ec273509131c2200e47527221cb62d7ee
2016-11-25 16:42:23 +01:00
Stephan Bergmann
c5d8cb41a5 loplugin:stringconstant: adapt to improved OUStringLiteral1
Change-Id: I5c9bfbb97f0eabe1ea691faf522d22070243d234
2016-08-30 15:30:36 +02:00
Stephan Bergmann
bdd60f1f5e Adapt loplugin:stringconstant to improved OUStringLiteral1
Change-Id: Ibc5128df8bcf8cb5f2f09551c0de6dfdb46bdee0
Reviewed-on: https://gerrit.libreoffice.org/28447
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2016-08-29 11:44:44 +00:00
Stephan Bergmann
8614502d73 Further clean-up
Change-Id: I884acbc85108f9cbd5e244c73a1f4c58a8c89613
2016-06-29 18:27:38 +02:00
Stephan Bergmann
733198de1b Remove support for Clang < 3.4
Change-Id: I81e97c5f720535b33dd3ce72d01151765e4e93a0
2016-06-29 09:15:25 +02:00
Stephan Bergmann
1ce7176ba1 Remove support for Clang < 3.3
Change-Id: I185852a738bac10dc6d331afccfcbc7ae1225cb1
2016-06-29 08:55:27 +02:00
Stephan Bergmann
0d3738a258 More Clang 3.4 "(anonymous namespace)" fixes
Change-Id: I7cb43f915565dadd611b90ee30373e472f97efb5
Reviewed-on: https://gerrit.libreoffice.org/26748
Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
Tested-by: Stephan Bergmann <sbergman@redhat.com>
2016-06-28 20:33:58 +00:00
Stephan Bergmann
1a6f599e98 loplugin:stringconstant: Don't warn about "OUString(OSL_THIS_FUNC)"
Change-Id: Id5f021bd798cb94b7246faed539304dae04b4700
2016-06-28 09:07:12 +02:00
Stephan Bergmann
643b70006f Teach loplugin:stringconstant about RTL_CONSTASCII_STRINGPARAM
Change-Id: I8ff0e104aad045f3835dc8facc760a8339b1d088
2016-06-03 10:58:26 +02:00
Stephan Bergmann
2db16f4bdc -Werror=return-type
Change-Id: I7691fa50d827b688cab299c85c933adabb29994c
2016-02-26 14:34:30 +01:00
Stephan Bergmann
bb24492c76 More loplugin::TypeCheck use
Change-Id: I2f4a26a918134568f541cd45bdcf5a12b1f1d2ee
2015-12-08 22:56:02 +01:00
Michael Stahl
22fb58a6fa compilerplugins: getAsTagDecl doesn't exist in clang 3.5
Change-Id: If7277820227486e2eb578a167e0fd9f05c8f74ae
Reviewed-on: https://gerrit.libreoffice.org/19823
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Michael Stahl <mstahl@redhat.com>
2015-11-06 19:38:13 +00:00
Stephan Bergmann
938f670928 loplugin:stringconstant: elide explicit ctor usage
Change-Id: I962db9583ef9cada42a61b6a95eeea818fceeead
2015-11-06 12:33:41 +01:00
Noel Grandin
59b072e22b yyyyy
Change-Id: I9a947beefd2dfe21da8239e841ea3fb416bd1548
2015-11-04 14:10:44 +02:00
Benjamin Ni
be729e7721 tdf#94269: Replace "n" prefix for bool variables with "b"
Change-Id: I178545792c7354a362658ac7ef8b1d4cf0865797
Signed-off-by: Michael Stahl <mstahl@redhat.com>
2015-11-02 23:40:57 +01:00
Stephan Bergmann
37a6fdf890 loplugin:stringconstant also for cases using char const v[] = "..."
Change-Id: Iba38686620624178a7be39d703389402bbcea4cb
2015-09-03 09:34:00 +02:00
Stephan Bergmann
3286c6c854 loplugin:stringconstant: OUStringBuffer: appendAscii -> append
Change-Id: I0d1c988aad308435542dbd381fcf6bf7e1af6290
2015-08-31 14:39:13 +02:00
Stephan Bergmann
5ed2014684 loplugin:stringconstant: handle OUString+=OUString(literal)
Change-Id: I85a88eaca89bb2c89a3ad374be09547f9b2ed78f
2015-06-26 13:55:36 +02:00
Stephan Bergmann
8fd802eb33 loplugin:stringconstant: OUStringLiteral1 can handle NUL literals just fine
Change-Id: I9b31b01a34a10d5bd329dccd39da83500d6fd2c7
2015-06-26 13:55:30 +02:00
Stephan Bergmann
d4ad86dac6 ...in case this ever gets used with an unsigned APSInt of bitwidth < 7
Change-Id: Ic9436529321e523edd25d0f83ac09a0e22a44013
2015-06-25 15:59:01 +02:00
Noel Grandin
f53c186b8d my previous fix triggered an assert in clang
Change-Id: I67b8dec0d49032134a1b588363e72fa88f5993f7
2015-06-25 14:00:26 +02:00
Noel Grandin
38ea4f018e error: invalid operands to binary expression ('llvm::APSInt' and 'int')
Change-Id: I1a509ce133954a31a504dcc178687427f85f4c1c
2015-06-25 13:48:11 +02:00
Stephan Bergmann
af333e8103 loplugin:stringconstant: Flag more inefficiencies
Change-Id: I47726315f12ef05714bea248d79cc503fb99b23c
2015-06-25 12:38:40 +02:00
Stephan Bergmann
2a52591bfe Extend loplugin:literalalternative to loplugin:stringconstant
Change-Id: Ie425af19019126b6a15ac03f52e32d186a46db35
2014-12-19 10:03:52 +01:00