Cppcheck
Classes | Functions
templatesimplifier.cpp File Reference
#include "templatesimplifier.h"
#include "errorlogger.h"
#include "errortypes.h"
#include "mathlib.h"
#include "settings.h"
#include "standards.h"
#include "token.h"
#include "tokenize.h"
#include "tokenlist.h"
#include "utils.h"
#include <algorithm>
#include <cassert>
#include <iostream>
#include <map>
#include <memory>
#include <stack>
#include <type_traits>
#include <utility>

Go to the source code of this file.

Classes

struct  newInstantiation
 

Functions

static TokenskipRequires (Token *tok)
 
template<class T , REQUIRES("T must be a Token class", std::is_convertible< T *, const Token * >) >
static T * findTemplateDeclarationEndImpl (T *tok)
 
static void invalidateForwardDecls (const Token *beg, const Token *end, std::map< Token *, Token * > *forwardDecls)
 
static const TokengetFunctionToken (const Token *nameToken)
 
static void getFunctionArguments (const Token *nameToken, std::vector< const Token * > &args)
 
static bool isConstMethod (const Token *nameToken)
 
static bool areAllParamsTypes (const std::vector< const Token * > &params)
 
static bool isLowerThanLogicalAnd (const Token *lower)
 
static bool isLowerThanOr (const Token *lower)
 
static bool isLowerThanXor (const Token *lower)
 
static bool isLowerThanAnd (const Token *lower)
 
static bool isLowerThanShift (const Token *lower)
 
static bool isLowerThanPlusMinus (const Token *lower)
 
static bool isLowerThanMulDiv (const Token *lower)
 
static bool isLowerEqualThanMulDiv (const Token *lower)
 
static TokenskipTernaryOp (Token *tok, const Token *backToken)
 
static void invalidateInst (const Token *beg, const Token *end, std::vector< newInstantiation > *newInst)
 
static bool validTokenStart (bool bounded, const Token *tok, const Token *frontToken, int offset)
 
static bool validTokenEnd (bool bounded, const Token *tok, const Token *backToken, int offset)
 
static bool matchTemplateParameters (const Token *nameTok, const std::list< std::string > &strings)
 
static bool specMatch (const TemplateSimplifier::TokenAndName &spec, const TemplateSimplifier::TokenAndName &decl)
 

Function Documentation

◆ areAllParamsTypes()

static bool areAllParamsTypes ( const std::vector< const Token * > &  params)
static

◆ findTemplateDeclarationEndImpl()

template<class T , REQUIRES("T must be a Token class", std::is_convertible< T *, const Token * >) >
static T* findTemplateDeclarationEndImpl ( T *  tok)
static

◆ getFunctionArguments()

static void getFunctionArguments ( const Token nameToken,
std::vector< const Token * > &  args 
)
static

◆ getFunctionToken()

static const Token* getFunctionToken ( const Token nameToken)
static

◆ invalidateForwardDecls()

static void invalidateForwardDecls ( const Token beg,
const Token end,
std::map< Token *, Token * > *  forwardDecls 
)
static

Definition at line 627 of file templatesimplifier.cpp.

References Token::next().

Referenced by TemplateSimplifier::removeTemplate().

◆ invalidateInst()

static void invalidateInst ( const Token beg,
const Token end,
std::vector< newInstantiation > *  newInst 
)
static

Definition at line 2446 of file templatesimplifier.cpp.

References Token::next().

Referenced by TemplateSimplifier::simplifyTemplateArgs().

◆ isConstMethod()

static bool isConstMethod ( const Token nameToken)
static

◆ isLowerEqualThanMulDiv()

static bool isLowerEqualThanMulDiv ( const Token lower)
static

◆ isLowerThanAnd()

static bool isLowerThanAnd ( const Token lower)
static

◆ isLowerThanLogicalAnd()

static bool isLowerThanLogicalAnd ( const Token lower)
static

◆ isLowerThanMulDiv()

static bool isLowerThanMulDiv ( const Token lower)
static

◆ isLowerThanOr()

static bool isLowerThanOr ( const Token lower)
static

◆ isLowerThanPlusMinus()

static bool isLowerThanPlusMinus ( const Token lower)
static

◆ isLowerThanShift()

static bool isLowerThanShift ( const Token lower)
static

◆ isLowerThanXor()

static bool isLowerThanXor ( const Token lower)
static

◆ matchTemplateParameters()

static bool matchTemplateParameters ( const Token nameTok,
const std::list< std::string > &  strings 
)
static

◆ skipRequires()

static Token* skipRequires ( Token tok)
static

◆ skipTernaryOp()

static Token* skipTernaryOp ( Token tok,
const Token backToken 
)
static

◆ specMatch()

static bool specMatch ( const TemplateSimplifier::TokenAndName spec,
const TemplateSimplifier::TokenAndName decl 
)
static

◆ validTokenEnd()

static bool validTokenEnd ( bool  bounded,
const Token tok,
const Token backToken,
int  offset 
)
static

Definition at line 2633 of file templatesimplifier.cpp.

References Token::next().

Referenced by TemplateSimplifier::simplifyCalculations().

◆ validTokenStart()

static bool validTokenStart ( bool  bounded,
const Token tok,
const Token frontToken,
int  offset 
)
static

Definition at line 2615 of file templatesimplifier.cpp.

References Token::previous().

Referenced by TemplateSimplifier::simplifyCalculations().