loplugin:unusedmethods cui

Change-Id: I8a4cb855054c487d7a8307ad219f10b06db3248b
This commit is contained in:
Noel Grandin
2015-07-17 10:34:58 +02:00
parent 956cb1f777
commit 89ef4dea32
35 changed files with 13 additions and 156 deletions

View File

@@ -121,11 +121,16 @@ bool UnusedMethodsRemove::VisitCXXMethodDecl( const CXXMethodDecl* functionDecl
if(!(found < mmappedData + mmapFilesize)) {
return true;
}
// sometimes the declaration has a semicolon just after it, and it's much neater to remove that too.
SourceRange replaceRange(functionDecl->getSourceRange());
// sometimes the declaration has a semicolon just after it, and it's much neater to remove that too.
if (rewriter->getRewrittenText(SourceRange(replaceRange.getEnd(), replaceRange.getEnd().getLocWithOffset(1))) == ";") {
replaceRange.setEnd(replaceRange.getEnd().getLocWithOffset(1));
}
// remove leading spaces
while (rewriter->getRewrittenText(SourceRange(replaceRange.getBegin().getLocWithOffset(-1), replaceRange.getBegin())) == " ")
{
replaceRange.setBegin(replaceRange.getBegin().getLocWithOffset(-1));
}
if (!replaceText(replaceRange, "")) {
report(
DiagnosticsEngine::Warning,