Age | Commit message (Collapse) | Author | Files | Lines |
|
Change-Id: I8ac4a2f1e442446384b88f38bdef21644409f8a2
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/90303
Tested-by: Jenkins
Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
|
|
noticed something that wasn't being picked up, wrote some tests,
and found an unhandled case in Plugin::getParentFunctionDecl
Change-Id: I52b4ea273be6614e197392dfc4d6053bbc1704de
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/90141
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
|
|
tweak plugin with the name of another clone method
Change-Id: I47193d31f53f48297c9e773da375c7255ddde282
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/87852
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
|
|
which resulted in only a couple of real finds, mostly false+
Change-Id: I26058a29c27bff50e9526bedd54fb04589c2934d
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/87765
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
|
|
...in <https://github.com/llvm/llvm-project/commit/
8a81daaa8b58aeaa192a47c4ce7f94b4d59ce082> "[AST] Split parent map traversal
logic into ParentMapContext.h", causing failures like
> compilerplugins/clang/constmethod.cxx: In member function ‘bool {anonymous}::ConstMethod::checkIfCanBeConst(const clang::Stmt*, const clang::CXXMethodDecl*)’:
> compilerplugins/clang/constmethod.cxx:191:70: error: invalid use of incomplete type ‘class clang::DynTypedNodeList’
> 191 | auto parentsRange = compiler.getASTContext().getParents(*stmt);
> | ^
> In file included from compilerplugins/clang/plugin.hxx:15,
> from compilerplugins/clang/constmethod.cxx:16:
> include/clang/AST/ASTContext.h:97:7: note: forward declaration of ‘class clang::DynTypedNodeList’
> 97 | class DynTypedNodeList;
> | ^~~~~~~~~~~~~~~~
Change-Id: Ib82d04608fa306a715af481422017c24053a01c6
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/87533
Tested-by: Jenkins
Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
|
|
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>
|
|
This is a continuation of ff002524c12471668e63837a804b6006f9136a34.
When compiling with icecream, its -frewrite-includes merges
all #include's into one .cxx file and marks them with with line
markers. But SourceManager::getFilename() doesn't take those
into account and so it reports all of those as <stdin>.
So use getFileNameOfSpellingLoc(), which explicitly handles this
case.
And we should probably never ever use SourceManager::getFilename().
Change-Id: Ia194c2e041578e1e199aee2df2f885922ef7e31a
Reviewed-on: https://gerrit.libreoffice.org/80326
Tested-by: Jenkins
Reviewed-by: Luboš Luňák <l.lunak@collabora.com>
|
|
Change-Id: Id005a7531d546dd43de13b49bcb3e93081c5ad8d
Reviewed-on: https://gerrit.libreoffice.org/78679
Tested-by: Jenkins
Reviewed-by: Julien Nabet <serval2412@yahoo.fr>
|
|
tighten up the only calling write-only methods part of the analysis
Change-Id: I5bc6fdf0ce51940653317e8a48c5241705c90d4c
Reviewed-on: https://gerrit.libreoffice.org/74022
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
|
|
Change-Id: I103bcc2f21741d0a52a0bdf053fdbddf5a3e9ea0
Reviewed-on: https://gerrit.libreoffice.org/68387
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Tested-by: Noel Grandin <noel.grandin@collabora.co.uk>
|
|
Change-Id: I3a060d94de7c3d77a54e7f7f87bef88458ab5161
Reviewed-on: https://gerrit.libreoffice.org/68132
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
|
|
when dealing with modifications to container classes (e.g. std::vector)
Change-Id: Ic30043631007355ee9a3d9e3f9b6488b435182d6
Reviewed-on: https://gerrit.libreoffice.org/65050
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
|
|
the old EvaluateAsInt method has been dropped as from current clang
Change-Id: Ie30d1547ad8de777badff4b380d2fc9fb261e8fe
Reviewed-on: https://gerrit.libreoffice.org/64107
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
|
|
...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>
|
|
treat fields touched in operator== as not being important, which
finds some more stuff (but also adds some false+)
Change-Id: I3f5d504d7dec7945a917afbcd58c92df74f03645
Reviewed-on: https://gerrit.libreoffice.org/62020
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
|
|
tighten up the handling of binary operators
Change-Id: I262ec57bf7142fa094d240738150a94d83fd15ee
Reviewed-on: https://gerrit.libreoffice.org/61777
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
|
|
look for collection-like fields that are never added to, and are
therefore effectively unused
Change-Id: Id52c5500ea5e3d2436fb5915aebb86278bf2d925
Reviewed-on: https://gerrit.libreoffice.org/60661
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
|
|
look for fields which are only assigned to in the constructor, so they
can be made const
Change-Id: I0b76817c2181227b04f6a29d6a808f5e31999765
Reviewed-on: https://gerrit.libreoffice.org/60393
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
|
|
by checking if the current namespace decl is in our code, so we have to
scan less stuff, which results in a 10% perf improvement for me
Change-Id: Idf0e30d57b6d0dcd13daa9ed679c28b9d233d387
Reviewed-on: https://gerrit.libreoffice.org/58942
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
|
|
...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>
|
|
idea from tml.
Extend the unusedfields plugin to find fields that are only assigned in
the constructor.
Change-Id: I258d3581afbe651d53ce730c9ba27a4598cd9248
Reviewed-on: https://gerrit.libreoffice.org/57733
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
|
|
we trade off a little accuracy for finding more possible write-only
fields.
Change-Id: I9f7edba99481fe4ded0a9d8e45e911b0ee99d269
Reviewed-on: https://gerrit.libreoffice.org/56715
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
|
|
ie. fields that are only touched in the constructor
Change-Id: Ia714cbfed9710e47e69ca9f0eb0eac4f7e8b8a86
Reviewed-on: https://gerrit.libreoffice.org/54412
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
|
|
so that the next time I accidentally leave one turned on, and commit it,
the buildbots will clean up naturally the next time they run 'make
clean'
Change-Id: Ia09dea9c272c322c7e2773c5458cb54aceb50dd1
|
|
Change-Id: I343262e0c61e9ecde5395f13732c212197e7fd03
|
|
improve the read-only check to ignore reads from fields that are guarded
by a boolean check, something like:
if (field)
field.foo();
this produces some false positives at the moment because I'm not
correctly handling the else block, but also some useful new dead code.
Change-Id: Id21fa1a56c171d09d979769b978b6eef14e8b695
Reviewed-on: https://gerrit.libreoffice.org/52664
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
|
|
...due to missing sys/file.h
Change-Id: I7cfd64c5355d9fdbb85320f876c277a408be9352
Reviewed-on: https://gerrit.libreoffice.org/47675
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
|
|
fix the ReturnStmt check
Change-Id: I95076076bd1313d23798c4615ea12910c86ed9a8
Reviewed-on: https://gerrit.libreoffice.org/47309
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
|
|
for some reason we're hitting more template AST nodes now? Anyhow,
updated singlevalfields and unusedenumconstants to cope.
For unusedfields, ignore field access inside Clone() methods, since it's
like a constructor.
Similarly for unusedmethods.
Change-Id: Icb2f76fb2f06ae5df21f9d75312e42a2800befb9
Reviewed-on: https://gerrit.libreoffice.org/45470
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
|
|
Change-Id: Ie8a2c6462ddc708140e725847199c8234ab6b592
Reviewed-on: https://gerrit.libreoffice.org/44528
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
|
|
Change-Id: I26734c13515394162d88351a1cbe2b20abdac865
|
|
to getParentStmt and rename parentFunctionDecl to getParentFunctionDecl,
so I don't keep using accidentally naming my variables the same as the
functions.
Change-Id: I66f9452458c8b439e5132191ac5219fb6d420708
|
|
Change-Id: I52373c32818234e376d855684635f9bf1012ed5e
|
|
which makes absolutely no difference to the results, but anyhow, would
be a shame to waste the work
Change-Id: I4576528f30986a5ce522c76fdf21873f0ce23f0a
|
|
Change-Id: I0ea1f0c7488c140fca9f64de326c6ac588ece925
|
|
(*) IsPassedByNonConst was completely wrong, not even sure why it worked
before.
(*) treat a field passed to operator>>= as being written to, but not
read
Change-Id: Id3a5f2f35222986fe5edba3f5a58215a1815d401
|
|
using some wrappers around callee and caller AST nodes
Change-Id: I599a04a18caa3ada70bcb266e228208b7a81f1a1
|
|
(*) better analysis of init-list-expressions
(*) fix analysis of calls to members, turns out there is no parameter
offset after all
(*) check for passing arrays to functions, need to check
if the parameter is T* or T const *
(*) check for assigning field to a T& variable
Change-Id: Ie6f07f970310c3854e74619fe4fd02a299bf6879
|
|
Change-Id: I9f7f30fce9324f7ccb79e9a8ef0c13e091d7c3a3
Reviewed-on: https://gerrit.libreoffice.org/40304
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Tested-by: Noel Grandin <noel.grandin@collabora.co.uk>
|
|
Change-Id: I4da97443fc7eb14fd94959a026ab45a9256c055f
Reviewed-on: https://gerrit.libreoffice.org/40158
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Tested-by: Noel Grandin <noel.grandin@collabora.co.uk>
|
|
Change-Id: I268b32270a17c0c3fcf8236c3e0eebac9a57cb5d
|
|
Change-Id: Ie8570de6a4eafc95352899fbfd1447d7c3a84e1a
|
|
found a couple more by running
make build-nocheck
to exclude testing code
Also, teach unusedfields loplugin about operator<<, since
referring to a field in an ostream operator<< does not indicate a
real use, it's normally for debugging
Change-Id: I3dce22bf5afda2fd09e01de9bf1d0ef85e535aa8
Reviewed-on: https://gerrit.libreoffice.org/39625
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
|
|
Change-Id: I4964ff97e0a1735dc08c6ad204cae0b08e9ffc2c
Reviewed-on: https://gerrit.libreoffice.org/39406
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
|
|
for some reason the insideMoveOrCopyDecl pointer to MethodDecl becomes
bad during AST traversal, but the pointers to RecordDecl seem stable?
Change-Id: Ida939f5ca4780e674b245411f7395f147258544e
|
|
(1) ignore reads inside copy/move constructors/operator=
(2) fix false+ when assigning to array field
(3) ignore reference ("&") fields
Change-Id: I69a1a1c567a0b28a783e605982e5150811b6cc4a
|
|
Change-Id: I6e96064a001fd511864665fe0ef8b60d45462c12
|
|
since commit 03ee996717dcf9e20529a6a3295df69d0d86dcce
"loplugin:unusedfields fix more false +"
Change-Id: Ief935fea8c554707db38b4ede4fab2ec1adca997
|
|
to match our more normal conventions.
Also drop the 'using std' and some other cruft
Change-Id: I02ef81c5427188bc03a20b157a57a900a9d7bf0d
|
|
deal with fields assigned to local variables, and some general cleanup
Change-Id: I894c74a01e9e28935ecd84308c2e92b080afafc6
|