2015-07-02 09:18:31 +02:00
|
|
|
/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
|
|
|
|
/*
|
|
|
|
* This file is part of the LibreOffice project.
|
|
|
|
*
|
|
|
|
* This Source Code Form is subject to the terms of the Mozilla Public
|
|
|
|
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
|
|
|
* file, You can obtain one at http://mozilla.org/MPL/2.0/.
|
|
|
|
*/
|
|
|
|
|
|
|
|
#include <cassert>
|
|
|
|
#include <string>
|
|
|
|
#include <iostream>
|
2015-07-06 10:44:18 +02:00
|
|
|
#include <fstream>
|
2015-07-02 09:18:31 +02:00
|
|
|
#include <set>
|
|
|
|
#include "plugin.hxx"
|
|
|
|
#include "compat.hxx"
|
|
|
|
|
|
|
|
/**
|
2016-02-01 14:52:38 +02:00
|
|
|
This plugin performs 3 different analyses:
|
|
|
|
|
|
|
|
(1) Find unused methods
|
|
|
|
(2) Find methods whose return types are never evaluated
|
|
|
|
(3) Find methods which are public, but are never called from outside the class i.e. they can be private
|
|
|
|
|
|
|
|
It does so, by dumping various call/definition/use info to a log file.
|
|
|
|
Then we will post-process the various lists and find the set of unused methods.
|
2015-07-02 09:18:31 +02:00
|
|
|
|
2015-10-27 01:59:25 +01:00
|
|
|
Be warned that it produces around 5G of log file.
|
2015-07-02 09:18:31 +02:00
|
|
|
|
|
|
|
The process goes something like this:
|
|
|
|
$ make check
|
2015-07-06 10:44:18 +02:00
|
|
|
$ make FORCE_COMPILE_ALL=1 COMPILER_PLUGIN_TOOL='unusedmethods' check
|
|
|
|
$ ./compilerplugins/clang/unusedmethods.py unusedmethods.log > result.txt
|
2015-07-02 09:18:31 +02:00
|
|
|
|
|
|
|
and then
|
|
|
|
$ for dir in *; do make FORCE_COMPILE_ALL=1 UPDATE_FILES=$dir COMPILER_PLUGIN_TOOL='unusedmethodsremove' $dir; done
|
|
|
|
to auto-remove the method declarations
|
|
|
|
|
|
|
|
Note that the actual process may involve a fair amount of undoing, hand editing, and general messing around
|
|
|
|
to get it to work :-)
|
|
|
|
|
|
|
|
TODO deal with calls to superclass/member constructors from other constructors, so
|
|
|
|
we can find unused constructors
|
|
|
|
*/
|
|
|
|
|
|
|
|
namespace {
|
|
|
|
|
2015-09-30 10:29:19 +02:00
|
|
|
struct MyFuncInfo
|
|
|
|
{
|
2016-02-01 14:52:38 +02:00
|
|
|
std::string access;
|
2015-09-30 10:29:19 +02:00
|
|
|
std::string returnType;
|
|
|
|
std::string nameAndParams;
|
|
|
|
std::string sourceLocation;
|
|
|
|
|
|
|
|
};
|
2016-02-25 11:33:33 +02:00
|
|
|
bool operator < (const MyFuncInfo &lhs, const MyFuncInfo &rhs)
|
|
|
|
{
|
|
|
|
return lhs.sourceLocation < rhs.sourceLocation;
|
|
|
|
}
|
2015-09-30 10:29:19 +02:00
|
|
|
|
2015-07-14 11:27:52 +02:00
|
|
|
// try to limit the voluminous output a little
|
2016-02-01 14:52:38 +02:00
|
|
|
|
|
|
|
// for the "unused method" analysis
|
2015-09-30 10:29:19 +02:00
|
|
|
static std::set<MyFuncInfo> callSet;
|
|
|
|
static std::set<MyFuncInfo> definitionSet;
|
2016-02-01 14:52:38 +02:00
|
|
|
// for the "unused return type" analysis
|
|
|
|
static std::set<MyFuncInfo> usedReturnSet;
|
|
|
|
// for the "unnecessary public" analysis
|
|
|
|
static std::set<MyFuncInfo> publicDefinitionSet;
|
|
|
|
static std::set<MyFuncInfo> calledFromOutsideSet;
|
2015-07-06 10:44:18 +02:00
|
|
|
|
|
|
|
|
2015-07-02 09:18:31 +02:00
|
|
|
class UnusedMethods:
|
|
|
|
public RecursiveASTVisitor<UnusedMethods>, public loplugin::Plugin
|
|
|
|
{
|
|
|
|
public:
|
|
|
|
explicit UnusedMethods(InstantiationData const & data): Plugin(data) {}
|
|
|
|
|
2015-07-06 10:44:18 +02:00
|
|
|
virtual void run() override
|
|
|
|
{
|
|
|
|
TraverseDecl(compiler.getASTContext().getTranslationUnitDecl());
|
|
|
|
|
|
|
|
// dump all our output in one write call - this is to try and limit IO "crosstalk" between multiple processes
|
|
|
|
// writing to the same logfile
|
2016-02-01 14:52:38 +02:00
|
|
|
|
2015-07-06 10:44:18 +02:00
|
|
|
std::string output;
|
2016-02-01 14:52:38 +02:00
|
|
|
for (const MyFuncInfo & s : definitionSet)
|
|
|
|
output += "definition:\t" + s.access + "\t" + s.returnType + "\t" + s.nameAndParams + "\t" + s.sourceLocation + "\n";
|
|
|
|
// for the "unused method" analysis
|
2015-09-30 10:29:19 +02:00
|
|
|
for (const MyFuncInfo & s : callSet)
|
|
|
|
output += "call:\t" + s.returnType + "\t" + s.nameAndParams + "\n";
|
2016-02-01 14:52:38 +02:00
|
|
|
// for the "unused return type" analysis
|
2016-01-11 08:41:55 +02:00
|
|
|
for (const MyFuncInfo & s : usedReturnSet)
|
|
|
|
output += "usedReturn:\t" + s.returnType + "\t" + s.nameAndParams + "\n";
|
2016-02-01 14:52:38 +02:00
|
|
|
// for the "unnecessary public" analysis
|
|
|
|
for (const MyFuncInfo & s : calledFromOutsideSet)
|
|
|
|
output += "outside:\t" + s.returnType + "\t" + s.nameAndParams + "\n";
|
2015-07-06 10:44:18 +02:00
|
|
|
ofstream myfile;
|
2015-08-04 16:28:49 +02:00
|
|
|
myfile.open( SRCDIR "/unusedmethods.log", ios::app | ios::out);
|
2015-07-06 10:44:18 +02:00
|
|
|
myfile << output;
|
|
|
|
myfile.close();
|
|
|
|
}
|
2015-07-02 09:18:31 +02:00
|
|
|
|
2015-10-02 08:37:23 +02:00
|
|
|
bool shouldVisitTemplateInstantiations () const { return true; }
|
|
|
|
|
2015-07-02 09:18:31 +02:00
|
|
|
bool VisitCallExpr(CallExpr* );
|
2015-07-16 14:45:53 +02:00
|
|
|
bool VisitFunctionDecl( const FunctionDecl* decl );
|
2015-07-02 09:18:31 +02:00
|
|
|
bool VisitDeclRefExpr( const DeclRefExpr* );
|
2015-09-30 10:29:19 +02:00
|
|
|
private:
|
2016-01-11 08:41:55 +02:00
|
|
|
void logCallToRootMethods(const FunctionDecl* functionDecl, std::set<MyFuncInfo>& funcSet);
|
2015-09-30 10:29:19 +02:00
|
|
|
MyFuncInfo niceName(const FunctionDecl* functionDecl);
|
2015-10-02 08:37:23 +02:00
|
|
|
std::string fullyQualifiedName(const FunctionDecl* functionDecl);
|
2015-07-02 09:18:31 +02:00
|
|
|
};
|
|
|
|
|
2015-09-30 10:29:19 +02:00
|
|
|
MyFuncInfo UnusedMethods::niceName(const FunctionDecl* functionDecl)
|
2015-07-02 09:18:31 +02:00
|
|
|
{
|
2015-07-23 09:49:57 +02:00
|
|
|
if (functionDecl->getInstantiatedFromMemberFunction())
|
|
|
|
functionDecl = functionDecl->getInstantiatedFromMemberFunction();
|
|
|
|
else if (functionDecl->getClassScopeSpecializationPattern())
|
|
|
|
functionDecl = functionDecl->getClassScopeSpecializationPattern();
|
|
|
|
// workaround clang-3.5 issue
|
|
|
|
#if __clang_major__ > 3 || ( __clang_major__ == 3 && __clang_minor__ >= 6 )
|
|
|
|
else if (functionDecl->getTemplateInstantiationPattern())
|
|
|
|
functionDecl = functionDecl->getTemplateInstantiationPattern();
|
|
|
|
#endif
|
|
|
|
|
2015-09-30 10:29:19 +02:00
|
|
|
MyFuncInfo aInfo;
|
2016-02-01 14:52:38 +02:00
|
|
|
switch (functionDecl->getAccess())
|
|
|
|
{
|
|
|
|
case AS_public: aInfo.access = "public"; break;
|
|
|
|
case AS_private: aInfo.access = "private"; break;
|
|
|
|
case AS_protected: aInfo.access = "protected"; break;
|
|
|
|
default: aInfo.access = "unknown"; break;
|
|
|
|
}
|
2015-09-30 10:29:19 +02:00
|
|
|
aInfo.returnType = compat::getReturnType(*functionDecl).getCanonicalType().getAsString();
|
|
|
|
|
2015-07-16 14:45:53 +02:00
|
|
|
if (isa<CXXMethodDecl>(functionDecl)) {
|
2015-07-22 10:20:03 +02:00
|
|
|
const CXXRecordDecl* recordDecl = dyn_cast<CXXMethodDecl>(functionDecl)->getParent();
|
2015-09-30 10:29:19 +02:00
|
|
|
aInfo.nameAndParams += recordDecl->getQualifiedNameAsString();
|
|
|
|
aInfo.nameAndParams += "::";
|
2015-07-16 14:45:53 +02:00
|
|
|
}
|
2015-09-30 10:29:19 +02:00
|
|
|
aInfo.nameAndParams += functionDecl->getNameAsString() + "(";
|
2015-07-02 09:18:31 +02:00
|
|
|
bool bFirst = true;
|
|
|
|
for (const ParmVarDecl *pParmVarDecl : functionDecl->params()) {
|
|
|
|
if (bFirst)
|
|
|
|
bFirst = false;
|
|
|
|
else
|
2015-09-30 10:29:19 +02:00
|
|
|
aInfo.nameAndParams += ",";
|
|
|
|
aInfo.nameAndParams += pParmVarDecl->getType().getCanonicalType().getAsString();
|
2015-07-02 09:18:31 +02:00
|
|
|
}
|
2015-09-30 10:29:19 +02:00
|
|
|
aInfo.nameAndParams += ")";
|
2015-07-16 14:45:53 +02:00
|
|
|
if (isa<CXXMethodDecl>(functionDecl) && dyn_cast<CXXMethodDecl>(functionDecl)->isConst()) {
|
2015-09-30 10:29:19 +02:00
|
|
|
aInfo.nameAndParams += " const";
|
2015-07-02 09:18:31 +02:00
|
|
|
}
|
2015-09-30 10:29:19 +02:00
|
|
|
|
|
|
|
SourceLocation expansionLoc = compiler.getSourceManager().getExpansionLoc( functionDecl->getLocation() );
|
|
|
|
StringRef name = compiler.getSourceManager().getFilename(expansionLoc);
|
|
|
|
aInfo.sourceLocation = std::string(name.substr(strlen(SRCDIR)+1)) + ":" + std::to_string(compiler.getSourceManager().getSpellingLineNumber(expansionLoc));
|
|
|
|
|
|
|
|
return aInfo;
|
2015-07-02 09:18:31 +02:00
|
|
|
}
|
|
|
|
|
2015-10-02 08:37:23 +02:00
|
|
|
std::string UnusedMethods::fullyQualifiedName(const FunctionDecl* functionDecl)
|
|
|
|
{
|
|
|
|
std::string ret = compat::getReturnType(*functionDecl).getCanonicalType().getAsString();
|
|
|
|
ret += " ";
|
|
|
|
if (isa<CXXMethodDecl>(functionDecl)) {
|
|
|
|
const CXXRecordDecl* recordDecl = dyn_cast<CXXMethodDecl>(functionDecl)->getParent();
|
|
|
|
ret += recordDecl->getQualifiedNameAsString();
|
|
|
|
ret += "::";
|
|
|
|
}
|
|
|
|
ret += functionDecl->getNameAsString() + "(";
|
|
|
|
bool bFirst = true;
|
|
|
|
for (const ParmVarDecl *pParmVarDecl : functionDecl->params()) {
|
|
|
|
if (bFirst)
|
|
|
|
bFirst = false;
|
|
|
|
else
|
|
|
|
ret += ",";
|
|
|
|
ret += pParmVarDecl->getType().getCanonicalType().getAsString();
|
|
|
|
}
|
|
|
|
ret += ")";
|
|
|
|
if (isa<CXXMethodDecl>(functionDecl) && dyn_cast<CXXMethodDecl>(functionDecl)->isConst()) {
|
|
|
|
ret += " const";
|
|
|
|
}
|
|
|
|
|
|
|
|
return ret;
|
|
|
|
}
|
|
|
|
|
2016-01-11 08:41:55 +02:00
|
|
|
void UnusedMethods::logCallToRootMethods(const FunctionDecl* functionDecl, std::set<MyFuncInfo>& funcSet)
|
2015-07-02 09:18:31 +02:00
|
|
|
{
|
2015-07-16 14:45:53 +02:00
|
|
|
functionDecl = functionDecl->getCanonicalDecl();
|
2015-10-02 08:37:23 +02:00
|
|
|
bool bCalledSuperMethod = false;
|
2015-07-16 14:45:53 +02:00
|
|
|
if (isa<CXXMethodDecl>(functionDecl)) {
|
|
|
|
// For virtual/overriding methods, we need to pretend we called the root method(s),
|
|
|
|
// so that they get marked as used.
|
|
|
|
const CXXMethodDecl* methodDecl = dyn_cast<CXXMethodDecl>(functionDecl);
|
|
|
|
for(CXXMethodDecl::method_iterator it = methodDecl->begin_overridden_methods();
|
|
|
|
it != methodDecl->end_overridden_methods(); ++it)
|
|
|
|
{
|
2016-01-11 08:41:55 +02:00
|
|
|
logCallToRootMethods(*it, funcSet);
|
2015-10-02 08:37:23 +02:00
|
|
|
bCalledSuperMethod = true;
|
2015-07-16 14:45:53 +02:00
|
|
|
}
|
2015-07-02 09:18:31 +02:00
|
|
|
}
|
2015-10-02 08:37:23 +02:00
|
|
|
if (!bCalledSuperMethod)
|
2015-07-02 09:18:31 +02:00
|
|
|
{
|
2015-10-02 08:37:23 +02:00
|
|
|
while (functionDecl->getTemplateInstantiationPattern())
|
|
|
|
functionDecl = functionDecl->getTemplateInstantiationPattern();
|
2016-01-11 08:41:55 +02:00
|
|
|
funcSet.insert(niceName(functionDecl));
|
2015-07-02 09:18:31 +02:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2015-07-07 13:58:41 +02:00
|
|
|
// prevent recursive templates from blowing up the stack
|
2015-10-02 08:37:23 +02:00
|
|
|
static std::set<std::string> traversedFunctionSet;
|
2015-07-07 13:58:41 +02:00
|
|
|
|
2016-02-01 14:52:38 +02:00
|
|
|
const Decl* get_DeclContext_from_Stmt(ASTContext& context, const Stmt& stmt)
|
|
|
|
{
|
|
|
|
auto it = context.getParents(stmt).begin();
|
|
|
|
|
|
|
|
if (it == context.getParents(stmt).end())
|
|
|
|
return nullptr;
|
|
|
|
|
|
|
|
const Decl *aDecl = it->get<Decl>();
|
|
|
|
if (aDecl)
|
|
|
|
return aDecl;
|
|
|
|
|
|
|
|
const Stmt *aStmt = it->get<Stmt>();
|
|
|
|
if (aStmt)
|
|
|
|
return get_DeclContext_from_Stmt(context, *aStmt);
|
|
|
|
|
|
|
|
return nullptr;
|
|
|
|
}
|
|
|
|
|
|
|
|
static const FunctionDecl* get_top_FunctionDecl_from_Stmt(ASTContext& context, const Stmt& stmt)
|
|
|
|
{
|
|
|
|
const Decl *decl = get_DeclContext_from_Stmt(context, stmt);
|
|
|
|
if (decl)
|
|
|
|
return static_cast<const FunctionDecl*>(decl->getNonClosureContext());
|
|
|
|
|
|
|
|
return nullptr;
|
|
|
|
}
|
|
|
|
|
2015-07-02 09:18:31 +02:00
|
|
|
bool UnusedMethods::VisitCallExpr(CallExpr* expr)
|
|
|
|
{
|
2015-10-02 08:37:23 +02:00
|
|
|
// Note that I don't ignore ANYTHING here, because I want to get calls to my code that result
|
|
|
|
// from template instantiation deep inside the STL and other external code
|
2015-07-15 13:41:11 +02:00
|
|
|
|
2015-07-07 10:12:55 +02:00
|
|
|
FunctionDecl* calleeFunctionDecl = expr->getDirectCallee();
|
2015-07-07 13:58:41 +02:00
|
|
|
if (calleeFunctionDecl == nullptr) {
|
2015-09-30 10:29:19 +02:00
|
|
|
Expr* callee = expr->getCallee()->IgnoreParenImpCasts();
|
|
|
|
DeclRefExpr* dr = dyn_cast<DeclRefExpr>(callee);
|
|
|
|
if (dr) {
|
|
|
|
calleeFunctionDecl = dyn_cast<FunctionDecl>(dr->getDecl());
|
|
|
|
if (calleeFunctionDecl)
|
|
|
|
goto gotfunc;
|
|
|
|
}
|
|
|
|
/*
|
|
|
|
expr->dump();
|
2016-02-02 19:47:20 +01:00
|
|
|
throw "Can't touch this";
|
2015-09-30 10:29:19 +02:00
|
|
|
*/
|
2015-07-07 13:58:41 +02:00
|
|
|
return true;
|
|
|
|
}
|
2015-09-30 10:29:19 +02:00
|
|
|
|
|
|
|
gotfunc:
|
2015-07-13 13:31:13 +02:00
|
|
|
// if we see a call to a function, it may effectively create new code,
|
|
|
|
// if the function is templated. However, if we are inside a template function,
|
|
|
|
// calling another function on the same template, the same problem occurs.
|
|
|
|
// Rather than tracking all of that, just traverse anything we have not already traversed.
|
2015-10-02 08:37:23 +02:00
|
|
|
if (traversedFunctionSet.insert(fullyQualifiedName(calleeFunctionDecl)).second)
|
2015-07-13 13:31:13 +02:00
|
|
|
TraverseFunctionDecl(calleeFunctionDecl);
|
2015-07-07 10:12:55 +02:00
|
|
|
|
2016-01-11 08:41:55 +02:00
|
|
|
logCallToRootMethods(calleeFunctionDecl, callSet);
|
|
|
|
|
2016-02-01 14:52:38 +02:00
|
|
|
const Stmt* parent = parentStmt(expr);
|
|
|
|
|
|
|
|
// Now do the checks necessary for the "unnecessary public" analysis
|
|
|
|
CXXMethodDecl* calleeMethodDecl = dyn_cast<CXXMethodDecl>(calleeFunctionDecl);
|
|
|
|
if (calleeMethodDecl && calleeMethodDecl->getAccess() == AS_public)
|
|
|
|
{
|
|
|
|
const FunctionDecl* parentFunctionDecl = get_top_FunctionDecl_from_Stmt(compiler.getASTContext(), *expr);
|
|
|
|
if (parentFunctionDecl && parentFunctionDecl != calleeFunctionDecl) {
|
|
|
|
calledFromOutsideSet.insert(niceName(parentFunctionDecl));
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
// Now do the checks necessary for the "unused return value" analysis
|
2016-01-11 08:41:55 +02:00
|
|
|
if (calleeFunctionDecl->getReturnType()->isVoidType()) {
|
|
|
|
return true;
|
|
|
|
}
|
|
|
|
if (!parent) {
|
2016-01-18 10:39:48 +02:00
|
|
|
// we will get null parent if it's under a CXXConstructExpr node
|
|
|
|
logCallToRootMethods(calleeFunctionDecl, usedReturnSet);
|
2016-01-11 08:41:55 +02:00
|
|
|
return true;
|
|
|
|
}
|
|
|
|
if (isa<Expr>(parent) || isa<ReturnStmt>(parent) || isa<DeclStmt>(parent)
|
|
|
|
|| isa<IfStmt>(parent) || isa<SwitchStmt>(parent) || isa<ForStmt>(parent)
|
|
|
|
|| isa<WhileStmt>(parent) || isa<DoStmt>(parent)
|
|
|
|
|| isa<CXXForRangeStmt>(parent))
|
|
|
|
{
|
|
|
|
logCallToRootMethods(calleeFunctionDecl, usedReturnSet);
|
|
|
|
return true;
|
|
|
|
}
|
|
|
|
if (isa<CompoundStmt>(parent) || isa<DefaultStmt>(parent) || isa<CaseStmt>(parent)
|
|
|
|
|| isa<LabelStmt>(parent))
|
|
|
|
{
|
|
|
|
return true;
|
|
|
|
}
|
|
|
|
parent->dump();
|
2015-07-16 14:45:53 +02:00
|
|
|
return true;
|
|
|
|
}
|
|
|
|
|
|
|
|
bool UnusedMethods::VisitFunctionDecl( const FunctionDecl* functionDecl )
|
2015-07-02 09:18:31 +02:00
|
|
|
{
|
|
|
|
functionDecl = functionDecl->getCanonicalDecl();
|
2015-07-16 14:45:53 +02:00
|
|
|
const CXXMethodDecl* methodDecl = dyn_cast_or_null<CXXMethodDecl>(functionDecl);
|
|
|
|
|
2015-07-02 09:18:31 +02:00
|
|
|
// ignore method overrides, since the call will show up as being directed to the root method
|
2015-07-16 14:45:53 +02:00
|
|
|
if (methodDecl && (methodDecl->size_overridden_methods() != 0 || methodDecl->hasAttr<OverrideAttr>())) {
|
2015-07-02 09:18:31 +02:00
|
|
|
return true;
|
|
|
|
}
|
|
|
|
// ignore stuff that forms part of the stable URE interface
|
|
|
|
if (isInUnoIncludeFile(compiler.getSourceManager().getSpellingLoc(
|
2015-09-29 12:40:47 +02:00
|
|
|
functionDecl->getCanonicalDecl()->getNameInfo().getLoc()))) {
|
2015-07-02 09:18:31 +02:00
|
|
|
return true;
|
|
|
|
}
|
|
|
|
if (isa<CXXDestructorDecl>(functionDecl)) {
|
|
|
|
return true;
|
|
|
|
}
|
|
|
|
if (isa<CXXConstructorDecl>(functionDecl)) {
|
|
|
|
return true;
|
|
|
|
}
|
2015-10-07 16:28:27 +02:00
|
|
|
if (functionDecl && functionDecl->isDeleted()) {
|
2015-07-02 09:18:31 +02:00
|
|
|
return true;
|
|
|
|
}
|
|
|
|
|
2015-12-18 09:37:44 +02:00
|
|
|
if( functionDecl->getLocation().isValid() && !ignoreLocation( functionDecl ))
|
2016-02-01 14:52:38 +02:00
|
|
|
{
|
|
|
|
MyFuncInfo funcInfo = niceName(functionDecl);
|
|
|
|
definitionSet.insert(funcInfo);
|
|
|
|
if (functionDecl->getAccess() == AS_public) {
|
|
|
|
publicDefinitionSet.insert(funcInfo);
|
|
|
|
}
|
|
|
|
}
|
2015-07-02 09:18:31 +02:00
|
|
|
return true;
|
|
|
|
}
|
|
|
|
|
|
|
|
// this catches places that take the address of a method
|
|
|
|
bool UnusedMethods::VisitDeclRefExpr( const DeclRefExpr* declRefExpr )
|
|
|
|
{
|
|
|
|
const Decl* functionDecl = declRefExpr->getDecl();
|
2015-07-16 14:45:53 +02:00
|
|
|
if (!isa<FunctionDecl>(functionDecl)) {
|
2015-07-02 09:18:31 +02:00
|
|
|
return true;
|
|
|
|
}
|
2016-01-11 08:41:55 +02:00
|
|
|
logCallToRootMethods(dyn_cast<FunctionDecl>(functionDecl)->getCanonicalDecl(), callSet);
|
|
|
|
logCallToRootMethods(dyn_cast<FunctionDecl>(functionDecl)->getCanonicalDecl(), usedReturnSet);
|
2015-07-02 09:18:31 +02:00
|
|
|
return true;
|
|
|
|
}
|
|
|
|
|
|
|
|
loplugin::Plugin::Registration< UnusedMethods > X("unusedmethods", false);
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
|