Cppcheck
|
#include <programmemory.h>
Public Types | |
using | Map = std::unordered_map< ExprIdToken, ValueFlow::Value, ExprIdToken::Hash > |
Public Member Functions | |
ProgramMemory ()=default | |
ProgramMemory (Map values) | |
void | setValue (const Token *expr, const ValueFlow::Value &value) |
const ValueFlow::Value * | getValue (nonneg int exprid, bool impossible=false) const |
bool | getIntValue (nonneg int exprid, MathLib::bigint &result) const |
void | setIntValue (const Token *expr, MathLib::bigint value, bool impossible=false) |
bool | getContainerSizeValue (nonneg int exprid, MathLib::bigint &result) const |
bool | getContainerEmptyValue (nonneg int exprid, MathLib::bigint &result) const |
void | setContainerSizeValue (const Token *expr, MathLib::bigint value, bool isEqual=true) |
void | setUnknown (const Token *expr) |
bool | getTokValue (nonneg int exprid, const Token *&result) const |
bool | hasValue (nonneg int exprid) |
const ValueFlow::Value & | at (nonneg int exprid) const |
ValueFlow::Value & | at (nonneg int exprid) |
void | erase_if (const std::function< bool(const ExprIdToken &)> &pred) |
void | swap (ProgramMemory &pm) |
void | clear () |
bool | empty () const |
void | replace (ProgramMemory pm) |
void | insert (const ProgramMemory &pm) |
Map::iterator | begin () |
Map::iterator | end () |
Map::const_iterator | begin () const |
Map::const_iterator | end () const |
Private Attributes | |
Map | mValues |
Friends | |
bool | operator== (const ProgramMemory &x, const ProgramMemory &y) |
bool | operator!= (const ProgramMemory &x, const ProgramMemory &y) |
Definition at line 99 of file programmemory.h.
using ProgramMemory::Map = std::unordered_map<ExprIdToken, ValueFlow::Value, ExprIdToken::Hash> |
Definition at line 100 of file programmemory.h.
|
default |
|
inlineexplicit |
Definition at line 104 of file programmemory.h.
ValueFlow::Value & ProgramMemory::at | ( | nonneg int | exprid | ) |
Definition at line 157 of file programmemory.cpp.
References ExprIdToken::exprid.
const ValueFlow::Value & ProgramMemory::at | ( | nonneg int | exprid | ) | const |
Definition at line 154 of file programmemory.cpp.
References ExprIdToken::exprid.
|
inline |
Definition at line 136 of file programmemory.h.
References mValues.
|
inline |
Definition at line 144 of file programmemory.h.
References mValues.
void ProgramMemory::clear | ( | ) |
Definition at line 176 of file programmemory.cpp.
Referenced by valueFlowFunctionReturn().
bool ProgramMemory::empty | ( | ) | const |
Definition at line 181 of file programmemory.cpp.
Referenced by valueFlowFunctionReturn().
|
inline |
Definition at line 140 of file programmemory.h.
References mValues.
|
inline |
Definition at line 148 of file programmemory.h.
References mValues.
void ProgramMemory::erase_if | ( | const std::function< bool(const ExprIdToken &)> & | pred | ) |
Definition at line 161 of file programmemory.cpp.
Referenced by ProgramMemoryState::removeModifiedVars(), and removeModifiedVars().
bool ProgramMemory::getContainerEmptyValue | ( | nonneg int | exprid, |
MathLib::bigint & | result | ||
) | const |
Definition at line 120 of file programmemory.cpp.
References ExprIdToken::exprid, ValueFlow::Value::intvalue, ValueFlow::Value::isContainerSizeValue(), and ValueFlow::Value::isImpossible().
Referenced by ValueFlowAnalyzer::evaluate().
bool ProgramMemory::getContainerSizeValue | ( | nonneg int | exprid, |
MathLib::bigint & | result | ||
) | const |
Definition at line 111 of file programmemory.cpp.
References ExprIdToken::exprid, ValueFlow::Value::intvalue, and ValueFlow::Value::isContainerSizeValue().
bool ProgramMemory::getIntValue | ( | nonneg int | exprid, |
MathLib::bigint & | result | ||
) | const |
Definition at line 82 of file programmemory.cpp.
References ExprIdToken::exprid, ValueFlow::Value::intvalue, and ValueFlow::Value::isIntValue().
Definition at line 100 of file programmemory.cpp.
References ExprIdToken::exprid, ValueFlow::Value::isTokValue(), and ValueFlow::Value::tokvalue.
const ValueFlow::Value * ProgramMemory::getValue | ( | nonneg int | exprid, |
bool | impossible = false |
||
) | const |
Definition at line 72 of file programmemory.cpp.
References ExprIdToken::exprid.
bool ProgramMemory::hasValue | ( | nonneg int | exprid | ) |
Definition at line 149 of file programmemory.cpp.
References ExprIdToken::exprid.
Referenced by fillProgramMemoryFromAssignments(), and valueFlowForLoop2().
void ProgramMemory::insert | ( | const ProgramMemory & | pm | ) |
Definition at line 193 of file programmemory.cpp.
Referenced by ProgramMemoryState::insert().
void ProgramMemory::replace | ( | ProgramMemory | pm | ) |
Definition at line 186 of file programmemory.cpp.
References mValues.
Referenced by getProgramMemory(), and ProgramMemoryState::replace().
void ProgramMemory::setContainerSizeValue | ( | const Token * | expr, |
MathLib::bigint | value, | ||
bool | isEqual = true |
||
) |
Definition at line 136 of file programmemory.cpp.
References ValueFlow::Value::CONTAINER_SIZE, ValueFlow::Value::Impossible, isEqual(), ValueFlow::Value::valueKind, and ValueFlow::Value::valueType.
Referenced by ProgramMemoryState::assume(), and programMemoryParseCondition().
void ProgramMemory::setIntValue | ( | const Token * | expr, |
MathLib::bigint | value, | ||
bool | impossible = false |
||
) |
Definition at line 92 of file programmemory.cpp.
References ValueFlow::Value::setImpossible().
Referenced by programMemoryParseCondition().
void ProgramMemory::setUnknown | ( | const Token * | expr | ) |
Definition at line 145 of file programmemory.cpp.
References ValueFlow::Value::UNINIT.
Referenced by fillProgramMemoryFromAssignments().
void ProgramMemory::setValue | ( | const Token * | expr, |
const ValueFlow::Value & | value | ||
) |
Definition at line 55 of file programmemory.cpp.
References Token::exprId(), Token::hasKnownIntValue(), solveExprValue(), and ExprIdToken::tok.
Referenced by addVars(), evaluateLibraryFunction(), ConditionHandler::fillFromPath(), fillProgramMemoryFromAssignments(), getProgramMemory(), programMemoryParseCondition(), and valueFlowFunctionReturn().
void ProgramMemory::swap | ( | ProgramMemory & | pm | ) |
Definition at line 171 of file programmemory.cpp.
References mValues.
Referenced by valueFlowForLoop2().
|
friend |
Definition at line 156 of file programmemory.h.
|
friend |
Definition at line 152 of file programmemory.h.
|
private |