Cppcheck
|
#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 Token * | skipRequires (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 Token * | getFunctionToken (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 * > ¶ms) |
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 Token * | skipTernaryOp (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) |
|
static |
Definition at line 767 of file templatesimplifier.cpp.
Referenced by TemplateSimplifier::getTemplateInstantiations().
|
static |
Definition at line 559 of file templatesimplifier.cpp.
References Token::Match(), and Token::simpleMatch().
Referenced by TemplateSimplifier::findTemplateDeclarationEnd().
|
static |
Definition at line 741 of file templatesimplifier.cpp.
References getFunctionToken(), Token::next(), Token::nextArgumentBeforeCreateLinks2(), and Token::str().
Referenced by TemplateSimplifier::getTemplateInstantiations(), TemplateSimplifier::simplifyTemplateInstantiations(), TemplateSimplifier::simplifyTemplates(), and specMatch().
Definition at line 727 of file templatesimplifier.cpp.
References Token::findClosingBracket(), Token::Match(), Token::next(), and Token::simpleMatch().
Referenced by getFunctionArguments(), and isConstMethod().
|
static |
Definition at line 627 of file templatesimplifier.cpp.
References Token::next().
Referenced by TemplateSimplifier::removeTemplate().
|
static |
Definition at line 2446 of file templatesimplifier.cpp.
References Token::next().
Referenced by TemplateSimplifier::simplifyTemplateArgs().
|
static |
Definition at line 758 of file templatesimplifier.cpp.
References getFunctionToken(), Token::link(), and Token::simpleMatch().
Referenced by TemplateSimplifier::simplifyTemplates().
|
static |
Definition at line 2323 of file templatesimplifier.cpp.
References isLowerThanMulDiv(), and Token::Match().
Referenced by TemplateSimplifier::simplifyNumericCalculations().
|
static |
Definition at line 2307 of file templatesimplifier.cpp.
References isLowerThanXor(), and Token::str().
Referenced by isLowerThanShift(), and TemplateSimplifier::simplifyNumericCalculations().
|
static |
Definition at line 2295 of file templatesimplifier.cpp.
References Token::isAssignmentOp(), and Token::Match().
Referenced by isLowerThanOr(), TemplateSimplifier::simplifyCalculations(), and TemplateSimplifier::simplifyNumericCalculations().
|
static |
Definition at line 2319 of file templatesimplifier.cpp.
References isLowerThanPlusMinus(), and Token::Match().
Referenced by isLowerEqualThanMulDiv(), TemplateSimplifier::simplifyCalculations(), and TemplateSimplifier::simplifyNumericCalculations().
|
static |
Definition at line 2299 of file templatesimplifier.cpp.
References isLowerThanLogicalAnd(), and Token::str().
Referenced by isLowerThanXor(), and TemplateSimplifier::simplifyNumericCalculations().
|
static |
Definition at line 2315 of file templatesimplifier.cpp.
References isLowerThanShift(), and Token::Match().
Referenced by isLowerThanMulDiv(), and TemplateSimplifier::simplifyNumericCalculations().
|
static |
Definition at line 2311 of file templatesimplifier.cpp.
References isLowerThanAnd(), and Token::str().
Referenced by isLowerThanPlusMinus(), and TemplateSimplifier::simplifyNumericCalculations().
|
static |
Definition at line 2303 of file templatesimplifier.cpp.
References isLowerThanOr(), and Token::str().
Referenced by isLowerThanAnd(), TemplateSimplifier::simplifyCalculations(), and TemplateSimplifier::simplifyNumericCalculations().
|
static |
Definition at line 3307 of file templatesimplifier.cpp.
References Token::findClosingBracket(), Token::isLong(), Token::isSigned(), Token::isUnsigned(), Token::next(), Token::str(), and Token::tokAt().
Referenced by TemplateSimplifier::replaceTemplateUsage().
Definition at line 40 of file templatesimplifier.cpp.
References Token::findClosingBracket(), Token::link(), Token::linkAt(), Token::Match(), Token::next(), Token::simpleMatch(), Token::str(), and Token::tokAt().
Referenced by TemplateSimplifier::simplifyTemplates().
Definition at line 2423 of file templatesimplifier.cpp.
References Token::link(), Token::Match(), Token::next(), and Token::str().
Referenced by TemplateSimplifier::simplifyTemplateArgs().
|
static |
Definition at line 3413 of file templatesimplifier.cpp.
References TemplateSimplifier::TokenAndName::fullName(), getFunctionArguments(), TemplateSimplifier::TokenAndName::isAlias(), TemplateSimplifier::TokenAndName::isFriend(), TemplateSimplifier::TokenAndName::isFunction(), TemplateSimplifier::TokenAndName::isPartialSpecialization(), TemplateSimplifier::TokenAndName::isSameFamily(), TemplateSimplifier::TokenAndName::isSpecialization(), and TemplateSimplifier::TokenAndName::nameToken().
|
static |
Definition at line 2633 of file templatesimplifier.cpp.
References Token::next().
Referenced by TemplateSimplifier::simplifyCalculations().
|
static |
Definition at line 2615 of file templatesimplifier.cpp.
References Token::previous().
Referenced by TemplateSimplifier::simplifyCalculations().