summaryrefslogtreecommitdiff
path: root/compilerplugins
diff options
context:
space:
mode:
authorNoel Grandin <noel@peralex.com>2015-09-29 12:40:47 +0200
committerNoel Grandin <noel@peralex.com>2015-09-29 15:08:43 +0200
commit34180700b2686c97cdce0b52ca9578a41a153035 (patch)
tree073f3753e4483f30efa3c7c769f23971e6a046d5 /compilerplugins
parente710170d906fcb248a5e4ff5a3a90cbf0e20003d (diff)
loplugin:removeunusedmethods, remove unused stuff
Change-Id: I35456b2a3ad2a84a1d045f09cdfb29e4c19b8350
Diffstat (limited to 'compilerplugins')
-rw-r--r--compilerplugins/clang/unusedmethods.cxx8
1 files changed, 3 insertions, 5 deletions
diff --git a/compilerplugins/clang/unusedmethods.cxx b/compilerplugins/clang/unusedmethods.cxx
index 71e75b431fee..fa62ce58e0d1 100644
--- a/compilerplugins/clang/unusedmethods.cxx
+++ b/compilerplugins/clang/unusedmethods.cxx
@@ -213,11 +213,9 @@ bool UnusedMethods::VisitCXXConstructExpr(const CXXConstructExpr* expr)
bool UnusedMethods::VisitFunctionDecl( const FunctionDecl* functionDecl )
{
- // I don't use the normal ignoreLocation() here, because I __want__ to include files that are
- // compiled in the $WORKDIR since they may refer to normal code
- SourceLocation expansionLoc = compiler.getSourceManager().getExpansionLoc( functionDecl->getLocStart() );
- if( compiler.getSourceManager().isInSystemHeader( expansionLoc ))
+ if (ignoreLocation(functionDecl)) {
return true;
+ }
functionDecl = functionDecl->getCanonicalDecl();
const CXXMethodDecl* methodDecl = dyn_cast_or_null<CXXMethodDecl>(functionDecl);
@@ -228,7 +226,7 @@ bool UnusedMethods::VisitFunctionDecl( const FunctionDecl* functionDecl )
}
// ignore stuff that forms part of the stable URE interface
if (isInUnoIncludeFile(compiler.getSourceManager().getSpellingLoc(
- functionDecl->getNameInfo().getLoc()))) {
+ functionDecl->getCanonicalDecl()->getNameInfo().getLoc()))) {
return true;
}
if (methodDecl && isStandardStuff(methodDecl->getParent()->getQualifiedNameAsString())) {