Cppcheck
Functions
infer.cpp File Reference
#include "infer.h"
#include "calculate.h"
#include "errortypes.h"
#include "valueptr.h"
#include <cassert>
#include <algorithm>
#include <functional>
#include <iterator>
#include <unordered_set>
#include <utility>

Go to the source code of this file.

Functions

template<class Predicate , class Compare >
static const ValueFlow::ValuegetCompareValue (const std::list< ValueFlow::Value > &values, Predicate pred, Compare compare)
 
static void addToErrorPath (ValueFlow::Value &value, const std::vector< const ValueFlow::Value * > &refs)
 
static void setValueKind (ValueFlow::Value &value, const std::vector< const ValueFlow::Value * > &refs)
 
static bool inferNotEqual (const std::list< ValueFlow::Value > &values, MathLib::bigint x)
 
std::vector< ValueFlow::Valueinfer (const ValuePtr< InferModel > &model, const std::string &op, std::list< ValueFlow::Value > lhsValues, std::list< ValueFlow::Value > rhsValues)
 
std::vector< ValueFlow::Valueinfer (const ValuePtr< InferModel > &model, const std::string &op, MathLib::bigint lhs, std::list< ValueFlow::Value > rhsValues)
 
std::vector< ValueFlow::Valueinfer (const ValuePtr< InferModel > &model, const std::string &op, std::list< ValueFlow::Value > lhsValues, MathLib::bigint rhs)
 
std::vector< MathLib::bigintgetMinValue (const ValuePtr< InferModel > &model, const std::list< ValueFlow::Value > &values)
 
std::vector< MathLib::bigintgetMaxValue (const ValuePtr< InferModel > &model, const std::list< ValueFlow::Value > &values)
 

Function Documentation

◆ addToErrorPath()

static void addToErrorPath ( ValueFlow::Value value,
const std::vector< const ValueFlow::Value * > &  refs 
)
static

Definition at line 240 of file infer.cpp.

References ValueFlow::Value::condition, ValueFlow::Value::debugPath, and ValueFlow::Value::errorPath.

Referenced by infer().

◆ getCompareValue()

template<class Predicate , class Compare >
static const ValueFlow::Value* getCompareValue ( const std::list< ValueFlow::Value > &  values,
Predicate  pred,
Compare  compare 
)
static

Definition at line 35 of file infer.cpp.

References ValueFlow::Value::intvalue, and Token::values().

◆ getMaxValue()

std::vector<MathLib::bigint> getMaxValue ( const ValuePtr< InferModel > &  model,
const std::list< ValueFlow::Value > &  values 
)

Definition at line 383 of file infer.cpp.

◆ getMinValue()

std::vector<MathLib::bigint> getMinValue ( const ValuePtr< InferModel > &  model,
const std::list< ValueFlow::Value > &  values 
)

Definition at line 377 of file infer.cpp.

Referenced by extractForLoopValues().

◆ infer() [1/3]

std::vector<ValueFlow::Value> infer ( const ValuePtr< InferModel > &  model,
const std::string &  op,
MathLib::bigint  lhs,
std::list< ValueFlow::Value rhsValues 
)

Definition at line 361 of file infer.cpp.

References infer().

◆ infer() [2/3]

std::vector<ValueFlow::Value> infer ( const ValuePtr< InferModel > &  model,
const std::string &  op,
std::list< ValueFlow::Value lhsValues,
MathLib::bigint  rhs 
)

Definition at line 369 of file infer.cpp.

References infer().

◆ infer() [3/3]

std::vector<ValueFlow::Value> infer ( const ValuePtr< InferModel > &  model,
const std::string &  op,
std::list< ValueFlow::Value lhsValues,
std::list< ValueFlow::Value rhsValues 
)

◆ inferNotEqual()

static bool inferNotEqual ( const std::list< ValueFlow::Value > &  values,
MathLib::bigint  x 
)
static

Definition at line 279 of file infer.cpp.

Referenced by infer().

◆ setValueKind()

static void setValueKind ( ValueFlow::Value value,
const std::vector< const ValueFlow::Value * > &  refs 
)
static