diff options
Diffstat (limited to 'compilerplugins')
-rw-r--r-- | compilerplugins/clang/unusedmethods.cxx | 19 | ||||
-rwxr-xr-x | compilerplugins/clang/unusedmethods.py | 2 |
2 files changed, 12 insertions, 9 deletions
diff --git a/compilerplugins/clang/unusedmethods.cxx b/compilerplugins/clang/unusedmethods.cxx index bdd606b91d50..7dc57e9b88c7 100644 --- a/compilerplugins/clang/unusedmethods.cxx +++ b/compilerplugins/clang/unusedmethods.cxx @@ -142,19 +142,20 @@ bool UnusedMethods::VisitCallExpr(CallExpr* expr) if (ignoreLocation(expr)) { return true; } - CXXMethodDecl* decl = dyn_cast_or_null<CXXMethodDecl>( - expr->getDirectCallee()); - if (decl == nullptr) { - return true; - } - logCallToRootMethods(decl); + FunctionDecl* calleeFunctionDecl = expr->getDirectCallee(); // if we see a call to a templated method, it effectively instantiates a new method, // so we need to examine it's interior to see if it in turn calls anything else - if (decl->getTemplatedKind() != clang::FunctionDecl::TemplatedKind::TK_NonTemplate - || decl->isFunctionTemplateSpecialization()) + if (calleeFunctionDecl->getTemplatedKind() != clang::FunctionDecl::TemplatedKind::TK_NonTemplate + || calleeFunctionDecl->isFunctionTemplateSpecialization()) { - TraverseCXXMethodDecl(decl); + TraverseFunctionDecl(calleeFunctionDecl); + } + + CXXMethodDecl* calleeMethodDecl = dyn_cast_or_null<CXXMethodDecl>(calleeFunctionDecl); + if (calleeMethodDecl == nullptr) { + return true; } + logCallToRootMethods(calleeMethodDecl); return true; } diff --git a/compilerplugins/clang/unusedmethods.py b/compilerplugins/clang/unusedmethods.py index 3ee4b386c95a..22d7089b93df 100755 --- a/compilerplugins/clang/unusedmethods.py +++ b/compilerplugins/clang/unusedmethods.py @@ -27,6 +27,8 @@ exclusionSet = set([ "void unoidl::detail::SourceProviderScannerData::setSource(const void *,unsigned long)", # TODO track instantiations of template class constructors "void comphelper::IEventProcessor::release()", + "void SotMutexHolder::acquire()", + "void SotMutexHolder::release()", # used by Windows build "_Bool basegfx::B2ITuple::equalZero() const", "class basegfx::B2DPolyPolygon basegfx::unotools::UnoPolyPolygon::getPolyPolygonUnsafe() const", |