summaryrefslogtreecommitdiffstats
path: root/compilerplugins/clang
diff options
context:
space:
mode:
authorNoel Grandin <noel@peralex.com>2015-07-07 10:12:55 +0200
committerNoel Grandin <noelgrandin@gmail.com>2015-07-07 11:01:11 +0000
commite546ed01e6bf6dbd8a30cecead4b0b75e2afe92a (patch)
treea0802d5bc6f57d75cad302069ff88d4390636660 /compilerplugins/clang
parentcall ScTokenArray::AdjustReferenceOnCopy() in ScFormulaCell clone, tdf#92468 (diff)
downloadcore-e546ed01e6bf6dbd8a30cecead4b0b75e2afe92a.tar.gz
core-e546ed01e6bf6dbd8a30cecead4b0b75e2afe92a.zip
loplugin:unusedmethods package
Change-Id: I19d6bbb9288d72b99d1023b4983b1c3fff7570e8 Reviewed-on: https://gerrit.libreoffice.org/16811 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Noel Grandin <noelgrandin@gmail.com>
Diffstat (limited to 'compilerplugins/clang')
-rw-r--r--compilerplugins/clang/unusedmethods.cxx19
-rwxr-xr-xcompilerplugins/clang/unusedmethods.py2
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",