summaryrefslogtreecommitdiff
path: root/compilerplugins
diff options
context:
space:
mode:
authorStephan Bergmann <sbergman@redhat.com>2016-11-04 09:20:49 +0100
committerStephan Bergmann <sbergman@redhat.com>2016-11-04 09:20:49 +0100
commitcbb7b10b6b2748db088ae2f78b54711639a7eb2d (patch)
tree94132a71aba9306d72741056056f89f8e0a48acb /compilerplugins
parentbb3e19624bf4a400e9012b9b4451dc9542261fd8 (diff)
-Werror=unused-function
Change-Id: I33790862cfe40693921d07182ccf4645c3ef28a3
Diffstat (limited to 'compilerplugins')
-rw-r--r--compilerplugins/clang/unnecessaryvirtual.cxx37
1 files changed, 0 insertions, 37 deletions
diff --git a/compilerplugins/clang/unnecessaryvirtual.cxx b/compilerplugins/clang/unnecessaryvirtual.cxx
index 82f91c71f1a7..ee3d8eced8fe 100644
--- a/compilerplugins/clang/unnecessaryvirtual.cxx
+++ b/compilerplugins/clang/unnecessaryvirtual.cxx
@@ -76,7 +76,6 @@ public:
bool VisitCXXMethodDecl( const CXXMethodDecl* decl );
private:
- std::string fullyQualifiedName(const FunctionDecl* functionDecl);
std::string toString(SourceLocation loc);
};
@@ -97,42 +96,6 @@ std::string niceName(const CXXMethodDecl* functionDecl)
return s;
}
-std::string UnnecessaryVirtual::fullyQualifiedName(const FunctionDecl* functionDecl)
-{
- if (functionDecl->getInstantiatedFromMemberFunction())
- functionDecl = functionDecl->getInstantiatedFromMemberFunction();
- else if (functionDecl->getClassScopeSpecializationPattern())
- functionDecl = functionDecl->getClassScopeSpecializationPattern();
-// workaround clang-3.5 issue
-#if CLANG_VERSION >= 30600
- else if (functionDecl->getTemplateInstantiationPattern())
- functionDecl = functionDecl->getTemplateInstantiationPattern();
-#endif
-
- 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 : compat::parameters(*functionDecl)) {
- 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;
-}
-
bool UnnecessaryVirtual::VisitCXXMethodDecl( const CXXMethodDecl* methodDecl )
{
if (ignoreLocation(methodDecl)) {