improve unusedfields loplugin
to ignore assignments when doing writeonly analysis Change-Id: I9eb6f2594003a610582dbc20acb7ccf14ef72c6c
This commit is contained in:
@@ -194,8 +194,7 @@ bool ConstParams::checkIfCanBeConst(const Stmt* stmt)
|
||||
return checkIfCanBeConst(parent);
|
||||
}
|
||||
return true;
|
||||
} else if (isa<BinaryOperator>(parent)) {
|
||||
const BinaryOperator* binaryOp = dyn_cast<BinaryOperator>(parent);
|
||||
} else if (auto binaryOp = dyn_cast<BinaryOperator>(parent)) {
|
||||
BinaryOperator::Opcode op = binaryOp->getOpcode();
|
||||
// TODO could do better, but would require tracking the LHS
|
||||
if (binaryOp->getRHS() == stmt && op == BO_Assign) {
|
||||
|
Reference in New Issue
Block a user