diff options
author | Noel Grandin <noel.grandin@collabora.co.uk> | 2024-03-21 19:12:56 +0200 |
---|---|---|
committer | Noel Grandin <noel.grandin@collabora.co.uk> | 2024-03-22 11:47:36 +0100 |
commit | 8ef4dc07cd4413253b5747dd714fadd548d6bcf6 (patch) | |
tree | ad51fde4a825d0a918a87719ef3a5e55d6ba50cb /compilerplugins | |
parent | e136900e7a971385be9367a3dcaedea54d1e7207 (diff) |
improve loplugin:staticmethods
Some of the exclusions were too aggressive. Restrict them to only the
important classes, which exposes some more places this plugin applies.
Change-Id: I1b2d1fb24391adc71ed0984f94168f61a149479f
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/165154
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'compilerplugins')
-rw-r--r-- | compilerplugins/clang/staticmethods.cxx | 26 |
1 files changed, 16 insertions, 10 deletions
diff --git a/compilerplugins/clang/staticmethods.cxx b/compilerplugins/clang/staticmethods.cxx index a28d605b3af3..ebe91520a7d5 100644 --- a/compilerplugins/clang/staticmethods.cxx +++ b/compilerplugins/clang/staticmethods.cxx @@ -111,16 +111,6 @@ bool StaticMethods::TraverseCXXMethodDecl(const CXXMethodDecl * pCXXMethodDecl) if (cdc.Class("BitmapInfoAccess").GlobalNamespace()) { return true; } - // the unotools and svl config code stuff is doing weird stuff with a reference-counted statically allocated pImpl class - if (loplugin::hasPathnamePrefix(aFilename, SRCDIR "/include/unotools/")) { - return true; - } - if (loplugin::hasPathnamePrefix(aFilename, SRCDIR "/include/svl/")) { - return true; - } - if (loplugin::hasPathnamePrefix(aFilename, SRCDIR "/include/framework/") || loplugin::hasPathnamePrefix(aFilename, SRCDIR "/framework/")) { - return true; - } // there is some odd stuff happening here I don't fully understand, leave it for now if (loplugin::hasPathnamePrefix(aFilename, SRCDIR "/include/canvas/") || loplugin::hasPathnamePrefix(aFilename, SRCDIR "/canvas/")) { return true; @@ -145,7 +135,23 @@ bool StaticMethods::TraverseCXXMethodDecl(const CXXMethodDecl * pCXXMethodDecl) { return true; } + auto fdc = loplugin::DeclCheck(pCXXMethodDecl); + + // somebody has work-in-progress here + if ((fdc.Function("getCurrZeroChar") + .Class("LocaleDataWrapper").GlobalNamespace())) + return true; + + // the unotools and svl config code stuff is doing weird stuff with a reference-counted statically allocated pImpl class + if ((fdc.Function("getByName2") + .Class("GlobalEventConfig").GlobalNamespace())) + return true; + if ((cdc.Class("SvtLinguConfig").GlobalNamespace())) + return true; + if ((cdc.Class("SvtModuleOptions").GlobalNamespace())) + return true; + // only empty on Linux, not on windows if ((fdc.Function("GetVisualRepresentationInNativeFormat_Impl") .Class("OleEmbeddedObject").GlobalNamespace()) |