loplugins: extract some common functionality

Change-Id: If470e1d9b481c9eda0829aa985152baf8fb46d7a
This commit is contained in:
Noel Grandin
2016-10-18 08:15:21 +02:00
parent 9d8d2e0787
commit 40fd53a238
17 changed files with 24 additions and 35 deletions

View File

@@ -312,12 +312,11 @@ bool UnusedMethods::VisitCXXConstructExpr( const CXXConstructExpr* constructExpr
bool UnusedMethods::VisitFunctionDecl( const FunctionDecl* functionDecl )
{
const FunctionDecl* canonicalFunctionDecl = functionDecl->getCanonicalDecl();
// ignore stuff that forms part of the stable URE interface
if (isInUnoIncludeFile(compiler.getSourceManager().getSpellingLoc(
canonicalFunctionDecl->getNameInfo().getLoc()))) {
if (isInUnoIncludeFile(functionDecl)) {
return true;
}
const FunctionDecl* canonicalFunctionDecl = functionDecl->getCanonicalDecl();
if (isa<CXXDestructorDecl>(functionDecl)) {
return true;
}