loplugin:constparams in basic

Change-Id: Idf55f63f2d56be4997a8cdc6afc5690eacac9a60
Reviewed-on: https://gerrit.libreoffice.org/40214
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
This commit is contained in:
Noel Grandin
2017-07-20 10:08:03 +02:00
parent f148100707
commit 6d829ae4f2
26 changed files with 59 additions and 55 deletions

View File

@@ -107,6 +107,7 @@ bool ConstParams::VisitFunctionDecl(FunctionDecl * functionDecl)
|| name == "memory_write"
|| name == "file_write"
|| name == "SalMainPipeExchangeSignal_impl"
|| name.startswith("SbRtl_")
// UNO component entry points
|| name.endswith("component_getFactory")
// in Scheduler::, wants to loop until a reference to a bool becomes true
@@ -197,6 +198,9 @@ bool ConstParams::VisitDeclRefExpr( const DeclRefExpr* declRefExpr )
if (interestingSet.find(parmVarDecl) == interestingSet.end()) {
return true;
}
// no need to check again if we have already eliminated this one
if (cannotBeConstSet.find(parmVarDecl) != cannotBeConstSet.end())
return true;
if (!checkIfCanBeConst(declRefExpr, parmVarDecl))
cannotBeConstSet.insert(parmVarDecl);