MCPcopy Create free account
hub / github.com/cppcheck-opensource/cppcheck / getLHSVariables

Function getLHSVariables

lib/astutils.cpp:3589–3600  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

3587}
3588
3589std::vector<const Variable*> getLHSVariables(const Token* tok)
3590{
3591 if (!Token::Match(tok, "%assign%|(|{"))
3592 return {};
3593 if (!tok->astOperand1())
3594 return {};
3595 if (tok->astOperand1()->varId() > 0 && tok->astOperand1()->variable())
3596 return {tok->astOperand1()->variable()};
3597 std::vector<const Variable*> result;
3598 getLHSVariablesRecursive(result, tok->astOperand1());
3599 return result;
3600}
3601
3602static const Token* getLHSVariableRecursive(const Token* tok)
3603{

Callers 2

valueFlowSymbolicFunction · 0.85
valueFlowAfterAssignFunction · 0.85

Calls 3

getLHSVariablesRecursiveFunction · 0.85
astOperand1Method · 0.80
variableMethod · 0.80

Tested by

no test coverage detected