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

Function getProgramMemory

lib/programmemory.cpp:609–619  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

607}
608
609ProgramMemory getProgramMemory(const Token* tok, const Token* expr, const ValueFlow::Value& value, const Settings& settings)
610{
611 ProgramMemory programMemory;
612 programMemory.replace(getInitialProgramState(tok, value.tokvalue, settings));
613 programMemory.replace(getInitialProgramState(tok, value.condition, settings));
614 fillProgramMemoryFromConditions(programMemory, tok, settings);
615 programMemory.setValue(expr, value);
616 const ProgramMemory state = programMemory;
617 fillProgramMemoryFromAssignments(programMemory, tok, settings, state, {{expr, value}});
618 return programMemory;
619}
620
621static bool isNumericValue(const ValueFlow::Value& value) {
622 return value.isIntValue() || value.isFloatValue();

Callers 1

valueFlowForLoopSimplifyFunction · 0.85

Calls 5

getInitialProgramStateFunction · 0.85
replaceMethod · 0.45
setValueMethod · 0.45

Tested by

no test coverage detected