diff options
author | Noel Grandin <noel@peralex.com> | 2015-04-01 16:23:59 +0200 |
---|---|---|
committer | Noel Grandin <noel@peralex.com> | 2015-04-02 09:38:29 +0200 |
commit | e9cb5577f4c1be0f59863ec5ccb68e8794a2f117 (patch) | |
tree | 9a84237851499e829442ed322ba050189943ce21 /compilerplugins/clang | |
parent | 1a18cafecb06a76e872f5f1a9434160ea8ffd881 (diff) |
loplugin:staticmethods
Change-Id: Ibf0c73ac17ec19ed672f66907db47057920babca
Diffstat (limited to 'compilerplugins/clang')
-rw-r--r-- | compilerplugins/clang/staticmethods.cxx | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/compilerplugins/clang/staticmethods.cxx b/compilerplugins/clang/staticmethods.cxx index b3f1b587cd29..eb5c06bed5fc 100644 --- a/compilerplugins/clang/staticmethods.cxx +++ b/compilerplugins/clang/staticmethods.cxx @@ -61,6 +61,9 @@ std::string StaticMethods::getFilename(SourceLocation loc) return compiler.getSourceManager().getFilename(spellingLocation); } +static bool startsWith(const std::string& rStr, const char* pSubStr) { + return rStr.compare(0, strlen(pSubStr), pSubStr) == 0; +} bool StaticMethods::TraverseCXXMethodDecl(const CXXMethodDecl * pCXXMethodDecl) { if (ignoreLocation(pCXXMethodDecl)) { @@ -109,6 +112,10 @@ bool StaticMethods::TraverseCXXMethodDecl(const CXXMethodDecl * pCXXMethodDecl) if (aParentName == "osl::OGlobalTimer") { return true; } + // leave the TopLeft() method alone for consistency with the other "corner" methods + if (aParentName == "BitmapInfoAccess") { + return true; + } // can't change it because in debug mode it can't be static // sal/cpprt/operators_new_delete.cxx if (aParentName == "(anonymous namespace)::AllocatorTraits") { @@ -119,6 +126,13 @@ bool StaticMethods::TraverseCXXMethodDecl(const CXXMethodDecl * pCXXMethodDecl) if (aParentName == "(anonymous namespace)::recently_used_item") { return true; } + // the unotools and svl config code stuff is doing weird stuff with a reference-counted statically allocated pImpl class + if (startsWith(getFilename(pCXXMethodDecl->getCanonicalDecl()->getLocStart()), SRCDIR "/include/unotools")) { + return true; + } + if (startsWith(getFilename(pCXXMethodDecl->getCanonicalDecl()->getLocStart()), SRCDIR "/include/svl")) { + return true; + } bVisitedThis = false; TraverseStmt(pCXXMethodDecl->getBody()); |