Cppcheck
Functions
findtoken.h File Reference
#include <functional>
#include <stack>
#include <string>
#include <type_traits>
#include <vector>
#include "config.h"
#include "errortypes.h"
#include "library.h"
#include "smallvector.h"
#include "symboldatabase.h"
#include "token.h"

Go to the source code of this file.

Functions

std::vector< MathLib::bigintevaluateKnownValues (const Token *tok)
 
template<class T , class Predicate , class Found , REQUIRES("T must be a Token class", std::is_convertible< T *, const Token * >) >
void findTokensImpl (T *start, const Token *end, const Predicate &pred, Found found)
 
template<class T , class Predicate , REQUIRES("T must be a Token class", std::is_convertible< T *, const Token * >) >
std::vector< T * > findTokens (T *start, const Token *end, const Predicate &pred)
 
template<class T , class Predicate , REQUIRES("T must be a Token class", std::is_convertible< T *, const Token * >) >
T * findToken (T *start, const Token *end, const Predicate &pred)
 
template<class T , class Predicate , class Found , class Evaluate , REQUIRES("T must be a Token class", std::is_convertible< T *, const Token * >) >
bool findTokensSkipDeadCodeImpl (const Library &library, T *start, const Token *end, const Predicate &pred, Found found, const Evaluate &evaluate)
 
template<class T , class Predicate , class Evaluate , REQUIRES("T must be a Token class", std::is_convertible< T *, const Token * >) >
std::vector< T * > findTokensSkipDeadCode (const Library &library, T *start, const Token *end, const Predicate &pred, const Evaluate &evaluate)
 
template<class T , class Predicate , REQUIRES("T must be a Token class", std::is_convertible< T *, const Token * >) >
std::vector< T * > findTokensSkipDeadCode (const Library &library, T *start, const Token *end, const Predicate &pred)
 
template<class T , class Predicate , class Evaluate , REQUIRES("T must be a Token class", std::is_convertible< T *, const Token * >) >
T * findTokenSkipDeadCode (const Library &library, T *start, const Token *end, const Predicate &pred, const Evaluate &evaluate)
 
template<class T , class Predicate , REQUIRES("T must be a Token class", std::is_convertible< T *, const Token * >) >
T * findTokenSkipDeadCode (const Library &library, T *start, const Token *end, const Predicate &pred)
 

Function Documentation

◆ evaluateKnownValues()

std::vector<MathLib::bigint> evaluateKnownValues ( const Token tok)
inline

◆ findToken()

template<class T , class Predicate , REQUIRES("T must be a Token class", std::is_convertible< T *, const Token * >) >
T* findToken ( T *  start,
const Token end,
const Predicate &  pred 
)

Definition at line 67 of file findtoken.h.

References findTokensImpl().

◆ findTokens()

template<class T , class Predicate , REQUIRES("T must be a Token class", std::is_convertible< T *, const Token * >) >
std::vector<T*> findTokens ( T *  start,
const Token end,
const Predicate &  pred 
)

Definition at line 56 of file findtoken.h.

References findTokensImpl().

◆ findTokensImpl()

template<class T , class Predicate , class Found , REQUIRES("T must be a Token class", std::is_convertible< T *, const Token * >) >
void findTokensImpl ( T *  start,
const Token end,
const Predicate &  pred,
Found  found 
)

Definition at line 45 of file findtoken.h.

References precedes().

Referenced by findToken(), and findTokens().

◆ findTokenSkipDeadCode() [1/2]

template<class T , class Predicate , REQUIRES("T must be a Token class", std::is_convertible< T *, const Token * >) >
T* findTokenSkipDeadCode ( const Library library,
T *  start,
const Token end,
const Predicate &  pred 
)

Definition at line 216 of file findtoken.h.

References evaluateKnownValues(), and findTokenSkipDeadCode().

◆ findTokenSkipDeadCode() [2/2]

template<class T , class Predicate , class Evaluate , REQUIRES("T must be a Token class", std::is_convertible< T *, const Token * >) >
T* findTokenSkipDeadCode ( const Library library,
T *  start,
const Token end,
const Predicate &  pred,
const Evaluate &  evaluate 
)

Definition at line 199 of file findtoken.h.

References evaluate(), and findTokensSkipDeadCodeImpl().

Referenced by findTokenSkipDeadCode().

◆ findTokensSkipDeadCode() [1/2]

template<class T , class Predicate , REQUIRES("T must be a Token class", std::is_convertible< T *, const Token * >) >
std::vector<T*> findTokensSkipDeadCode ( const Library library,
T *  start,
const Token end,
const Predicate &  pred 
)

Definition at line 193 of file findtoken.h.

References evaluateKnownValues(), and findTokensSkipDeadCode().

◆ findTokensSkipDeadCode() [2/2]

template<class T , class Predicate , class Evaluate , REQUIRES("T must be a Token class", std::is_convertible< T *, const Token * >) >
std::vector<T*> findTokensSkipDeadCode ( const Library library,
T *  start,
const Token end,
const Predicate &  pred,
const Evaluate &  evaluate 
)

Definition at line 172 of file findtoken.h.

References evaluate(), and findTokensSkipDeadCodeImpl().

Referenced by findAllUsages(), and findTokensSkipDeadCode().

◆ findTokensSkipDeadCodeImpl()

template<class T , class Predicate , class Found , class Evaluate , REQUIRES("T must be a Token class", std::is_convertible< T *, const Token * >) >
bool findTokensSkipDeadCodeImpl ( const Library library,
T *  start,
const Token end,
const Predicate &  pred,
Found  found,
const Evaluate &  evaluate 
)