Cppcheck
Public Types | Public Member Functions | Private Attributes | Friends | List of all members
ProgramMemory Struct Reference

#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::ValuegetValue (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::Valueat (nonneg int exprid) const
 
ValueFlow::Valueat (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)
 

Detailed Description

Definition at line 99 of file programmemory.h.

Member Typedef Documentation

◆ Map

Definition at line 100 of file programmemory.h.

Constructor & Destructor Documentation

◆ ProgramMemory() [1/2]

ProgramMemory::ProgramMemory ( )
default

◆ ProgramMemory() [2/2]

ProgramMemory::ProgramMemory ( Map  values)
inlineexplicit

Definition at line 104 of file programmemory.h.

Member Function Documentation

◆ at() [1/2]

ValueFlow::Value & ProgramMemory::at ( nonneg int  exprid)

Definition at line 157 of file programmemory.cpp.

References ExprIdToken::exprid.

◆ at() [2/2]

const ValueFlow::Value & ProgramMemory::at ( nonneg int  exprid) const

Definition at line 154 of file programmemory.cpp.

References ExprIdToken::exprid.

◆ begin() [1/2]

Map::iterator ProgramMemory::begin ( )
inline

Definition at line 136 of file programmemory.h.

References mValues.

◆ begin() [2/2]

Map::const_iterator ProgramMemory::begin ( ) const
inline

Definition at line 144 of file programmemory.h.

References mValues.

◆ clear()

void ProgramMemory::clear ( )

Definition at line 176 of file programmemory.cpp.

Referenced by valueFlowFunctionReturn().

◆ empty()

bool ProgramMemory::empty ( ) const

Definition at line 181 of file programmemory.cpp.

Referenced by valueFlowFunctionReturn().

◆ end() [1/2]

Map::iterator ProgramMemory::end ( )
inline

Definition at line 140 of file programmemory.h.

References mValues.

◆ end() [2/2]

Map::const_iterator ProgramMemory::end ( ) const
inline

Definition at line 148 of file programmemory.h.

References mValues.

◆ erase_if()

void ProgramMemory::erase_if ( const std::function< bool(const ExprIdToken &)> &  pred)

◆ getContainerEmptyValue()

bool ProgramMemory::getContainerEmptyValue ( nonneg int  exprid,
MathLib::bigint result 
) const

◆ getContainerSizeValue()

bool ProgramMemory::getContainerSizeValue ( nonneg int  exprid,
MathLib::bigint result 
) const

◆ getIntValue()

bool ProgramMemory::getIntValue ( nonneg int  exprid,
MathLib::bigint result 
) const

◆ getTokValue()

bool ProgramMemory::getTokValue ( nonneg int  exprid,
const Token *&  result 
) const

◆ getValue()

const ValueFlow::Value * ProgramMemory::getValue ( nonneg int  exprid,
bool  impossible = false 
) const

Definition at line 72 of file programmemory.cpp.

References ExprIdToken::exprid.

◆ hasValue()

bool ProgramMemory::hasValue ( nonneg int  exprid)

Definition at line 149 of file programmemory.cpp.

References ExprIdToken::exprid.

Referenced by fillProgramMemoryFromAssignments(), and valueFlowForLoop2().

◆ insert()

void ProgramMemory::insert ( const ProgramMemory pm)

Definition at line 193 of file programmemory.cpp.

Referenced by ProgramMemoryState::insert().

◆ replace()

void ProgramMemory::replace ( ProgramMemory  pm)

Definition at line 186 of file programmemory.cpp.

References mValues.

Referenced by getProgramMemory(), and ProgramMemoryState::replace().

◆ setContainerSizeValue()

void ProgramMemory::setContainerSizeValue ( const Token expr,
MathLib::bigint  value,
bool  isEqual = true 
)

◆ setIntValue()

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().

◆ setUnknown()

void ProgramMemory::setUnknown ( const Token expr)

Definition at line 145 of file programmemory.cpp.

References ValueFlow::Value::UNINIT.

Referenced by fillProgramMemoryFromAssignments().

◆ setValue()

void ProgramMemory::setValue ( const Token expr,
const ValueFlow::Value value 
)

◆ swap()

void ProgramMemory::swap ( ProgramMemory pm)

Definition at line 171 of file programmemory.cpp.

References mValues.

Referenced by valueFlowForLoop2().

Friends And Related Function Documentation

◆ operator!=

bool operator!= ( const ProgramMemory x,
const ProgramMemory y 
)
friend

Definition at line 156 of file programmemory.h.

◆ operator==

bool operator== ( const ProgramMemory x,
const ProgramMemory y 
)
friend

Definition at line 152 of file programmemory.h.

Member Data Documentation

◆ mValues

Map ProgramMemory::mValues
private

Definition at line 161 of file programmemory.h.

Referenced by begin(), end(), replace(), and swap().


The documentation for this struct was generated from the following files: