diff options
Diffstat (limited to 'compilerplugins/clang/staticmethods.cxx')
-rw-r--r-- | compilerplugins/clang/staticmethods.cxx | 37 |
1 files changed, 23 insertions, 14 deletions
diff --git a/compilerplugins/clang/staticmethods.cxx b/compilerplugins/clang/staticmethods.cxx index 06afc3d92584..ebe91520a7d5 100644 --- a/compilerplugins/clang/staticmethods.cxx +++ b/compilerplugins/clang/staticmethods.cxx @@ -9,6 +9,8 @@ #include "clang/AST/Attr.h" +#include "config_clang.h" + #include "check.hxx" #include "plugin.hxx" @@ -91,11 +93,11 @@ bool StaticMethods::TraverseCXXMethodDecl(const CXXMethodDecl * pCXXMethodDecl) return true; } // don't mess with the backwards compatibility stuff - if (loplugin::isSamePathname(getFilename(compat::getBeginLoc(pCXXMethodDecl)), SRCDIR "/cppuhelper/source/compat.cxx")) { + if (loplugin::isSamePathname(getFilename(pCXXMethodDecl->getBeginLoc()), SRCDIR "/cppuhelper/source/compat.cxx")) { return true; } // the DDE has a dummy implementation on Linux and a real one on Windows - auto aFilename = getFilename(compat::getBeginLoc(pCXXMethodDecl->getCanonicalDecl())); + auto aFilename = getFilename(pCXXMethodDecl->getCanonicalDecl()->getBeginLoc()); if (loplugin::isSamePathname(aFilename, SRCDIR "/include/svl/svdde.hxx")) { return true; } @@ -109,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; @@ -135,7 +127,6 @@ bool StaticMethods::TraverseCXXMethodDecl(const CXXMethodDecl * pCXXMethodDecl) || cdc.Class("SvtOptionsDrawinglayer").GlobalNamespace() || cdc.Class("SvtMenuOptions").GlobalNamespace() || cdc.Class("SvtToolPanelOptions").GlobalNamespace() - || cdc.Class("SvtSlideSorterBarOptions").GlobalNamespace() || (cdc.Class("SharedResources").Namespace("connectivity") .GlobalNamespace()) || (cdc.Class("OParseContextClient").Namespace("svxform") @@ -144,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()) @@ -182,7 +189,9 @@ bool StaticMethods::TraverseCXXMethodDecl(const CXXMethodDecl * pCXXMethodDecl) .GlobalNamespace()) || (fdc.Function("Read_Majority").Class("SwWW8ImplReader") .GlobalNamespace()) - || fdc.Function("Ignore").Class("SwWrtShell").GlobalNamespace()) + || fdc.Function("Ignore").Class("SwWrtShell").GlobalNamespace() + || (cdc.Class("AttributesChecker").AnonymousNamespace().GlobalNamespace() + && startsWith(pCXXMethodDecl->getNameAsString(), "check"))) { return true; } |