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

Method valueFlowConstantFoldAST

lib/valueflow.cpp:7194–7202  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

7192}
7193
7194const ValueFlow::Value *ValueFlow::valueFlowConstantFoldAST(Token *expr, const Settings &settings)
7195{
7196 if (expr && expr->values().empty()) {
7197 valueFlowConstantFoldAST(expr->astOperand1(), settings);
7198 valueFlowConstantFoldAST(expr->astOperand2(), settings);
7199 valueFlowSetConstantValue(expr, settings);
7200 }
7201 return expr && expr->hasKnownValue() ? &expr->values().front() : nullptr;
7202}
7203
7204struct ValueFlowState {
7205 explicit ValueFlowState(TokenList& tokenlist,

Callers

nothing calls this directly

Calls 6

astOperand1Method · 0.80
astOperand2Method · 0.80
hasKnownValueMethod · 0.80
frontMethod · 0.80
emptyMethod · 0.45

Tested by

no test coverage detected