Cppcheck
|
The token list that the TokenList generates is a linked-list of this class. More...
#include <token.h>
Classes | |
struct | stringifyOptions |
Public Types | |
enum | Type { eVariable , eType , eFunction , eKeyword , eName , eNumber , eString , eChar , eBoolean , eLiteral , eEnumerator , eArithmeticalOp , eComparisonOp , eAssignmentOp , eLogicalOp , eBitOp , eIncDecOp , eExtendedOp , eBracket , eLambda , eEllipsis , eOther , eNone } |
Public Member Functions | |
Token (const Token &)=delete | |
Token & | operator= (const Token &)=delete |
Token (TokensFrontBack &tokensFrontBack) | |
Token (const Token *tok) | |
~Token () | |
ConstTokenRange | until (const Token *t) const |
template<typename T > | |
void | str (T &&s) |
void | concatStr (std::string const &b) |
Concatenate two (quoted) strings. More... | |
const std::string & | str () const |
void | deleteNext (nonneg int count=1) |
Unlink and delete the next 'count' tokens. More... | |
void | deletePrevious (nonneg int count=1) |
Unlink and delete the previous 'count' tokens. More... | |
void | swapWithNext () |
Swap the contents of this token with the next token. More... | |
const Token * | tokAt (int index) const |
Token * | tokAt (int index) |
const Token * | linkAt (int index) const |
Token * | linkAt (int index) |
const std::string & | strAt (int index) const |
const ValueType * | valueType () const |
void | setValueType (ValueType *vt) |
const ValueType * | argumentType () const |
Token::Type | tokType () const |
void | tokType (Token::Type t) |
bool | isKeyword () const |
bool | isName () const |
bool | isNameOnly () const |
bool | isUpperCaseName () const |
bool | isLiteral () const |
bool | isNumber () const |
bool | isEnumerator () const |
bool | isVariable () const |
bool | isOp () const |
bool | isConstOp () const |
bool | isExtendedOp () const |
bool | isArithmeticalOp () const |
bool | isComparisonOp () const |
bool | isAssignmentOp () const |
bool | isBoolean () const |
bool | isIncDecOp () const |
bool | isBinaryOp () const |
bool | isUnaryOp (const std::string &s) const |
bool | isUnaryPreOp () const |
uint64_t | flags () const |
void | flags (const uint64_t flags_) |
bool | isUnsigned () const |
void | isUnsigned (const bool sign) |
bool | isSigned () const |
void | isSigned (const bool sign) |
bool | isPointerCompare () const |
void | isPointerCompare (const bool b) |
bool | isLong () const |
void | isLong (bool size) |
bool | isStandardType () const |
void | isStandardType (const bool b) |
bool | isExpandedMacro () const |
bool | isCast () const |
void | isCast (bool c) |
bool | isAttributeConstructor () const |
void | isAttributeConstructor (const bool ac) |
bool | isAttributeDestructor () const |
void | isAttributeDestructor (const bool value) |
bool | isAttributeUnused () const |
void | isAttributeUnused (bool unused) |
bool | isAttributeUsed () const |
void | isAttributeUsed (const bool unused) |
bool | isAttributePure () const |
void | isAttributePure (const bool value) |
bool | isAttributeConst () const |
void | isAttributeConst (bool value) |
bool | isAttributeNoreturn () const |
void | isAttributeNoreturn (const bool value) |
bool | isAttributeNothrow () const |
void | isAttributeNothrow (const bool value) |
bool | isAttributeExport () const |
void | isAttributeExport (const bool value) |
bool | isAttributePacked () const |
void | isAttributePacked (const bool value) |
bool | isAttributeNodiscard () const |
void | isAttributeNodiscard (const bool value) |
bool | isAttributeMaybeUnused () const |
void | isAttributeMaybeUnused (const bool value) |
void | setCppcheckAttribute (TokenImpl::CppcheckAttributes::Type type, MathLib::bigint value) |
bool | getCppcheckAttribute (TokenImpl::CppcheckAttributes::Type type, MathLib::bigint &value) const |
bool | hasCppcheckAttributes () const |
bool | isControlFlowKeyword () const |
bool | isOperatorKeyword () const |
void | isOperatorKeyword (const bool value) |
bool | isComplex () const |
void | isComplex (const bool value) |
bool | isEnumType () const |
void | isEnumType (const bool value) |
bool | isAtAddress () const |
void | isAtAddress (bool b) |
bool | isIncompleteVar () const |
void | isIncompleteVar (bool b) |
bool | isSimplifiedTypedef () const |
void | isSimplifiedTypedef (bool b) |
bool | isIncompleteConstant () const |
void | isIncompleteConstant (bool b) |
bool | isConstexpr () const |
void | isConstexpr (bool b) |
bool | isExternC () const |
void | isExternC (bool b) |
bool | isSplittedVarDeclComma () const |
void | isSplittedVarDeclComma (bool b) |
bool | isSplittedVarDeclEq () const |
void | isSplittedVarDeclEq (bool b) |
bool | isImplicitInt () const |
void | isImplicitInt (bool b) |
bool | isInline () const |
void | isInline (bool b) |
bool | isAtomic () const |
void | isAtomic (bool b) |
bool | isRestrict () const |
void | isRestrict (bool b) |
bool | isRemovedVoidParameter () const |
void | setRemovedVoidParameter (bool b) |
bool | isTemplate () const |
void | isTemplate (bool b) |
bool | isSimplifiedScope () const |
void | isSimplifiedScope (bool b) |
bool | isFinalType () const |
void | isFinalType (bool b) |
bool | isInitComma () const |
void | isInitComma (bool b) |
bool | isBitfield () const |
unsigned char | bits () const |
const std::set< TemplateSimplifier::TokenAndName * > * | templateSimplifierPointers () const |
std::set< TemplateSimplifier::TokenAndName * > * | templateSimplifierPointers () |
void | templateSimplifierPointer (TemplateSimplifier::TokenAndName *tokenAndName) |
void | setBits (const unsigned char b) |
bool | isUtf8 () const |
bool | isUtf16 () const |
bool | isUtf32 () const |
bool | isCChar () const |
bool | isCMultiChar () const |
bool | isTemplateArg () const |
Is current token a template argument? More... | |
void | isTemplateArg (const bool value) |
std::string | getMacroName () const |
void | setMacroName (std::string name) |
nonneg int | fileIndex () const |
void | fileIndex (nonneg int indexOfFile) |
nonneg int | linenr () const |
void | linenr (nonneg int lineNumber) |
nonneg int | column () const |
void | column (nonneg int c) |
Token * | next () |
const Token * | next () const |
Token * | insertToken (const std::string &tokenStr, const std::string &originalNameStr=emptyString, const std::string ¯oNameStr=emptyString, bool prepend=false) |
Insert new token after this token. More... | |
Token * | insertTokenBefore (const std::string &tokenStr, const std::string &originalNameStr=emptyString, const std::string ¯oNameStr=emptyString) |
Token * | previous () |
const Token * | previous () const |
nonneg int | varId () const |
void | varId (nonneg int id) |
nonneg int | exprId () const |
void | exprId (nonneg int id) |
void | setUniqueExprId () |
bool | isUniqueExprId () const |
void | printOut (const char *title=nullptr) const |
For debugging purposes, prints token and all tokens followed by it. More... | |
void | printOut (const char *title, const std::vector< std::string > &fileNames) const |
For debugging purposes, prints token and all tokens followed by it. More... | |
void | printLines (int lines=5) const |
print out tokens - used for debugging More... | |
std::string | stringify (const stringifyOptions &options) const |
std::string | stringify (bool varid, bool attributes, bool macro) const |
Stringify a token. More... | |
std::string | stringifyList (const stringifyOptions &options, const std::vector< std::string > *fileNames=nullptr, const Token *end=nullptr) const |
std::string | stringifyList (const Token *end, bool attributes=true) const |
std::string | stringifyList (bool varid=false) const |
std::string | stringifyList (bool varid, bool attributes, bool linenumbers, bool linebreaks, bool files, const std::vector< std::string > *fileNames=nullptr, const Token *end=nullptr) const |
Stringify a list of token, from current instance on. More... | |
void | deleteThis () |
Remove the contents for this token from the token list. More... | |
void | link (Token *linkToToken) |
Create link to given token. More... | |
const Token * | link () const |
Return token where this token links to. More... | |
Token * | link () |
void | scope (const Scope *s) |
Associate this token with given scope. More... | |
const Scope * | scope () const |
void | function (const Function *f) |
Associate this token with given function. More... | |
const Function * | function () const |
void | variable (const Variable *v) |
Associate this token with given variable. More... | |
const Variable * | variable () const |
void | type (const ::Type *t) |
Associate this token with given type. More... | |
const ::Type * | type () const |
const Enumerator * | enumerator () const |
void | enumerator (const Enumerator *e) |
Associate this token with given enumerator. More... | |
std::string | strValue () const |
This can be called only for tokens that are strings, else the assert() is called. More... | |
nonneg int | progressValue () const |
Get progressValue (0 - 100) More... | |
const Token * | nextArgument () const |
Token * | nextArgument () |
const Token * | nextArgumentBeforeCreateLinks2 () const |
const Token * | nextTemplateArgument () const |
const Token * | findClosingBracket () const |
Returns the closing bracket of opening '<'. More... | |
Token * | findClosingBracket () |
const Token * | findOpeningBracket () const |
Token * | findOpeningBracket () |
const std::string & | originalName () const |
const std::list< ValueFlow::Value > & | values () const |
template<typename T > | |
void | originalName (T &&name) |
Sets the original name. More... | |
bool | hasKnownIntValue () const |
bool | hasKnownValue () const |
bool | hasKnownValue (ValueFlow::Value::ValueType t) const |
bool | hasKnownSymbolicValue (const Token *tok) const |
const ValueFlow::Value * | getKnownValue (ValueFlow::Value::ValueType t) const |
MathLib::bigint | getKnownIntValue () const |
const ValueFlow::Value * | getValue (const MathLib::bigint val) const |
const ValueFlow::Value * | getMaxValue (bool condition, MathLib::bigint path=0) const |
const ValueFlow::Value * | getMinValue (bool condition, MathLib::bigint path=0) const |
const ValueFlow::Value * | getMovedValue () const |
const ValueFlow::Value * | getValueLE (const MathLib::bigint val, const Settings &settings) const |
const ValueFlow::Value * | getValueGE (const MathLib::bigint val, const Settings &settings) const |
const ValueFlow::Value * | getInvalidValue (const Token *ftok, nonneg int argnr, const Settings &settings) const |
const ValueFlow::Value * | getContainerSizeValue (const MathLib::bigint val) const |
const Token * | getValueTokenMaxStrLength () const |
const Token * | getValueTokenMinStrSize (const Settings &settings, MathLib::bigint *path=nullptr) const |
bool | addValue (const ValueFlow::Value &value) |
Add token value. More... | |
void | removeValues (std::function< bool(const ValueFlow::Value &)> pred) |
nonneg int | index () const |
void | assignIndexes () |
void | astOperand1 (Token *tok) |
void | astOperand2 (Token *tok) |
void | astParent (Token *tok) |
Token * | astOperand1 () |
const Token * | astOperand1 () const |
Token * | astOperand2 () |
const Token * | astOperand2 () const |
Token * | astParent () |
const Token * | astParent () const |
Token * | astSibling () |
const Token * | astSibling () const |
Token * | astTop () |
const Token * | astTop () const |
std::pair< const Token *, const Token * > | findExpressionStartEndTokens () const |
bool | isCalculation () const |
Is current token a calculation? Only true for operands. More... | |
void | clearValueFlow () |
std::string | astString (const char *sep="") const |
std::string | astStringVerbose () const |
std::string | astStringZ3 () const |
std::string | expressionString () const |
void | printAst (bool verbose, bool xml, const std::vector< std::string > &fileNames, std::ostream &out) const |
void | printValueFlow (bool xml, std::ostream &out) const |
void | scopeInfo (std::shared_ptr< ScopeInfo2 > newScopeInfo) |
std::shared_ptr< ScopeInfo2 > | scopeInfo () const |
void | setCpp11init (bool cpp11init) const |
TokenImpl::Cpp11init | isCpp11init () const |
TokenDebug | getTokenDebug () const |
void | setTokenDebug (TokenDebug td) |
bool | isCpp () const |
bool | isC () const |
Static Public Member Functions | |
template<size_t count> | |
static bool | simpleMatch (const Token *tok, const char(&pattern)[count]) |
Match given token (or list of tokens) to a pattern list. More... | |
static bool | simpleMatch (const Token *tok, const char pattern[], size_t pattern_len) |
static bool | Match (const Token *tok, const char pattern[], nonneg int varid=0) |
Match given token (or list of tokens) to a pattern list. More... | |
static nonneg int | getStrLength (const Token *tok) |
static nonneg int | getStrArraySize (const Token *tok) |
static nonneg int | getStrSize (const Token *tok, const Settings &settings) |
template<size_t count> | |
static const Token * | findsimplematch (const Token *const startTok, const char(&pattern)[count]) |
static const Token * | findsimplematch (const Token *const startTok, const char pattern[], size_t pattern_len) |
template<size_t count> | |
static const Token * | findsimplematch (const Token *const startTok, const char(&pattern)[count], const Token *const end) |
static const Token * | findsimplematch (const Token *const startTok, const char pattern[], size_t pattern_len, const Token *const end) |
static const Token * | findmatch (const Token *const startTok, const char pattern[], const nonneg int varId=0) |
static const Token * | findmatch (const Token *const startTok, const char pattern[], const Token *const end, const nonneg int varId=0) |
template<size_t count> | |
static Token * | findsimplematch (Token *const startTok, const char(&pattern)[count]) |
static Token * | findsimplematch (Token *const startTok, const char pattern[], size_t pattern_len) |
template<size_t count> | |
static Token * | findsimplematch (Token *const startTok, const char(&pattern)[count], const Token *const end) |
static Token * | findsimplematch (Token *const startTok, const char pattern[], size_t pattern_len, const Token *const end) |
static Token * | findmatch (Token *const startTok, const char pattern[], const nonneg int varId=0) |
static Token * | findmatch (Token *const startTok, const char pattern[], const Token *const end, const nonneg int varId=0) |
static void | eraseTokens (Token *begin, const Token *end) |
Delete tokens between begin and end. More... | |
static void | replace (Token *replaceThis, Token *start, Token *end) |
Replace token replaceThis with tokens between start and end, including start and end. More... | |
static const ::Type * | typeOf (const Token *tok, const Token **typeTok=nullptr) |
static std::pair< const Token *, const Token * > | typeDecl (const Token *tok, bool pointedToType=false) |
static std::string | typeStr (const Token *tok) |
static void | createMutualLinks (Token *begin, Token *end) |
Links two elements against each other. More... | |
static void | move (Token *srcStart, Token *srcEnd, Token *newLocation) |
Move srcStart and srcEnd tokens and all tokens between them into new a location. More... | |
static void | assignProgressValues (Token *tok) |
Calculate progress values for all tokens. More... | |
Private Types | |
enum | : uint64_t { fIsUnsigned = (1ULL << 0) , fIsSigned = (1ULL << 1) , fIsPointerCompare = (1ULL << 2) , fIsLong = (1ULL << 3) , fIsStandardType = (1ULL << 4) , fIsCast = (1ULL << 6) , fIsAttributeConstructor = (1ULL << 7) , fIsAttributeDestructor = (1ULL << 8) , fIsAttributeUnused = (1ULL << 9) , fIsAttributePure = (1ULL << 10) , fIsAttributeConst = (1ULL << 11) , fIsAttributeNoreturn = (1ULL << 12) , fIsAttributeNothrow = (1ULL << 13) , fIsAttributeUsed = (1ULL << 14) , fIsAttributePacked = (1ULL << 15) , fIsAttributeExport = (1ULL << 16) , fIsAttributeMaybeUnused = (1ULL << 17) , fIsAttributeNodiscard = (1ULL << 18) , fIsControlFlowKeyword = (1ULL << 19) , fIsOperatorKeyword = (1ULL << 20) , fIsComplex = (1ULL << 21) , fIsEnumType = (1ULL << 22) , fIsName = (1ULL << 23) , fIsLiteral = (1ULL << 24) , fIsTemplateArg = (1ULL << 25) , fAtAddress = (1ULL << 26) , fIncompleteVar = (1ULL << 27) , fConstexpr = (1ULL << 28) , fExternC = (1ULL << 29) , fIsSplitVarDeclComma = (1ULL << 30) , fIsSplitVarDeclEq = (1ULL << 31) , fIsImplicitInt = (1ULL << 32) , fIsInline = (1ULL << 33) , fIsTemplate = (1ULL << 34) , fIsSimplifedScope = (1ULL << 35) , fIsRemovedVoidParameter = (1ULL << 36) , fIsIncompleteConstant = (1ULL << 37) , fIsRestrict = (1ULL << 38) , fIsAtomic = (1ULL << 39) , fIsSimplifiedTypedef = (1ULL << 40) , fIsFinalType = (1ULL << 41) , fIsInitComma = (1ULL << 42) } |
enum | : uint64_t { efMaxSize = sizeof(nonneg int) * 8 , efIsUnique = efMaxSize - 2 } |
Private Member Functions | |
void | next (Token *nextToken) |
void | previous (Token *previousToken) |
void | takeData (Token *fromToken) |
used by deleteThis() to take data from token to delete More... | |
bool | getFlag (uint64_t flag_) const |
Get specified flag state. More... | |
void | setFlag (uint64_t flag_, bool state_) |
Set specified flag state. More... | |
void | update_property_info () |
Updates internal property cache like _isName or _isBoolean. More... | |
void | update_property_isStandardType () |
Update internal property cache about isStandardType() More... | |
void | update_property_char_string_literal () |
Update internal property cache about string and char literals. More... | |
void | astStringVerboseRecursive (std::string &ret, const nonneg int indent1=0, const nonneg int indent2=0) const |
Internal helper function to avoid excessive string allocations. More... | |
Static Private Member Functions | |
static int | multiCompare (const Token *tok, const char *haystack, nonneg int varid) |
Needle is build from multiple alternatives. More... | |
static bool | firstWordEquals (const char *str, const char *word) |
Works almost like strcmp() except returns only true or false and if str has empty space ' ' character, that character is handled as if it were '\0'. More... | |
static const char * | chrInFirstWord (const char *str, char c) |
Works almost like strchr() except if str has empty space ' ' character, that character is handled as if it were '\0'. More... | |
Private Attributes | |
TokensFrontBack & | mTokensFrontBack |
std::string | mStr |
Token * | mNext {} |
Token * | mPrevious {} |
Token * | mLink {} |
Token::Type | mTokType = eNone |
uint64_t | mFlags {} |
TokenImpl * | mImpl {} |
Friends | |
class | TestToken |
The token list that the TokenList generates is a linked-list of this class.
Tokens are stored as strings. The "if", "while", etc are stored in plain text. The reason the Token class is needed (instead of using the string class) is that some extra functionality is also needed for tokens:
The Token class also has other functions for management of token list, matching tokens, etc.
|
private |
|
private |
enum Token::Type |
|
delete |
Referenced by insertToken().
|
explicit |
|
explicit |
Definition at line 66 of file token.cpp.
References fileIndex(), and linenr().
bool Token::addValue | ( | const ValueFlow::Value & | value | ) |
Add token value.
Return true if value is added.
Definition at line 2228 of file token.cpp.
References ValueFlow::Value::isImpossible(), ValueFlow::Value::isInconclusive(), ValueFlow::Value::isIntValue(), ValueFlow::Value::isKnown(), ValueFlow::Value::isLifetimeValue(), ValueFlow::Value::isTokValue(), mImpl, TokenImpl::mValues, TokenImpl::mVarId, removeContradictions(), sameValueType(), str(), ValueFlow::Value::tokvalue, ValueFlow::Value::valueType, and ValueFlow::Value::varId.
Referenced by Tokenizer::arraySizeAfterValueFlow(), and setTokenValue().
|
inline |
Definition at line 336 of file token.h.
References astParent(), Match(), mImpl, and TokenImpl::mValueType.
Referenced by CheckIO::ArgumentInfo::ArgumentInfo().
void Token::assignIndexes | ( | ) |
Definition at line 2317 of file token.cpp.
References index(), mImpl, TokenImpl::mIndex, mPrevious, and next().
Referenced by clangimport::parseClangAstDump(), and Tokenizer::simplifyTokenList1().
|
static |
Calculate progress values for all tokens.
Definition at line 2307 of file token.cpp.
References next().
Referenced by TokenList::createTokens(), and Tokenizer::simplifyTokenList1().
|
inline |
Definition at line 1378 of file token.h.
Referenced by astStringZ3(), and isUnaryPreOp().
void Token::astOperand1 | ( | Token * | tok | ) |
Definition at line 1456 of file token.cpp.
References astParent(), astTop(), TokenImpl::mAstOperand1, and mImpl.
Referenced by ConditionHandler::afterCondition(), CheckCondition::alwaysTrueFalse(), ValueFlowAnalyzer::analyzeCondition(), ValueFlowAnalyzer::analyzeLifetime(), ValueFlowAnalyzer::analyzeToken(), CheckNullPointer::arithmetic(), CheckBufferOverrun::arrayIndex(), arrayIndexMessage(), CheckBufferOverrun::arrayIndexThenCheck(), Tokenizer::arraySizeAfterValueFlow(), CheckAutoVariables::assignFunctionArg(), astCount(), astHasExpr(), astHasVar(), astIsLHS(), astIsRHS(), astIsVariableComparison(), astParent(), astStringXml(), bifurcate(), CheckBufferOverrun::bufferOverflow(), CheckCondition::checkBadBitmaskCheck(), CheckOther::checkComparePointers(), CheckCondition::checkCompareValueOutOfTypeRange(), CheckBool::checkComparisonOfBoolExpressionWithInt(), CheckBool::checkComparisonOfBoolWithInt(), CheckBool::checkComparisonOfFuncReturningBool(), CheckClass::checkConstFunc(), CheckOther::checkConstPointer(), CheckOther::checkConstVariable(), CheckOther::checkDuplicateBranch(), CheckCondition::checkDuplicateConditionalAssign(), CheckOther::checkDuplicateExpression(), CheckOther::checkEvaluationOrder(), CheckUninitVar::checkExpr(), CheckStl::checkFindInsert(), CheckUnusedVar::checkFunctionVariableUsage(), CheckUnusedVar::checkFunctionVariableUsage_iterateScopes(), CheckCondition::checkIncorrectLogicOperator(), CheckCondition::checkInvalidTestForOverflow(), CheckType::checkLongCast(), CheckFunctions::checkMathFunctions(), CheckClass::checkMemset(), CheckOther::checkMisusedScopedObject(), CheckCondition::checkModuloAlwaysTrueFalse(), CheckOther::checkOverlappingWrite(), CheckCondition::checkPointerAdditionResultNotNull(), CheckMemoryLeakInFunction::checkReallocUsage(), FwdAnalysis::checkRecursive(), CheckOther::checkRedundantAssignment(), CheckOther::checkRedundantCopy(), CheckOther::checkRedundantPointerOp(), CheckClass::checkReturnPtrThis(), CheckLeakAutoVar::checkScope(), CheckUninitVar::checkScopeForVariable(), CheckType::checkSignConversion(), CheckSizeof::checkSizeofForPointerSize(), CheckMemoryLeakStructMember::checkStructVariable(), CheckString::checkSuspiciousStringCompare(), CheckLeakAutoVar::checkTokenInsideExpression(), CheckAssert::checkVariableAssignment(), CheckOther::checkVariableScope(), CheckOther::clarifyCalculation(), CheckOther::clarifyStatement(), CheckCondition::comparison(), CheckOther::comparisonNonZeroExpressionLessThanZero(), conditionAlwaysTrueOrFalse(), conditionString(), CheckOther::constStatementError(), SymbolDatabase::createSymbolDatabaseExprIds(), createTokenFromExpression(), clangimport::AstNode::createTokens(), clangimport::AstNode::createTokensCall(), clangimport::AstNode::createTokensVarDecl(), derefShared(), Tokenizer::dump(), exprDependsOnThis(), extractForLoopValues(), fillProgramMemoryFromAssignments(), findAllocFuncCallToken(), findArgumentPosRecursive(), findConstructor(), SymbolDatabase::findEnumerator(), findExpressionStartEndTokens(), SymbolDatabase::findFunction(), Scope::findFunction(), findInsertValue(), followAllReferences(), PathAnalysis::forwardRecursive(), CheckLeakAutoVar::functionCall(), CheckMemoryLeak::functionReturnType(), getAddressContainer(), CheckMemoryLeak::getAllocationType(), Library::getAllocFuncInfo(), getArgumentPos(), getArgumentStart(), getAstParentSkipPossibleCastAndAddressOf(), getBufAndOffset(), getCastTypeStartToken(), Library::getContainerFromAction(), getContainerFromSize(), Library::getContainerFromYield(), getContainerSizeFromConstructorArgs(), Library::getContainerYield(), getContainerYield(), CheckMemoryLeak::getDeallocationType(), Library::getDeallocFuncInfo(), getExpressionRange(), getExprUsage(), CTU::getFileInfo(), Library::getFunctionName(), getIteratorExpression(), getLHSVariable(), getLHSVariableRecursive(), getLHSVariables(), getLHSVariablesRecursive(), getLHSVariableToken(), getLibraryContainer(), getLifetimeTokens(), getnumchildren(), getOperatorFunction(), getParentLifetimeObject(), getParentMember(), getParentVar(), CheckMemoryLeak::getReallocationType(), Library::getReallocFuncInfo(), getSingleFunctionCall(), getSingleReturnVar(), hasFunctionCall(), hasGccCompoundStatement(), hasNoreturnFunction(), FwdAnalysis::hasOperand(), hasVarIds(), if_findCompare(), ifvar(), innerSmtString(), CheckStl::invalidContainer(), CheckFunctions::invalidFunctionUsage(), CheckOther::invalidPointerCast(), isAddressOfLocalVariable(), isAutoVarArray(), isBracketAccess(), isCalculation(), isCallFunction(), isConstExpression(), isConstFunctionCall(), isConstStatement(), isConstVarExpression(), CheckStl::isContainerSize(), CheckStl::isContainerSizeGE(), Library::isContainerYield(), isCPPCast(), FwdAnalysis::isEscapedAlias(), isExpression(), isForLoopCondition(), isGlobalData(), isIfConstexpr(), isInConstructorList(), isIntegralOrPointer(), isLikelyStreamRead(), isLocalContainerBuffer(), isMapFind(), CheckUninitVar::isMemberVariableUsage(), isMoveOrForward(), SymbolicConditionHandler::isNegatedBool(), isNonConstFunctionCall(), isNullOperand(), isOperandExpanded(), isOppositeCond(), isOppositeExpression(), CheckCondition::isOverlappingCond(), CheckNullPointer::isPointerDeRef(), isSameExpression(), Library::isScopeNoReturn(), isSimpleExpr(), isTemporary(), isThisChanged(), isUniqueExpression(), isUsedAsBool(), isVarDeclOp(), isVariableChanged(), isVariableChangedByFunctionCall(), isVariableExpression(), isVariableInit(), CheckUninitVar::isVariableUsage(), isVariableUsed(), isVarUsedInTree(), isVLAIndex(), isVoidStmt(), SubExpressionAnalyzer::match(), minmaxCompare(), minUnsignedValue(), CheckStl::mismatchingContainerIterator(), CheckCondition::multiCondition2(), CheckBufferOverrun::negativeArraySize(), notvar(), CheckBufferOverrun::objectIndex(), CheckString::overlappingStrcmp(), SimpleConditionHandler::parse(), IteratorConditionHandler::parse(), SymbolicConditionHandler::parse(), ContainerConditionHandler::parse(), parseBinaryIntOp(), parseCompareEachInt(), parseComparison(), CheckBool::pointerArithBool(), CheckBool::pointerArithBoolCond(), CheckBufferOverrun::pointerArithmetic(), FwdAnalysis::possiblyAliased(), programMemoryParseCondition(), CheckLeakAutoVar::ret(), setTokenValue(), ValueFlow::setValues(), SymbolDatabase::setValueType(), SymbolDatabase::setValueTypeInTokenList(), singleAssignInScope(), singleMemberCallInScope(), skipLocalVars(), SymbolicConditionHandler::skipNot(), CheckString::sprintfOverlappingData(), CheckStl::stlOutOfBounds(), CheckStl::string_c_str(), CheckSizeof::suspiciousSizeofCalculation(), CheckOther::testIfNonZeroExpressionIsPositive(), truncateImplicitConversion(), typeDecl(), typeOf(), FwdAnalysis::unusedValue(), useFunctionArgs(), CheckFunctions::useStandardLibrary(), CheckStl::useStlAlgorithm(), valueFlowAfterAssign(), valueFlowAfterMove(), valueFlowArrayElement(), valueFlowBitAnd(), ValueFlow::valueFlowConstantFoldAST(), valueFlowContainerSize(), valueFlowDynamicBufferSize(), valueFlowForLoop2(), valueFlowForLoopSimplify(), valueFlowForwardLifetime(), valueFlowFunctionReturn(), valueFlowImpossibleValues(), valueFlowInferCondition(), valueFlowLifetime(), valueFlowLifetimeUserConstructor(), valueFlowPointerAlias(), valueFlowRightShift(), valueFlowSameExpressions(), valueFlowSetConstantValue(), valueFlowSmartPointer(), valueFlowSymbolic(), valueFlowSymbolicInfer(), valueFlowSymbolicOperators(), and valueFlowUnknownFunctionReturn().
|
inline |
Definition at line 1384 of file token.h.
Referenced by astStringZ3(), isCalculation(), and isUnaryPreOp().
void Token::astOperand2 | ( | Token * | tok | ) |
Definition at line 1468 of file token.cpp.
References astParent(), astTop(), TokenImpl::mAstOperand2, and mImpl.
Referenced by ConditionHandler::afterCondition(), ValueFlowAnalyzer::analyzeCondition(), CheckBufferOverrun::argumentSize(), CheckNullPointer::arithmetic(), Variable::arrayDimensions(), CheckBufferOverrun::arrayIndex(), Tokenizer::arraySizeAfterValueFlow(), astCount(), astHasExpr(), astHasVar(), astIsLHS(), astIsRHS(), astIsVariableComparison(), astParent(), astSibling(), astStringXml(), bifurcate(), CheckBufferOverrun::bufferOverflow(), CheckCondition::checkBadBitmaskCheck(), CheckOther::checkCharVariable(), CheckOther::checkComparePointers(), CheckBool::checkComparisonOfBoolExpressionWithInt(), CheckBool::checkComparisonOfBoolWithInt(), CheckClass::checkConstFunc(), CheckOther::checkConstPointer(), CheckOther::checkConstVariable(), CheckIO::checkCoutCerrMisusage(), CheckOther::checkDuplicateBranch(), CheckCondition::checkDuplicateConditionalAssign(), CheckOther::checkDuplicateExpression(), CheckOther::checkEvaluationOrder(), CheckUninitVar::checkExpr(), CheckStl::checkFindInsert(), CheckUnusedVar::checkFunctionVariableUsage(), CheckUnusedVar::checkFunctionVariableUsage_iterateScopes(), CheckOther::checkIncompleteArrayFill(), CheckCondition::checkIncorrectLogicOperator(), CheckOther::checkKnownArgument(), CheckFunctions::checkMathFunctions(), CheckClass::checkMemset(), CheckOther::checkMisusedScopedObject(), CheckCondition::checkModuloAlwaysTrueFalse(), CheckOther::checkOverlappingWrite(), CheckCondition::checkPointerAdditionResultNotNull(), CheckMemoryLeakInFunction::checkReallocUsage(), FwdAnalysis::checkRecursive(), CheckOther::checkRedundantAssignment(), CheckOther::checkRedundantCopy(), CheckUninitVar::checkRhs(), CheckLeakAutoVar::checkScope(), CheckUninitVar::checkScopeForVariable(), CheckSizeof::checkSizeofForPointerSize(), CheckMemoryLeakStructMember::checkStructVariable(), CheckString::checkSuspiciousStringCompare(), CheckLeakAutoVar::checkTokenInsideExpression(), CheckOther::checkVariableScope(), CheckCondition::comparison(), CheckOther::comparisonNonZeroExpressionLessThanZero(), conditionAlwaysTrueOrFalse(), conditionString(), CheckOther::constStatementError(), SymbolDatabase::createSymbolDatabaseExprIds(), SymbolDatabase::createSymbolDatabaseSetVariablePointers(), clangimport::AstNode::createTokens(), clangimport::AstNode::createTokensCall(), clangimport::AstNode::createTokensVarDecl(), Tokenizer::dump(), CheckCondition::duplicateCondition(), exprDependsOnThis(), extractForLoopValues(), fillProgramMemoryFromAssignments(), findAllocFuncCallToken(), findArgumentPosRecursive(), findExpressionStartEndTokens(), findInsertValue(), followAllReferences(), PathAnalysis::forwardRecursive(), CheckLeakAutoVar::functionCall(), CheckMemoryLeak::functionReturnType(), getAddressContainer(), Library::getAllocFuncInfo(), getArgumentPos(), getArgumentStart(), getAstParentSkipPossibleCastAndAddressOf(), getBufAndOffset(), getCastTypeStartToken(), Library::getContainerFromAction(), Library::getContainerFromYield(), getContainerIndex(), getContainerSizeFromConstructorArgs(), Library::getContainerYield(), CheckMemoryLeak::getDeallocationType(), Library::getDeallocFuncInfo(), getDimensionsEtc(), getEnumType(), getExpressionRange(), Library::getFunctionName(), getInitListSize(), getIteratorExpression(), getLHSVariableRecursive(), getLHSVariablesRecursive(), getLifetimeTokens(), getLoopContainer(), getnumchildren(), getOperatorFunction(), getOverrunIndexValues(), getParentMember(), Library::getReallocFuncInfo(), getVariableInitExpression(), Scope::getVariableList(), getVariableValues(), hasFunctionCall(), hasGccCompoundStatement(), hasNoreturnFunction(), FwdAnalysis::hasOperand(), hasVarIds(), CheckStl::if_find(), if_findCompare(), ifvar(), CheckOther::invalidPointerCast(), isAddressOfLocalVariable(), isArray(), isAutoVarArray(), isBasicForLoop(), isBracketAccess(), isCalculation(), isConstExpression(), isConstStatement(), isConstTop(), isConstVarExpression(), CheckStl::isContainerSizeGE(), Library::isContainerYield(), isCPPCast(), CheckBufferOverrun::isCtuUnsafeBufferUsage(), isEscapedReference(), isExpression(), isForLoopIncrement(), isInConstructorList(), isIntegralOrPointer(), isLeafDot(), isLikelyStreamRead(), isLocalContainerBuffer(), isMapFind(), isNullablePointer(), isNullOperand(), isOperandExpanded(), isOppositeCond(), CheckCondition::isOverlappingCond(), CheckNullPointer::isPointerDeRef(), isRangeForScope(), isSameExpression(), isSimpleExpr(), isStrlenOf(), isTemporary(), isType(), isUniqueExpression(), isVarDeclOp(), isVariableChangedByFunctionCall(), isVariableExpression(), isVariableInit(), isVariableUsed(), isVarUsedInTree(), isVLAIndex(), isWithoutSideEffects(), ValueFlowAnalyzer::isWritable(), ContainerExpressionAnalyzer::isWritable(), isZeroBoundCond(), CheckStl::knownEmptyContainer(), lifetimeType(), minUnsignedValue(), CheckCondition::multiCondition(), CheckCondition::multiCondition2(), CheckBufferOverrun::negativeArraySize(), CheckStl::negativeIndex(), notvar(), CheckBufferOverrun::objectIndex(), SimpleConditionHandler::parse(), IteratorConditionHandler::parse(), SymbolicConditionHandler::parse(), ContainerConditionHandler::parse(), parseBinaryIntOp(), parseCompareEachInt(), parseComparison(), CheckBool::pointerArithBool(), CheckBool::pointerArithBoolCond(), CheckBufferOverrun::pointerArithmetic(), FwdAnalysis::possiblyAliased(), programMemoryParseCondition(), CheckLeakAutoVar::ret(), CheckFunctions::returnLocalStdMove(), setTokenValue(), ExpressionAnalyzer::setupExprVarIds(), SymbolDatabase::setValueType(), SymbolDatabase::setValueTypeInTokenList(), CheckSizeof::sizeofCalculation(), CheckSizeof::sizeofFunction(), CheckString::sprintfOverlappingData(), CheckStl::stlOutOfBounds(), CheckStl::string_c_str(), CheckBufferOverrun::stringNotZeroTerminated(), CheckString::strPlusCharError(), CheckSizeof::suspiciousSizeofCalculation(), CheckOther::testIfNonZeroExpressionIsPositive(), truncateImplicitConversion(), typeDecl(), typeOf(), useFunctionArgs(), CheckFunctions::useStandardLibrary(), CheckStl::useStlAlgorithm(), valueFlowAfterAssign(), valueFlowAfterMove(), valueFlowAfterSwap(), valueFlowArrayElement(), valueFlowBitAnd(), valueFlowConditionExpressions(), ValueFlow::valueFlowConstantFoldAST(), valueFlowContainerSetTokValue(), valueFlowContainerSize(), valueFlowDynamicBufferSize(), valueFlowEnumValue(), valueFlowForLoop(), valueFlowForLoop2(), valueFlowForLoopSimplify(), valueFlowForwardLifetime(), valueFlowGlobalConstVar(), valueFlowGlobalStaticVar(), valueFlowImpossibleValues(), valueFlowInferCondition(), valueFlowLifetimeUserConstructor(), valueFlowPointerAlias(), valueFlowRightShift(), valueFlowSameExpressions(), valueFlowSetConstantValue(), valueFlowSmartPointer(), valueFlowSymbolic(), valueFlowSymbolicInfer(), valueFlowSymbolicOperators(), and ContainerExpressionAnalyzer::writeValue().
|
inline |
Definition at line 1390 of file token.h.
Referenced by astParent().
void Token::astParent | ( | Token * | tok | ) |
Definition at line 1437 of file token.cpp.
References astOperand1(), astOperand2(), astParent(), TokenImpl::mAstOperand1, TokenImpl::mAstOperand2, TokenImpl::mAstParent, and mImpl.
Referenced by ConditionHandler::afterCondition(), CheckCondition::alwaysTrueFalse(), ValueFlowAnalyzer::analyzeLifetime(), ValueFlowAnalyzer::analyzeMatch(), ValueFlowAnalyzer::analyzeToken(), CheckIO::ArgumentInfo::ArgumentInfo(), argumentType(), CheckBufferOverrun::arrayIndex(), CheckBufferOverrun::arrayIndexThenCheck(), assignExpr(), ProgramMemoryState::assume(), ValueFlowAnalyzer::assume(), astHasToken(), astIsLHS(), astIsLhs(), astIsRangeBasedForDecl(), astIsRHS(), astIsRhs(), astOperand1(), astOperand2(), astParent(), astParentSkipParens(), ConditionHandler::beforeCondition(), bifurcateVariableChanged(), CheckBufferOverrun::bufferOverflow(), CheckCondition::checkBadBitmaskCheck(), CheckOther::checkCharVariable(), CheckClass::checkConstFunc(), CheckOther::checkConstPointer(), CheckOther::checkConstVariable(), CheckIO::checkCoutCerrMisusage(), CheckStl::checkDereferenceInvalidIterator2(), CheckOther::checkDuplicateExpression(), CheckOther::checkEvaluationOrder(), CheckStl::checkFindInsertError(), CheckMemoryLeakNoVar::checkForUnreleasedInputArgument(), CheckMemoryLeakNoVar::checkForUnusedReturnValue(), CheckUnusedVar::checkFunctionVariableUsage(), CheckUnusedVar::checkFunctionVariableUsage_iterateScopes(), CheckFunctions::checkIgnoredReturnValue(), CheckStl::checkIteratorPair(), CheckFunctions::checkLibraryMatchFunctions(), CheckUninitVar::checkLoopBodyRecursive(), CheckOther::checkMisusedScopedObject(), CheckOther::checkNegativeBitwiseShift(), CheckMemoryLeakInFunction::checkReallocUsage(), FwdAnalysis::checkRecursive(), CheckExceptionSafety::checkRethrowCopy(), CheckUninitVar::checkScope(), CheckLeakAutoVar::checkScope(), CheckUninitVar::checkScopeForVariable(), CheckClass::checkSelfInitialization(), CheckMemoryLeakStructMember::checkStructVariable(), CheckLeakAutoVar::checkTokenInsideExpression(), CheckOther::checkVariableScope(), CheckAutoVariables::checkVarLifetimeScope(), CheckOther::clarifyStatement(), conditionString(), SymbolDatabase::createSymbolDatabaseExprIds(), SymbolDatabase::createSymbolDatabaseFindAllScopes(), SymbolDatabase::createSymbolDatabaseIncompleteVars(), SymbolDatabase::createSymbolDatabaseSetVariablePointers(), SymbolDatabase::debugSymbolDatabase(), CheckUninitVar::diag(), CheckCondition::diag(), Tokenizer::dump(), endOfExpression(), CheckStl::eraseCheckLoopVar(), CheckStl::eraseIteratorOutOfBounds(), findEndOfFunctionCallForParameter(), SymbolDatabase::findEnumerator(), Scope::findFunction(), findIteratorYield(), findLambdaStartToken(), findParent(), Function::findReturns(), findStartToken(), findVarBound(), followVariableExpression(), CheckLeakAutoVar::functionCall(), getAstParentSkipPossibleCastAndAddressOf(), getContainerFunction(), getContainerYield(), getExprUsage(), Library::getFunctionName(), getFunctionUsage(), CheckClass::getIfStmtBodyStart(), getIncompleteNameID(), getInvalidMethod(), getLifetimeTokens(), getOtherOperand(), getOverrunIndexValues(), getParentMember(), getParentMembers(), getParentValueTypes(), Library::getUseRetValType(), hasEmptyCaptureList(), hasOverloadedAssignment(), CheckCondition::identicalConditionAfterEarlyExitError(), CheckStl::if_find(), if_findCompare(), CheckClass::initializerListOrder(), CheckClass::initializeVarList(), SubExpressionAnalyzer::internalMatch(), CheckStl::invalidContainer(), SubExpressionAnalyzer::isAlias(), isAssignedToNonLocal(), isConditionKnown(), isConstStatement(), isConstTop(), ValueFlow::isContainerSizeChanged(), isContainerSizeChangedByFunction(), isConvertedToBool(), CheckBufferOverrun::isCtuUnsafeBufferUsage(), isDanglingSubFunction(), isDeadTemporary(), isDecayedPointer(), isForLoopCondition(), isForLoopIncrement(), Library::isFunctionConst(), ValueFlowAnalyzer::isGlobalModified(), isInConstructorList(), isIntegralOrPointer(), isLeafDot(), ValueFlow::isLifetimeBorrowed(), isLikelyStream(), isLikelyStreamRead(), isMacroUsage(), CheckUninitVar::isMemberVariableUsage(), ValueFlowAnalyzer::isModified(), ContainerExpressionAnalyzer::isModified(), isMoveOrForward(), Library::isnoreturn(), isNullOperand(), isOppositeExpression(), CheckNullPointer::isPointerDeRef(), isSameExpression(), isSimpleExpr(), isStructuredBindingVariable(), isTemporary(), isUnchanged(), isUsedAsBool(), isVariableChanged(), isVariableChangedByFunctionCall(), isVariableExprHidden(), isVariableMutableInInitializer(), CheckUninitVar::isVariableUsage(), isVariableUsed(), ValueFlowAnalyzer::isWritable(), ContainerExpressionAnalyzer::isWritable(), CheckStl::mismatchingContainerIterator(), CheckStl::missingComparison(), CheckCondition::multiCondition2(), CheckBufferOverrun::objectIndexError(), CheckStl::outOfBounds(), CheckString::overlappingStrcmpError(), SimpleConditionHandler::parse(), ContainerConditionHandler::parse(), CheckPostfixOperator::postfixOperator(), CheckLeakAutoVar::ret(), Library::returnValueType(), setTokenValue(), ExpressionAnalyzer::setupExprVarIds(), SymbolDatabase::setValueType(), SymbolDatabase::setValueTypeInTokenList(), ConditionHandler::skipNotAndCasts(), CheckSizeof::suspiciousSizeofCalculation(), ConditionHandler::traverseCondition(), typeDecl(), CheckUninitVar::uninitvarError(), ValueFlowAnalyzer::update(), CheckStl::uselessCalls(), valueFlowAfterAssign(), valueFlowAfterMove(), valueFlowArray(), valueFlowArrayBool(), valueFlowDebug(), valueFlowDynamicBufferSize(), valueFlowForLoopSimplify(), valueFlowForwardAssign(), valueFlowForwardLifetime(), valueFlowGlobalStaticVar(), valueFlowImpossibleValues(), valueFlowInferCondition(), valueFlowLifetime(), valueFlowLifetimeFunction(), valueFlowPointerAlias(), valueFlowSetConstantValue(), valueFlowSmartPointer(), valueFlowSymbolic(), CheckUninitVar::valueFlowUninit(), valueFlowUnknownFunctionReturn(), CheckMemoryLeakInClass::variable(), ContainerExpressionAnalyzer::writeValue(), and ValueFlowAnalyzer::writeValue().
|
inline |
Definition at line 1396 of file token.h.
References astOperand2().
Referenced by CheckCondition::checkCompareValueOutOfTypeRange(), CheckStl::checkDereferenceInvalidIterator2(), CheckCondition::checkInvalidTestForOverflow(), CheckOther::checkKnownArgument(), if_findCompare(), isOppositeCond(), isUsedAsBool(), isVariableExprHidden(), and ConditionHandler::skipNotAndCasts().
|
inline |
Definition at line 1406 of file token.h.
References astOperand2().
|
inline |
std::string Token::astStringVerbose | ( | ) | const |
Definition at line 1748 of file token.cpp.
References astStringVerboseRecursive().
|
private |
Internal helper function to avoid excessive string allocations.
Definition at line 1716 of file token.cpp.
Referenced by astStringVerbose().
std::string Token::astStringZ3 | ( | ) | const |
Definition at line 1755 of file token.cpp.
References astOperand1(), astOperand2(), astStringZ3(), and str().
Referenced by astStringZ3().
|
inline |
Definition at line 1416 of file token.h.
References TokenImpl::mAstParent, and mImpl.
Referenced by ConditionHandler::afterCondition(), ProgramMemoryState::assume(), astOperand1(), astOperand2(), ConditionHandler::beforeCondition(), CheckLeakAutoVar::changeAllocStatus(), CheckClass::checkConstFunc(), CheckCondition::checkDuplicateConditionalAssign(), SymbolDatabase::findEnumerator(), findInsertValue(), CheckClass::getIfStmtBodyStart(), getSingleExpressionInBlock(), innerSmtString(), isConditionKnown(), isConstTop(), isDeadTemporary(), isIfConstexpr(), isInLoopCondition(), isReturnScope(), Library::isScopeNoReturn(), skipLocalVars(), ConditionHandler::traverseCondition(), valueFlowContainerSize(), and valueFlowForLoopSimplify().
|
inline |
Definition at line 1423 of file token.h.
References TokenImpl::mAstParent, and mImpl.
|
inline |
Definition at line 689 of file token.h.
Referenced by SymbolDatabase::setValueType().
|
staticprivate |
|
inline |
Definition at line 1441 of file token.h.
Referenced by ValueFlow::setValues().
|
inline |
Definition at line 823 of file token.h.
Referenced by TemplateSimplifier::addNamespace(), TokenList::addtoken(), TokenList::createTokens(), Tokenizer::dump(), TemplateSimplifier::expandTemplate(), TokenList::insertTokens(), Tokenizer::simplifyTypedef(), and Tokenizer::simplifyTypedefCpp().
void Token::concatStr | ( | std::string const & | b | ) |
Concatenate two (quoted) strings.
Automatically cuts of the last/first character. Example: "hello ""world" -> "hello world". Used by the token simplifier.
Definition at line 212 of file token.cpp.
References getStringLiteral(), isCChar(), isStringLiteral(), mStr, and update_property_info().
Referenced by Tokenizer::combineStringAndCharLiterals().
Links two elements against each other.
Definition at line 1248 of file token.cpp.
References link().
Referenced by clangimport::AstNode::addTypeTokens(), Tokenizer::createLinks2(), clangimport::AstNode::createScope(), createTokenFromExpression(), Tokenizer::elseif(), TemplateSimplifier::expandTemplate(), TokenList::insertTokens(), linkBrackets(), Tokenizer::simplifyAddBracesPair(), Tokenizer::simplifyIfSwitchForInit(), TemplateSimplifier::simplifyTemplates(), Tokenizer::simplifyTypedefCpp(), Tokenizer::simplifyTypeIntrinsics(), Tokenizer::sizeofAddParentheses(), and TemplateSimplifier::useDefaultArgumentValues().
void Token::deleteNext | ( | nonneg int | count = 1 | ) |
Unlink and delete the next 'count' tokens.
Definition at line 245 of file token.cpp.
References TokensFrontBack::back, link(), mLink, mNext, mTokensFrontBack, next(), and previous().
Referenced by Tokenizer::arraySize(), Tokenizer::combineOperators(), Tokenizer::combineStringAndCharLiterals(), Tokenizer::concatenateNegativeNumberAndAnyPositive(), Tokenizer::deleteInvalidTypedef(), deleteThis(), TemplateSimplifier::eraseTokens(), eraseTokens(), TemplateSimplifier::getTemplateInstantiations(), Tokenizer::removeExtraTemplateKeywords(), Tokenizer::removeMacroInClassDef(), Tokenizer::removeMacrosInGlobalScope(), Tokenizer::removeRedundantSemicolons(), TemplateSimplifier::simplifyCalculations(), Tokenizer::simplifyDoublePlusAndDoubleMinus(), Tokenizer::simplifyEmptyNamespaces(), Tokenizer::simplifyExternC(), Tokenizer::simplifyFunctionParameters(), Tokenizer::simplifyFunctionPointers(), Tokenizer::simplifyIfSwitchForInit(), TemplateSimplifier::simplifyNumericCalculations(), Tokenizer::simplifyParameterVoid(), Tokenizer::simplifyPointerToStandardType(), Tokenizer::simplifyRedundantConsecutiveBraces(), Tokenizer::simplifyRedundantParentheses(), Tokenizer::simplifyRoundCurlyParentheses(), Tokenizer::simplifyStaticConst(), TemplateSimplifier::simplifyTemplateArgs(), TemplateSimplifier::simplifyTemplates(), Tokenizer::simplifyTokenList1(), Tokenizer::simplifyTypedefCpp(), and splitDefinitionFromTypedef().
void Token::deletePrevious | ( | nonneg int | count = 1 | ) |
Unlink and delete the previous 'count' tokens.
Definition at line 265 of file token.cpp.
References TokensFrontBack::front, link(), mLink, mPrevious, mTokensFrontBack, next(), and previous().
Referenced by deleteThis(), TemplateSimplifier::deleteToken(), Tokenizer::simplifyTypedefCpp(), and Tokenizer::simplifyUsing().
void Token::deleteThis | ( | ) |
Remove the contents for this token from the token list.
The contents are replaced with the contents of the next token and the next token is unlinked and deleted from the token list.
So this token will still be valid after the 'deleteThis()'.
Definition at line 329 of file token.cpp.
References deleteNext(), deletePrevious(), link(), mNext, mPrevious, str(), and takeData().
Referenced by Tokenizer::combineOperators(), Tokenizer::deleteInvalidTypedef(), TemplateSimplifier::deleteToken(), TemplateSimplifier::expandTemplate(), Tokenizer::initVar(), Tokenizer::removeMacrosInGlobalScope(), Tokenizer::removePragma(), Tokenizer::simplifyEmptyNamespaces(), Tokenizer::simplifyExternC(), Tokenizer::simplifyFunctionPointers(), Tokenizer::simplifyHeadersAndUnusedTemplates(), Tokenizer::simplifyRedundantParentheses(), Tokenizer::simplifyRoundCurlyParentheses(), TemplateSimplifier::simplifyTemplateAliases(), TemplateSimplifier::simplifyTemplates(), Tokenizer::simplifyTypedef(), Tokenizer::simplifyTypedefCpp(), Tokenizer::simplifyTypedefLHS(), Tokenizer::simplifyUsing(), splitDefinitionFromTypedef(), and TemplateSimplifier::useDefaultArgumentValues().
|
inline |
Definition at line 1111 of file token.h.
Referenced by clangimport::Data::enumDecl(), isSameConstantValue(), isSameExpression(), clangimport::Data::Decl::ref(), SymbolDatabase::setValueTypeInTokenList(), valueFlowSetConstantValue(), and SymbolDatabase::~SymbolDatabase().
|
inline |
Associate this token with given enumerator.
e | Enumerator to be associated |
Delete tokens between begin and end.
E.g. if begin = 1 and end = 5, tokens 2,3 and 4 would be erased.
begin | Tokens after this will be erased. |
end | Tokens before this will be erased. |
Definition at line 1238 of file token.cpp.
References deleteNext(), and next().
Referenced by Tokenizer::deleteInvalidTypedef(), Tokenizer::removeMacrosInGlobalScope(), Tokenizer::removePragma(), Tokenizer::simplifyFunctionPointers(), Tokenizer::simplifyHeadersAndUnusedTemplates(), Tokenizer::simplifyPointerToStandardType(), Tokenizer::simplifySQL(), TemplateSimplifier::simplifyTemplateArgs(), TemplateSimplifier::simplifyTemplates(), Tokenizer::simplifyTypedefCpp(), and Tokenizer::simplifyUsing().
std::string Token::expressionString | ( | ) | const |
Definition at line 1647 of file token.cpp.
References findExpressionStartEndTokens(), and stringFromTokenRange().
Referenced by ConditionHandler::afterCondition(), CheckCondition::alwaysTrueFalseError(), Function::argsMatch(), CheckCondition::assignmentInCondition(), ValueFlow::Value::assumeCondition(), ConditionHandler::beforeCondition(), CheckBufferOverrun::bufferOverflowError(), CheckStl::checkDereferenceInvalidIterator2(), CheckStl::checkFindInsertError(), CheckMemoryLeakNoVar::checkForUnreleasedInputArgument(), CheckUnusedVar::checkFunctionVariableUsage(), CheckOther::checkIncompleteArrayFill(), CheckCondition::checkIncorrectLogicOperator(), CheckStl::checkIteratorPair(), CheckOther::checkKnownArgument(), CheckUninitVar::checkLoopBody(), CheckOther::checkSignOfUnsignedVariable(), CheckString::checkSuspiciousStringCompare(), conditionString(), CheckOther::constStatementError(), CheckStl::dereferenceInvalidIteratorError(), CheckCondition::duplicateConditionalAssignError(), CheckOther::duplicateExpressionError(), ValueFlow::eitherTheConditionIsRedundant(), CheckStl::eraseIteratorOutOfBoundsError(), CheckAutoVariables::errorDanglngLifetime(), followAllReferences(), followVariableExpressionError(), LifetimeStore::fromFunctionArg(), Check::getErrorPath(), CTU::getFileInfo(), getIncompleteNameID(), getLifetimeTokens(), CheckCondition::identicalConditionAfterEarlyExitError(), CheckCondition::identicalInnerConditionError(), ValueFlow::Value::infoString(), CheckType::integerOverflowError(), CheckStl::invalidContainerReferenceError(), CheckCondition::invalidTestForOverflow(), CheckOther::knownArgumentError(), CheckStl::knownEmptyContainerError(), CheckOther::knownPointerToBoolError(), makeConditionValue(), CheckFunctions::memsetInvalid2ndParam(), CheckStl::mismatchingContainerExpressionError(), CheckStl::mismatchingContainerIteratorError(), CheckStl::mismatchingContainersError(), CheckBufferOverrun::negativeArraySizeError(), CheckBufferOverrun::objectIndexError(), CheckCondition::oppositeInnerConditionError(), CheckStl::outOfBounds(), CheckStl::outOfBoundsError(), CheckStl::outOfBoundsIndexExpressionError(), CheckString::overlappingStrcmpError(), CheckCondition::pointerAdditionResultNotNullError(), CheckBufferOverrun::pointerArithmeticError(), CheckType::signConversionError(), CheckString::sprintfOverlappingData(), ValueFlow::Value::toString(), CheckUninitVar::uninitvarError(), CheckOther::unknownEvaluationOrder(), ValueFlow::Value::Value(), valueFlowAfterMove(), valueFlowLifetimeFunction(), and valueFlowSubFunction().
|
inline |
Definition at line 883 of file token.h.
Referenced by astHasExpr(), ConditionHandler::beforeCondition(), CheckOther::checkInnerScope(), CheckAutoVariables::checkVarLifetimeScope(), SymbolDatabase::createSymbolDatabaseExprIds(), Tokenizer::dump(), ValueFlowAnalyzer::evaluate(), ExpressionAnalyzer::ExpressionAnalyzer(), fillProgramMemoryFromAssignments(), findExpressionChangedImpl(), followVariableExpression(), getContainerSizeFromConstructorArgs(), ExprIdToken::getExpressionId(), hasKnownSymbolicValue(), ValueFlow::hasLifetimeToken(), SubExpressionAnalyzer::internalMatch(), SubExpressionAnalyzer::isAlias(), ExpressionAnalyzer::isAliasModified(), isAliasOf(), isCompatibleValues(), isContainerSizeChanged(), isExpressionChangedAt(), isIteratorPair(), isSameToken(), isStrlenOf(), ValueFlowAnalyzer::isWritable(), ExpressionAnalyzer::match(), SubExpressionAnalyzer::match(), ContainerExpressionAnalyzer::match(), SymbolicInferModel::match(), SymbolicConditionHandler::parse(), programMemoryParseCondition(), ValueFlow::Value::sameToken(), sameValueType(), setSymbolic(), ProgramMemory::setValue(), SymbolicInferModel::SymbolicInferModel(), TokenExprIdCompare(), TokenExprIdEqual(), ConditionHandler::traverseCondition(), valueFlowAfterAssign(), valueFlowConditionExpressions(), valueFlowContainerSize(), valueFlowForwardLifetime(), valueFlowSmartPointer(), and valueFlowSymbolicOperators().
|
inline |
Definition at line 809 of file token.h.
Referenced by TemplateSimplifier::addNamespace(), TokenList::addtoken(), CheckUnusedVar::checkStructMemberUsage(), TokenList::copyTokens(), TokenList::createTokens(), clangimport::AstNode::createTokens1(), TemplateSimplifier::expandTemplate(), followVariableExpression(), TokenList::insertTokens(), Function::isSafe(), CheckUnusedFunctions::parseTokens(), printValueFlow(), Tokenizer::simplifyHeadersAndUnusedTemplates(), stringifyList(), and Token().
Token * Token::findClosingBracket | ( | ) |
Definition at line 976 of file token.cpp.
References findClosingBracket().
const Token * Token::findClosingBracket | ( | ) | const |
Returns the closing bracket of opening '<'.
Should only be used if link() is unavailable.
Definition at line 917 of file token.cpp.
References isName(), isOperator(), link(), Match(), mPrevious, mStr, next(), previous(), simpleMatch(), str(), strAt(), and tokAt().
Referenced by TemplateSimplifier::addInstantiation(), Tokenizer::createLinks2(), TemplateSimplifier::expandTemplate(), findClosingBracket(), getFunctionToken(), TemplateSimplifier::getNewName(), TemplateSimplifier::getTemplateDeclarations(), TemplateSimplifier::getTemplateInstantiations(), TemplateSimplifier::getTemplateNamePositionTemplateClass(), TemplateSimplifier::getTemplateNamePositionTemplateFunction(), TemplateSimplifier::getTemplateNamePositionTemplateVariable(), TemplateSimplifier::getTemplateParametersInDeclaration(), TemplateSimplifier::instantiateMatch(), matchMemberName(), TemplateSimplifier::matchSpecialization(), matchTemplateParameters(), nextArgumentBeforeCreateLinks2(), TemplateSimplifier::printOut(), TemplateSimplifier::replaceTemplateUsage(), setVarIdParseDeclaration(), Tokenizer::setVarIdPass1(), Tokenizer::setVarIdPass2(), Tokenizer::simplifyHeadersAndUnusedTemplates(), TemplateSimplifier::simplifyTemplateAliases(), TemplateSimplifier::simplifyTemplates(), Tokenizer::simplifyTypedefCpp(), Tokenizer::simplifyUsing(), Tokenizer::simplifyVarDecl(), skipRequires(), Tokenizer::splitTemplateRightAngleBrackets(), TemplateSimplifier::templateParameters(), TemplateSimplifier::TokenAndName::TokenAndName(), and TemplateSimplifier::useDefaultArgumentValues().
Definition at line 1514 of file token.cpp.
References astOperand1(), astOperand2(), findLambdaEndToken(), goToLeftParenthesis(), goToRightParenthesis(), isUnaryPreOp(), link(), Match(), precedes(), simpleMatch(), str(), and succeeds().
Referenced by CheckUnusedVar::checkFunctionVariableUsage(), CheckOther::checkInnerScope(), FwdAnalysis::checkRecursive(), CheckOther::checkRedundantAssignment(), expressionString(), and CheckClass::initializationListUsage().
|
static |
Definition at line 1065 of file token.cpp.
References findmatchImpl(), and varId().
Referenced by CheckAutoVariables::autoVariables(), CheckStl::checkDereferenceInvalidIterator(), CheckMemoryLeakNoVar::checkForUnusedReturnValue(), checkFunctionUsage(), CheckOther::checkInnerScope(), CheckOther::checkInvalidFree(), CheckMemoryLeakInFunction::checkReallocUsage(), CheckLeakAutoVar::checkScope(), CheckUninitVar::checkScopeForVariable(), CheckUnusedVar::checkStructMemberUsage(), CheckOther::checkUnreachableCode(), Scope::checkVariable(), findStartToken(), CheckLeakAutoVar::functionCall(), getUnsafeFunction(), isBreakScope(), isEarlyExit(), isEscapeScope(), SymbolDatabase::isFunction(), Function::returnDefEnd(), singleAssignInScope(), singleConditionalInScope(), singleMemberCallInScope(), CheckClass::thisSubtraction(), TemplateSimplifier::TokenAndName::TokenAndName(), CheckStl::useStlAlgorithm(), valueFlowForLoop(), and valueFlowForLoopSimplify().
|
static |
Definition at line 1084 of file token.cpp.
References findmatchImpl(), and varId().
|
static |
Definition at line 1070 of file token.cpp.
References findmatchImpl(), and varId().
|
static |
Definition at line 1089 of file token.cpp.
References findmatchImpl(), and varId().
Token * Token::findOpeningBracket | ( | ) |
Definition at line 1008 of file token.cpp.
References findOpeningBracket().
const Token * Token::findOpeningBracket | ( | ) | const |
Definition at line 982 of file token.cpp.
References link(), Match(), mStr, previous(), and str().
Referenced by Tokenizer::calculateScopes(), Tokenizer::combineOperators(), findOpeningBracket(), insertToken(), Tokenizer::simplifyStaticConst(), TemplateSimplifier::simplifyTemplateInstantiations(), and TemplateSimplifier::TokenAndName::TokenAndName().
|
static |
Definition at line 1026 of file token.cpp.
References findsimplematchImpl().
|
static |
Definition at line 1046 of file token.cpp.
References findsimplematchImpl().
|
inlinestatic |
Definition at line 763 of file token.h.
Referenced by TemplateSimplifier::TokenAndName::aliasEndToken(), Variable::arrayDimensions(), CheckAutoVariables::assignFunctionArg(), CheckCondition::assignIf(), CheckAutoVariables::checkAutoVariableAssignment(), CheckBoost::checkBoostForeachModification(), CheckStl::checkDereferenceInvalidIterator(), CheckOther::checkDuplicateExpression(), Tokenizer::checkForEnumsWithTypedef(), CheckOther::checkInnerScope(), CheckLeakAutoVar::checkScope(), CheckUnusedVar::checkStructMemberUsage(), CheckOther::checkUnreachableCode(), CheckOther::checkUnusedLabel(), Scope::checkVariable(), SymbolDatabase::createSymbolDatabaseEscapeFunctions(), SymbolDatabase::createSymbolDatabaseSetVariablePointers(), CheckLeakAutoVar::functionCall(), getSingleFunctionCall(), getSingleReturnVar(), TemplateSimplifier::getTemplateInstantiations(), CheckStl::if_find(), isEarlyExit(), isReturnScope(), CheckStl::iterators(), Lambda::Lambda(), CheckCondition::multiCondition2(), parsedecl(), CheckBool::pointerArithBool(), CheckClass::privateFunctions(), Function::returnsConst(), Variable::setValueType(), Tokenizer::setVarIdPass1(), Tokenizer::simplifyRedundantParentheses(), singleStatement(), skipLocalVars(), and valueFlowUninit().
|
static |
Definition at line 1031 of file token.cpp.
References findsimplematchImpl().
|
static |
Definition at line 1051 of file token.cpp.
References findsimplematchImpl().
|
staticprivate |
|
inline |
Definition at line 418 of file token.h.
Referenced by TokenList::addtoken(), TokenList::copyTokens(), and TokenList::insertTokens().
|
inline |
void Token::function | ( | const Function * | f | ) |
Associate this token with given function.
f | Function to be associated |
Definition at line 1093 of file token.cpp.
References eFunction, eLambda, eName, Function::isLambda(), TokenImpl::mFunction, mImpl, mTokType, and tokType().
Referenced by CheckIO::ArgumentInfo::ArgumentInfo(), astStringXml(), CheckClass::checkConstFunc(), checkFunctionUsage(), CheckUnusedVar::checkFunctionVariableUsage_iterateScopes(), CheckOther::checkMisusedScopedObject(), CheckOther::checkRedundantCopy(), CheckLeakAutoVar::checkScope(), CheckOther::checkVarFuncNullUB(), compareTokenRanges(), SymbolDatabase::createSymbolDatabaseSetVariablePointers(), clangimport::AstNode::createTokensFunctionDecl(), Tokenizer::dump(), exprDependsOnThis(), findConstructor(), SymbolDatabase::findEnumerator(), SymbolDatabase::findFunction(), followAllReferences(), clangimport::Data::funcDecl(), CheckMemoryLeak::getAllocationType(), getArgumentVars(), CheckClass::getFirstVirtualFunctionCallStack(), getFunction(), getFunctionUsage(), getLifetimeTokens(), getParentValueTypes(), getSingleFunctionCall(), hasNoreturnFunction(), CheckClass::initializeVarList(), isConstFunctionCall(), CheckClass::isConstMemberFunc(), isConstVarExpression(), isContainerSizeChangedByFunction(), isEscapeFunction(), isExpressionChangedAt(), Library::isFunctionConst(), CheckUninitVar::isFunctionParUsage(), ValueFlowAnalyzer::isGlobalModified(), isMacroUsage(), CheckClass::isMemberFunc(), CheckUninitVar::isMemberVariableAssignment(), isNonConstFunctionCall(), Library::isnoreturn(), Library::isNotLibraryFunction(), Library::isnotnoreturn(), isParameterChanged(), isSameExpression(), Tokenizer::isScopeNoReturn(), isSimpleExpr(), isTemporary(), isThisChanged(), isUniqueExpression(), isVariableChanged(), isVariableChangedByFunctionCall(), CheckCondition::multiCondition2(), parsedecl(), CheckNullPointer::parseFunctionCall(), clangimport::Data::Decl::ref(), SymbolDatabase::setValueType(), SymbolDatabase::setValueTypeInTokenList(), CheckSizeof::sizeofFunction(), CheckStl::string_c_str(), CheckClass::thisUseAfterFree(), tokenIsFunctionReturningBool(), typeDecl(), typeOf(), CheckOther::unreachableCodeError(), valueFlowFunctionReturn(), valueFlowLifetimeFunction(), valueFlowSubFunction(), and SymbolDatabase::~SymbolDatabase().
const ValueFlow::Value * Token::getContainerSizeValue | ( | const MathLib::bigint | val | ) | const |
Definition at line 2618 of file token.cpp.
References mImpl, and TokenImpl::mValues.
|
inline |
Definition at line 539 of file token.h.
Referenced by valueFlowSafeFunctions().
|
inlineprivate |
const ValueFlow::Value * Token::getInvalidValue | ( | const Token * | ftok, |
nonneg int | argnr, | ||
const Settings & | settings | ||
) | const |
Definition at line 1963 of file token.cpp.
References Settings::certainty, ValueFlow::Value::condition, inconclusive, SimpleEnableGroup< T >::isEnabled(), Library::isFloatArgValid(), ValueFlow::Value::isInconclusive(), Library::isIntArgValid(), Settings::library, mImpl, TokenImpl::mValues, Settings::severity, and warning.
Referenced by CheckFunctions::invalidFunctionUsage().
|
inline |
Definition at line 1218 of file token.h.
Referenced by Variable::arrayDimensions(), Tokenizer::arraySizeAfterValueFlow(), checkBufferSize(), CheckCondition::checkCompareValueOutOfTypeRange(), CheckCondition::checkInvalidTestForOverflow(), checkMissingReturnScope(), CheckOther::checkOverlappingWrite(), CheckMemoryLeakInFunction::checkReallocUsage(), CheckUninitVar::checkScopeForVariable(), conditionAlwaysTrueOrFalse(), evaluateKnownValues(), getBufAndOffset(), getEnumType(), getVariableValues(), if_findCompare(), CheckFunctions::invalidFunctionUsage(), CheckBufferOverrun::isCtuUnsafeBufferUsage(), isFalseKeyword(), isTrueKeyword(), CheckBufferOverrun::objectIndex(), SymbolDatabase::setArrayDimensionsUsingValueFlow(), CheckBufferOverrun::stringNotZeroTerminated(), CheckFunctions::useStandardLibrary(), and valueFlowDynamicBufferSize().
const ValueFlow::Value * Token::getKnownValue | ( | ValueFlow::Value::ValueType | t | ) | const |
Definition at line 2552 of file token.cpp.
References mImpl, and TokenImpl::mValues.
Referenced by CheckStl::eraseIteratorOutOfBounds(), and valueFlowGetStrLength().
|
inline |
Definition at line 755 of file token.h.
Referenced by TokenList::addtoken(), Tokenizer::dump(), TemplateSimplifier::expandTemplate(), TokenList::insertTokens(), and Tokenizer::simplifyVarDecl().
const ValueFlow::Value * Token::getMaxValue | ( | bool | condition, |
MathLib::bigint | path = 0 |
||
) | const |
Definition at line 2592 of file token.cpp.
References getCompareValue(), mImpl, and TokenImpl::mValues.
Referenced by isOutOfBoundsImpl().
const ValueFlow::Value * Token::getMinValue | ( | bool | condition, |
MathLib::bigint | path = 0 |
||
) | const |
Definition at line 2599 of file token.cpp.
References getCompareValue(), mImpl, and TokenImpl::mValues.
const ValueFlow::Value * Token::getMovedValue | ( | ) | const |
Definition at line 2606 of file token.cpp.
References mImpl, and TokenImpl::mValues.
Should be called for %str%% tokens only.
tok | token with C-string |
Definition at line 807 of file token.cpp.
References eString, getStringLiteral(), str(), and tokType().
Referenced by Tokenizer::arraySize(), getDimensionsEtc(), getStrSize(), and CheckFunctions::invalidFunctionUsage().
Should be called for %str%% tokens only.
tok | token with C-string |
Definition at line 777 of file token.cpp.
References eString, getStringLiteral(), mTokType, and str().
Referenced by checkBufferSize(), CheckString::checkIncorrectStringCompare(), createBuiltinLibraryFunctions(), Tokenizer::dump(), getMinFormatStringOutputLength(), getValueTokenMaxStrLength(), ContainerConditionHandler::parse(), setTokenValue(), TemplateSimplifier::simplifyTemplateArgs(), Tokenizer::sizeOfType(), CheckBufferOverrun::stringNotZeroTerminated(), valueFlowContainerSize(), valueFlowDynamicBufferSize(), valueFlowGetStrLength(), and ContainerExpressionAnalyzer::writeValue().
Should be called for %str%% tokens only.
tok | token with C-string |
settings | Settings |
Definition at line 822 of file token.cpp.
References eString, ValueFlow::getSizeOf(), getStrArraySize(), nonneg, ValueType::pointer, tokType(), and valueType().
Referenced by getValueTokenMinStrSize(), and valueFlowSetConstantValue().
|
inline |
Definition at line 1475 of file token.h.
Referenced by SymbolDatabase::debugSymbolDatabase(), and valueFlowDebug().
const ValueFlow::Value * Token::getValue | ( | const MathLib::bigint | val | ) | const |
Definition at line 2562 of file token.cpp.
References mImpl, and TokenImpl::mValues.
Referenced by addByOne(), CheckNullPointer::arithmetic(), CheckUninitVar::checkIfForWhileHead(), CheckCondition::checkPointerAdditionResultNotNull(), and CheckFunctions::invalidFunctionUsage().
const ValueFlow::Value * Token::getValueGE | ( | const MathLib::bigint | val, |
const Settings & | settings | ||
) | const |
Definition at line 1954 of file token.cpp.
References ValueFlow::findValue(), mImpl, and TokenImpl::mValues.
Referenced by CheckOther::checkCharVariable(), CheckBool::checkComparisonOfBoolExpressionWithInt(), CheckStl::isContainerSizeGE(), and CheckBufferOverrun::pointerArithmetic().
const ValueFlow::Value * Token::getValueLE | ( | const MathLib::bigint | val, |
const Settings & | settings | ||
) | const |
Definition at line 1945 of file token.cpp.
References ValueFlow::findValue(), mImpl, and TokenImpl::mValues.
Referenced by CheckBool::checkComparisonOfBoolExpressionWithInt(), isNegative(), CheckBufferOverrun::negativeArraySize(), and CheckBufferOverrun::pointerArithmetic().
const Token * Token::getValueTokenMaxStrLength | ( | ) | const |
Definition at line 2008 of file token.cpp.
References eString, getStrLength(), mImpl, and TokenImpl::mValues.
Referenced by checkBufferSize(), and CheckBufferOverrun::stringNotZeroTerminated().
const Token * Token::getValueTokenMinStrSize | ( | const Settings & | settings, |
MathLib::bigint * | path = nullptr |
||
) | const |
Definition at line 1988 of file token.cpp.
References eString, getStrSize(), mImpl, and TokenImpl::mValues.
Referenced by getDimensionsEtc(), CheckFunctions::invalidFunctionUsage(), and CheckString::stringLiteralWrite().
bool Token::hasKnownIntValue | ( | ) | const |
Definition at line 2519 of file token.cpp.
References mImpl, and TokenImpl::mValues.
Referenced by accumulateBoolLiteral(), addByOne(), ValueFlowAnalyzer::analyzeCondition(), Variable::arrayDimensions(), Tokenizer::arraySizeAfterValueFlow(), ConditionHandler::beforeCondition(), bifurcate(), checkBufferSize(), CheckCondition::checkCompareValueOutOfTypeRange(), PathAnalysis::checkCond(), CheckStl::checkDereferenceInvalidIterator2(), CheckOther::checkKnownArgument(), checkMissingReturnScope(), CheckOther::checkOverlappingWrite(), CheckCondition::checkPointerAdditionResultNotNull(), CheckMemoryLeakInFunction::checkReallocUsage(), FwdAnalysis::checkRecursive(), CheckUninitVar::checkScopeForVariable(), conditionAlwaysTrueOrFalse(), CheckCondition::duplicateCondition(), ValueFlowAnalyzer::evaluateInt(), evaluateKnownValues(), CheckLeakAutoVar::functionCall(), getBufAndOffset(), getContainerSizeFromConstructorArgs(), getEnumType(), getExpressionRange(), getVariableValues(), if_findCompare(), inferCondition(), CheckFunctions::invalidFunctionUsage(), CheckStl::isContainerSizeGE(), CheckBufferOverrun::isCtuUnsafeBufferUsage(), isFalseKeyword(), isNonZero(), isSameToken(), isTrueKeyword(), isUsedAsBool(), makeContainerSizeValue(), match(), minUnsignedValue(), CheckCondition::multiCondition2(), CheckNullPointer::nullConstantDereference(), CheckBufferOverrun::objectIndex(), CheckStl::outOfBounds(), SimpleConditionHandler::parse(), SymbolicConditionHandler::parse(), parseCompareEachInt(), ValueFlow::parseCompareInt(), SymbolDatabase::setArrayDimensionsUsingValueFlow(), ProgramMemory::setValue(), ConditionHandler::skipNotAndCasts(), solveExprValue(), MultiValueFlowAnalyzer::stopOnCondition(), CheckBufferOverrun::stringNotZeroTerminated(), ConditionHandler::traverseCondition(), CheckFunctions::useStandardLibrary(), valueFlowArrayBool(), valueFlowArrayElement(), valueFlowConditionExpressions(), valueFlowContainerSize(), valueFlowDynamicBufferSize(), valueFlowEnumValue(), valueFlowImpossibleValues(), valueFlowInferCondition(), valueFlowSameExpressions(), valueFlowSymbolicInfer(), valueFlowSymbolicOperators(), and CheckOther::warningOldStylePointerCast().
bool Token::hasKnownSymbolicValue | ( | const Token * | tok | ) | const |
Definition at line 2541 of file token.cpp.
References exprId(), mImpl, and TokenImpl::mValues.
Referenced by SymbolicConditionHandler::parse().
bool Token::hasKnownValue | ( | ) | const |
Definition at line 2528 of file token.cpp.
References ValueFlow::Value::isKnown(), mImpl, and TokenImpl::mValues.
Referenced by getDimensionsEtc(), CheckFunctions::invalidFunctionUsage(), isConstVarExpression(), CheckStl::outOfBounds(), CheckStl::stlOutOfBounds(), valueFlowBitAnd(), ValueFlow::valueFlowConstantFoldAST(), valueFlowContainerSize(), valueFlowDynamicBufferSize(), valueFlowFunctionReturn(), and valueFlowRightShift().
bool Token::hasKnownValue | ( | ValueFlow::Value::ValueType | t | ) | const |
Definition at line 2533 of file token.cpp.
References mImpl, and TokenImpl::mValues.
|
inline |
Definition at line 1247 of file token.h.
Referenced by assignIndexes(), linkAt(), precedes(), succeeds(), and tokAt().
Token * Token::insertToken | ( | const std::string & | tokenStr, |
const std::string & | originalNameStr = emptyString , |
||
const std::string & | macroNameStr = emptyString , |
||
bool | prepend = false |
||
) |
Insert new token after this token.
This function will handle relations between next and previous token also.
tokenStr | String for the new token. |
originalNameStr | String used for Token::originalName(). |
prepend | Insert the new token before this token when it's not the first one on the tokens list. |
Definition at line 1105 of file token.cpp.
References TokensFrontBack::back, findOpeningBracket(), TokensFrontBack::front, linkAt(), Match(), TokenImpl::mFileIndex, mImpl, TokenImpl::mLineNumber, TokenImpl::mProgressValue, TokenImpl::mScopeInfo, mStr, mTokensFrontBack, next(), originalName(), previous(), scope(), scopeInfo(), setMacroName(), simpleMatch(), str(), strAt(), tokAt(), and Token().
Referenced by TemplateSimplifier::addNamespace(), Tokenizer::addSemicolonAfterUnknownMacro(), TokenList::addtoken(), CheckIO::ArgumentInfo::ArgumentInfo(), Tokenizer::arraySize(), Tokenizer::arraySizeAfterValueFlow(), TokenList::copyTokens(), TokenList::createTokens(), Tokenizer::elseif(), TemplateSimplifier::expandTemplate(), TemplateSimplifier::getTemplateInstantiations(), Tokenizer::initVar(), TokenList::insertTokens(), Tokenizer::simplifyAddBracesPair(), Tokenizer::simplifyCaseRange(), Tokenizer::simplifyFunctionParameters(), Tokenizer::simplifyIfSwitchForInit(), Tokenizer::simplifyLabelsCaseDefault(), Tokenizer::simplifySQL(), Tokenizer::simplifyStaticConst(), Tokenizer::simplifyTypedefCpp(), Tokenizer::simplifyTypeIntrinsics(), Tokenizer::simplifyUsing(), Tokenizer::simplifyUsingToTypedef(), Tokenizer::simplifyVarDecl(), Tokenizer::simplifyVariableMultipleAssign(), Tokenizer::sizeofAddParentheses(), splitDefinitionFromTypedef(), Tokenizer::splitTemplateRightAngleBrackets(), and TemplateSimplifier::useDefaultArgumentValues().
|
inline |
Definition at line 857 of file token.h.
Referenced by Tokenizer::createLinks2(), TemplateSimplifier::expandTemplate(), TemplateSimplifier::getTemplateInstantiations(), Tokenizer::simplifyStaticConst(), and Tokenizer::simplifyTypedefLHS().
|
inline |
Definition at line 395 of file token.h.
Referenced by CheckCondition::alwaysTrueFalse(), Tokenizer::dump(), if_findCompare(), isSimpleExpr(), isVariableChanged(), setTokenValue(), SymbolDatabase::setValueType(), and CheckStl::size().
|
inline |
Definition at line 401 of file token.h.
Referenced by CheckClass::checkConstFunc(), CheckOther::checkConstVariable(), CheckUnusedVar::checkFunctionVariableUsage(), CheckUnusedVar::checkFunctionVariableUsage_iterateScopes(), CheckOther::checkIncompleteStatement(), CheckOther::checkMisusedScopedObject(), CheckAssert::checkVariableAssignment(), doAssignment(), Tokenizer::dump(), getEnumType(), getLHSVariable(), if_findCompare(), isConstExpression(), isLowerThanLogicalAnd(), isSameExpression(), ValueFlowAnalyzer::isWritable(), multiComparePercent(), SymbolDatabase::setValueType(), and skipLocalVars().
|
inline |
Definition at line 636 of file token.h.
Referenced by Tokenizer::dump().
|
inline |
Definition at line 494 of file token.h.
Referenced by isSameExpression().
|
inline |
|
inline |
Definition at line 512 of file token.h.
Referenced by Tokenizer::dump().
|
inline |
Definition at line 530 of file token.h.
Referenced by Tokenizer::dump(), and Variable::evaluate().
|
inline |
|
inline |
Definition at line 518 of file token.h.
Referenced by CheckUnusedVar::checkStructMemberUsage().
|
inline |
Definition at line 488 of file token.h.
Referenced by isSameExpression().
|
inline |
Definition at line 476 of file token.h.
Referenced by CheckUnusedVar::checkFunctionVariableUsage(), and Tokenizer::dump().
|
inline |
|
inline |
Definition at line 482 of file token.h.
Referenced by CheckUnusedVar::checkFunctionVariableUsage().
|
inline |
|
inline |
Definition at line 410 of file token.h.
Referenced by CheckIO::ArgumentInfo::ArgumentInfo(), CheckOther::checkOverlappingWrite(), extractForLoopValues(), getBufAndOffset(), getCastTypeStartToken(), getVariableValues(), isGlobalData(), isIntegralOrPointer(), isLikelyStreamRead(), isSameExpression(), isVariableChanged(), isVariableInit(), CheckUninitVar::isVariableUsage(), CheckBool::pointerArithBoolCond(), truncateImplicitConversion(), CheckFunctions::useStandardLibrary(), and valueFlowArrayElement().
|
inline |
Definition at line 404 of file token.h.
Referenced by astIsBool(), CheckBool::checkComparisonOfBoolWithInt(), Scope::checkVariable(), CheckOther::constStatementError(), Tokenizer::dump(), isSimpleExpr(), multiComparePercent(), and SymbolDatabase::setValueTypeInTokenList().
bool Token::isC | ( | ) | const |
Definition at line 2723 of file token.cpp.
References TokenList::isC(), TokensFrontBack::list, and mTokensFrontBack.
Referenced by CheckUninitVar::checkScope(), CheckString::checkSuspiciousStringCompare(), SymbolDatabase::createSymbolDatabaseFindAllScopes(), SymbolDatabase::findType(), hasOverloadedAssignment(), SymbolDatabase::isFunction(), and SymbolDatabase::returnImplicitIntError().
bool Token::isCalculation | ( | ) | const |
Is current token a calculation? Only true for operands.
For '*' and '&' tokens it is looked up if this is a dereference or address-of. A dereference or address-of is not counted as a calculation.
Definition at line 1556 of file token.cpp.
References astOperand1(), astOperand2(), isNumber(), Match(), str(), and varId().
Referenced by CheckOther::checkConstVariable(), and CheckSizeof::sizeofCalculation().
|
inline |
Definition at line 458 of file token.h.
Referenced by CheckIO::ArgumentInfo::ArgumentInfo(), CheckBufferOverrun::bufferOverflow(), CheckOther::checkConstPointer(), CheckMemoryLeakNoVar::checkForUnreleasedInputArgument(), CheckMemoryLeakNoVar::checkForUnusedReturnValue(), CheckOther::checkKnownArgument(), CheckMemoryLeakInFunction::checkReallocUsage(), FwdAnalysis::checkRecursive(), CheckLeakAutoVar::checkScope(), CheckUninitVar::checkScopeForVariable(), CheckLeakAutoVar::checkTokenInsideExpression(), CheckOther::constStatementError(), Tokenizer::dump(), findAllocFuncCallToken(), SymbolDatabase::findFunction(), CheckLeakAutoVar::functionCall(), getAstParentSkipPossibleCastAndAddressOf(), getExprUsage(), CheckMemoryLeak::getReallocationType(), isAddressOfLocalVariable(), isConditionKnown(), isConstStatement(), isFunctionCall(), isNullOperand(), isTemporary(), isUsedAsBool(), isVariableChanged(), CheckUninitVar::isVariableUsage(), isVoidCast(), Tokenizer::markCppCasts(), CheckBufferOverrun::objectIndex(), CheckLeakAutoVar::ret(), CheckFunctions::returnLocalStdMove(), setTokenValue(), SymbolDatabase::setValueTypeInTokenList(), CheckString::sprintfOverlappingData(), valueFlowDynamicBufferSize(), valueFlowForwardLifetime(), and valueFlowFunctionReturn().
|
inline |
Definition at line 722 of file token.h.
References emptyString, and isPrefixStringCharLiteral().
Referenced by concatStr(), SymbolDatabase::setValueTypeInTokenList(), and valueFlowSetConstantValue().
|
inline |
Definition at line 727 of file token.h.
References emptyString, and isPrefixStringCharLiteral().
Referenced by SymbolDatabase::setValueTypeInTokenList(), and valueFlowSetConstantValue().
|
inline |
Definition at line 398 of file token.h.
Referenced by CheckCondition::alwaysTrueFalse(), astIsVariableComparison(), CheckOther::checkConstVariable(), CheckOther::comparisonNonZeroExpressionLessThanZero(), conditionAlwaysTrueOrFalse(), conditionString(), Tokenizer::createLinks2(), Tokenizer::dump(), if_findCompare(), isComputableValue(), isOppositeCond(), multiComparePercent(), parseCompareEachInt(), parseComparison(), SymbolDatabase::setValueTypeInTokenList(), CheckStl::stlOutOfBounds(), CheckOther::testIfNonZeroExpressionIsPositive(), CheckFunctions::useStandardLibrary(), and valueFlowConditionExpressions().
|
inline |
Definition at line 555 of file token.h.
Referenced by compareTokenFlags(), Tokenizer::dump(), stringify(), and tokenType().
|
inline |
Definition at line 594 of file token.h.
Referenced by CheckCondition::alwaysTrueFalse(), and Tokenizer::simplifyTokenList1().
|
inline |
Definition at line 385 of file token.h.
Referenced by bifurcate(), getExprUsage(), hasNoreturnFunction(), CheckUninitVar::isMemberVariableAssignment(), isVariableUsed(), minUnsignedValue(), multiComparePercent(), and truncateImplicitConversion().
|
inline |
Definition at line 546 of file token.h.
Referenced by Tokenizer::checkConfiguration(), SymbolDatabase::createSymbolDatabaseExprIds(), getFunctionUsage(), and Tokenizer::simplifyTypedefCpp().
bool Token::isCpp | ( | ) | const |
Definition at line 2718 of file token.cpp.
References TokenList::isCPP(), TokensFrontBack::list, and mTokensFrontBack.
Referenced by Scope::addEnum(), Function::argsMatch(), Variable::arrayDimensions(), CheckUnusedVar::checkFunctionVariableUsage(), CheckUnusedVar::checkFunctionVariableUsage_iterateScopes(), CheckLeakAutoVar::checkScope(), CheckUninitVar::checkScopeForVariable(), CheckString::checkSuspiciousStringCompare(), Scope::checkVariable(), CheckClass::copyconstructors(), SymbolDatabase::createSymbolDatabaseFindAllScopes(), Tokenizer::duplicateTypedef(), Variable::evaluate(), findLambdaStartToken(), CheckLeakAutoVar::functionCall(), CheckMemoryLeak::getAllocationType(), CheckMemoryLeak::getDeallocationType(), isDifferentType(), Library::isFloatArgValid(), SymbolDatabase::isFunction(), Tokenizer::isFunctionHead(), Library::isIntArgValid(), isLikelyStream(), isLikelyStreamRead(), isLocalVarNoAutoDealloc(), isNullOperand(), SymbolDatabase::isReservedName(), isSameExpression(), isTemporary(), isVariableChanged(), isVariableChangedByFunctionCall(), Scope::isVariableDeclaration(), CheckUninitVar::isVariableUsage(), isWithoutSideEffects(), CheckCondition::multiCondition2(), needsInitialization(), CheckBufferOverrun::objectIndex(), parsedecl(), Scope::Scope(), clangimport::AstNode::setValueType(), SymbolDatabase::setValueType(), SymbolDatabase::setValueTypeInTokenList(), setVarIdParseDeclaration(), Tokenizer::setVarIdPass1(), Tokenizer::simplifyFunctionPointers(), Tokenizer::simplifyHeadersAndUnusedTemplates(), Tokenizer::simplifyRedundantParentheses(), Tokenizer::simplifyTypedefCpp(), Tokenizer::simplifyVarDecl(), CheckType::tooBigSignedBitwiseShiftError(), CheckFunctions::useStandardLibrary(), CheckVaarg::va_list_usage(), valueFlowDynamicBufferSize(), valueFlowGlobalStaticVar(), valueFlowLibraryFunction(), valueFlowSetConstantValue(), and valueFlowUnknownFunctionReturn().
|
inline |
|
inline |
Definition at line 374 of file token.h.
Referenced by CheckOther::constStatementError(), Scope::findFunction(), isConstant(), isConstVarExpression(), and isOperandExpanded().
|
inline |
Definition at line 561 of file token.h.
Referenced by CheckUninitVar::checkScope(), CheckUninitVar::checkScopeForVariable(), and type().
|
inline |
Definition at line 455 of file token.h.
Referenced by ConditionHandler::afterCondition(), CheckCondition::alwaysTrueFalse(), ConditionHandler::beforeCondition(), CheckUnusedVar::checkFunctionVariableUsage(), CheckOther::checkKnownPointerToBool(), CheckOther::checkRedundantPointerOp(), CheckOther::checkShadowVariables(), CheckUnusedVar::checkStructMemberUsage(), CheckOther::checkSuspiciousSemicolon(), CheckClass::checkUselessOverride(), CheckOther::checkVariableScope(), compareTokenFlags(), compareTokenRanges(), Tokenizer::dump(), isConstStatement(), isOperandExpanded(), isSameConstantValue(), Tokenizer::simplifyTypedefCpp(), CheckSizeof::sizeofCalculation(), and stringify().
|
inline |
Definition at line 391 of file token.h.
Referenced by CheckUnusedVar::checkFunctionVariableUsage_iterateScopes().
|
inline |
Definition at line 601 of file token.h.
Referenced by CheckOther::checkPassByReference(), Tokenizer::dump(), Function::setFlags(), and Tokenizer::simplifyExternC().
|
inline |
Definition at line 671 of file token.h.
Referenced by CheckClass::checkVirtualFunctionCallInConstructor().
|
inline |
Definition at line 622 of file token.h.
Referenced by Tokenizer::dump().
|
inline |
Definition at line 407 of file token.h.
Referenced by CheckOther::checkConstPointer(), isVariableChanged(), and CheckStl::useStlAlgorithm().
|
inline |
Definition at line 587 of file token.h.
Referenced by SymbolDatabase::createSymbolDatabaseExprIds(), and findExpressionChangedImpl().
|
inline |
Definition at line 573 of file token.h.
Referenced by SymbolDatabase::createSymbolDatabaseExprIds(), findExpressionChangedImpl(), findIncompleteVar(), isReturnScope(), ExpressionAnalyzer::setupExprVarIds(), valueFlowImpossibleValues(), and valueFlowSymbolic().
|
inline |
Definition at line 678 of file token.h.
Referenced by isUsedAsBool(), setTokenValue(), and ValueFlow::setValues().
|
inline |
Definition at line 629 of file token.h.
Referenced by Function::setFlags(), and Tokenizer::simplifyTypedefCpp().
|
inline |
Definition at line 358 of file token.h.
Referenced by CheckFunctions::checkLibraryMatchFunctions(), checkMissingReturnScope(), CheckOther::checkMisusedScopedObject(), CheckMemoryLeakStructMember::checkStructVariable(), CheckOther::checkUnreachableCode(), Scope::checkVariable(), SymbolDatabase::createSymbolDatabaseExprIds(), SymbolDatabase::createSymbolDatabaseFindAllScopes(), SymbolDatabase::findEnumerator(), SymbolDatabase::findVariableType(), CheckLeakAutoVar::functionCall(), Scope::getVariableList(), isEnumScope(), isExpressionChangedAt(), SymbolDatabase::isFunction(), ValueFlowAnalyzer::isGlobalModified(), CheckClass::isMemberVar(), isNonMacro(), Library::isNotLibraryFunction(), Library::isScopeNoReturn(), isThisChanged(), isType(), isUsedAsBool(), isVariableChangedByFunctionCall(), CheckUnusedFunctions::parseTokens(), Tokenizer::removeMacrosInGlobalScope(), Tokenizer::reportUnknownMacros(), SymbolDatabase::setValueTypeInTokenList(), Tokenizer::setVarIdPass1(), Tokenizer::simplifyHeadersAndUnusedTemplates(), Tokenizer::simplifyRedundantParentheses(), Tokenizer::simplifyTypedefCpp(), Tokenizer::simplifyUsing(), CheckOther::unreachableCodeError(), and valueFlowSubFunction().
|
inline |
Definition at line 368 of file token.h.
Referenced by ValueFlowAnalyzer::analyzeCondition(), CheckString::checkSuspiciousStringCompare(), followVariableExpression(), getEnumType(), isExpressionChangedAt(), CheckUnusedVar::isFunctionWithoutSideEffects(), matchMemberVarName(), Tokenizer::setVarIdPass1(), Tokenizer::setVarIdPass2(), Tokenizer::simplifyUsing(), and Tokenizer::sizeofAddParentheses().
|
inline |
Definition at line 443 of file token.h.
Referenced by Function::argsMatch(), CheckIO::ArgumentInfo::ArgumentInfo(), CheckIO::argumentType(), CheckIO::checkFormatString(), CheckString::checkSuspiciousStringCompare(), checkVariableCallMatch(), compareTokenFlags(), TemplateSimplifier::expandTemplate(), TemplateSimplifier::getTemplateInstantiations(), TemplateSimplifier::matchSpecialization(), matchTemplateParameters(), parsedecl(), TemplateSimplifier::printOut(), SymbolDatabase::setValueType(), SymbolDatabase::setValueTypeInTokenList(), Tokenizer::sizeOfType(), stringify(), tokenType(), update_property_char_string_literal(), and valueFlowSetConstantValue().
|
inline |
Definition at line 361 of file token.h.
Referenced by Function::addArguments(), SymbolDatabase::addClassFunction(), Tokenizer::addSemicolonAfterUnknownMacro(), Tokenizer::arraySize(), CheckBool::checkComparisonOfBoolExpressionWithInt(), CheckClass::checkConst(), CheckClass::checkConstFunc(), CheckUnusedVar::checkFunctionVariableUsage(), CheckUnusedVar::checkFunctionVariableUsage_iterateScopes(), CheckOther::checkInnerScope(), FwdAnalysis::checkRecursive(), CheckLeakAutoVar::checkScope(), CheckOther::checkVarFuncNullUB(), Tokenizer::combineOperators(), Tokenizer::combineStringAndCharLiterals(), conditionAlwaysTrueOrFalse(), conditionString(), doAssignment(), Tokenizer::dump(), CheckStl::erase(), Variable::evaluate(), TemplateSimplifier::expandTemplate(), findClosingBracket(), SymbolDatabase::findScope(), SymbolDatabase::findType(), SymbolDatabase::findTypeInNested(), CheckMemoryLeak::getAllocationType(), FwdAnalysis::getExprVarIds(), Library::getFunctionName(), getIteratorExpression(), iscast(), isConstExpression(), isExpressionChangedAt(), SymbolDatabase::isFunction(), isFunctionCall(), CheckUninitVar::isFunctionParUsage(), isGlobalData(), CheckUninitVar::isMemberVariableAssignment(), isReturnScope(), isSameExpression(), Library::isScopeNoReturn(), isUpperCaseName(), isVariableChangedByFunctionCall(), CheckUninitVar::isVariableUsage(), multiComparePercent(), CheckCondition::multiCondition2(), Type::name(), parsedecl(), Tokenizer::removeMacrosInGlobalScope(), Tokenizer::reportUnknownMacros(), SymbolDatabase::setArrayDimensionsUsingValueFlow(), Tokenizer::setVarId(), setVarIdClassDeclaration(), Tokenizer::setVarIdClassFunction(), setVarIdParseDeclaration(), Tokenizer::setVarIdPass1(), Tokenizer::setVarIdPass2(), CheckType::signConversionError(), Tokenizer::simplifyCAlternativeTokens(), Tokenizer::simplifyFunctionParameters(), Tokenizer::simplifyFunctionPointers(), Tokenizer::simplifyHeadersAndUnusedTemplates(), Tokenizer::simplifyInitVar(), TemplateSimplifier::simplifyTemplates(), Tokenizer::simplifyTypedef(), Tokenizer::simplifyTypedefCpp(), Tokenizer::simplifyVarDecl(), stringify(), TemplateSimplifier::templateParameters(), valueFlowNumber(), valueFlowSwitchVariable(), and valueFlowUnknownFunctionReturn().
|
inline |
Definition at line 364 of file token.h.
Referenced by Tokenizer::simplifyTypedefCpp(), and Tokenizer::simplifyUsing().
|
inline |
Definition at line 371 of file token.h.
Referenced by CheckCondition::alwaysTrueFalse(), CheckCondition::checkInvalidTestForOverflow(), CheckOther::clarifyCalculation(), CheckCondition::comparison(), CheckOther::constStatementError(), SymbolDatabase::createSymbolDatabaseExprIds(), Tokenizer::dump(), Tokenizer::initVar(), isCalculation(), SymbolDatabase::isFunction(), CheckCondition::isOverlappingCond(), isSameConstantValue(), isSimpleExpr(), isUsedAsBool(), CheckFunctions::memsetInvalid2ndParam(), multiComparePercent(), SymbolDatabase::setValueTypeInTokenList(), Tokenizer::simplifyArrayAccessSyntax(), Tokenizer::simplifyDoublePlusAndDoubleMinus(), TemplateSimplifier::simplifyNumericCalculations(), Tokenizer::simplifyTokenList1(), TemplateSimplifier::templateParameters(), valueFlowSetConstantValue(), and valueFlowSmartPointer().
|
inline |
Definition at line 380 of file token.h.
Referenced by CheckBool::checkComparisonOfBoolExpressionWithInt(), Tokenizer::dump(), findEndOfFunctionCallForParameter(), multiComparePercent(), CheckNullPointer::nullConstantDereference(), Tokenizer::setVarIdPass1(), and TemplateSimplifier::templateParameters().
|
inline |
Definition at line 549 of file token.h.
Referenced by isOperator(), and Tokenizer::setVarIdPass1().
|
inline |
Definition at line 650 of file token.h.
Referenced by Tokenizer::dump().
|
inline |
Definition at line 643 of file token.h.
Referenced by Tokenizer::dump().
|
inline |
Definition at line 430 of file token.h.
Referenced by CheckIO::ArgumentInfo::ArgumentInfo(), CheckOther::checkCastIntToCharAndBack(), compareTokenFlags(), Tokenizer::dump(), TemplateSimplifier::expandTemplate(), TemplateSimplifier::matchSpecialization(), matchTemplateParameters(), parsedecl(), TemplateSimplifier::printOut(), SymbolDatabase::setValueType(), SymbolDatabase::setValueTypeInTokenList(), stringify(), and tokenType().
|
inline |
|
inline |
Definition at line 664 of file token.h.
Referenced by CheckOther::checkInnerScope(), and Tokenizer::simplifyIfSwitchForInit().
|
inline |
Definition at line 580 of file token.h.
Referenced by SymbolDatabase::createSymbolDatabaseFindAllScopes(), Tokenizer::simplifyTypedefCpp(), and Tokenizer::simplifyUsing().
|
inline |
Definition at line 608 of file token.h.
Referenced by Tokenizer::dump(), and Tokenizer::simplifyVarDecl().
|
inline |
Definition at line 615 of file token.h.
Referenced by CheckUnusedVar::checkFunctionVariableUsage(), CheckOther::checkRedundantCopy(), Tokenizer::dump(), Variable::evaluate(), getVariableChangedStart(), Tokenizer::simplifyVarDecl(), valueFlowAfterAssign(), and Variable::Variable().
|
inline |
Definition at line 449 of file token.h.
Referenced by Function::addArguments(), SymbolDatabase::addClassFunction(), CheckMemoryLeakInClass::check(), CheckIO::checkFormatString(), CheckMemoryLeakNoVar::checkForUnreleasedInputArgument(), CheckMemoryLeakNoVar::checkForUnusedReturnValue(), CheckUnusedVar::checkFunctionVariableUsage_iterateScopes(), CheckOther::checkMisusedScopedObject(), CheckUninitVar::checkScope(), CheckUninitVar::checkScopeForVariable(), CheckUnusedVar::checkStructMemberUsage(), CheckClass::constructors(), SymbolDatabase::createSymbolDatabaseVariableSymbolTable(), Variable::evaluate(), TemplateSimplifier::expandTemplate(), getCastTypeStartToken(), Tokenizer::initVar(), isConstStatement(), isExpressionChangedAt(), SymbolDatabase::isFunction(), isFunctionCall(), isLocalVarNoAutoDealloc(), CheckClass::isMemberVar(), isNonMacro(), Library::isNotLibraryFunction(), isType(), isUnknownType(), parsedecl(), CheckUnusedFunctions::parseTokens(), Tokenizer::removeMacrosInGlobalScope(), Tokenizer::reportUnknownMacros(), Function::returnsStandardType(), setAutoTokenProperties(), SymbolDatabase::setValueType(), SymbolDatabase::setValueTypeInTokenList(), setVarIdParseDeclaration(), Tokenizer::setVarIdPass1(), Tokenizer::setVarIdPass2(), Tokenizer::simplifyRedundantParentheses(), Tokenizer::simplifyTypedefCpp(), Tokenizer::simplifyUsing(), Tokenizer::splitTemplateRightAngleBrackets(), update_property_isStandardType(), and valueFlowSetConstantValue().
|
inline |
Definition at line 657 of file token.h.
Referenced by Tokenizer::removeExtraTemplateKeywords().
|
inline |
Is current token a template argument?
Original code:
template<class C> struct S { C x; }; S<int> s;
Resulting code:
struct S<int> { int x ; // <- "int" is a template argument } S<int> s;
Definition at line 748 of file token.h.
Referenced by CheckOther::checkConstPointer(), compareTokenFlags(), Tokenizer::dump(), TemplateSimplifier::expandTemplate(), isSameConstantValue(), valueFlowNumber(), and valueFlowSetConstantValue().
|
inline |
Definition at line 413 of file token.h.
Referenced by ValueFlowAnalyzer::analyzeToken(), CheckClass::checkConstFunc(), CheckOther::checkConstPointer(), CheckOther::checkConstVariable(), CheckUnusedVar::checkFunctionVariableUsage_iterateScopes(), CheckMemoryLeakInFunction::checkReallocUsage(), FwdAnalysis::checkRecursive(), CheckClass::checkReturnPtrThis(), derefShared(), extractForLoopValues(), Scope::findFunction(), followVariableExpression(), getAstParentSkipPossibleCastAndAddressOf(), getBufAndOffset(), getExprUsage(), CTU::getFileInfo(), getIteratorExpression(), getLibraryContainer(), getLifetimeTokens(), getOverrunIndexValues(), CheckMemoryLeak::getReallocationType(), isAddressOfLocalVariable(), isAutoVarArray(), CheckUninitVar::isMemberVariableUsage(), isOppositeExpression(), CheckNullPointer::isPointerDeRef(), isTemporary(), isUnchanged(), isUsedAsBool(), isVariableChanged(), CheckUninitVar::isVariableUsage(), CheckCondition::multiCondition2(), FwdAnalysis::possiblyAliased(), setTokenValue(), valueFlowImpossibleValues(), valueFlowLifetime(), valueFlowPointerAlias(), and CheckUninitVar::valueFlowUninit().
bool Token::isUnaryPreOp | ( | ) | const |
Definition at line 1592 of file token.cpp.
References astOperand1(), astOperand2(), eIncDecOp, TokenImpl::mAstOperand1, mImpl, mNext, mPrevious, and tokType().
Referenced by findExpressionStartEndTokens().
|
inline |
Definition at line 898 of file token.h.
Referenced by ExpressionAnalyzer::ExpressionAnalyzer().
|
inline |
Definition at line 424 of file token.h.
Referenced by Function::argsMatch(), CheckIO::ArgumentInfo::ArgumentInfo(), CheckIO::argumentType(), CheckIO::checkFormatString(), checkVariableCallMatch(), compareTokenFlags(), Tokenizer::dump(), TemplateSimplifier::expandTemplate(), Variable::isUnsigned(), TemplateSimplifier::matchSpecialization(), matchTemplateParameters(), parsedecl(), TemplateSimplifier::printOut(), SymbolDatabase::setValueType(), SymbolDatabase::setValueTypeInTokenList(), stringify(), and tokenType().
|
inline |
bool Token::isUpperCaseName | ( | ) | const |
Definition at line 203 of file token.cpp.
References isName(), and mStr.
Referenced by CheckClass::checkConst(), CheckLeakAutoVar::checkScope(), Tokenizer::combineOperators(), SymbolDatabase::createSymbolDatabaseFindAllScopes(), SymbolDatabase::isFunction(), Tokenizer::isFunctionHead(), Tokenizer::removeMacroInClassDef(), Tokenizer::removeMacrosInGlobalScope(), Tokenizer::reportUnknownMacros(), Tokenizer::simplifyAddBracesPair(), and Tokenizer::simplifyTokenList1().
|
inline |
Definition at line 712 of file token.h.
References isPrefixStringCharLiteral().
Referenced by SymbolDatabase::setValueTypeInTokenList(), and valueFlowSetConstantValue().
|
inline |
Definition at line 717 of file token.h.
References isPrefixStringCharLiteral().
Referenced by SymbolDatabase::setValueTypeInTokenList(), and valueFlowSetConstantValue().
|
inline |
Definition at line 707 of file token.h.
References isPrefixStringCharLiteral().
Referenced by SymbolDatabase::setValueTypeInTokenList(), and valueFlowSetConstantValue().
|
inline |
Definition at line 816 of file token.h.
Referenced by TemplateSimplifier::addNamespace(), TokenList::addtoken(), CheckOther::checkShadowVariables(), CheckUninitVar::checkStruct(), CheckOther::checkSuspiciousSemicolon(), CheckOther::checkUnreachableCode(), TokenList::copyTokens(), TokenList::createTokens(), clangimport::AstNode::createTokens1(), Tokenizer::dump(), TemplateSimplifier::expandTemplate(), findShadowed(), TokenList::insertTokens(), CheckStl::missingComparisonError(), CheckCondition::multiCondition(), CheckCondition::oppositeElseIfConditionError(), CheckUnusedFunctions::parseTokens(), printLines(), printValueFlow(), Tokenizer::simplifyFunctionParameters(), Tokenizer::simplifyTypedef(), Tokenizer::simplifyTypedefCpp(), stringifyList(), Token(), CheckType::tooBigBitwiseShiftError(), CheckType::tooBigSignedBitwiseShiftError(), and CheckOther::zerodivError().
|
inline |
|
inline |
Create link to given token.
linkToToken | The token where this token should link to. |
Definition at line 1015 of file token.h.
Referenced by Function::addArguments(), SymbolDatabase::addClassFunction(), Scope::addEnum(), SymbolDatabase::addNewFunction(), Tokenizer::addSemicolonAfterUnknownMacro(), ConditionHandler::afterCondition(), CheckIO::ArgumentInfo::ArgumentInfo(), Variable::arrayDimensions(), Tokenizer::arraySize(), Tokenizer::arraySizeAfterValueFlow(), CheckAssert::assertWithSideEffects(), CheckCondition::assignIfParseScope(), ProgramMemoryState::assume(), ValueFlowAnalyzer::assume(), astParentSkipParens(), ConditionHandler::beforeCondition(), Tokenizer::calculateScopes(), CheckAutoVariables::checkAutoVariableAssignment(), CheckBoost::checkBoostForeachModification(), TemplateSimplifier::checkComplicatedSyntaxErrorsInTemplates(), Tokenizer::checkConfiguration(), CheckClass::checkConstFunc(), CheckStl::checkDereferenceInvalidIterator(), CheckStl::checkDereferenceInvalidIterator2(), CheckCondition::checkDuplicateConditionalAssign(), CheckOther::checkDuplicateExpression(), CheckOther::checkEvaluationOrder(), CheckStl::checkFindInsert(), Tokenizer::checkForEnumsWithTypedef(), CheckMemoryLeakNoVar::checkForUnsafeArgAlloc(), CheckMemoryLeakNoVar::checkForUnusedReturnValue(), CheckOther::checkFuncArgNamesDifferent(), CheckUnusedVar::checkFunctionVariableUsage(), CheckUnusedVar::checkFunctionVariableUsage_iterateScopes(), CheckUninitVar::checkIfForWhileHead(), CheckString::checkIncorrectStringCompare(), CheckOther::checkInnerScope(), CheckOther::checkInterlockedDecrement(), CheckUninitVar::checkLoopBodyRecursive(), checkMissingReturnScope(), CheckOther::checkMisusedScopedObject(), FwdAnalysis::checkRecursive(), CheckOther::checkRedundantCopy(), CheckClass::checkReturnPtrThis(), checkReturns(), CheckUninitVar::checkScope(), CheckLeakAutoVar::checkScope(), CheckUninitVar::checkScopeForVariable(), CheckClass::checkSelfInitialization(), CheckSizeof::checkSizeofForPointerSize(), CheckLeakAutoVar::checkTokenInsideExpression(), CheckOther::checkUnreachableCode(), CheckClass::checkUselessOverride(), CheckOther::checkVarFuncNullUB(), Scope::checkVariable(), CheckOther::checkVariableScope(), CheckAutoVariables::checkVarLifetimeScope(), CheckOther::clarifyCalculation(), Function::constructorMemberInitialization(), CheckClass::constructors(), TokenList::copyTokens(), Tokenizer::createLinks2(), createMutualLinks(), SymbolDatabase::createSymbolDatabaseExprIds(), SymbolDatabase::createSymbolDatabaseFindAllScopes(), SymbolDatabase::createSymbolDatabaseSetFunctionPointers(), SymbolDatabase::createSymbolDatabaseSetScopePointers(), SymbolDatabase::createSymbolDatabaseSetVariablePointers(), SymbolDatabase::createSymbolDatabaseVariableSymbolTable(), clangimport::AstNode::createTokens(), clangimport::AstNode::createTokensCall(), clangimport::AstNode::createTokensFunctionDecl(), clangimport::AstNode::createTokensVarDecl(), Variable::declEndToken(), deleteNext(), deletePrevious(), deleteThis(), Library::detectContainerInternal(), doAssignment(), Tokenizer::dump(), CheckCondition::duplicateCondition(), Tokenizer::duplicateTypedef(), Tokenizer::elseif(), CheckStl::eraseCheckLoopVar(), Variable::evaluate(), TemplateSimplifier::expandTemplate(), findClosingBracket(), findExpressionStartEndTokens(), findLambdaEndScope(), findLambdaEndTokenGeneric(), findLambdaStartToken(), findOpeningBracket(), Function::findReturns(), findTypeEnd(), findUnmatchedTernaryOp(), PathAnalysis::forwardRange(), Function::Function(), CheckLeakAutoVar::functionCall(), CheckMemoryLeak::getAllocationType(), getArgumentPos(), getArgumentStart(), getEnableIfReturnType(), CheckClass::getIfStmtBodyStart(), CheckMemoryLeak::getReallocationType(), TemplateSimplifier::getTemplateDeclarations(), TemplateSimplifier::getTemplateParametersInDeclaration(), getTypeString(), Scope::getVariableList(), getVariableValues(), CheckClass::getVirtualFunctionCalls(), goToLeftParenthesis(), goToRightParenthesis(), CheckClass::hasAllocationInIfScope(), Type::initBaseInfo(), CheckClass::initializerListOrder(), CheckClass::initializeVarList(), Tokenizer::initVar(), CheckStl::invalidContainer(), isAlignAttribute(), isBasicForLoop(), isBreakScope(), isCallFunction(), iscast(), isConstMethod(), isCPPAttribute(), isDeadTemporary(), isEarlyExit(), isEscapeScope(), isExecutableScope(), SymbolDatabase::isFunction(), isFunctionCall(), Tokenizer::isFunctionHead(), CheckUninitVar::isFunctionParUsage(), CheckClass::isMemberVar(), CheckUninitVar::isMemberVariableAssignment(), isOperator(), isParameterChanged(), isPartOfClassStructUnion(), CheckNullPointer::isPointerDeRef(), CheckUnusedVar::isRecordTypeWithoutSideEffects(), isReturnScope(), isSameExpression(), isStdMoveOrStdForwarded(), isTemporary(), isType(), isVariableChanged(), isVariableChangedByFunctionCall(), Scope::isVariableDeclaration(), isVariableInit(), isVoidStmt(), CheckStl::iterators(), CheckStl::knownEmptyContainer(), Lambda::Lambda(), CheckCondition::multiCondition(), CheckCondition::multiCondition2(), Type::name(), nextArgumentBeforeCreateLinks2(), nextTemplateArgument(), CheckNullPointer::nullConstantDereference(), parsedecl(), CheckUnusedFunctions::parseTokens(), Tokenizer::processFunc(), CheckOther::redundantBitwiseOperationInSwitchError(), Tokenizer::removeExtraTemplateKeywords(), Tokenizer::removeMacrosInGlobalScope(), Tokenizer::removeRedundantSemicolons(), Tokenizer::reportUnknownMacros(), CheckLeakAutoVar::ret(), Scope::setBodyStartEnd(), Function::setFlags(), ValueFlow::setValues(), SymbolDatabase::setValueTypeInTokenList(), setVarIdClassDeclaration(), setVarIdParseDeclaration(), Tokenizer::setVarIdPass1(), Tokenizer::setVarIdPass2(), setVarIdStructMembers(), Tokenizer::simplifyAddBracesPair(), Tokenizer::simplifyAddBracesToCommand(), Tokenizer::simplifyEmptyNamespaces(), Tokenizer::simplifyFunctionParameters(), Tokenizer::simplifyFunctionPointers(), Tokenizer::simplifyHeadersAndUnusedTemplates(), Tokenizer::simplifyIfSwitchForInit(), Tokenizer::simplifyInitVar(), Tokenizer::simplifyLabelsCaseDefault(), Tokenizer::simplifyRedundantConsecutiveBraces(), Tokenizer::simplifyRedundantParentheses(), TemplateSimplifier::simplifyTemplateAliases(), TemplateSimplifier::simplifyTemplates(), Tokenizer::simplifyTokenList1(), Tokenizer::simplifyTypedef(), Tokenizer::simplifyTypedefCpp(), Tokenizer::simplifyTypeIntrinsics(), Tokenizer::simplifyUsing(), Tokenizer::simplifyVarDecl(), singleConditionalInScope(), singleMemberCallInScope(), singleStatement(), skipBrackets(), skipBracketsAndMembers(), skipCaseLabel(), skipDecl(), skipPointers(), skipRequires(), skipTernaryOp(), splitDefinitionFromTypedef(), CheckStl::string_c_str(), CheckBufferOverrun::stringNotZeroTerminated(), CheckSizeof::suspiciousSizeofCalculation(), takeData(), TemplateSimplifier::templateParameters(), TemplateSimplifier::TokenAndName::TokenAndName(), typeDecl(), TemplateSimplifier::useDefaultArgumentValues(), CheckStl::useStlAlgorithm(), Tokenizer::validate(), valueFlowAfterMove(), valueFlowArray(), valueFlowConditionExpressions(), valueFlowContainerSetTokValue(), valueFlowContainerSize(), valueFlowForLoopSimplify(), valueFlowLifetime(), valueFlowSwitchVariable(), CheckMemoryLeakInClass::variable(), Variable::Variable(), CheckClass::virtualFunctionCallInConstructorError(), and CheckOther::warningOldStylePointerCast().
Token * Token::linkAt | ( | int | index | ) |
Definition at line 418 of file token.cpp.
References index(), and linkAtImpl().
const Token * Token::linkAt | ( | int | index | ) | const |
Definition at line 413 of file token.cpp.
References index(), and linkAtImpl().
Referenced by Function::addArguments(), SymbolDatabase::addClassFunction(), Scope::addEnum(), SymbolDatabase::addNewFunction(), ConditionHandler::afterCondition(), ValueFlowAnalyzer::analyze(), Function::argsMatch(), CheckIO::ArgumentInfo::ArgumentInfo(), Tokenizer::arraySize(), Tokenizer::arraySizeAfterValueFlow(), CheckCondition::assignIfParseScope(), ValueFlowAnalyzer::assume(), Tokenizer::calculateScopes(), CheckAutoVariables::checkAutoVariableAssignment(), CheckBoost::checkBoostForeachModification(), CheckClass::checkConstFunc(), CheckOther::checkDuplicateBranch(), CheckIO::checkFileUsage(), checkFunctionUsage(), CheckUnusedVar::checkFunctionVariableUsage(), CheckUnusedVar::checkFunctionVariableUsage_iterateScopes(), CheckString::checkIncorrectStringCompare(), CheckOther::checkInnerScope(), CheckOther::checkInvalidFree(), CheckUninitVar::checkLoopBodyRecursive(), CheckOther::checkMisusedScopedObject(), CheckMemoryLeakInFunction::checkReallocUsage(), FwdAnalysis::checkRecursive(), CheckClass::checkReturnPtrThis(), CheckUninitVar::checkRhs(), CheckUninitVar::checkScope(), CheckLeakAutoVar::checkScope(), CheckUninitVar::checkScopeForVariable(), CheckSizeof::checkSizeofForPointerSize(), CheckMemoryLeakStructMember::checkStructVariable(), CheckOther::checkUnreachableCode(), CheckClass::checkUnsafeClassRefMember(), Scope::checkVariable(), CheckOther::checkVariableScope(), CheckClass::copyconstructors(), SymbolDatabase::createSymbolDatabaseFindAllScopes(), SymbolDatabase::createSymbolDatabaseSetFunctionPointers(), Tokenizer::deleteInvalidTypedef(), CheckCondition::duplicateCondition(), Tokenizer::duplicateTypedef(), CheckStl::erase(), CheckStl::eraseCheckLoopVar(), TemplateSimplifier::expandTemplate(), SymbolDatabase::findFunction(), SymbolDatabase::findFunctionInScope(), findLambdaEndScope(), findNextTokenFromBreak(), SymbolDatabase::findScope(), findStartToken(), SymbolDatabase::findType(), SymbolDatabase::findTypeInNested(), SymbolDatabase::findVariableType(), PathAnalysis::forwardRange(), Function::Function(), CheckLeakAutoVar::functionCall(), functionThrowsRecursive(), getIteratorExpression(), TemplateSimplifier::getTemplateNamePositionTemplateFunction(), TemplateSimplifier::getTemplateNamePositionTemplateVariable(), CheckStl::if_find(), CheckClass::initializerListOrder(), CheckClass::initializeVarList(), insertToken(), CheckOther::invalidPointerCast(), isBasicForLoop(), iscast(), CheckIO::ArgumentInfo::isComplexType(), isCPPAttribute(), CheckBufferOverrun::isCtuUnsafeBufferUsage(), SymbolDatabase::isFunction(), Tokenizer::isFunctionHead(), CheckUninitVar::isFunctionParUsage(), CheckClass::isMemberVar(), isRangeForScope(), CheckUnusedVar::isRecordTypeWithoutSideEffects(), Library::isScopeNoReturn(), Tokenizer::isScopeNoReturn(), isStlStringType(), Scope::isVariableDeclaration(), CheckStl::iterators(), Tokenizer::markCppCasts(), CheckStl::missingComparison(), CheckCondition::multiCondition(), CheckCondition::multiCondition2(), parsedecl(), CheckUnusedFunctions::parseTokens(), Tokenizer::processFunc(), Tokenizer::removeMacrosInGlobalScope(), Tokenizer::removePragma(), Tokenizer::reportUnknownMacros(), setValues(), setVarIdParseDeclaration(), Tokenizer::setVarIdPass1(), Tokenizer::setVarIdPass2(), setVarIdStructMembers(), Tokenizer::simplifyAddBracesPair(), Tokenizer::simplifyExternC(), Tokenizer::simplifyFunctionPointers(), Tokenizer::simplifyHeadersAndUnusedTemplates(), Tokenizer::simplifyIfSwitchForInit(), Tokenizer::simplifyInitVar(), Tokenizer::simplifyRedundantConsecutiveBraces(), Tokenizer::simplifyRedundantParentheses(), Tokenizer::simplifyRoundCurlyParentheses(), TemplateSimplifier::simplifyTemplateInstantiations(), Tokenizer::simplifyTokenList1(), Tokenizer::simplifyTypedefCpp(), Tokenizer::simplifyTypedefLHS(), Tokenizer::simplifyUsing(), Tokenizer::simplifyVarDecl(), singleConditionalInScope(), singleMemberCallInScope(), Tokenizer::sizeofAddParentheses(), skipDecl(), skipPointers(), skipRequires(), skipScopeIdentifiers(), Tokenizer::startOfExecutableScope(), CheckStl::stlOutOfBounds(), CheckStl::string_c_str(), Type::Type(), typeDecl(), CheckStl::uselessCalls(), CheckVaarg::va_list_usage(), valueFlowContainerSize(), valueFlowForLoopSimplify(), valueFlowForLoopSimplifyAfter(), valueFlowImpossibleValues(), valueFlowSetConstantValue(), and CheckClass::virtualDestructor().
Match given token (or list of tokens) to a pattern list.
Possible patterns
multi-compare patterns such as "int|void|char" can contain %or%, %oror% and %op% it is recommended to put such an %cmd% as the first pattern. For example: "%var%|%num%|)" means yes to a variable, a number or ')'.
The patterns can be also combined to compare to multiple tokens at once by separating tokens with a space, e.g. ") const|void {" will return true if first token is ')' next token is either "const" or "void" and token after that is '{'. If even one of the tokens does not match its pattern, false is returned.
tok | List of tokens to be compared to the pattern |
pattern | The pattern against which the tokens are compared, e.g. "const" or ") const|volatile| {". |
varid | if %varid% is given in the pattern the Token::varId will be matched against this argument |
Definition at line 688 of file token.cpp.
References chrInFirstWord(), firstWordEquals(), multiCompareImpl(), next(), and str().
Referenced by accumulateBool(), accumulateBoolLiteral(), Function::addArguments(), addByOne(), SymbolDatabase::addClassFunction(), Scope::addEnum(), TemplateSimplifier::addNamespace(), SymbolDatabase::addNewFunction(), Tokenizer::addSemicolonAfterUnknownMacro(), clangimport::AstNode::addTypeTokens(), ConditionHandler::afterCondition(), CheckCondition::alwaysTrueFalse(), ValueFlowAnalyzer::analyze(), ValueFlowAnalyzer::analyzeCondition(), ValueFlowAnalyzer::analyzeMatch(), ValueFlowAnalyzer::analyzeToken(), Function::argsMatch(), CheckIO::ArgumentInfo::ArgumentInfo(), CheckBufferOverrun::argumentSize(), argumentType(), CheckIO::argumentType(), CheckNullPointer::arithmetic(), Variable::arrayDimensions(), CheckBufferOverrun::arrayIndex(), CheckBufferOverrun::arrayIndexThenCheck(), Tokenizer::arraySize(), Tokenizer::arraySizeAfterValueFlow(), assignExpr(), CheckAutoVariables::assignFunctionArg(), CheckCondition::assignIf(), CheckCondition::assignIfParseScope(), ProgramMemoryState::assume(), ValueFlowAnalyzer::assume(), astCanonicalType(), astParentSkipParens(), CheckAutoVariables::autoVariables(), ConditionHandler::beforeCondition(), bifurcate(), bifurcateVariableChanged(), CheckBufferOverrun::bufferOverflow(), Tokenizer::calculateScopes(), CheckUninitVar::check(), CheckString::checkAlwaysTrueOrFalseStringCompare(), CheckCondition::checkAssignmentInCondition(), CheckAutoVariables::checkAutoVariableAssignment(), CheckCondition::checkBadBitmaskCheck(), CheckBoost::checkBoostForeachModification(), CheckOther::checkCastIntToCharAndBack(), CheckOther::checkCharVariable(), CheckOther::checkCommaSeparatedReturn(), CheckOther::checkComparePointers(), CheckOther::checkComparisonFunctionIsAlwaysTrueOrFalse(), CheckBool::checkComparisonOfBoolExpressionWithInt(), TemplateSimplifier::checkComplicatedSyntaxErrorsInTemplates(), Tokenizer::checkConfiguration(), CheckClass::checkConst(), CheckClass::checkConstFunc(), CheckOther::checkConstPointer(), CheckOther::checkConstVariable(), CheckIO::checkCoutCerrMisusage(), CheckStl::checkDereferenceInvalidIterator2(), CheckCondition::checkDuplicateConditionalAssign(), CheckOther::checkDuplicateExpression(), CheckOther::checkEvaluationOrder(), CheckUninitVar::checkExpr(), CheckIO::checkFileUsage(), CheckStl::checkFindInsert(), CheckType::checkFloatToIntegerOverflow(), Tokenizer::checkForEnumsWithTypedef(), CheckIO::checkFormatString(), CheckMemoryLeakNoVar::checkForUnreleasedInputArgument(), CheckMemoryLeakNoVar::checkForUnsafeArgAlloc(), CheckMemoryLeakNoVar::checkForUnusedReturnValue(), CheckOther::checkFuncArgNamesDifferent(), checkFunctionUsage(), CheckUnusedVar::checkFunctionVariableUsage(), CheckUnusedVar::checkFunctionVariableUsage_iterateScopes(), CheckUninitVar::checkIfForWhileHead(), CheckFunctions::checkIgnoredReturnValue(), CheckOther::checkIncompleteArrayFill(), CheckOther::checkIncompleteStatement(), CheckCondition::checkIncorrectLogicOperator(), CheckString::checkIncorrectStringCompare(), CheckOther::checkInnerScope(), CheckOther::checkInterlockedDecrement(), CheckOther::checkInvalidFree(), CheckCondition::checkInvalidTestForOverflow(), CheckStl::checkIteratorPair(), CheckOther::checkKnownArgument(), CheckOther::checkKnownPointerToBool(), CheckFunctions::checkLibraryMatchFunctions(), CheckType::checkLongCast(), CheckUninitVar::checkLoopBodyRecursive(), CheckFunctions::checkMathFunctions(), CheckClass::checkMemset(), CheckClass::checkMemsetType(), CheckFunctions::checkMissingReturn(), checkMissingReturnScope(), CheckOther::checkMisusedScopedObject(), CheckCondition::checkModuloAlwaysTrueFalse(), CheckStl::checkMutexes(), CheckOther::checkNanInArithmeticExpression(), CheckOther::checkNegativeBitwiseShift(), CheckOther::checkOverlappingWrite(), CheckFunctions::checkProhibitedFunctions(), CheckMemoryLeakInClass::checkPublicFunctions(), CheckMemoryLeakInFunction::checkReallocUsage(), FwdAnalysis::checkRecursive(), CheckOther::checkRedundantAssignment(), CheckOther::checkRedundantCopy(), CheckExceptionSafety::checkRethrowCopy(), CheckClass::checkReturnPtrThis(), checkReturns(), CheckUninitVar::checkRhs(), CheckUninitVar::checkScope(), CheckLeakAutoVar::checkScope(), CheckUninitVar::checkScopeForVariable(), CheckClass::checkSelfInitialization(), CheckType::checkSignConversion(), CheckSizeof::checkSizeofForArrayParameter(), CheckSizeof::checkSizeofForNumericParameter(), CheckSizeof::checkSizeofForPointerSize(), CheckUninitVar::checkStruct(), CheckUnusedVar::checkStructMemberUsage(), CheckMemoryLeakStructMember::checkStructVariable(), CheckOther::checkSuspiciousCaseInSwitch(), CheckString::checkSuspiciousStringCompare(), CheckClass::checkThisUseAfterFree(), CheckClass::checkThisUseAfterFreeRecursive(), CheckLeakAutoVar::checkTokenInsideExpression(), CheckType::checkTooBigBitwiseShift(), CheckOther::checkUnreachableCode(), CheckClass::checkUnsafeClassRefMember(), CheckOther::checkUnusedLabel(), CheckOther::checkVarFuncNullUB(), Scope::checkVariable(), checkVariableCallMatch(), CheckOther::checkVariableScope(), CheckAutoVariables::checkVarLifetimeScope(), CheckIO::checkWrongPrintfScanfArguments(), CheckOther::clarifyCalculation(), CheckCondition::clarifyCondition(), CheckOther::clarifyStatement(), Tokenizer::combineOperators(), Tokenizer::combineStringAndCharLiterals(), CheckCondition::comparison(), CheckOther::comparisonNonZeroExpressionLessThanZero(), Tokenizer::concatenateNegativeNumberAndAnyPositive(), conditionString(), CheckClass::constructors(), CheckOther::constStatementError(), containerAppendsElement(), containerPopsElement(), containerYieldsElement(), CheckClass::copyconstructors(), TokenList::copyTokens(), Summaries::create(), Tokenizer::createLinks2(), clangimport::AstNode::createScope(), SymbolDatabase::createSymbolDatabaseExprIds(), SymbolDatabase::createSymbolDatabaseFindAllScopes(), SymbolDatabase::createSymbolDatabaseFunctionReturnTypes(), SymbolDatabase::createSymbolDatabaseIncompleteVars(), SymbolDatabase::createSymbolDatabaseSetFunctionPointers(), SymbolDatabase::createSymbolDatabaseSetVariablePointers(), SymbolDatabase::createSymbolDatabaseVariableSymbolTable(), createTokenFromExpression(), clangimport::AstNode::createTokens(), CheckExceptionSafety::deallocThrow(), Variable::declEndToken(), Library::detectContainerInternal(), Library::detectSmartPointer(), CheckUninitVar::diag(), CheckCondition::diag(), doAssignment(), TemplateSimplifier::TokenAndName::dump(), Tokenizer::dump(), CheckOther::duplicateExpressionError(), Tokenizer::duplicateTypedef(), ValueFlow::eitherTheConditionIsRedundant(), Tokenizer::elseif(), CheckStl::erase(), CheckStl::eraseCheckLoopVar(), Variable::evaluate(), ValueFlowAnalyzer::evaluateInt(), TemplateSimplifier::expandTemplate(), exprDependsOnThis(), ExpressionAnalyzer::ExpressionAnalyzer(), extractForLoopValues(), fillProgramMemoryFromAssignments(), findAllocFuncCallToken(), findClosingBracket(), findEndOfFunctionCallForParameter(), SymbolDatabase::findEnumerator(), findExpressionStartEndTokens(), findFormat(), SymbolDatabase::findFunction(), Scope::findFunction(), SymbolDatabase::findFunctionInScope(), findInsertValue(), findLambdaEndScope(), findLambdaEndTokenGeneric(), findmatchImpl(), findOpeningBracket(), findStartToken(), findTemplateDeclarationEndImpl(), findTokensSkipDeadCodeImpl(), SymbolDatabase::findType(), findTypeEnd(), SymbolDatabase::findTypeInNested(), findUnmatchedTernaryOp(), SymbolDatabase::findVariableType(), TemplateSimplifier::fixForwardDeclaredDefaultArgumentValues(), followAllReferences(), followVariableExpression(), PathAnalysis::forwardRange(), Function::Function(), CheckLeakAutoVar::functionCall(), CheckMemoryLeak::functionReturnType(), CheckMemoryLeak::getAllocationType(), getArgumentPos(), getArgumentStart(), getArgumentVars(), getAstParentSkipPossibleCastAndAddressOf(), getBufAndOffset(), getCastTypeStartToken(), Library::getContainerFromAction(), getContainerFromSize(), Library::getContainerFromYield(), getContainerFunction(), getContainerIndex(), getContainerName(), getContainerYield(), ConditionHandler::Condition::getContextAndValues(), CheckMemoryLeak::getDeallocationType(), getDimensionsEtc(), getEnableIfReturnType(), getExpression(), getExprUsage(), CheckClass::getFileInfo(), getFunction(), getFunctionArgumentValues(), Library::getFunctionName(), getFunctionToken(), getFunctionUsage(), getFuncTokFromThis(), getIncompleteNameID(), getInitTokImpl(), getInvalidMethod(), getIteratorExpression(), getLHSVariableRecursive(), getLHSVariables(), getLHSVariablesRecursive(), getLHSVariableToken(), getLifetimeTokens(), TemplateSimplifier::getNewName(), Function::getOverriddenFunctionRecursive(), getOverrunIndexValues(), getParentValueTypes(), CheckMemoryLeak::getReallocationType(), getSingleFunctionCall(), getStepTokImpl(), TemplateSimplifier::getTemplateDeclarations(), TemplateSimplifier::getTemplateInstantiations(), TemplateSimplifier::getTemplateNamePosition(), TemplateSimplifier::getTemplateNamePositionTemplateClass(), TemplateSimplifier::getTemplateNamePositionTemplateFunction(), TemplateSimplifier::getTemplateNamePositionTemplateVariable(), TemplateSimplifier::getTemplateParametersInDeclaration(), getTokenArgumentFunctionImpl(), gettokenlistfromvalid(), Variable::getTypeName(), getTypeString(), getUnsafeFunction(), getVariableInitExpression(), Scope::getVariableList(), getVariableValues(), CheckClass::getVirtualFunctionCalls(), CheckClass::hasAllocation(), hasFunctionCall(), hasNoreturnFunction(), CheckStl::if_find(), ifvar(), inBooleanFunction(), Type::initBaseInfo(), CheckClass::initializationListUsage(), CheckClass::initializerListOrder(), CheckClass::initializeVarList(), Tokenizer::initVar(), insertToken(), TokenList::insertTokens(), TemplateSimplifier::instantiateMatch(), CheckStl::invalidContainer(), CheckFunctions::invalidFunctionUsage(), CheckOther::invalidPointerCast(), CheckIO::invalidScanf(), isAddressOfLocalVariable(), CheckCondition::isAliased(), isAliased(), ValueFlowAnalyzer::isAliasModified(), CheckIO::ArgumentInfo::isArrayOrPointer(), isAutoVar(), isBool(), isBreakOrContinueScope(), isCalculation(), isCallFunction(), iscast(), isClassStructUnionEnumStart(), isComputableValue(), isConditionKnown(), isConstant(), isConstFunctionCall(), isConstStatement(), isConstTop(), isConstVarExpression(), CheckStl::isContainerSize(), ValueFlow::isContainerSizeChanged(), isContainerSizeChangedByFunction(), isConvertedToBool(), CheckBufferOverrun::isCtuUnsafeBufferUsage(), isDanglingSubFunction(), isEnumDefinition(), isEnumScope(), isEnumStart(), isEscaped(), isEscapedOrJump(), isEscapeFunction(), isExecutableScope(), isExpression(), isExpressionChangedAt(), Library::isFloatArgValid(), isForwardJump(), SymbolDatabase::isFunction(), isFunctionCall(), Tokenizer::isFunctionHead(), isFunctionOrBreakPattern(), CheckUninitVar::isFunctionParUsage(), isGlobalData(), ValueFlowAnalyzer::isGlobalModified(), isInConstructorList(), isInitialVarAssign(), isInLoopCondition(), Library::isIntArgValid(), isIntegralOnlyOperator(), isIntegralOrPointer(), isIterator(), CheckIO::ArgumentInfo::isKnownType(), isLikelyStream(), isLikelyStreamRead(), isLocalVarNoAutoDealloc(), isLockGuard(), isLowerEqualThanMulDiv(), isLowerThanLogicalAnd(), isLowerThanMulDiv(), isLowerThanPlusMinus(), CheckMemoryLeakStructMember::isMalloc(), isMapFind(), Tokenizer::isMemberFunction(), CheckClass::isMemberVar(), CheckUninitVar::isMemberVariableAssignment(), CheckUninitVar::isMemberVariableUsage(), ValueFlowAnalyzer::isModified(), ContainerExpressionAnalyzer::isModified(), isMutex(), isNonInvertibleOperation(), isNullOperand(), isOpenParenthesisMemberFunctionCallOfVarId(), CheckCondition::isOverlappingCond(), isParameterChanged(), CheckNullPointer::isPointerDeRef(), isPointerReleased(), CheckUnusedVar::isRecordTypeWithoutSideEffects(), CheckMemoryLeak::isReopenStandardStream(), isReturnScope(), isSameConstantValue(), isSameExpression(), ValueFlowAnalyzer::isSameSymbolicValue(), isScopeBracket(), Library::isScopeNoReturn(), isSimpleExpr(), CheckIO::ArgumentInfo::isStdContainer(), isStdMoveOrStdForwarded(), CheckIO::ArgumentInfo::isStdVectorOrString(), isStlStringType(), isStructuredBindingVariable(), isTemporary(), isThisChanged(), isType(), isUnchanged(), isUnevaluated(), isUnknownType(), isUsedAsBool(), isVariableChanged(), isVariableChangedByFunctionCall(), isVariableDecl(), Scope::isVariableDeclaration(), isVariableMutableInInitializer(), isVariablesChanged(), CheckUninitVar::isVariableUsage(), isVariableUsed(), isVoidStmt(), ValueFlowAnalyzer::isWritable(), ContainerExpressionAnalyzer::isWritable(), CheckStl::iterators(), CheckStl::knownEmptyContainer(), Lambda::Lambda(), Tokenizer::markCppCasts(), matchMemberFunctionName(), matchMemberName(), matchMemberVarName(), TemplateSimplifier::matchSpecialization(), CheckFunctions::memsetInvalid2ndParam(), CheckFunctions::memsetZeroBytes(), minmaxCompare(), minUnsignedValue(), CheckStl::mismatchingContainerIterator(), CheckStl::mismatchingContainers(), CheckStl::missingComparison(), CheckCondition::multiCondition2(), Type::name(), CheckBufferOverrun::negativeArraySize(), CheckStl::negativeIndex(), nextAfterAstRightmostLeafGeneric(), nextArgumentBeforeCreateLinks2(), nextArgumentImpl(), nextTemplateArgument(), notvar(), CheckNullPointer::nullConstantDereference(), CheckNullPointer::nullPointerByDeRefAndChec(), CheckClass::operatorEqToSelf(), CheckStl::outOfBoundsIndexExpression(), CheckString::overlappingStrcmp(), SimpleConditionHandler::parse(), IteratorConditionHandler::parse(), SymbolicConditionHandler::parse(), ContainerConditionHandler::parse(), clangimport::parseClangAstDump(), parsedecl(), CheckNullPointer::parseFunctionCall(), CheckUnusedFunctions::parseTokens(), CheckBool::pointerArithBoolCond(), CheckBufferOverrun::pointerArithmetic(), Check64BitPortability::pointerassignment(), FwdAnalysis::possiblyAliased(), CheckPostfixOperator::postfixOperator(), SymbolDatabase::printOut(), Tokenizer::processFunc(), programMemoryParseCondition(), CheckOther::redundantBitwiseOperationInSwitchError(), CheckStl::redundantCondition(), Tokenizer::removeExtraTemplateKeywords(), Tokenizer::removeMacroInClassDef(), Tokenizer::removeMacrosInGlobalScope(), TemplateSimplifier::replaceTemplateUsage(), Tokenizer::reportUnknownMacros(), CheckLeakAutoVar::ret(), CheckFunctions::returnLocalStdMove(), Function::returnsReference(), CheckBool::returnValueOfFunctionReturningBool(), Scope::Scope(), SymbolDatabase::setArrayDimensionsUsingValueFlow(), setConditionalValues(), Function::setFlags(), setTokenValue(), ExpressionAnalyzer::setupExprVarIds(), setValueBound(), ValueFlow::setValues(), Variable::setValueType(), SymbolDatabase::setValueType(), SymbolDatabase::setValueTypeInTokenList(), setVarIdClassDeclaration(), Tokenizer::setVarIdClassFunction(), setVarIdParseDeclaration(), Tokenizer::setVarIdPass1(), Tokenizer::setVarIdPass2(), setVarIdStructMembers(), Tokenizer::simplifyAddBracesPair(), Tokenizer::simplifyAddBracesToCommand(), Tokenizer::simplifyArrayAccessSyntax(), TemplateSimplifier::simplifyCalculations(), Tokenizer::simplifyCAlternativeTokens(), Tokenizer::simplifyCaseRange(), Tokenizer::simplifyEmptyNamespaces(), Tokenizer::simplifyExternC(), Tokenizer::simplifyFunctionParameters(), Tokenizer::simplifyFunctionPointers(), Tokenizer::simplifyHeadersAndUnusedTemplates(), Tokenizer::simplifyIfSwitchForInit(), Tokenizer::simplifyInitVar(), Tokenizer::simplifyLabelsCaseDefault(), TemplateSimplifier::simplifyNumericCalculations(), Tokenizer::simplifyParameterVoid(), Tokenizer::simplifyPointerToStandardType(), Tokenizer::simplifyRedundantParentheses(), Tokenizer::simplifyRoundCurlyParentheses(), Tokenizer::simplifyStaticConst(), TemplateSimplifier::simplifyTemplateAliases(), TemplateSimplifier::simplifyTemplateArgs(), TemplateSimplifier::simplifyTemplateInstantiations(), TemplateSimplifier::simplifyTemplates(), Tokenizer::simplifyTokenList1(), Tokenizer::simplifyTypedef(), Tokenizer::simplifyTypedefCpp(), Tokenizer::simplifyTypedefLHS(), Tokenizer::simplifyTypeIntrinsics(), Tokenizer::simplifyUsing(), Tokenizer::simplifyUsingToTypedef(), Tokenizer::simplifyVarDecl(), Tokenizer::simplifyVariableMultipleAssign(), singleAssignInScope(), singleIncrementInScope(), singleMemberCallInScope(), CheckStl::size(), Tokenizer::sizeofAddParentheses(), CheckSizeof::sizeofsizeof(), CheckSizeof::sizeofVoid(), skipBracketsAndMembers(), skipCaseLabel(), skipCVRefs(), skipDecl(), skipEnumBody(), skipInitializerList(), skipLocalVars(), skipMembers(), ConditionHandler::skipNotAndCasts(), skipPointers(), skipPointersAndQualifiers(), skipRequires(), skipScopeIdentifiers(), skipTernaryOp(), Variable::smartPointerType(), ValueFlow::solveExprValue(), splitDefinitionFromTypedef(), Tokenizer::splitTemplateRightAngleBrackets(), CheckString::sprintfOverlappingData(), Tokenizer::startOfExecutableScope(), CheckStl::stlBoundaries(), CheckStl::stlOutOfBounds(), CheckStl::string_c_str(), stringFromTokenRange(), CheckString::stringLiteralWrite(), MemberExpressionAnalyzer::submatch(), CheckSizeof::suspiciousSizeofCalculation(), TemplateSimplifier::templateParameters(), TemplateSimplifier::TokenAndName::TokenAndName(), tokenIsFunctionReturningBool(), ConditionHandler::traverseCondition(), typeDecl(), typeOf(), TemplateSimplifier::useDefaultArgumentValues(), useFunctionArgs(), CheckStl::uselessCalls(), CheckFunctions::useStandardLibrary(), CheckStl::useStlAlgorithm(), usingNamespace(), CheckVaarg::va_list_usage(), Tokenizer::validate(), Tokenizer::validateC(), valueFlowAfterMove(), valueFlowArray(), valueFlowArrayBool(), valueFlowArrayElement(), valueFlowConditionExpressions(), valueFlowContainerSetTokValue(), valueFlowContainerSize(), valueFlowDynamicBufferSize(), valueFlowForLoopSimplify(), valueFlowForwardAssign(), valueFlowForwardLifetime(), valueFlowFunctionDefaultParameter(), valueFlowFunctionReturn(), valueFlowGlobalConstVar(), valueFlowGlobalStaticVar(), valueFlowImpossibleValues(), valueFlowInferCondition(), valueFlowLifetime(), valueFlowLifetimeClassConstructor(), valueFlowLifetimeConstructor(), valueFlowLifetimeFunction(), valueFlowNumber(), valueFlowSameExpressions(), valueFlowSetConditionToKnown(), valueFlowSetConstantValue(), valueFlowSmartPointer(), valueFlowSubFunction(), valueFlowSwitchVariable(), valueFlowSymbolicInfer(), valueFlowSymbolicOperators(), CheckUninitVar::valueFlowUninit(), valueFlowUninit(), CheckMemoryLeakInClass::variable(), Variable::Variable(), CheckClass::virtualDestructor(), CheckClass::virtualFunctionCallInConstructorError(), CheckOther::warningOldStylePointerCast(), and ContainerExpressionAnalyzer::writeValue().
Move srcStart and srcEnd tokens and all tokens between them into new a location.
Only links between tokens are changed.
srcStart | This is the first token to be moved |
srcEnd | The last token to be moved |
newLocation | srcStart will be placed after this token. |
[newLocation] -> b -> c -> [srcStart] -> [srcEnd] -> f
Definition at line 834 of file token.cpp.
References mImpl, TokenImpl::mProgressValue, next(), and previous().
Referenced by Tokenizer::simplifyAddBracesPair().
|
staticprivate |
Needle is build from multiple alternatives.
If one of them is equal to haystack, return value is 1. If there are no matches, but one alternative to needle is empty string, return value is 0. If needle was not found, return value is -1.
tok | Current token (needle) |
haystack | e.g. "one|two" or "|one|two" |
varid | optional varid of token |
Definition at line 626 of file token.cpp.
References multiCompareImpl().
|
inline |
Definition at line 830 of file token.h.
Referenced by Function::addArguments(), SymbolDatabase::addClassFunction(), Scope::addEnum(), TemplateSimplifier::addInstantiation(), SymbolDatabase::addNewFunction(), Tokenizer::addSemicolonAfterUnknownMacro(), CheckCondition::alwaysTrueFalse(), ValueFlowAnalyzer::analyzeMatch(), Function::argsMatch(), CheckIO::ArgumentInfo::ArgumentInfo(), CheckBufferOverrun::argumentSize(), CheckIO::argumentType(), CheckNullPointer::arithmetic(), Variable::arrayDimensions(), CheckBufferOverrun::arrayIndex(), CheckBufferOverrun::arrayIndexThenCheck(), Tokenizer::arraySize(), Tokenizer::arraySizeAfterValueFlow(), CheckAssert::assertWithSideEffects(), CheckAutoVariables::assignFunctionArg(), CheckCondition::assignIf(), CheckCondition::assignIfParseScope(), assignIndexes(), assignProgressValues(), CheckAutoVariables::autoVariables(), bifurcateVariableChanged(), CheckBufferOverrun::bufferOverflow(), TokenList::calculateHash(), Tokenizer::calculateScopes(), CheckUninitVar::check(), FwdAnalysis::check(), CheckOther::checkAccessOfMovedVariable(), CheckString::checkAlwaysTrueOrFalseStringCompare(), CheckBool::checkAssignBoolToFloat(), CheckBool::checkAssignBoolToPointer(), CheckCondition::checkAssignmentInCondition(), CheckAutoVariables::checkAutoVariableAssignment(), CheckCondition::checkBadBitmaskCheck(), CheckBool::checkBitwiseOnBoolean(), CheckBoost::checkBoostForeachModification(), CheckOther::checkCastIntToCharAndBack(), CheckOther::checkCharVariable(), CheckOther::checkCommaSeparatedReturn(), CheckOther::checkComparePointers(), CheckCondition::checkCompareValueOutOfTypeRange(), CheckOther::checkComparisonFunctionIsAlwaysTrueOrFalse(), CheckBool::checkComparisonOfBoolExpressionWithInt(), CheckBool::checkComparisonOfBoolWithBool(), CheckBool::checkComparisonOfBoolWithInt(), CheckBool::checkComparisonOfFuncReturningBool(), TemplateSimplifier::checkComplicatedSyntaxErrorsInTemplates(), Tokenizer::checkConfiguration(), CheckClass::checkConst(), CheckClass::checkConstFunc(), CheckOther::checkConstPointer(), CheckOther::checkConstVariable(), CheckIO::checkCoutCerrMisusage(), CheckStl::checkDereferenceInvalidIterator(), CheckStl::checkDereferenceInvalidIterator2(), CheckOther::checkDuplicateBranch(), CheckCondition::checkDuplicateConditionalAssign(), CheckOther::checkDuplicateExpression(), CheckOther::checkEvaluationOrder(), CppCheck::checkFile(), CheckIO::checkFileUsage(), CheckStl::checkFindInsert(), CheckType::checkFloatToIntegerOverflow(), Tokenizer::checkForEnumsWithTypedef(), CheckMemoryLeakNoVar::checkForUnreleasedInputArgument(), CheckMemoryLeakNoVar::checkForUnsafeArgAlloc(), CheckMemoryLeakNoVar::checkForUnusedReturnValue(), CheckOther::checkFuncArgNamesDifferent(), checkFunctionUsage(), CheckUnusedVar::checkFunctionVariableUsage(), CheckUnusedVar::checkFunctionVariableUsage_iterateScopes(), CheckUninitVar::checkIfForWhileHead(), CheckFunctions::checkIgnoredReturnValue(), CheckOther::checkIncompleteArrayFill(), CheckOther::checkIncompleteStatement(), CheckCondition::checkIncorrectLogicOperator(), CheckString::checkIncorrectStringCompare(), CheckBool::checkIncrementBoolean(), CheckOther::checkInnerScope(), CheckType::checkIntegerOverflow(), CheckOther::checkInterlockedDecrement(), CheckOther::checkInvalidFree(), CheckCondition::checkInvalidTestForOverflow(), CheckOther::checkKnownArgument(), CheckOther::checkKnownPointerToBool(), CheckFunctions::checkLibraryMatchFunctions(), CheckType::checkLongCast(), CheckUninitVar::checkLoopBodyRecursive(), CheckFunctions::checkMathFunctions(), CheckClass::checkMemset(), checkMissingReturnScope(), CheckOther::checkMisusedScopedObject(), CheckCondition::checkModuloAlwaysTrueFalse(), CheckOther::checkModuloOfOne(), CheckStl::checkMutexes(), CheckOther::checkNanInArithmeticExpression(), CheckOther::checkNegativeBitwiseShift(), CheckOther::checkOverlappingWrite(), CheckCondition::checkPointerAdditionResultNotNull(), CheckFunctions::checkProhibitedFunctions(), CheckMemoryLeakInClass::checkPublicFunctions(), CheckMemoryLeakInFunction::checkReallocUsage(), FwdAnalysis::checkRecursive(), CheckOther::checkRedundantAssignment(), CheckOther::checkRedundantCopy(), CheckOther::checkRedundantPointerOp(), CheckExceptionSafety::checkRethrowCopy(), CheckClass::checkReturnPtrThis(), CheckUninitVar::checkRhs(), CheckUninitVar::checkScope(), CheckLeakAutoVar::checkScope(), CheckUninitVar::checkScopeForVariable(), CheckClass::checkSelfInitialization(), CheckType::checkSignConversion(), CheckOther::checkSignOfUnsignedVariable(), CheckSizeof::checkSizeofForArrayParameter(), CheckSizeof::checkSizeofForNumericParameter(), CheckSizeof::checkSizeofForPointerSize(), CheckUninitVar::checkStruct(), CheckUnusedVar::checkStructMemberUsage(), CheckMemoryLeakStructMember::checkStructVariable(), CheckOther::checkSuspiciousCaseInSwitch(), CheckString::checkSuspiciousStringCompare(), CheckClass::checkThisUseAfterFree(), CheckClass::checkThisUseAfterFreeRecursive(), CheckType::checkTooBigBitwiseShift(), CheckOther::checkUnreachableCode(), CheckClass::checkUnsafeClassRefMember(), CheckOther::checkUnusedLabel(), CheckOther::checkVarFuncNullUB(), Scope::checkVariable(), CheckOther::checkVariableScope(), CheckAutoVariables::checkVarLifetimeScope(), CheckIO::checkWrongPrintfScanfArguments(), CheckOther::checkZeroDivision(), CheckOther::clarifyCalculation(), CheckCondition::clarifyCondition(), CheckOther::clarifyStatement(), Tokenizer::combineOperators(), Tokenizer::combineStringAndCharLiterals(), compareTokenRanges(), CheckCondition::comparison(), Tokenizer::concatenateNegativeNumberAndAnyPositive(), CheckClass::constructors(), CheckClass::copyconstructors(), TokenList::copyTokens(), countPar(), Summaries::create(), Tokenizer::createLinks(), Tokenizer::createLinks2(), clangimport::AstNode::createScope(), SymbolDatabase::createSymbolDatabaseEnums(), SymbolDatabase::createSymbolDatabaseExprIds(), SymbolDatabase::createSymbolDatabaseFindAllScopes(), SymbolDatabase::createSymbolDatabaseFunctionReturnTypes(), SymbolDatabase::createSymbolDatabaseIncompleteVars(), SymbolDatabase::createSymbolDatabaseSetFunctionPointers(), SymbolDatabase::createSymbolDatabaseSetScopePointers(), SymbolDatabase::createSymbolDatabaseSetTypePointers(), SymbolDatabase::createSymbolDatabaseSetVariablePointers(), SymbolDatabase::createSymbolDatabaseVariableSymbolTable(), createTokenFromExpression(), clangimport::AstNode::createTokens(), clangimport::AstNode::createTokensFunctionDecl(), clangimport::AstNode::createTokensVarDecl(), CheckExceptionSafety::deallocThrow(), SymbolDatabase::debugSymbolDatabase(), Variable::declEndToken(), Tokenizer::deleteInvalidTypedef(), deleteNext(), deletePrevious(), TemplateSimplifier::deleteToken(), TokenList::deleteTokens(), CheckExceptionSafety::destructors(), Library::detectSmartPointer(), doAssignment(), Tokenizer::dump(), CheckCondition::duplicateCondition(), Tokenizer::duplicateTypedef(), ValueFlow::eitherTheConditionIsRedundant(), Tokenizer::elseif(), endOfExpression(), CheckStl::eraseCheckLoopVar(), CheckStl::eraseIteratorOutOfBounds(), TemplateSimplifier::eraseTokens(), eraseTokens(), Variable::evaluate(), TemplateSimplifier::expandTemplate(), extractForLoopValues(), findClosingBracket(), findExpression(), SymbolDatabase::findFunction(), Scope::findFunction(), SymbolDatabase::findFunctionInScope(), findIncompleteVar(), findLambdaEndScope(), findmatchImpl(), findNextTokenFromBreak(), Function::findReturns(), SymbolDatabase::findScope(), findsimplematchImpl(), findThisChanged(), SymbolDatabase::findType(), findTypeEnd(), SymbolDatabase::findTypeInNested(), findUnmatchedTernaryOp(), findVarBound(), findVariableChanged(), TemplateSimplifier::fixForwardDeclaredDefaultArgumentValues(), followVariableExpression(), ConditionHandler::forward(), PathAnalysis::forwardRange(), Function::Function(), CheckLeakAutoVar::functionCall(), CheckMemoryLeak::functionReturnType(), functionThrowsRecursive(), CheckMemoryLeak::getAllocationType(), getArgumentPos(), getArgumentStart(), getCastTypeStartToken(), getContainerFunction(), CheckMemoryLeak::getDeallocationType(), getEnableIfReturnType(), getEndOfVarScope(), getEnumType(), getExpression(), CTU::getFileInfo(), CheckClass::getFileInfo(), getFunctionArguments(), Library::getFunctionName(), getFunctionToken(), getFunctionUsage(), getFuncTokFromThis(), getIteratorExpression(), getLHSVariableRecursive(), getLHSVariablesRecursive(), getLoopContainer(), TemplateSimplifier::getNewName(), getPointerDepth(), CheckMemoryLeak::getReallocationType(), getSingleFunctionCall(), getSingleReturnVar(), TemplateSimplifier::getTemplateDeclarations(), TemplateSimplifier::getTemplateInstantiations(), TemplateSimplifier::getTemplateNamePositionTemplateClass(), TemplateSimplifier::getTemplateNamePositionTemplateFunction(), TemplateSimplifier::getTemplateNamePositionTemplateVariable(), TemplateSimplifier::getTemplateParametersInDeclaration(), gettokenlistfromvalid(), ValueFlowPassRunner::getTotalValues(), getTypeString(), getUnsafeFunction(), getVariableChangedStart(), Scope::getVariableList(), getVariableValues(), goToLeftParenthesis(), CheckClass::hasAllocation(), CheckClass::hasAssignSelf(), hasToken(), CheckStl::if_find(), ifvar(), inBooleanFunction(), Type::initBaseInfo(), CheckClass::initializationListUsage(), CheckClass::initializerListOrder(), CheckClass::initializeVarList(), Tokenizer::initVar(), insertToken(), TokenList::insertTokens(), TemplateSimplifier::instantiateMatch(), invalidateForwardDecls(), invalidateInst(), CheckStl::invalidContainer(), CheckFunctions::invalidFunctionUsage(), CheckOther::invalidPointerCast(), CheckIO::invalidScanf(), CheckCondition::isAliased(), isAliased(), TemplateSimplifier::TokenAndName::isAliasToken(), isAlignAttribute(), CheckIO::ArgumentInfo::isArrayOrPointer(), isCallFunction(), iscast(), isConstExpression(), isConstFunctionCall(), isConstStatement(), isContainerSizeChanged(), CheckBufferOverrun::isCtuUnsafeBufferUsage(), isEarlyExit(), isEnumDefinition(), Library::isFloatArgValid(), isForwardJump(), SymbolDatabase::isFunction(), isFunctionCall(), Tokenizer::isFunctionHead(), CheckUnusedVar::isFunctionWithoutSideEffects(), ValueFlowAnalyzer::isGlobalModified(), Library::isIntArgValid(), CheckMemoryLeakStructMember::isMalloc(), CheckUninitVar::isMemberVariableUsage(), isNonConstFunctionCall(), isNotEqual(), isOpenParenthesisMemberFunctionCallOfVarId(), isPointerReleased(), CheckUnusedVar::isRecordTypeWithoutSideEffects(), isSameExpression(), isTemporary(), isUnchanged(), isUnknownType(), isVariableChanged(), isVariableChangedByFunctionCall(), isVariableDecl(), Scope::isVariableDeclaration(), isVariableInit(), isVariableMutableInInitializer(), isVariablesChanged(), CheckStl::iterators(), CheckStl::knownEmptyContainer(), Lambda::Lambda(), Tokenizer::markCppCasts(), SuppressionList::markUnmatchedInlineSuppressionsAsChecked(), Match(), matchMemberName(), matchMemberVarName(), TemplateSimplifier::matchSpecialization(), matchTemplateParameters(), CheckFunctions::memsetInvalid2ndParam(), CheckFunctions::memsetZeroBytes(), CheckStl::mismatchingContainerIterator(), CheckStl::mismatchingContainers(), CheckStl::missingComparison(), move(), CheckCondition::multiCondition(), CheckCondition::multiCondition2(), Type::name(), CheckBufferOverrun::negativeArraySize(), CheckStl::negativeIndex(), nextArgumentBeforeCreateLinks2(), nextTemplateArgument(), CheckNullPointer::nullConstantDereference(), CheckNullPointer::nullPointerByDeRefAndChec(), numberOfArgumentsWithoutAst(), CheckBufferOverrun::objectIndex(), CheckStl::outOfBounds(), CheckStl::outOfBoundsIndexExpression(), CheckString::overlappingStrcmp(), clangimport::parseClangAstDump(), parsedecl(), CheckUnusedFunctions::parseTokens(), CheckBool::pointerArithBool(), CheckBufferOverrun::pointerArithmetic(), Check64BitPortability::pointerassignment(), CheckPostfixOperator::postfixOperator(), Tokenizer::printDebugOutput(), printLines(), SymbolDatabase::printOut(), TemplateSimplifier::printOut(), printValueFlow(), SymbolDatabase::printVariable(), Tokenizer::processFunc(), programMemoryParseCondition(), CheckOther::redundantBitwiseOperationInSwitchError(), Tokenizer::removeExtraTemplateKeywords(), Tokenizer::removeMacroInClassDef(), Tokenizer::removeMacrosInGlobalScope(), Tokenizer::removePragma(), Tokenizer::removeRedundantSemicolons(), TemplateSimplifier::removeTemplate(), replace(), TemplateSimplifier::replaceTemplateUsage(), Tokenizer::reportUnknownMacros(), CheckLeakAutoVar::ret(), CheckExceptionSafety::rethrowNoCurrentException(), CheckBool::returnValueOfFunctionReturningBool(), Scope::Scope(), SymbolDatabase::setArrayDimensionsUsingValueFlow(), setTokenValue(), setTypes(), ExpressionAnalyzer::setupExprVarIds(), setValues(), ValueFlow::setValues(), Variable::setValueType(), SymbolDatabase::setValueType(), SymbolDatabase::setValueTypeInTokenList(), Tokenizer::setVarId(), setVarIdClassDeclaration(), Tokenizer::setVarIdClassFunction(), setVarIdParseDeclaration(), Tokenizer::setVarIdPass1(), Tokenizer::setVarIdPass2(), setVarIdStructMembers(), simpleMatch(), Tokenizer::simplifyAddBraces(), Tokenizer::simplifyAddBracesPair(), Tokenizer::simplifyAddBracesToCommand(), Tokenizer::simplifyArrayAccessSyntax(), TemplateSimplifier::simplifyCalculations(), Tokenizer::simplifyCAlternativeTokens(), Tokenizer::simplifyCaseRange(), Tokenizer::simplifyDoublePlusAndDoubleMinus(), Tokenizer::simplifyEmptyNamespaces(), Tokenizer::simplifyExternC(), Tokenizer::simplifyFunctionParameters(), Tokenizer::simplifyFunctionPointers(), Tokenizer::simplifyHeadersAndUnusedTemplates(), Tokenizer::simplifyIfSwitchForInit(), Tokenizer::simplifyInitVar(), Tokenizer::simplifyLabelsCaseDefault(), TemplateSimplifier::simplifyNumericCalculations(), Tokenizer::simplifyParameterVoid(), Tokenizer::simplifyPointerToStandardType(), Tokenizer::simplifyRedundantConsecutiveBraces(), Tokenizer::simplifyRedundantParentheses(), Tokenizer::simplifyRoundCurlyParentheses(), Tokenizer::simplifySQL(), Tokenizer::simplifyStaticConst(), TemplateSimplifier::simplifyTemplateAliases(), TemplateSimplifier::simplifyTemplateArgs(), TemplateSimplifier::simplifyTemplateInstantiations(), TemplateSimplifier::simplifyTemplates(), Tokenizer::simplifyTokenList1(), Tokenizer::simplifyTokens1(), Tokenizer::simplifyTypedef(), Tokenizer::simplifyTypedefCpp(), Tokenizer::simplifyTypedefLHS(), Tokenizer::simplifyTypeIntrinsics(), Tokenizer::simplifyUsing(), Tokenizer::simplifyUsingError(), Tokenizer::simplifyUsingToTypedef(), Tokenizer::simplifyVarDecl(), Tokenizer::simplifyVariableMultipleAssign(), singleAssignInScope(), singleConditionalInScope(), singleIncrementInScope(), singleMemberCallInScope(), singleStatement(), CheckStl::size(), Tokenizer::sizeofAddParentheses(), CheckSizeof::sizeofCalculation(), CheckSizeof::sizeofFunction(), CheckSizeof::sizeofsizeof(), CheckSizeof::sizeofVoid(), skipCaseLabel(), skipCVRefs(), skipDecl(), skipLocalVars(), skipPointers(), skipPointersAndQualifiers(), skipRequires(), skipScopeIdentifiers(), skipTernaryOp(), Variable::smartPointerType(), splitDefinitionFromTypedef(), Tokenizer::splitTemplateRightAngleBrackets(), CheckString::sprintfOverlappingData(), Tokenizer::startOfExecutableScope(), CheckStl::stlBoundaries(), CheckStl::stlOutOfBounds(), CheckStl::string_c_str(), stringFromTokenRange(), stringifyList(), CheckString::stringLiteralWrite(), CheckBufferOverrun::stringNotZeroTerminated(), CheckString::strPlusChar(), MemberExpressionAnalyzer::submatch(), CheckSizeof::suspiciousSizeofCalculation(), TemplateSimplifier::templateParameters(), CheckClass::thisSubtraction(), tokDistance(), TemplateSimplifier::TokenAndName::TokenAndName(), ConditionHandler::traverseCondition(), Type::Type(), typeDecl(), typeOf(), typesMatch(), CheckExceptionSafety::unhandledExceptionSpecification(), Tokenizer::unsupportedTypedef(), TemplateSimplifier::useDefaultArgumentValues(), CheckStl::uselessCalls(), CheckFunctions::useStandardLibrary(), CheckStl::useStlAlgorithm(), usingNamespace(), CheckVaarg::va_list_usage(), CheckVaarg::va_start_argument(), Tokenizer::validate(), Tokenizer::validateC(), validTokenEnd(), valueFlowAfterAssign(), valueFlowAfterMove(), valueFlowAfterSwap(), valueFlowArray(), valueFlowArrayBool(), valueFlowArrayElement(), valueFlowBitAnd(), valueFlowConditionExpressions(), valueFlowContainerSetTokValue(), valueFlowContainerSize(), valueFlowDebug(), valueFlowDynamicBufferSize(), valueFlowForLoop(), valueFlowForLoop2(), valueFlowForLoopSimplify(), valueFlowForLoopSimplifyAfter(), valueFlowForwardAssign(), valueFlowForwardConst(), valueFlowForwardLifetime(), valueFlowGlobalConstVar(), valueFlowGlobalStaticVar(), valueFlowImpossibleValues(), valueFlowInferCondition(), valueFlowInjectParameter(), valueFlowIteratorInfer(), valueFlowIterators(), valueFlowLifetime(), valueFlowLifetimeFunction(), valueFlowNumber(), valueFlowPointerAlias(), valueFlowRightShift(), valueFlowSafeFunctions(), valueFlowSameExpressions(), valueFlowSetConstantValue(), valueFlowSmartPointer(), valueFlowString(), valueFlowSubFunction(), valueFlowSwitchVariable(), valueFlowSymbolic(), valueFlowSymbolicInfer(), valueFlowSymbolicOperators(), CheckUninitVar::valueFlowUninit(), valueFlowUninit(), valueFlowUnknownFunctionReturn(), CheckMemoryLeakInClass::variable(), Variable::Variable(), variableIsUsedInScope(), CheckClass::virtualDestructor(), CheckClass::virtualFunctionCallInConstructorError(), CheckOther::warningOldStylePointerCast(), Variables::write(), and SymbolDatabase::~SymbolDatabase().
Token * Token::nextArgument | ( | ) |
Definition at line 874 of file token.cpp.
References nextArgumentImpl().
const Token * Token::nextArgument | ( | ) | const |
Definition at line 869 of file token.cpp.
References nextArgumentImpl().
Referenced by Function::argsMatch(), CheckOther::checkEvaluationOrder(), CheckIO::checkFileUsage(), CheckIO::checkFormatString(), CheckMemoryLeakNoVar::checkForUnsafeArgAlloc(), CheckOther::checkFuncArgNamesDifferent(), CheckFunctions::checkMathFunctions(), CheckClass::checkMemset(), CheckSizeof::checkSizeofForPointerSize(), findFormat(), CheckLeakAutoVar::functionCall(), CheckMemoryLeak::getDeallocationType(), CheckIO::invalidScanf(), CheckClass::isMemberFunc(), CheckStl::iterators(), numberOfArgumentsWithoutAst(), CheckStl::string_c_str(), CheckStl::uselessCalls(), and CheckVaarg::va_start_argument().
const Token * Token::nextArgumentBeforeCreateLinks2 | ( | ) | const |
Definition at line 879 of file token.cpp.
References findClosingBracket(), link(), Match(), and next().
Referenced by getFunctionArguments(), and Tokenizer::setVarIdPass1().
const Token * Token::nextTemplateArgument | ( | ) | const |
Definition at line 896 of file token.cpp.
References link(), Match(), and next().
Referenced by Variable::arrayDimensions(), CheckStl::if_find(), and parsedecl().
|
inline |
Definition at line 1193 of file token.h.
References emptyString.
Referenced by TokenList::addtoken(), ValueFlowAnalyzer::analyzeMatch(), CheckIO::ArgumentInfo::ArgumentInfo(), CheckIO::argumentType(), CheckIO::checkFormatString(), CheckMemoryLeakStructMember::checkStructVariable(), Tokenizer::combineOperators(), SymbolDatabase::createSymbolDatabaseIncompleteVars(), clangimport::AstNode::createTokens(), derefShared(), Tokenizer::dump(), TemplateSimplifier::expandTemplate(), SymbolDatabase::findFunction(), getDimensionsEtc(), Library::getFunctionName(), getLifetimeTokens(), CheckIO::getSeverity(), insertToken(), TokenList::insertTokens(), isAddressOfLocalVariable(), isConstFunctionCall(), Tokenizer::isFunctionHead(), isGlobalData(), isOpenParenthesisMemberFunctionCallOfVarId(), CheckNullPointer::isPointerDeRef(), isSameExpression(), isTemporary(), Lambda::Lambda(), CheckNullPointer::nullConstantDereference(), parsedecl(), setTokenValue(), SymbolDatabase::setValueType(), valueFlowAfterMove(), and valueFlowLifetime().
|
inline |
|
inline |
Definition at line 862 of file token.h.
Referenced by Function::addArguments(), SymbolDatabase::addClassFunction(), ConditionHandler::afterCondition(), CheckCondition::alwaysTrueFalse(), ValueFlowAnalyzer::analyzeCondition(), CheckIO::ArgumentInfo::ArgumentInfo(), Tokenizer::arraySize(), CheckCondition::assignIf(), ProgramMemoryState::assume(), ValueFlowAnalyzer::assume(), astParentSkipParens(), ConditionHandler::beforeCondition(), LifetimeStore::byDerefCopy(), Tokenizer::calculateScopes(), CheckLeakAutoVar::changeAllocStatus(), CheckAutoVariables::checkAutoVariableAssignment(), CheckBool::checkComparisonOfBoolWithBool(), CheckBool::checkComparisonOfFuncReturningBool(), CheckClass::checkConstFunc(), CheckOther::checkDuplicateExpression(), CheckOther::checkEvaluationOrder(), CheckUninitVar::checkExpr(), CheckIO::checkFileUsage(), CheckUnusedVar::checkFunctionVariableUsage(), CheckUnusedVar::checkFunctionVariableUsage_iterateScopes(), CheckOther::checkIncompleteStatement(), CheckString::checkIncorrectStringCompare(), CheckOther::checkInnerScope(), CheckUninitVar::checkLoopBodyRecursive(), CheckClass::checkMemset(), checkMissingReturnScope(), CheckOther::checkMisusedScopedObject(), FwdAnalysis::checkRecursive(), CheckOther::checkRedundantCopy(), checkReturns(), CheckUninitVar::checkRhs(), CheckLeakAutoVar::checkScope(), CheckUninitVar::checkScopeForVariable(), CheckOther::checkSuspiciousSemicolon(), CheckLeakAutoVar::checkTokenInsideExpression(), CheckOther::checkUnreachableCode(), CheckOther::checkUnusedLabel(), CheckOther::checkVarFuncNullUB(), Scope::checkVariable(), CheckOther::checkVariableScope(), CheckOther::clarifyStatement(), Tokenizer::combineOperators(), CheckClass::constructors(), Tokenizer::createLinks2(), SymbolDatabase::createSymbolDatabaseFindAllScopes(), SymbolDatabase::createSymbolDatabaseIncompleteVars(), clangimport::AstNode::createTokens(), clangimport::AstNode::createTokensVarDecl(), Tokenizer::deleteInvalidTypedef(), deleteNext(), deletePrevious(), Tokenizer::duplicateTypedef(), Tokenizer::elseif(), CheckStl::erase(), Variable::evaluate(), TemplateSimplifier::expandTemplate(), fillProgramMemoryFromAssignments(), findAllocFuncCallToken(), findClosingBracket(), SymbolDatabase::findFunction(), Scope::findFunction(), findOpeningBracket(), findOpenParentesisOfMove(), findStartToken(), TemplateSimplifier::fixForwardDeclaredDefaultArgumentValues(), followAllReferences(), Function::Function(), getArgumentVars(), Library::getContainerFromAction(), Library::getContainerFromYield(), getContainerYield(), getExpression(), FwdAnalysis::getExprVarIds(), Library::getFunctionName(), getIteratorExpression(), getLHSVariableRecursive(), getLHSVariablesRecursive(), getLifetimeTokens(), Function::getOverriddenFunctionRecursive(), getParentLifetime(), getSingleFunctionCall(), TemplateSimplifier::getTemplateInstantiations(), TemplateSimplifier::getTemplateNamePositionTemplateFunction(), TemplateSimplifier::getTemplateParametersInDeclaration(), Scope::getVariableList(), getVariableValues(), CheckClass::getVirtualFunctionCalls(), goToRightParenthesis(), hasGccCompoundStatement(), hasNoreturnFunction(), CheckClass::initializeVarList(), insertToken(), isBasicForLoop(), isCallFunction(), iscast(), isClassStructUnionEnumStart(), isConditionKnown(), isConstFunctionCall(), isConstStatement(), isConstTop(), isConstVarExpression(), CheckStl::isContainerSize(), Library::isContainerYield(), isCPPCast(), isDanglingSubFunction(), isEnumScope(), isExecutableScope(), isForwardJump(), SymbolDatabase::isFunction(), CheckUninitVar::isFunctionParUsage(), isGlobalData(), isInConstructorList(), isInLoopCondition(), CheckClass::isMemberVar(), CheckUninitVar::isMemberVariableAssignment(), CheckUninitVar::isMemberVariableUsage(), isParameterChanged(), isPartOfClassStructUnion(), Variable::isPointerArray(), CheckNullPointer::isPointerDeRef(), isRangeForScope(), isReturnScope(), isSameExpression(), Library::isScopeNoReturn(), Tokenizer::isScopeNoReturn(), isSimpleExpr(), isStrlenOf(), isStructuredBindingVariable(), isTemporary(), isThisChanged(), isVariableChanged(), isVariableChangedByFunctionCall(), CheckUninitVar::isVariableUsage(), isVoidStmt(), CheckStl::iterators(), TemplateSimplifier::matchSpecialization(), move(), CheckCondition::multiCondition2(), CheckNullPointer::nullConstantDereference(), CheckClass::operatorEqToSelf(), parsedecl(), CheckUnusedFunctions::parseTokens(), Check64BitPortability::pointerassignment(), FwdAnalysis::possiblyAliased(), CheckPostfixOperator::postfixOperator(), Tokenizer::removeExtraTemplateKeywords(), Tokenizer::removeMacrosInGlobalScope(), replace(), Tokenizer::reportUnknownMacros(), CheckLeakAutoVar::ret(), Function::returnsPointer(), Function::returnsReference(), Function::returnsStandardType(), Function::returnsVoid(), Function::setFlags(), setTokenValue(), ExpressionAnalyzer::setupExprVarIds(), setValues(), Variable::setValueType(), SymbolDatabase::setValueType(), SymbolDatabase::setValueTypeInTokenList(), setVarIdClassDeclaration(), setVarIdParseDeclaration(), Tokenizer::setVarIdPass1(), Tokenizer::setVarIdPass2(), setVarIdStructMembers(), Tokenizer::simplifyAddBracesPair(), Tokenizer::simplifyAddBracesToCommand(), Tokenizer::simplifyCAlternativeTokens(), Tokenizer::simplifyDoublePlusAndDoubleMinus(), Tokenizer::simplifyEmptyNamespaces(), Tokenizer::simplifyFunctionParameters(), Tokenizer::simplifyFunctionPointers(), Tokenizer::simplifyHeadersAndUnusedTemplates(), Tokenizer::simplifyInitVar(), Tokenizer::simplifyLabelsCaseDefault(), TemplateSimplifier::simplifyNumericCalculations(), Tokenizer::simplifyPointerToStandardType(), Tokenizer::simplifyRedundantParentheses(), Tokenizer::simplifyRoundCurlyParentheses(), Tokenizer::simplifyStaticConst(), TemplateSimplifier::simplifyTemplateAliases(), TemplateSimplifier::simplifyTemplateArgs(), TemplateSimplifier::simplifyTemplateInstantiations(), TemplateSimplifier::simplifyTemplates(), Tokenizer::simplifyTypedefCpp(), Tokenizer::simplifyTypedefLHS(), Tokenizer::simplifyTypeIntrinsics(), Tokenizer::simplifyUsing(), Tokenizer::simplifyUsingToTypedef(), Tokenizer::simplifyVarDecl(), Tokenizer::simplifyVariableMultipleAssign(), singleAssignInScope(), CheckStl::size(), CheckSizeof::sizeofCalculation(), CheckSizeof::sizeofFunction(), skipDecl(), skipLocalVars(), splitDefinitionFromTypedef(), Tokenizer::splitTemplateRightAngleBrackets(), CheckStl::string_c_str(), TemplateSimplifier::templateParameters(), TemplateSimplifier::TokenAndName::TokenAndName(), tokenIsFunctionReturningBool(), ConditionHandler::traverseCondition(), typeDecl(), typeOf(), typesMatch(), TemplateSimplifier::useDefaultArgumentValues(), CheckStl::uselessCalls(), CheckStl::useStlAlgorithm(), CheckVaarg::va_list_usage(), Tokenizer::validateC(), validTokenStart(), valueFlowContainerSize(), valueFlowDynamicBufferSize(), valueFlowEnumValue(), valueFlowForLoopSimplify(), valueFlowForwardLifetime(), valueFlowFunctionReturn(), valueFlowLibraryFunction(), valueFlowLifetime(), valueFlowLifetimeClassConstructor(), valueFlowLifetimeConstructor(), valueFlowLifetimeFunction(), valueFlowSmartPointer(), valueFlowSwitchVariable(), valueFlowUnknownFunctionReturn(), Variable::Variable(), CheckClass::virtualFunctionCallInConstructorError(), and CheckOther::warningOldStylePointerCast().
|
inlineprivate |
void Token::printAst | ( | bool | verbose, |
bool | xml, | ||
const std::vector< std::string > & | fileNames, | ||
std::ostream & | out | ||
) | const |
Definition at line 1681 of file token.cpp.
Referenced by Tokenizer::printDebugOutput().
void Token::printLines | ( | int | lines = 5 | ) | const |
print out tokens - used for debugging
Definition at line 1272 of file token.cpp.
References Token::stringifyOptions::forDebugExprId(), linenr(), next(), and stringifyList().
void Token::printOut | ( | const char * | title, |
const std::vector< std::string > & | fileNames | ||
) | const |
For debugging purposes, prints token and all tokens followed by it.
title | Title for the printout or use default parameter or 0 for no title. |
fileNames | Prints out file name instead of file index. File index should match the index of the string in this vector. |
Definition at line 1264 of file token.cpp.
References Token::stringifyOptions::forPrintOut(), and stringifyList().
void Token::printOut | ( | const char * | title = nullptr | ) | const |
For debugging purposes, prints token and all tokens followed by it.
title | Title for the printout or use default parameter or 0 for no title. |
Definition at line 1257 of file token.cpp.
References Token::stringifyOptions::forPrintOut(), and stringifyList().
Referenced by Tokenizer::printDebugOutput(), and TemplateSimplifier::simplifyTemplates().
void Token::printValueFlow | ( | bool | xml, |
std::ostream & | out | ||
) | const |
Definition at line 1764 of file token.cpp.
References ValueFlow::Value::BUFFER_SIZE, ValueFlow::Value::CONTAINER_SIZE, fileIndex(), ValueFlow::Value::FLOAT, TokenList::getFiles(), id_string(), ValueFlow::Value::Impossible, ValueFlow::Value::Inconclusive, ValueFlow::Value::INT, ValueFlow::Value::ITERATOR_END, ValueFlow::Value::ITERATOR_START, ValueFlow::Value::Known, ValueFlow::Value::LIFETIME, linenr(), TokensFrontBack::list, mImpl, ValueFlow::Value::MOVED, mTokensFrontBack, TokenImpl::mValues, next(), ValueFlow::Value::Possible, ValueType::sign, str(), ValueFlow::Value::SYMBOLIC, ValueFlow::Value::TOK, ValueFlow::Value::toString(), ValueFlow::Value::UNINIT, ValueType::UNSIGNED, values(), and valueType().
Referenced by Tokenizer::dump(), and Tokenizer::printDebugOutput().
|
inline |
Get progressValue (0 - 100)
Definition at line 1150 of file token.h.
Referenced by SymbolDatabase::createSymbolDatabaseFindAllScopes(), TemplateSimplifier::simplifyTemplateInstantiations(), Tokenizer::simplifyTypedefCpp(), and Tokenizer::simplifyUsing().
|
inline |
Definition at line 1242 of file token.h.
Referenced by valueFlowSmartPointer().
Replace token replaceThis with tokens between start and end, including start and end.
The replaceThis token is deleted.
replaceThis | This token will be deleted. |
start | This will be in the place of replaceThis |
end | This is also in the place of replaceThis |
Definition at line 346 of file token.cpp.
References TokensFrontBack::back, mImpl, TokenImpl::mProgressValue, mTokensFrontBack, next(), and previous().
Referenced by Tokenizer::simplifyFunctionParameters(), and Tokenizer::simplifyTypedef().
|
inline |
Definition at line 1049 of file token.h.
Referenced by insertToken(), typeDecl(), and typeOf().
|
inline |
Associate this token with given scope.
s | Scope to be associated |
Definition at line 1042 of file token.h.
Referenced by accumulateStructMembers(), SymbolDatabase::addClassFunction(), clangimport::AstNode::addFullScopeNameTokens(), clangimport::AstNode::addtoken(), clangimport::AstNode::addTypeTokens(), CheckBufferOverrun::arrayIndex(), Tokenizer::arraySizeAfterValueFlow(), CheckOther::checkConstPointer(), CheckOther::checkDuplicateExpression(), CheckUnusedVar::checkFunctionVariableUsage_iterateScopes(), CheckOther::checkInnerScope(), CheckClass::checkMemset(), checkMissingReturnScope(), CheckStl::checkMutexes(), FwdAnalysis::checkRecursive(), CheckOther::checkUnreachableCode(), CheckOther::checkVariableScope(), CheckAutoVariables::checkVarLifetimeScope(), CheckClass::constructors(), clangimport::AstNode::createScope(), SymbolDatabase::createSymbolDatabaseSetVariablePointers(), clangimport::AstNode::createTokens(), clangimport::AstNode::createTokensForCXXRecord(), clangimport::AstNode::createTokensFunctionDecl(), clangimport::AstNode::createTokensVarDecl(), CheckExceptionSafety::deallocThrow(), Tokenizer::dump(), exprDependsOnThis(), fillProgramMemoryFromConditions(), SymbolDatabase::findEnumerator(), findExpression(), SymbolDatabase::findFunction(), Scope::findFunction(), findNextTokenFromBreak(), Function::findReturns(), findStartToken(), followVariableExpression(), PathAnalysis::forward(), Function::Function(), getEndOfVarScope(), Library::getFunctionName(), getLoopScope(), clangimport::AstNode::getNestedInScope(), getVariableValues(), inBooleanFunction(), CheckAssert::inSameScope(), isDanglingSubFunction(), isDeadScope(), isEscapeScope(), isExpression(), isInScope(), CheckNullPointer::isPointerDeRef(), isScope(), isScopeBracket(), isWithinScope(), CheckStl::iterators(), CheckCondition::multiCondition2(), parsedecl(), CheckUnusedFunctions::parseTokens(), FwdAnalysis::possiblyAliased(), CheckLeakAutoVar::ret(), CheckBool::returnValueOfFunctionReturningBool(), clangimport::AstNode::setValueType(), SymbolDatabase::setValueType(), SymbolDatabase::setValueTypeInTokenList(), TemplateSimplifier::simplifyTemplateAliases(), skipLocalVars(), Variable::smartPointerType(), typeDecl(), typeOf(), SingleValueFlowAnalyzer::updateScope(), MultiValueFlowAnalyzer::updateScope(), CheckVaarg::va_list_usage(), valueFlowContainerSize(), valueFlowForLoopSimplifyAfter(), valueFlowForward(), valueFlowIteratorInfer(), valueFlowIterators(), valueFlowLifetime(), valueFlowSmartPointer(), valueFlowUninit(), and SymbolDatabase::~SymbolDatabase().
std::shared_ptr< ScopeInfo2 > Token::scopeInfo | ( | ) | const |
Definition at line 2514 of file token.cpp.
References mImpl, and TokenImpl::mScopeInfo.
void Token::scopeInfo | ( | std::shared_ptr< ScopeInfo2 > | newScopeInfo | ) |
Definition at line 2510 of file token.cpp.
References mImpl, and TokenImpl::mScopeInfo.
Referenced by Tokenizer::calculateScopes(), TemplateSimplifier::getTemplateInstantiations(), and insertToken().
|
inline |
Definition at line 1468 of file token.h.
References TokenImpl::CPP11INIT, and TokenImpl::NOINIT.
|
inline |
|
inlineprivate |
Set specified flag state.
flag_ | flag to set state |
state_ | new state of flag |
Definition at line 1356 of file token.h.
Referenced by update_property_info().
|
inline |
Definition at line 758 of file token.h.
Referenced by TokenList::addtoken(), TokenList::createTokens(), insertToken(), TokenList::insertTokens(), and Tokenizer::simplifyVarDecl().
|
inline |
Definition at line 653 of file token.h.
Referenced by Tokenizer::simplifyParameterVoid().
|
inline |
Definition at line 1478 of file token.h.
Referenced by TokenList::copyTokens().
void Token::setValueType | ( | ValueType * | vt | ) |
Definition at line 2325 of file token.cpp.
References mImpl, and TokenImpl::mValueType.
Referenced by clangimport::AstNode::createTokens(), clangimport::AstNode::createTokensCall(), clangimport::AstNode::setValueType(), SymbolDatabase::setValueType(), SymbolDatabase::setValueTypeInTokenList(), and SymbolDatabase::~SymbolDatabase().
|
static |
|
inlinestatic |
Match given token (or list of tokens) to a pattern list.
Possible patterns "someRandomText" If token contains "someRandomText".
The patterns can be also combined to compare to multiple tokens at once by separating tokens with a space, e.g. ") void {" will return true if first token is ')' next token is "void" and token after that is '{'. If even one of the tokens does not match its pattern, false is returned.
tok | List of tokens to be compared to the pattern |
pattern | The pattern against which the tokens are compared, e.g. "const" or ") void {". |
Definition at line 252 of file token.h.
Referenced by accumulateBool(), Function::addArguments(), SymbolDatabase::addClassFunction(), Tokenizer::addSemicolonAfterUnknownMacro(), ConditionHandler::afterCondition(), TemplateSimplifier::alreadyHasNamespace(), CheckCondition::alwaysTrueFalse(), CheckCondition::alwaysTrueFalseError(), ValueFlowAnalyzer::analyze(), ValueFlowAnalyzer::analyzeLifetime(), Function::argsMatch(), CheckIO::ArgumentInfo::ArgumentInfo(), CheckBufferOverrun::arrayIndex(), CheckBufferOverrun::arrayIndexThenCheck(), Tokenizer::arraySize(), Tokenizer::arraySizeAfterValueFlow(), CheckAssert::assertWithSideEffects(), CheckCondition::assignIfParseScope(), ProgramMemoryState::assume(), ValueFlowAnalyzer::assume(), astIsRangeBasedForDecl(), astParentSkipParens(), CheckAutoVariables::autoVariables(), ConditionHandler::beforeCondition(), CheckBufferOverrun::bufferOverflow(), Tokenizer::calculateScopes(), CheckLeakAutoVar::changeAllocStatus(), CheckCondition::checkAssignmentInCondition(), CheckAutoVariables::checkAutoVariableAssignment(), CheckBoost::checkBoostForeachModification(), CheckOther::checkCharVariable(), CheckBool::checkComparisonOfFuncReturningBool(), TemplateSimplifier::checkComplicatedSyntaxErrorsInTemplates(), CheckClass::checkConstFunc(), CheckOther::checkConstPointer(), CheckOther::checkDuplicateBranch(), CheckCondition::checkDuplicateConditionalAssign(), CheckOther::checkDuplicateExpression(), CheckOther::checkEvaluationOrder(), CheckClass::checkExplicitConstructors(), CheckIO::checkFileUsage(), CheckStl::checkFindInsert(), CheckStl::checkFindInsertError(), CheckMemoryLeakNoVar::checkForUnreleasedInputArgument(), CheckMemoryLeakNoVar::checkForUnsafeArgAlloc(), CheckMemoryLeakNoVar::checkForUnusedReturnValue(), CheckOther::checkFuncArgNamesDifferent(), CheckUnusedVar::checkFunctionVariableUsage(), CheckUnusedVar::checkFunctionVariableUsage_iterateScopes(), CheckOther::checkIncompleteStatement(), CheckString::checkIncorrectStringCompare(), CheckOther::checkInnerScope(), CheckFunctions::checkLibraryMatchFunctions(), CheckUninitVar::checkLoopBodyRecursive(), CheckFunctions::checkMathFunctions(), CheckClass::checkMemset(), checkMissingReturnScope(), CheckOther::checkMisusedScopedObject(), CheckCondition::checkModuloAlwaysTrueFalse(), CheckOther::checkNanInArithmeticExpression(), CheckOther::checkOverlappingWrite(), CheckFunctions::checkProhibitedFunctions(), CheckMemoryLeakInFunction::checkReallocUsage(), FwdAnalysis::checkRecursive(), CheckOther::checkRedundantAssignment(), CheckOther::checkRedundantCopy(), CheckExceptionSafety::checkRethrowCopy(), CheckClass::checkReturnPtrThis(), checkReturns(), CheckUninitVar::checkScope(), CheckLeakAutoVar::checkScope(), CheckUninitVar::checkScopeForVariable(), CheckSizeof::checkSizeofForPointerSize(), CheckMemoryLeakStructMember::checkStructVariable(), CheckOther::checkSuspiciousSemicolon(), CheckLeakAutoVar::checkTokenInsideExpression(), CheckType::checkTooBigBitwiseShift(), CheckOther::checkUnreachableCode(), CheckOther::checkVarFuncNullUB(), Scope::checkVariable(), CheckOther::checkVariableScope(), CheckAutoVariables::checkVarLifetimeScope(), CheckIO::checkWrongPrintfScanfArguments(), CheckCondition::clarifyCondition(), Tokenizer::combineOperators(), CheckOther::comparePointersError(), Function::constructorMemberInitialization(), CheckClass::constructors(), CheckOther::constStatementError(), Summaries::create(), SymbolDatabase::createSymbolDatabaseExprIds(), SymbolDatabase::createSymbolDatabaseFindAllScopes(), SymbolDatabase::createSymbolDatabaseIncompleteVars(), SymbolDatabase::createSymbolDatabaseNeedInitialization(), SymbolDatabase::createSymbolDatabaseSetVariablePointers(), SymbolDatabase::createSymbolDatabaseVariableSymbolTable(), clangimport::AstNode::createTokens(), CheckExceptionSafety::deallocThrow(), CheckExceptionSafety::destructors(), CheckCondition::duplicateCondition(), Tokenizer::duplicateTypedef(), endOfExpression(), CheckStl::erase(), CheckStl::eraseCheckLoopVar(), CheckStl::eraseIteratorOutOfBounds(), Variable::evaluate(), TemplateSimplifier::expandTemplate(), exprDependsOnThis(), extractForLoopValues(), fillProgramMemoryFromAssignments(), findAllocFuncCallToken(), findClosingBracket(), SymbolDatabase::findEnumerator(), findExpressionStartEndTokens(), SymbolDatabase::findFunction(), findInsertValue(), findLambdaEndScope(), findLambdaStartToken(), findNextTokenFromBreak(), Function::findReturns(), SymbolDatabase::findScope(), findsimplematchImpl(), findStartToken(), findTemplateDeclarationEndImpl(), findTokensSkipDeadCodeImpl(), SymbolDatabase::findType(), SymbolDatabase::findTypeInNested(), findVarBound(), SymbolDatabase::findVariableType(), followAllReferences(), PathAnalysis::forwardRange(), Function::Function(), CheckLeakAutoVar::functionCall(), functionThrowsRecursive(), getAddressContainer(), CheckMemoryLeak::getAllocationType(), Library::getAllocFuncInfo(), getArgumentStart(), getArgumentVars(), getBufAndOffset(), getCastTypeStartToken(), getCondTokFromEndImpl(), getCondTokImpl(), Library::getContainerFromAction(), Library::getContainerFromYield(), getContainerIndex(), getContainerSizeFromConstructor(), getContainerSizeFromConstructorArgs(), Library::getContainerYield(), CheckMemoryLeak::getDeallocationType(), Library::getDeallocFuncInfo(), getEnableIfReturnType(), getExprUsage(), CheckClass::getFileInfo(), getFunction(), Library::getFunctionName(), getFunctionToken(), getFuncTokFromThis(), CheckClass::getIfStmtBodyStart(), getInitTokImpl(), getIteratorExpression(), getLHSVariableRecursive(), getLHSVariablesRecursive(), getLifetimeTokens(), getLoopContainer(), getOverrunIndexValues(), getParentLifetime(), getParentLifetimeObject(), getParentMember(), getParentMembers(), getParentValueTypes(), getParentVar(), getPointerDepth(), Library::getReallocFuncInfo(), getSingleExpressionInBlock(), getSingleFunctionCall(), getStepTokImpl(), TemplateSimplifier::getTemplateDeclarations(), TemplateSimplifier::getTemplateInstantiations(), TemplateSimplifier::getTemplateNamePositionTemplateFunction(), TemplateSimplifier::getTemplateNamePositionTemplateVariable(), TemplateSimplifier::getTemplateParametersInDeclaration(), getTokenArgumentFunctionImpl(), Variable::getTypeName(), Library::getUseRetValType(), Scope::getVariableList(), CheckClass::getVirtualFunctionCalls(), CheckClass::hasAssignSelf(), hasEmptyCaptureList(), hasGccCompoundStatement(), hasNoreturnFunction(), hasOverloadedAssignment(), hasVolatileCastOrVar(), CheckCondition::identicalConditionAfterEarlyExitError(), CheckStl::if_find(), ifvar(), CheckClass::initializerListOrder(), CheckClass::initializeVarList(), insertToken(), CheckFunctions::invalidFunctionUsage(), CheckOther::invalidPointerCast(), isAlignAttribute(), isArray(), isAssignedToNonLocal(), isAutoVarArray(), isBasicForLoop(), isBracketAccess(), isBreakOrContinueScope(), isBreakScope(), iscast(), isConditionKnown(), isConstFunctionCall(), isConstMethod(), isConstStatement(), isConstTop(), isConstVarExpression(), CheckStl::isContainerSize(), ValueFlow::isContainerSizeChanged(), isContainerSizeChangedByFunction(), Library::isContainerYield(), isCPPAttribute(), isCPPCast(), CheckBufferOverrun::isCtuUnsafeBufferUsage(), isDanglingSubFunction(), isDeadTemporary(), isDecayedPointer(), isEnumDefinition(), isEnumScope(), isEscaped(), isEscapedOrJump(), isEscapedReference(), isEscapeScope(), isExecutableScope(), isExpression(), isForLoopCondition(), isForLoopIncrement(), SymbolDatabase::isFunction(), isFunctionCall(), Library::isFunctionConst(), CheckUninitVar::isFunctionParUsage(), CheckUnusedVar::isFunctionWithoutSideEffects(), ValueFlowAnalyzer::isGlobalModified(), isIfConstexpr(), isInConstructorList(), CheckClass::isInverted(), isLeafDot(), isLocalContainerBuffer(), isMapFind(), CheckClass::isMemberVar(), CheckUninitVar::isMemberVariableAssignment(), CheckUninitVar::isMemberVariableUsage(), ValueFlowAnalyzer::isModified(), isMoveOrForward(), SymbolicConditionHandler::isNegatedBool(), isNonMacro(), Library::isnoreturn(), isNullablePointer(), CheckMemoryLeak::isOpenDevNull(), isRangeForScope(), CheckUnusedVar::isRecordTypeWithoutSideEffects(), isReturnScope(), isSameExpression(), isScope(), Library::isScopeNoReturn(), Tokenizer::isScopeNoReturn(), isStdMoveOrStdForwarded(), isStlStringType(), isStrlenOf(), isStructuredBindingVariable(), isTemporary(), isThisChanged(), isType(), isUnchanged(), isUsedAsBool(), isVariableChanged(), isVariableChangedByFunctionCall(), Scope::isVariableDeclaration(), isVariableExpression(), isVariableExprHidden(), isVariableInit(), CheckUninitVar::isVariableUsage(), isVarUsedInTree(), isVector(), isVoidCast(), isVoidStmt(), ContainerExpressionAnalyzer::isWritable(), CheckStl::iterators(), CheckStl::knownEmptyContainer(), Lambda::Lambda(), lifetimeType(), Tokenizer::markCppCasts(), matchMemberName(), ValueType::matchParameter(), TemplateSimplifier::matchSpecialization(), CheckFunctions::memsetInvalid2ndParam(), CheckStl::mismatchingContainerIterator(), CheckStl::missingComparison(), CheckCondition::multiCondition(), CheckCondition::multiCondition2(), CheckNullPointer::nullConstantDereference(), numberOfArgumentsWithoutAst(), CheckBufferOverrun::objectIndex(), CheckBufferOverrun::objectIndexError(), CheckStl::outOfBounds(), CheckString::overlappingStrcmp(), SimpleConditionHandler::parse(), parsedecl(), CheckUnusedFunctions::parseTokens(), FwdAnalysis::possiblyAliased(), Tokenizer::processFunc(), programMemoryParseCondition(), Tokenizer::removePragma(), Tokenizer::removeRedundantSemicolons(), TemplateSimplifier::removeTemplate(), TemplateSimplifier::replaceTemplateUsage(), Tokenizer::reportUnknownMacros(), CheckLeakAutoVar::ret(), CheckExceptionSafety::rethrowNoCurrentException(), CheckFunctions::returnLocalStdMove(), Function::returnsPointer(), Function::returnsReference(), Function::returnsVoid(), CheckBool::returnValueOfFunctionReturningBool(), Library::returnValueType(), setConditionalValues(), Function::setFlags(), setTokenValue(), setTypes(), ExpressionAnalyzer::setupExprVarIds(), setValues(), SymbolDatabase::setValueType(), SymbolDatabase::setValueTypeInTokenList(), setVarIdClassDeclaration(), Tokenizer::setVarIdClassFunction(), setVarIdParseDeclaration(), Tokenizer::setVarIdPass1(), Tokenizer::setVarIdPass2(), Tokenizer::simplifyAddBracesPair(), Tokenizer::simplifyAddBracesToCommand(), Tokenizer::simplifyFunctionParameters(), Tokenizer::simplifyFunctionPointers(), Tokenizer::simplifyHeadersAndUnusedTemplates(), Tokenizer::simplifyIfSwitchForInit(), Tokenizer::simplifyInitVar(), Tokenizer::simplifyRedundantConsecutiveBraces(), Tokenizer::simplifyRedundantParentheses(), Tokenizer::simplifyRoundCurlyParentheses(), Tokenizer::simplifySQL(), Tokenizer::simplifyStaticConst(), TemplateSimplifier::simplifyTemplateArgs(), TemplateSimplifier::simplifyTemplateInstantiations(), TemplateSimplifier::simplifyTemplates(), Tokenizer::simplifyTokenList1(), Tokenizer::simplifyTypedefCpp(), Tokenizer::simplifyTypedefLHS(), Tokenizer::simplifyUsing(), Tokenizer::simplifyVarDecl(), singleAssignInScope(), singleConditionalInScope(), singleMemberCallInScope(), singleStatement(), Tokenizer::sizeofAddParentheses(), CheckSizeof::sizeofCalculation(), CheckSizeof::sizeofFunction(), CheckSizeof::sizeofVoid(), skipDecl(), skipLocalVars(), SymbolicConditionHandler::skipNot(), ConditionHandler::skipNotAndCasts(), skipPointers(), skipRequires(), ValueFlow::solveExprValue(), Tokenizer::splitTemplateRightAngleBrackets(), CheckString::sprintfOverlappingData(), CheckStl::stlOutOfBounds(), CheckStl::string_c_str(), CheckString::stringLiteralWrite(), CheckBufferOverrun::stringNotZeroTerminated(), CheckSizeof::suspiciousSizeofCalculation(), TemplateSimplifier::templateParameters(), CheckOther::testIfNonZeroExpressionIsPositive(), TemplateSimplifier::TokenAndName::TokenAndName(), Type::Type(), typeDecl(), typeOf(), CheckUninitVar::uninitvarError(), FwdAnalysis::unusedValue(), TemplateSimplifier::useDefaultArgumentValues(), CheckStl::uselessCalls(), CheckStl::useStlAlgorithm(), CheckVaarg::va_list_usage(), CheckVaarg::va_start_argument(), Tokenizer::validateC(), valueFlowAfterMove(), valueFlowAfterSwap(), valueFlowArray(), valueFlowArrayElement(), valueFlowConditionExpressions(), valueFlowContainerSetTokValue(), valueFlowContainerSize(), valueFlowForLoop(), valueFlowForLoopSimplify(), valueFlowForwardAssign(), valueFlowForwardLifetime(), valueFlowImpossibleValues(), valueFlowLifetime(), valueFlowLifetimeConstructor(), valueFlowLifetimeUserConstructor(), valueFlowPointerAlias(), valueFlowSetConstantValue(), valueFlowSmartPointer(), valueFlowSwitchVariable(), valueFlowSymbolic(), valueFlowSymbolicOperators(), CheckUninitVar::valueFlowUninit(), Variable::Variable(), variableIsUsedInScope(), CheckClass::virtualDestructor(), CheckOther::warningOldStylePointerCast(), Variables::write(), and ContainerExpressionAnalyzer::writeValue().
|
inline |
Definition at line 192 of file token.h.
Referenced by astStringZ3(), chrInFirstWord(), deleteThis(), firstWordEquals(), getStrArraySize(), getStrLength(), and isCalculation().
|
inline |
Definition at line 179 of file token.h.
Referenced by Function::addArguments(), SymbolDatabase::addClassFunction(), Scope::addEnum(), Scope::addFunction(), SymbolDatabase::addGlobalFunction(), TemplateSimplifier::addNamespace(), SymbolDatabase::addNewFunction(), Tokenizer::addSemicolonAfterUnknownMacro(), TokenList::addtoken(), clangimport::AstNode::addTypeTokens(), addValue(), ConditionHandler::afterCondition(), CheckCondition::alwaysTrueFalse(), Function::argsMatch(), CheckIO::ArgumentInfo::ArgumentInfo(), CheckIO::argumentType(), arithmeticTypeString(), Variable::arrayDimensions(), CheckBufferOverrun::arrayIndex(), CheckBufferOverrun::arrayIndexThenCheck(), Tokenizer::arraySize(), CheckCondition::assignIf(), CheckCondition::assignIfParseScope(), astContainerAction(), astContainerYield(), astCount(), astIsVariableComparison(), astStringXml(), Tokenizer::calculateScopes(), CheckLeakAutoVar::changeAllocStatus(), CheckLeakAutoVar::changeAllocStatusIfRealloc(), CheckAutoVariables::checkAutoVariableAssignment(), CheckCondition::checkBadBitmaskCheck(), CheckOther::checkCastIntToCharAndBack(), CheckBool::checkComparisonOfBoolWithBool(), CheckBool::checkComparisonOfBoolWithInt(), CheckBool::checkComparisonOfFuncReturningBool(), Tokenizer::checkConfiguration(), CheckClass::checkConst(), CheckClass::checkConstFunc(), CheckOther::checkDuplicateBranch(), CheckCondition::checkDuplicateConditionalAssign(), CheckOther::checkDuplicateExpression(), CheckOther::checkEvaluationOrder(), CheckIO::checkFileUsage(), CheckIO::checkFormatString(), CheckMemoryLeakNoVar::checkForUnsafeArgAlloc(), CheckMemoryLeakNoVar::checkForUnusedReturnValue(), CheckOther::checkFuncArgNamesDifferent(), checkFunctionUsage(), CheckUnusedVar::checkFunctionVariableUsage(), CheckUnusedVar::checkFunctionVariableUsage_iterateScopes(), CheckOther::checkIncompleteArrayFill(), CheckCondition::checkIncorrectLogicOperator(), CheckOther::checkInnerScope(), CheckOther::checkInterlockedDecrement(), CheckCondition::checkInvalidTestForOverflow(), CheckOther::checkKnownArgument(), CheckUninitVar::checkLoopBodyRecursive(), CheckFunctions::checkMathFunctions(), CheckClass::checkMemset(), CheckClass::checkMemsetType(), checkMissingReturnScope(), CheckOther::checkMisusedScopedObject(), CheckCondition::checkModuloAlwaysTrueFalse(), CheckMemoryLeakInClass::checkPublicFunctions(), CheckMemoryLeakInFunction::checkReallocUsage(), FwdAnalysis::checkRecursive(), CheckOther::checkRedundantAssignment(), CheckOther::checkRedundantCopy(), CheckClass::checkReturnPtrThis(), CheckUninitVar::checkRhs(), CheckUninitVar::checkScope(), CheckLeakAutoVar::checkScope(), CheckUninitVar::checkScopeForVariable(), CheckClass::checkSelfInitialization(), CheckSizeof::checkSizeofForArrayParameter(), CheckSizeof::checkSizeofForPointerSize(), CheckUninitVar::checkStruct(), CheckMemoryLeakStructMember::checkStructVariable(), CheckOther::checkSuspiciousCaseInSwitch(), CheckLeakAutoVar::checkTokenInsideExpression(), CheckOther::checkUnreachableCode(), CheckOther::checkVarFuncNullUB(), Scope::checkVariable(), checkVariableCallMatch(), CheckOther::checkVariableScope(), CheckOther::clarifyCalculation(), CheckOther::clarifyStatement(), Tokenizer::combineOperators(), Tokenizer::combineStringAndCharLiterals(), compareTokenRanges(), CheckCondition::comparison(), Tokenizer::concatenateNegativeNumberAndAnyPositive(), conditionAlwaysTrueOrFalse(), conditionString(), CheckClass::constructors(), CheckOther::constStatementError(), CheckClass::copyconstructors(), createBuiltinLibraryFunctions(), Tokenizer::createLinks2(), SymbolDatabase::createSymbolDatabaseExprIds(), SymbolDatabase::createSymbolDatabaseFindAllScopes(), SymbolDatabase::createSymbolDatabaseIncompleteVars(), SymbolDatabase::createSymbolDatabaseSetFunctionPointers(), SymbolDatabase::createSymbolDatabaseSetVariablePointers(), SymbolDatabase::createSymbolDatabaseVariableSymbolTable(), TokenList::createTokens(), clangimport::AstNode::createTokens(), clangimport::AstNode::createTokensFunctionDecl(), clangimport::AstNode::createTokensVarDecl(), CheckExceptionSafety::deallocThrow(), Tokenizer::deleteInvalidTypedef(), derefShared(), Library::detectSmartPointer(), doAssignment(), Tokenizer::dump(), CheckOther::duplicateAssignExpressionError(), CheckCondition::duplicateConditionalAssignError(), CheckOther::duplicateExpressionError(), Tokenizer::duplicateTypedef(), ValueFlow::eitherTheConditionIsRedundant(), Tokenizer::elseif(), CheckStl::eraseCheckLoopVar(), CheckStl::eraseIteratorOutOfBounds(), CheckStl::eraseIteratorOutOfBoundsError(), CheckAutoVariables::errorDanglingReference(), CheckAutoVariables::errorInvalidDeallocation(), Variable::evaluate(), TemplateSimplifier::expandTemplate(), exprDependsOnThis(), extractForLoopValues(), findArgumentPosRecursive(), findClosingBracket(), SymbolDatabase::findEnumerator(), findExpressionStartEndTokens(), SymbolDatabase::findFunction(), Scope::findFunction(), SymbolDatabase::findFunctionInScope(), findLambdaEndTokenGeneric(), findLambdaStartToken(), findOpeningBracket(), findOpenParentesisOfMove(), Function::findReturns(), SymbolDatabase::findScope(), SymbolDatabase::findType(), SymbolDatabase::findTypeInNested(), findUnmatchedTernaryOp(), SymbolDatabase::findVariableType(), SymbolDatabase::findVariableTypeInBase(), followVariableExpressionError(), LifetimeStore::fromFunctionArg(), CheckOther::funcArgNamesDifferent(), CheckOther::funcArgOrderDifferent(), Function::Function(), CheckLeakAutoVar::functionCall(), functionThrowsRecursive(), CheckMemoryLeak::getAllocationType(), ValueFlowAnalyzer::getAssign(), getAstParentSkipPossibleCastAndAddressOf(), getCastTypeStartToken(), getConditions(), getContainerName(), Library::getContainerYield(), CheckMemoryLeak::getDeallocationType(), getExpression(), getExpressionRange(), getExprUsage(), FwdAnalysis::getExprVarIds(), getFunctionArguments(), Library::getFunctionName(), getFunctionUsage(), getIncompleteNameID(), getInvalidMethod(), getIteratorExpression(), getLifetimeTokens(), clangimport::AstNode::getNestedInScope(), getnumchildren(), getOperatorFunction(), Function::getOverloadedFunctions(), Function::getOverriddenFunctionRecursive(), getOverrunIndexValues(), CheckMemoryLeak::getReallocationType(), getSingleFunctionCall(), getSingleReturnVar(), getStrArraySize(), getStrLength(), TemplateSimplifier::getTemplateInstantiations(), TemplateSimplifier::getTemplateNamePosition(), TemplateSimplifier::getTemplateParametersInDeclaration(), getTypeString(), CTU::getUnsafeUsage(), Scope::getVariableList(), getVariableValues(), CheckClass::getVirtualFunctionCalls(), CheckClass::hasAllocationInIfScope(), hasGccCompoundStatement(), hasNoreturnFunction(), CheckStl::if_find(), if_findCompare(), ifvar(), ValueFlow::Value::infoString(), Type::initBaseInfo(), CheckClass::initializationListUsage(), CheckClass::initializerListOrder(), CheckClass::initializeVarList(), Tokenizer::initVar(), innerSmtString(), insertToken(), TokenList::insertTokens(), CheckStl::invalidContainerLoopError(), CheckFunctions::invalidFunctionUsage(), CheckIO::invalidPrintfArgTypeError_float(), CheckIO::invalidPrintfArgTypeError_n(), CheckIO::invalidPrintfArgTypeError_p(), CheckIO::invalidPrintfArgTypeError_s(), CheckIO::invalidPrintfArgTypeError_sint(), CheckIO::invalidPrintfArgTypeError_uint(), CheckIO::invalidScanf(), CheckIO::invalidScanfArgTypeError_float(), CheckIO::invalidScanfArgTypeError_int(), CheckIO::invalidScanfArgTypeError_s(), CheckIO::invalidScanfError(), isAddressOfLocalVariable(), isAutoVarArray(), isBracketAccess(), isCallFunction(), iscast(), isChar(), CheckIO::ArgumentInfo::isComplexType(), isConditionKnown(), isConstExpression(), isConstFunctionCall(), isConstTop(), isConstVarExpression(), CheckStl::isContainerSize(), CheckStl::isContainerSizeGE(), Library::isContainerYield(), isCPPCastKeyword(), isEarlyExit(), isEnumDefinition(), isEnumStart(), Type::isEnumType(), isForwardJump(), SymbolDatabase::isFunction(), isFunctionCall(), Tokenizer::isFunctionHead(), CheckUninitVar::isFunctionParUsage(), isGlobalData(), CheckClass::isInverted(), isIterator(), ValueFlow::isLifetimeBorrowed(), isLikelyStreamRead(), isLocalContainerBuffer(), isLowerThanAnd(), isLowerThanOr(), isLowerThanShift(), isLowerThanXor(), CheckClass::isMemberFunc(), CheckClass::isMemberVar(), CheckUninitVar::isMemberVariableAssignment(), isNonConstFunctionCall(), isNonMacro(), isNotEqual(), isNullOperand(), CheckMemoryLeak::isOpenDevNull(), isOperator(), isOppositeCond(), CheckCondition::isOverlappingCond(), isParameterChanged(), isPartOfClassStructUnion(), Variable::isPointerArray(), CheckNullPointer::isPointerDeRef(), SymbolDatabase::isReservedName(), isReturnScope(), isSameExpression(), isScopeBracket(), Library::isScopeNoReturn(), isSimpleExpr(), isStdMoveOrStdForwarded(), isStructuredBindingVariable(), isType(), Type::isTypeAlias(), isUnchanged(), isUsedAsBool(), isVariableChanged(), isVariableChangedByFunctionCall(), Scope::isVariableDeclaration(), isVariableInit(), CheckUninitVar::isVariableUsage(), isVariableUsed(), isVarUsedInTree(), isVLAIndex(), ValueFlowAnalyzer::isWritable(), isZeroBoundCond(), CheckStl::iterators(), CheckOther::knownArgumentError(), CheckStl::knownEmptyContainer(), CheckLeakAutoVar::leakIfAllocated(), linkBrackets(), Match(), match(), matchMemberName(), TemplateSimplifier::matchSpecialization(), matchTemplateParameters(), CheckFunctions::mathfunctionCallWarning(), CheckFunctions::memsetInvalid2ndParam(), CheckFunctions::memsetZeroBytes(), minUnsignedValue(), CheckStl::mismatchingContainerIterator(), multiCompareImpl(), multiComparePercent(), CheckCondition::multiCondition2(), Type::name(), notvar(), CheckNullPointer::nullConstantDereference(), numberOfArgumentsWithoutAst(), CheckClass::operatorEqToSelf(), CheckOther::oppositeExpressionError(), CheckStl::outOfBoundsIndexExpressionError(), CheckString::overlappingStrcmp(), CheckOther::overlappingWriteFunction(), SimpleConditionHandler::parse(), ContainerConditionHandler::parse(), parseComparison(), parsedecl(), CheckUnusedFunctions::parseTokens(), CheckBool::pointerArithBoolCond(), CheckNullPointer::pointerArithmeticError(), FwdAnalysis::possiblyAliased(), CheckPostfixOperator::postfixOperator(), SymbolDatabase::printOut(), TemplateSimplifier::printOut(), printValueFlow(), SymbolDatabase::printVariable(), Tokenizer::processFunc(), programMemoryParseCondition(), CheckStl::redundantCondition(), CheckNullPointer::redundantConditionWarning(), Tokenizer::removeExtraTemplateKeywords(), Tokenizer::removeMacrosInGlobalScope(), Tokenizer::removeRedundantSemicolons(), TemplateSimplifier::replaceTemplateUsage(), Tokenizer::reportUnknownMacros(), SymbolDatabase::returnImplicitIntError(), Library::returnValueType(), Scope::Scope(), SymbolDatabase::setArrayDimensionsUsingValueFlow(), Function::setFlags(), setTokenValue(), setTypes(), ValueFlow::setValues(), SymbolDatabase::setValueType(), SymbolDatabase::setValueTypeInTokenList(), setVarIdClassDeclaration(), Tokenizer::setVarIdClassFunction(), setVarIdParseDeclaration(), Tokenizer::setVarIdPass1(), Tokenizer::setVarIdPass2(), setVarIdStructMembers(), CheckOther::shadowError(), Tokenizer::simplifyAddBracesPair(), Tokenizer::simplifyAddBracesToCommand(), Tokenizer::simplifyArrayAccessSyntax(), TemplateSimplifier::simplifyCalculations(), Tokenizer::simplifyCAlternativeTokens(), Tokenizer::simplifyCaseRange(), Tokenizer::simplifyDoublePlusAndDoubleMinus(), Tokenizer::simplifyEmptyNamespaces(), Tokenizer::simplifyExternC(), Tokenizer::simplifyFunctionParameters(), Tokenizer::simplifyFunctionPointers(), Tokenizer::simplifyHeadersAndUnusedTemplates(), Tokenizer::simplifyIfSwitchForInit(), Tokenizer::simplifyInitVar(), Tokenizer::simplifyLabelsCaseDefault(), TemplateSimplifier::simplifyNumericCalculations(), Tokenizer::simplifyRedundantParentheses(), Tokenizer::simplifyRoundCurlyParentheses(), Tokenizer::simplifySQL(), Tokenizer::simplifyStaticConst(), TemplateSimplifier::simplifyTemplateAliases(), TemplateSimplifier::simplifyTemplateArgs(), TemplateSimplifier::simplifyTemplateInstantiations(), TemplateSimplifier::simplifyTemplates(), Tokenizer::simplifyTokenList1(), Tokenizer::simplifyTokens1(), Tokenizer::simplifyTypedef(), Tokenizer::simplifyTypedefCpp(), Tokenizer::simplifyTypeIntrinsics(), Tokenizer::simplifyUsing(), Tokenizer::simplifyUsingError(), Tokenizer::simplifyUsingToTypedef(), Tokenizer::simplifyVarDecl(), Tokenizer::simplifyVariableMultipleAssign(), singleConditionalInScope(), singleIncrementInScope(), singleMemberCallInScope(), singleStatement(), CheckStl::size(), CheckStl::sizeError(), CheckSizeof::sizeofFunction(), Tokenizer::sizeOfType(), skipBrackets(), skipBracketsAndMembers(), skipCaseLabel(), skipDecl(), skipInitializerList(), skipRequires(), skipTernaryOp(), Variable::smartPointerType(), ValueFlow::solveExprValue(), splitDefinitionFromTypedef(), Tokenizer::splitTemplateRightAngleBrackets(), CheckString::sprintfOverlappingDataError(), Tokenizer::startOfExecutableScope(), CheckStl::stlOutOfBounds(), CheckStl::string_c_str(), CheckString::stringLiteralWriteError(), MemberExpressionAnalyzer::submatch(), CheckOther::suspiciousSemicolonError(), CheckSizeof::suspiciousSizeofCalculation(), TemplateSimplifier::templateParameters(), CheckClass::thisUseAfterFree(), TemplateSimplifier::TokenAndName::TokenAndName(), tokenToString(), tokenType(), ValueFlow::Value::toString(), Type::type(), typeDecl(), typesMatch(), Tokenizer::unhandled_macro_class_x_y(), Tokenizer::unhandledCharLiteral(), CheckExceptionSafety::unhandledExceptionSpecificationError(), Tokenizer::unknownMacroError(), Tokenizer::unmatchedToken(), CheckOther::unreachableCodeError(), Tokenizer::unsupportedTypedef(), CheckOther::unusedLabelError(), TemplateSimplifier::useDefaultArgumentValues(), useFunctionArgs(), CheckStl::uselessCalls(), CheckStl::uselessCallsConstructorError(), CheckFunctions::useStandardLibrary(), CheckStl::useStlAlgorithm(), usingNamespace(), CheckVaarg::va_list_usage(), Tokenizer::validate(), Tokenizer::validateC(), SymbolDatabase::validateExecutableScopes(), valueFlowAfterAssign(), valueFlowAfterMove(), valueFlowBitAnd(), valueFlowDynamicBufferSize(), valueFlowForLoop2(), valueFlowForLoopSimplify(), valueFlowForwardLifetime(), valueFlowFunctionReturn(), valueFlowInferCondition(), valueFlowLifetimeClassConstructor(), valueFlowLifetimeFunction(), valueFlowNumber(), valueFlowPointerAlias(), valueFlowRightShift(), valueFlowSetConstantValue(), valueFlowSwitchVariable(), valueFlowSymbolicInfer(), valueFlowSymbolicOperators(), valueFlowUninit(), valueFlowUnknownFunctionReturn(), CheckMemoryLeakInClass::variable(), Variable::Variable(), CheckClass::virtualDestructor(), CheckClass::virtualFunctionCallInConstructorError(), CheckOther::warningOldStylePointerCast(), ValueFlowAnalyzer::writeValue(), CheckIO::wrongPrintfScanfArgumentsError(), and CheckOther::zerodivError().
const std::string & Token::strAt | ( | int | index | ) | const |
Definition at line 423 of file token.cpp.
References emptyString, mStr, and tokAt().
Referenced by Function::addArguments(), SymbolDatabase::addClassFunction(), TemplateSimplifier::addNamespace(), Function::argsMatch(), CheckIO::ArgumentInfo::ArgumentInfo(), CheckIO::argumentType(), Tokenizer::arraySize(), CheckCondition::assignIf(), CheckCondition::assignIfParseScope(), bifurcate(), Tokenizer::calculateScopes(), CheckClass::checkConstFunc(), CheckStl::checkDereferenceInvalidIterator(), CheckOther::checkEvaluationOrder(), CheckIO::checkFileUsage(), CheckIO::checkFormatString(), CheckMemoryLeakNoVar::checkForUnsafeArgAlloc(), CheckUnusedVar::checkFunctionVariableUsage_iterateScopes(), CheckString::checkIncorrectStringCompare(), CheckOther::checkInnerScope(), CheckOther::checkInterlockedDecrement(), CheckClass::checkMemset(), CheckMemoryLeakInClass::checkPublicFunctions(), CheckOther::checkRedundantCopy(), CheckClass::checkReturnPtrThis(), CheckUninitVar::checkScope(), CheckLeakAutoVar::checkScope(), CheckUninitVar::checkScopeForVariable(), CheckSizeof::checkSizeofForPointerSize(), CheckOther::checkUnreachableCode(), checkVariableCallMatch(), containerAppendsElement(), containerPopsElement(), containerYieldsElement(), Tokenizer::createLinks2(), SymbolDatabase::createSymbolDatabaseFindAllScopes(), doAssignment(), Tokenizer::duplicateTypedef(), Tokenizer::elseif(), Variable::evaluate(), TemplateSimplifier::expandTemplate(), findClosingBracket(), SymbolDatabase::findEnumerator(), SymbolDatabase::findFunction(), SymbolDatabase::findFunctionInScope(), SymbolDatabase::findScope(), SymbolDatabase::findType(), SymbolDatabase::findTypeInNested(), SymbolDatabase::findVariableType(), Function::Function(), CheckMemoryLeak::getAllocationType(), Library::getContainerFromAction(), getContainerFromSize(), Library::getContainerFromYield(), getContainerIndex(), getContainerYield(), CheckMemoryLeak::getDeallocationType(), Library::getFunctionName(), TemplateSimplifier::getTemplateInstantiations(), TemplateSimplifier::getTemplateNamePositionTemplateClass(), TemplateSimplifier::getTemplateNamePositionTemplateFunction(), TemplateSimplifier::getTemplateParametersInDeclaration(), getTypeString(), CheckClass::initializationListUsage(), CheckClass::initializeVarList(), Tokenizer::initVar(), insertToken(), TemplateSimplifier::instantiateMatch(), CheckIO::ArgumentInfo::isArrayOrPointer(), CheckIO::ArgumentInfo::isComplexType(), isContainerSizeChangedByFunction(), isEnumStart(), SymbolDatabase::isFunction(), CheckClass::isMemberVar(), CheckUninitVar::isMemberVariableAssignment(), CheckUninitVar::isMemberVariableUsage(), isOperator(), isPartOfClassStructUnion(), isStdMoveOrStdForwarded(), CheckIO::ArgumentInfo::isStdVectorOrString(), Scope::isVariableDeclaration(), CheckStl::iterators(), matchMemberVarName(), CheckFunctions::mathfunctionCallWarning(), CheckNullPointer::nullConstantDereference(), Check64BitPortability::pointerassignment(), SymbolDatabase::printOut(), TemplateSimplifier::printOut(), CheckOther::redundantBitwiseOperationInSwitchError(), Tokenizer::removeMacrosInGlobalScope(), Tokenizer::reportUnknownMacros(), SymbolDatabase::setValueType(), setVarIdClassDeclaration(), Tokenizer::setVarIdPass1(), Tokenizer::setVarIdPass2(), setVarIdStructMembers(), Tokenizer::simplifyAddBracesPair(), Tokenizer::simplifyAddBracesToCommand(), Tokenizer::simplifyCAlternativeTokens(), Tokenizer::simplifyCaseRange(), Tokenizer::simplifyEmptyNamespaces(), Tokenizer::simplifyExternC(), Tokenizer::simplifyFunctionParameters(), Tokenizer::simplifyHeadersAndUnusedTemplates(), Tokenizer::simplifyLabelsCaseDefault(), Tokenizer::simplifyRedundantParentheses(), TemplateSimplifier::simplifyTemplateInstantiations(), Tokenizer::simplifyTokenList1(), Tokenizer::simplifyTypedefCpp(), Tokenizer::simplifyUsing(), Tokenizer::simplifyVarDecl(), CheckStl::size(), skipPointers(), skipScopeIdentifiers(), Tokenizer::splitTemplateRightAngleBrackets(), CheckStl::stlOutOfBounds(), CheckStl::string_c_str(), CheckClass::thisSubtraction(), TemplateSimplifier::TokenAndName::TokenAndName(), Tokenizer::unhandled_macro_class_x_y(), TemplateSimplifier::useDefaultArgumentValues(), CheckStl::uselessCalls(), Tokenizer::validateC(), valueFlowArrayElement(), valueFlowContainerSize(), valueFlowDynamicBufferSize(), and CheckOther::warningOldStylePointerCast().
std::string Token::stringify | ( | bool | varid, |
bool | attributes, | ||
bool | macro | ||
) | const |
Stringify a token.
varid | Print varids. (Style: "varname\@id") |
attributes | Print attributes of tokens like "unsigned" in front of it. |
macro | Prints $ in front of the token if it was expanded from a macro. |
Definition at line 1328 of file token.cpp.
References Token::stringifyOptions::attributes, Token::stringifyOptions::macro, stringify(), and Token::stringifyOptions::varid.
std::string Token::stringify | ( | const stringifyOptions & | options | ) | const |
Definition at line 1280 of file token.cpp.
References Token::stringifyOptions::attributes, eChar, efIsUnique, eString, Token::stringifyOptions::exprid, Token::stringifyOptions::idtype, isComplex(), isExpandedMacro(), isLong(), isName(), isSigned(), isUnsigned(), Token::stringifyOptions::macro, TokenImpl::mExprId, mImpl, mStr, mTokType, TokenImpl::mVarId, and Token::stringifyOptions::varid.
Referenced by CheckIO::argumentType(), CheckOther::checkDuplicateBranch(), and stringify().
std::string Token::stringifyList | ( | bool | varid, |
bool | attributes, | ||
bool | linenumbers, | ||
bool | linebreaks, | ||
bool | files, | ||
const std::vector< std::string > * | fileNames = nullptr , |
||
const Token * | end = nullptr |
||
) | const |
Stringify a list of token, from current instance on.
varid | Print varids. (Style: "varname\@id") |
attributes | Print attributes of tokens like "unsigned" in front of it. |
linenumbers | Print line number in front of each line |
linebreaks | Insert "\\n" into string when line number changes |
files | print Files as numbers or as names (if fileNames is given) |
fileNames | Vector of filenames. Used (if given) to print filenames as strings instead of numbers. |
end | Stringification ends before this token is reached. 0 to stringify until end of list. |
Definition at line 1415 of file token.cpp.
References Token::stringifyOptions::attributes, Token::stringifyOptions::files, Token::stringifyOptions::linebreaks, Token::stringifyOptions::linenumbers, Token::stringifyOptions::macro, stringifyList(), and Token::stringifyOptions::varid.
std::string Token::stringifyList | ( | bool | varid = false | ) | const |
Definition at line 1432 of file token.cpp.
References stringifyList().
std::string Token::stringifyList | ( | const stringifyOptions & | options, |
const std::vector< std::string > * | fileNames = nullptr , |
||
const Token * | end = nullptr |
||
) | const |
Definition at line 1337 of file token.cpp.
References fileIndex(), Token::stringifyOptions::files, Token::stringifyOptions::linebreaks, linenr(), Token::stringifyOptions::linenumbers, TokenImpl::mFileIndex, mImpl, TokenImpl::mLineNumber, and next().
Referenced by CheckOther::checkDuplicateBranch(), isUniqueExpression(), printLines(), printOut(), Tokenizer::simplifySQL(), and stringifyList().
std::string Token::stringifyList | ( | const Token * | end, |
bool | attributes = true |
||
) | const |
Definition at line 1427 of file token.cpp.
References stringifyList().
std::string Token::strValue | ( | ) | const |
This can be called only for tokens that are strings, else the assert() is called.
If Token is e.g. '"hello"', this will return 'hello' (removing the double quotes).
Definition at line 223 of file token.cpp.
References eString, getStringLiteral(), mStr, and mTokType.
Referenced by CheckIO::checkFileUsage().
void Token::swapWithNext | ( | ) |
Swap the contents of this token with the next token.
Definition at line 285 of file token.cpp.
References mFlags, mImpl, mLink, mNext, mStr, TokenImpl::mTemplateSimplifierPointers, mTokType, and templateSimplifierPointer().
Referenced by Tokenizer::simplifyStaticConst().
|
private |
used by deleteThis() to take data from token to delete
Definition at line 311 of file token.cpp.
References link(), mFlags, mImpl, mLink, mStr, TokenImpl::mTemplateSimplifierPointers, mTokType, templateSimplifierPointer(), and tokType().
Referenced by deleteThis().
|
inline |
Definition at line 698 of file token.h.
Referenced by swapWithNext(), takeData(), and TemplateSimplifier::TokenAndName::TokenAndName().
|
inline |
|
inline |
Token * Token::tokAt | ( | int | index | ) |
Definition at line 398 of file token.cpp.
References index(), and tokAtImpl().
const Token * Token::tokAt | ( | int | index | ) | const |
Definition at line 393 of file token.cpp.
References index(), and tokAtImpl().
Referenced by accumulateBoolLiteral(), Function::addArguments(), addByOne(), SymbolDatabase::addClassFunction(), TemplateSimplifier::addInstantiation(), TemplateSimplifier::addNamespace(), SymbolDatabase::addNewFunction(), ConditionHandler::afterCondition(), TemplateSimplifier::TokenAndName::aliasStartToken(), TemplateSimplifier::alreadyHasNamespace(), ValueFlowAnalyzer::analyzeCondition(), Function::argsMatch(), CheckIO::ArgumentInfo::ArgumentInfo(), CheckIO::argumentType(), Tokenizer::arraySize(), Tokenizer::arraySizeAfterValueFlow(), CheckCondition::assignIf(), CheckCondition::assignIfError(), CheckCondition::assignIfParseScope(), ValueFlowAnalyzer::assume(), CheckAutoVariables::autoVariables(), bifurcate(), Tokenizer::calculateScopes(), CheckBoost::checkBoostForeachModification(), CheckExceptionSafety::checkCatchExceptionByValue(), TemplateSimplifier::checkComplicatedSyntaxErrorsInTemplates(), Tokenizer::checkConfiguration(), CheckClass::checkConstFunc(), CheckStl::checkDereferenceInvalidIterator(), CheckOther::checkDuplicateBranch(), CheckOther::checkDuplicateExpression(), CheckIO::checkFileUsage(), Tokenizer::checkForEnumsWithTypedef(), CheckMemoryLeakNoVar::checkForUnsafeArgAlloc(), checkFunctionUsage(), CheckUnusedVar::checkFunctionVariableUsage(), CheckUnusedVar::checkFunctionVariableUsage_iterateScopes(), CheckUninitVar::checkIfForWhileHead(), CheckOther::checkIncompleteArrayFill(), CheckString::checkIncorrectStringCompare(), CheckOther::checkInnerScope(), CheckOther::checkInterlockedDecrement(), CheckFunctions::checkLibraryMatchFunctions(), CheckUninitVar::checkLoopBodyRecursive(), CheckFunctions::checkMathFunctions(), CheckClass::checkMemset(), CheckClass::checkMemsetType(), checkMissingReturnScope(), CheckOther::checkMisusedScopedObject(), CheckStl::checkMutexes(), CheckMemoryLeakInClass::checkPublicFunctions(), CheckMemoryLeakInFunction::checkReallocUsage(), FwdAnalysis::checkRecursive(), CheckOther::checkRedundantCopy(), CheckExceptionSafety::checkRethrowCopy(), CheckClass::checkReturnPtrThis(), checkReturns(), CheckLeakAutoVar::checkScope(), CheckUninitVar::checkScopeForVariable(), CheckSizeof::checkSizeofForPointerSize(), CheckUninitVar::checkStruct(), CheckOther::checkSuspiciousSemicolon(), CheckClass::checkThisUseAfterFreeRecursive(), CheckLeakAutoVar::checkTokenInsideExpression(), CheckOther::checkUnreachableCode(), CheckClass::checkUnsafeClassRefMember(), CheckOther::checkVarFuncNullUB(), Scope::checkVariable(), CheckOther::checkVariableScope(), CheckCondition::clarifyCondition(), Tokenizer::combineOperators(), Tokenizer::concatenateNegativeNumberAndAnyPositive(), CheckClass::copyconstructors(), Tokenizer::createLinks2(), clangimport::AstNode::createScope(), SymbolDatabase::createSymbolDatabaseClassInfo(), SymbolDatabase::createSymbolDatabaseFindAllScopes(), SymbolDatabase::createSymbolDatabaseIncompleteVars(), doAssignment(), CheckCondition::duplicateCondition(), Tokenizer::duplicateTypedef(), CheckStl::erase(), CheckStl::eraseCheckLoopVar(), TemplateSimplifier::expandTemplate(), findClosingBracket(), SymbolDatabase::findEnumerator(), SymbolDatabase::findFunction(), SymbolDatabase::findFunctionInScope(), SymbolDatabase::findScope(), findStartToken(), SymbolDatabase::findType(), SymbolDatabase::findTypeInNested(), SymbolDatabase::findVariableType(), PathAnalysis::forwardRange(), CheckLeakAutoVar::functionCall(), CheckMemoryLeak::getAllocationType(), getCastTypeStartToken(), Library::getContainerFromAction(), getContainerFromSize(), Library::getContainerFromYield(), getContainerIndex(), getContainerName(), getContainerYield(), CheckMemoryLeak::getDeallocationType(), Library::getFunctionName(), getFuncTokFromThis(), getLifetimeTokens(), TemplateSimplifier::getNewName(), TemplateSimplifier::getTemplateDeclarations(), TemplateSimplifier::getTemplateInstantiations(), TemplateSimplifier::getTemplateNamePosition(), TemplateSimplifier::getTemplateNamePositionTemplateClass(), TemplateSimplifier::getTemplateNamePositionTemplateFunction(), TemplateSimplifier::getTemplateNamePositionTemplateVariable(), getTypeString(), getVariableChangedStart(), getVariableInitExpression(), Scope::getVariableList(), CheckClass::hasAllocation(), CheckStl::if_find(), Type::initBaseInfo(), CheckClass::initializationListUsage(), CheckClass::initializeVarList(), Tokenizer::initVar(), insertToken(), CheckFunctions::invalidFunctionUsage(), CheckIO::invalidScanf(), isAutoVar(), isBreakOrContinueScope(), CheckIO::ArgumentInfo::isComplexType(), isConstFunctionCall(), isEnumStart(), isFunctionCall(), Tokenizer::isFunctionHead(), CheckUnusedVar::isFunctionWithoutSideEffects(), isInitialVarAssign(), CheckClass::isMemberFunc(), Tokenizer::isMemberFunction(), CheckClass::isMemberVar(), CheckUninitVar::isMemberVariableAssignment(), CheckUninitVar::isMemberVariableUsage(), isOpenParenthesisMemberFunctionCallOfVarId(), CheckNullPointer::isPointerDeRef(), CheckUnusedVar::isRecordTypeWithoutSideEffects(), isReturnScope(), isSameExpression(), Library::isScopeNoReturn(), Tokenizer::isScopeNoReturn(), CheckIO::ArgumentInfo::isStdContainer(), isStdMoveOrStdForwarded(), CheckIO::ArgumentInfo::isStdVectorOrString(), isThisChanged(), isUnknownType(), isVariableChanged(), isVariableChangedByFunctionCall(), Scope::isVariableDeclaration(), ContainerExpressionAnalyzer::isWritable(), CheckStl::iterators(), matchMemberName(), matchMemberVarName(), TemplateSimplifier::matchSpecialization(), matchTemplateParameters(), CheckStl::missingComparison(), CheckCondition::multiCondition(), CheckCondition::multiCondition2(), Type::name(), CheckNullPointer::nullConstantDereference(), parsedecl(), CheckNullPointer::parseFunctionCall(), CheckUnusedFunctions::parseTokens(), CheckBool::pointerArithBool(), FwdAnalysis::possiblyAliased(), SymbolDatabase::printOut(), Tokenizer::processFunc(), CheckStl::redundantCondition(), Tokenizer::removeExtraTemplateKeywords(), Tokenizer::removeMacroInClassDef(), Tokenizer::removeMacrosInGlobalScope(), Tokenizer::reportUnknownMacros(), CheckLeakAutoVar::ret(), setTypes(), SymbolDatabase::setValueType(), SymbolDatabase::setValueTypeInTokenList(), setVarIdClassDeclaration(), Tokenizer::setVarIdClassFunction(), setVarIdParseDeclaration(), Tokenizer::setVarIdPass1(), Tokenizer::setVarIdPass2(), setVarIdStructMembers(), Tokenizer::simplifyAddBracesPair(), Tokenizer::simplifyAddBracesToCommand(), Tokenizer::simplifyArrayAccessSyntax(), TemplateSimplifier::simplifyCalculations(), Tokenizer::simplifyCaseRange(), Tokenizer::simplifyEmptyNamespaces(), Tokenizer::simplifyFunctionParameters(), Tokenizer::simplifyFunctionPointers(), Tokenizer::simplifyHeadersAndUnusedTemplates(), Tokenizer::simplifyIfSwitchForInit(), Tokenizer::simplifyInitVar(), Tokenizer::simplifyLabelsCaseDefault(), TemplateSimplifier::simplifyNumericCalculations(), Tokenizer::simplifyPointerToStandardType(), Tokenizer::simplifyRedundantParentheses(), Tokenizer::simplifyRoundCurlyParentheses(), Tokenizer::simplifySQL(), TemplateSimplifier::simplifyTemplateAliases(), TemplateSimplifier::simplifyTemplateArgs(), TemplateSimplifier::simplifyTemplateInstantiations(), TemplateSimplifier::simplifyTemplates(), Tokenizer::simplifyTypedefCpp(), Tokenizer::simplifyTypeIntrinsics(), Tokenizer::simplifyUsing(), Tokenizer::simplifyUsingToTypedef(), Tokenizer::simplifyVarDecl(), Tokenizer::simplifyVariableMultipleAssign(), singleAssignInScope(), singleIncrementInScope(), singleMemberCallInScope(), CheckStl::size(), CheckSizeof::sizeofCalculation(), CheckSizeof::sizeofFunction(), skipBracketsAndMembers(), skipDecl(), skipInitializerList(), skipMembers(), skipPointers(), skipRequires(), skipScopeIdentifiers(), splitDefinitionFromTypedef(), Tokenizer::splitTemplateRightAngleBrackets(), CheckStl::stlOutOfBounds(), strAt(), CheckStl::string_c_str(), TemplateSimplifier::templateParameters(), TemplateSimplifier::TokenAndName::TokenAndName(), Type::Type(), typeDecl(), TemplateSimplifier::useDefaultArgumentValues(), CheckStl::uselessCalls(), CheckStl::useStlAlgorithm(), usingNamespace(), CheckVaarg::va_list_usage(), CheckVaarg::va_start_argument(), Tokenizer::validateC(), valueFlowArray(), valueFlowArrayElement(), valueFlowContainerSize(), valueFlowDynamicBufferSize(), valueFlowFunctionDefaultParameter(), valueFlowImpossibleValues(), valueFlowLifetime(), valueFlowLifetimeFunction(), valueFlowSetConstantValue(), valueFlowSmartPointer(), valueFlowSwitchVariable(), CheckMemoryLeakInClass::variable(), CheckClass::virtualDestructor(), and CheckOther::warningOldStylePointerCast().
|
inline |
Definition at line 343 of file token.h.
Referenced by CheckIO::ArgumentInfo::ArgumentInfo(), CheckIO::argumentType(), CheckBufferOverrun::arrayIndex(), CheckBufferOverrun::arrayIndexThenCheck(), CheckClass::checkConstFunc(), CheckIO::checkFileUsage(), CheckIO::checkFormatString(), CheckUnusedVar::checkFunctionVariableUsage(), CheckUnusedVar::checkFunctionVariableUsage_iterateScopes(), CheckOther::checkIncompleteStatement(), CheckString::checkSuspiciousStringCompare(), CheckAssert::checkVariableAssignment(), Tokenizer::concatenateNegativeNumberAndAnyPositive(), CheckClass::constructors(), CheckOther::constStatementError(), TokenList::copyTokens(), createBuiltinLibraryFunctions(), Tokenizer::createLinks2(), SymbolDatabase::createSymbolDatabaseExprIds(), Tokenizer::dump(), CheckAutoVariables::errorInvalidDeallocation(), function(), getParentValueTypes(), getStrArraySize(), getStrSize(), TemplateSimplifier::getTemplateInstantiations(), TokenList::insertTokens(), CheckIO::invalidScanf(), isConstExpression(), ValueFlowAnalyzer::isGlobalModified(), isSameExpression(), isSimpleExpr(), isUnaryPreOp(), isVariableChanged(), isVariableChangedByFunctionCall(), ContainerExpressionAnalyzer::isWritable(), multiComparePercent(), SymbolDatabase::setValueType(), SymbolDatabase::setValueTypeInTokenList(), Tokenizer::setVarIdPass2(), Tokenizer::simplifyAddBracesPair(), Tokenizer::simplifyTokens1(), CheckStl::size(), CheckSizeof::sizeofFunction(), Tokenizer::sizeOfType(), takeData(), TemplateSimplifier::templateParameters(), type(), update_property_info(), update_property_isStandardType(), valueFlowConditionExpressions(), valueFlowDynamicBufferSize(), valueFlowGetStrLength(), valueFlowSetConstantValue(), valueFlowString(), CheckOther::warningOldStylePointerCast(), and ContainerExpressionAnalyzer::writeValue().
|
inline |
|
inline |
void Token::type | ( | const ::Type * | t | ) |
Associate this token with given type.
t | Type to be associated |
Definition at line 2333 of file token.cpp.
References eName, eType, Type::isEnumType(), isEnumType(), mImpl, mTokType, TokenImpl::mType, and tokType().
Referenced by CheckClass::checkConst(), CheckMemoryLeakNoVar::checkForUnreleasedInputArgument(), CheckClass::checkMemset(), CheckOther::checkMisusedScopedObject(), CheckLeakAutoVar::checkScope(), CheckClass::constructors(), SymbolDatabase::createSymbolDatabaseSetSmartPointerType(), Tokenizer::dump(), CheckLeakAutoVar::functionCall(), CheckMemoryLeak::getAllocationType(), Function::getOverriddenFunctionRecursive(), Tokenizer::isScopeNoReturn(), isTemporary(), isUnknownType(), Variable::iteratorType(), CheckOther::knownArgumentError(), parsedecl(), SymbolDatabase::printOut(), SymbolDatabase::setValueType(), SymbolDatabase::setValueTypeInTokenList(), SymbolDatabase::sizeOfType(), typeDecl(), typeOf(), valueFlowSetConstantValue(), and SymbolDatabase::~SymbolDatabase().
|
static |
pointedToType | return the pointed-to type? |
Definition at line 2397 of file token.cpp.
References astIsContainer(), astIsIterator(), astIsRangeBasedForDecl(), astIsSmartPointer(), astOperand1(), astOperand2(), astParent(), ValueType::containerTypeToken, Variable::declarationId(), Variable::declEndToken(), Scope::function, function(), link(), linkAt(), Match(), Variable::nameToken(), next(), nextAfterAstRightmostLeaf(), previous(), previousBeforeAstLeftmostLeaf(), Function::retDef, scope(), simpleMatch(), ValueType::smartPointerTypeToken, str(), tokAt(), type(), Variable::typeEndToken(), typeOf(), Variable::typeStartToken(), Variable::valueType(), and variable().
Referenced by astCanonicalType(), getPointerDepth(), isDifferentType(), isLockGuard(), isMutex(), and typeStr().
Definition at line 2343 of file token.cpp.
References astOperand1(), astOperand2(), Scope::function, function(), getArgumentVars(), getLHSVariableToken(), getTokenArgumentFunction(), Match(), next(), previous(), Function::retType, scope(), simpleMatch(), type(), and variable().
Referenced by getArgumentVars(), getParentValueTypes(), isDifferentType(), isTrivialConstructor(), typeDecl(), and valueFlowLifetimeConstructor().
|
static |
Definition at line 2496 of file token.cpp.
References ValueType::str(), typeDecl(), and valueType().
Referenced by valueFlowLifetimeFunction().
ConstTokenRange Token::until | ( | const Token * | t | ) | const |
|
private |
Update internal property cache about string and char literals.
Definition at line 194 of file token.cpp.
References eChar, eString, isLong(), isPrefixStringCharLiteral(), mStr, and mTokType.
Referenced by update_property_info().
|
private |
Updates internal property cache like _isName or _isBoolean.
Called after any mStr() modification.
Definition at line 103 of file token.cpp.
References controlFlowKeywords, eArithmeticalOp, eAssignmentOp, eBitOp, eBoolean, eBracket, eChar, eComparisonOp, eEllipsis, eExtendedOp, eFunction, eIncDecOp, eKeyword, eLogicalOp, eName, eNone, eNumber, eOther, eString, eType, eVariable, fIsControlFlowKeyword, isCharLiteral(), MathLib::isFloat(), MathLib::isInt(), TokenList::isKeyword(), isStringLiteral(), TokensFrontBack::list, mImpl, mLink, mStr, mTokensFrontBack, mTokType, TokenImpl::mVarId, setFlag(), tokType(), update_property_char_string_literal(), and update_property_isStandardType().
Referenced by concatStr().
|
private |
Update internal property cache about isStandardType()
Definition at line 181 of file token.cpp.
References eType, isStandardType(), mStr, stdTypes, and tokType().
Referenced by update_property_info().
|
inline |
Definition at line 1197 of file token.h.
References TokenImpl::mEmptyValueList.
Referenced by CheckCondition::alwaysTrueFalse(), astStringXml(), LifetimeStore::byDerefCopy(), LifetimeStore::byRef(), LifetimeStore::byVal(), PathAnalysis::checkCond(), CheckStl::checkDereferenceInvalidIterator2(), CheckOther::checkKnownArgument(), FwdAnalysis::checkRecursive(), CheckUninitVar::checkScopeForVariable(), compareKnownValue(), Tokenizer::dump(), ValueFlowAnalyzer::evaluate(), ValueFlowAnalyzer::evaluateInt(), ConditionHandler::fillFromPath(), findFormat(), CheckLeakAutoVar::functionCall(), getBufferSizeValue(), getCompareValue(), getContainerValues(), getExpressionRange(), CTU::getFileInfo(), getFunctionArgumentValues(), getInnerLifetime(), getKnownValueFromToken(), ValueFlow::getLifetimeObjValues(), getLifetimeTokens(), getOOBIterValue(), ValueFlowAnalyzer::getSymbols(), ValueFlowPassRunner::getTotalValues(), inferCondition(), isAliasOf(), isAutoVarArray(), CheckStl::isContainerSizeGE(), isKnownEmptyContainer(), isNonZero(), isOutOfBoundsImpl(), ValueFlowAnalyzer::isSameSymbolicValue(), isSameToken(), isStrlenOf(), isUsedAsBool(), ContainerExpressionAnalyzer::isWritable(), makeContainerSizeValue(), match(), minUnsignedValue(), CheckNullPointer::nullConstantDereference(), CheckBufferOverrun::objectIndex(), CheckStl::outOfBounds(), parseCompareEachInt(), printValueFlow(), setTokenValue(), ExpressionAnalyzer::setupExprVarIds(), Tokenizer::simplifyTokens1(), ConditionHandler::skipNotAndCasts(), MultiValueFlowAnalyzer::stopOnCondition(), valueFlowAfterAssign(), valueFlowArrayBool(), valueFlowArrayElement(), ValueFlow::valueFlowConstantFoldAST(), valueFlowContainerSize(), valueFlowDebug(), valueFlowDynamicBufferSize(), valueFlowEnumValue(), valueFlowForwardConst(), valueFlowForwardLifetime(), valueFlowFunctionDefaultParameter(), valueFlowImpossibleValues(), valueFlowInferCondition(), valueFlowIteratorInfer(), valueFlowLifetime(), valueFlowLifetimeFunction(), valueFlowLifetimeUserConstructor(), valueFlowSmartPointer(), valueFlowSymbolicOperators(), CheckOther::warningOldStylePointerCast(), and ContainerExpressionAnalyzer::writeValue().
|
inline |
Definition at line 331 of file token.h.
Referenced by ConditionHandler::afterCondition(), CheckNullPointer::arithmetic(), astContainerAction(), astContainerYield(), astIsBool(), astIsCharWithSign(), astIsContainerString(), astIsFloat(), astIsGenericChar(), astIsIntegral(), astIsIterator(), astIsPointer(), astIsPrimitive(), astIsSmartPointer(), astIsUniqueSmartPointer(), astIsUnsigned(), ConditionHandler::beforeCondition(), CheckBufferOverrun::bufferOverflow(), CheckOther::checkCharVariable(), CheckCondition::checkCompareValueOutOfTypeRange(), CheckClass::checkConstFunc(), CheckOther::checkConstPointer(), CheckOther::checkConstVariable(), CheckOther::checkDuplicateExpression(), CheckStl::checkFindInsert(), CheckUnusedVar::checkFunctionVariableUsage(), CheckUnusedVar::checkFunctionVariableUsage_iterateScopes(), CheckCondition::checkIncorrectLogicOperator(), CheckCondition::checkInvalidTestForOverflow(), CheckType::checkLongCast(), CheckCondition::checkPointerAdditionResultNotNull(), FwdAnalysis::checkRecursive(), CheckOther::checkRedundantPointerOp(), CheckOther::checkSignOfUnsignedVariable(), CheckSizeof::checkSizeofForPointerSize(), CheckString::checkSuspiciousStringCompare(), CheckOther::clarifyCalculation(), CheckOther::comparisonNonZeroExpressionLessThanZero(), SymbolDatabase::createSymbolDatabaseSetVariablePointers(), clangimport::AstNode::createTokens(), SymbolDatabase::debugSymbolDatabase(), Tokenizer::dump(), CheckStl::eraseIteratorOutOfBounds(), findExpressionChangedImpl(), SymbolDatabase::findFunction(), Scope::findFunction(), followVariableExpression(), CheckLeakAutoVar::functionCall(), getBufAndOffset(), CheckBufferOverrun::getBufferSize(), getClassScope(), Library::getContainerFromAction(), Library::getContainerFromYield(), getContainerFunction(), getDimensionsEtc(), getEnumType(), getExprUsage(), CTU::getFileInfo(), ContainerExpressionAnalyzer::getIndirect(), getInvalidMethod(), getLibraryContainer(), getParentValueTypes(), getPointerDepth(), getStrSize(), hasOverloadedAssignment(), CheckCondition::identicalConditionAfterEarlyExitError(), CheckClass::initializeVarList(), CheckFunctions::invalidFunctionUsage(), CheckOther::invalidPointerCast(), ValueFlowAnalyzer::isAliasModified(), CheckStl::isContainerSize(), ValueFlow::isContainerSizeChanged(), isContainerSizeChangedByFunction(), CheckBufferOverrun::isCtuUnsafeBufferUsage(), isDifferentType(), isGlobalData(), isIntegralOrPointer(), isIterator(), ValueFlow::isLifetimeBorrowed(), isMapFind(), isNegative(), isNullOperand(), isSameConstantValue(), isSameExpression(), isStdMoveOrStdForwarded(), isTemporary(), isTrivialConstructor(), isVariableChanged(), isVariableChangedByFunctionCall(), CheckUninitVar::isVariableUsage(), isVoidCast(), ContainerExpressionAnalyzer::isWritable(), CheckCondition::multiCondition2(), CheckBufferOverrun::objectIndex(), CheckStl::outOfBoundsError(), parsedecl(), CheckBufferOverrun::pointerArithmetic(), printValueFlow(), SymbolDatabase::printVariable(), CheckLeakAutoVar::ret(), CheckFunctions::returnLocalStdMove(), Library::returnValueType(), setAutoTokenProperties(), setTokenValue(), Variable::setValueType(), SymbolDatabase::setValueType(), SymbolDatabase::setValueTypeInTokenList(), CheckString::sprintfOverlappingData(), CheckStl::stlOutOfBounds(), CheckStl::string_c_str(), CheckOther::testIfNonZeroExpressionIsPositive(), typeStr(), useFunctionArgs(), CheckStl::uselessCalls(), CheckStl::useStlAlgorithm(), valueFlowAfterAssign(), valueFlowContainerSize(), valueFlowDynamicBufferSize(), valueFlowGlobalConstVar(), valueFlowGlobalStaticVar(), valueFlowIsSameContainerType(), valueFlowLifetime(), valueFlowLifetimeClassConstructor(), valueFlowLifetimeConstructor(), valueFlowLifetimeFunction(), valueFlowSetConstantValue(), clangimport::Data::varDecl(), ContainerExpressionAnalyzer::writeValue(), and ValueFlowAnalyzer::writeValue().
|
inline |
|
inline |
Associate this token with given variable.
v | Variable to be associated |
Definition at line 1070 of file token.h.
Referenced by ConditionHandler::afterCondition(), CheckIO::ArgumentInfo::ArgumentInfo(), CheckBufferOverrun::argumentSize(), CheckBufferOverrun::arrayIndex(), CheckAutoVariables::assignFunctionArg(), astStringXml(), bifurcate(), CheckBufferOverrun::bufferOverflow(), CheckExceptionSafety::checkCatchExceptionByValue(), CheckOther::checkComparePointers(), CheckBool::checkComparisonOfBoolWithBool(), CheckClass::checkConstFunc(), CheckOther::checkConstPointer(), CheckCondition::checkDuplicateConditionalAssign(), CheckUnusedVar::checkFunctionVariableUsage(), CheckUnusedVar::checkFunctionVariableUsage_iterateScopes(), CheckOther::checkIncompleteArrayFill(), CheckClass::checkMemset(), CheckStl::checkMutexes(), FwdAnalysis::checkRecursive(), CheckOther::checkRedundantCopy(), CheckOther::checkRedundantPointerOp(), CheckUninitVar::checkScopeForVariable(), CheckOther::checkShadowVariables(), CheckSizeof::checkSizeofForArrayParameter(), CheckSizeof::checkSizeofForPointerSize(), CheckClass::checkUnsafeClassRefMember(), CheckOther::checkVariableScope(), CheckAutoVariables::checkVarLifetimeScope(), CheckOther::comparePointersError(), CheckOther::comparisonNonZeroExpressionLessThanZero(), CheckClass::copyconstructors(), clangimport::AstNode::createScope(), SymbolDatabase::createSymbolDatabaseExprIds(), SymbolDatabase::createSymbolDatabaseSetVariablePointers(), Tokenizer::dump(), CheckStl::erase(), CheckAutoVariables::errorInvalidDeallocation(), exprDependsOnThis(), SymbolDatabase::findEnumerator(), findExpressionChangedImpl(), findFormat(), Scope::findFunction(), followAllReferences(), followVariableExpression(), CheckLeakAutoVar::functionCall(), CheckMemoryLeak::functionReturnType(), getArgumentVars(), CheckBufferOverrun::getBufferSize(), getDimensionsEtc(), ValueFlow::getEndOfExprScope(), getExprUsage(), CTU::getFileInfo(), getFunction(), getFunctionUsage(), getLHSVariable(), getLHSVariableRecursive(), getLHSVariablesRecursive(), getLHSVariableToken(), getLifetimeTokens(), ValueFlow::getLifetimeVariable(), getOverrunIndexValues(), getParentLifetime(), getParentVar(), getVariables(), hasUniqueOwnership(), hasUnknownVars(), hasVolatileCastOrVar(), CheckStl::if_find(), CheckClass::initializerListOrder(), CheckClass::initializeVarList(), CheckStl::invalidContainer(), CheckFunctions::invalidFunctionUsage(), isAddressOfLocalVariable(), isArray(), isArrayArg(), isArrayVar(), isAutoVar(), isAutoVarArray(), isBracketAccess(), isConstExpression(), isConstFunctionCall(), isConstVarExpression(), isCpp03ContainerSizeSlow(), isDanglingSubFunction(), isDeadScope(), isExpression(), CheckUninitVar::isFunctionParUsage(), CheckUnusedVar::isFunctionWithoutSideEffects(), isGlobalData(), isInitialVarAssign(), isInScope(), isLocal(), isLocalContainerBuffer(), isLocalVarNoAutoDealloc(), CheckUninitVar::isMemberVariableUsage(), isNonConstFunctionCall(), isNonReferenceArg(), isNullablePointer(), isOutOfBoundsImpl(), CheckNullPointer::isPointerDeRef(), isPtrArg(), CheckUnusedVar::isRecordTypeWithoutSideEffects(), isRefPtrArg(), isSameExpression(), Tokenizer::isScopeNoReturn(), CheckIO::ArgumentInfo::isStdContainer(), isUniqueExpression(), isVarDecl(), isVarDeclOp(), isVariableChanged(), isVariableChangedByFunctionCall(), isVariableDecl(), isVariableMutableInInitializer(), CheckUninitVar::isVariableUsage(), isVector(), isWithoutSideEffects(), CheckStl::iterators(), ValueFlow::lifetimeMessage(), CheckCondition::multiCondition2(), CheckStl::negativeIndex(), CheckNullPointer::nullConstantDereference(), parsedecl(), CheckBufferOverrun::pointerArithmetic(), clangimport::Data::Decl::ref(), CheckFunctions::returnLocalStdMove(), ExpressionAnalyzer::setupExprVarIds(), SymbolDatabase::setValueType(), SymbolDatabase::setValueTypeInTokenList(), skipLocalVars(), CheckStl::string_c_str(), CheckSizeof::suspiciousSizeofCalculation(), typeDecl(), typeOf(), useFunctionArgs(), CheckStl::uselessCalls(), CheckStl::useStlAlgorithm(), CheckVaarg::va_start_argument(), valueFlowAfterMove(), valueFlowArray(), valueFlowArrayBool(), valueFlowContainerSetTokValue(), valueFlowDynamicBufferSize(), valueFlowForLoopSimplifyAfter(), valueFlowForwardAssign(), valueFlowForwardLifetime(), valueFlowGlobalConstVar(), valueFlowGlobalStaticVar(), valueFlowLifetime(), valueFlowLifetimeFunction(), valueFlowPointerAlias(), valueFlowSetConstantValue(), valueFlowSmartPointer(), valueFlowSubFunction(), valueFlowSwitchVariable(), valueFlowUninit(), clangimport::Data::varDecl(), and SymbolDatabase::~SymbolDatabase().
|
inline |
Definition at line 870 of file token.h.
Referenced by Function::addArguments(), ConditionHandler::afterCondition(), CheckAutoVariables::assignFunctionArg(), CheckClass::assignVar(), astHasVar(), astIsVariableComparison(), astStringXml(), bifurcate(), CheckLeakAutoVar::changeAllocStatus(), CheckLeakAutoVar::changeAllocStatusIfRealloc(), CheckBoost::checkBoostForeachModification(), CheckOther::checkComparePointers(), CheckBool::checkComparisonOfBoolWithBool(), CheckBool::checkComparisonOfBoolWithInt(), CheckClass::checkConstFunc(), CheckStl::checkDereferenceInvalidIterator(), CheckCondition::checkDuplicateConditionalAssign(), CheckOther::checkDuplicateExpression(), CheckUninitVar::checkExpr(), CheckIO::checkFileUsage(), CheckOther::checkFuncArgNamesDifferent(), CheckUnusedVar::checkFunctionVariableUsage_iterateScopes(), CheckOther::checkInnerScope(), CheckOther::checkInvalidFree(), CheckCondition::checkInvalidTestForOverflow(), CheckOther::checkMisusedScopedObject(), CheckMemoryLeakInClass::checkPublicFunctions(), CheckMemoryLeakInFunction::checkReallocUsage(), FwdAnalysis::checkRecursive(), CheckExceptionSafety::checkRethrowCopy(), CheckUninitVar::checkRhs(), CheckLeakAutoVar::checkScope(), CheckUninitVar::checkScopeForVariable(), CheckClass::checkSelfInitialization(), CheckOther::checkShadowVariables(), CheckSizeof::checkSizeofForPointerSize(), CheckMemoryLeakStructMember::checkStructVariable(), CheckLeakAutoVar::checkTokenInsideExpression(), Scope::checkVariable(), CheckOther::checkVariableScope(), conditionAlwaysTrueOrFalse(), CheckClass::copyconstructors(), TokenList::copyTokens(), SymbolDatabase::createSymbolDatabaseExprIds(), SymbolDatabase::createSymbolDatabaseVariableSymbolTable(), Library::detectContainerInternal(), doAssignment(), Tokenizer::dump(), CheckStl::eraseCheckLoopVar(), SymbolDatabase::findFunction(), findmatch(), findVarBound(), SymbolDatabase::fixVarId(), followAllReferences(), followVariableExpression(), CheckLeakAutoVar::functionCall(), CheckMemoryLeak::getDeallocationType(), FwdAnalysis::getExprVarIds(), getLifetimeTokens(), MultiValueFlowAnalyzer::getValue(), getVariableValues(), getVarIds(), CheckClass::hasAllocation(), hasUnknownVars(), ifvar(), CheckClass::initializeVarList(), Tokenizer::initVar(), TokenList::insertTokens(), CheckStl::invalidContainer(), SingleValueFlowAnalyzer::isAlias(), MultiValueFlowAnalyzer::isAlias(), isAliasOf(), isCalculation(), iscast(), isConstStatement(), isExpressionChangedAt(), SymbolDatabase::isFunction(), isGlobalData(), isInitialVarAssign(), CheckClass::isMemberVar(), Library::isNotLibraryFunction(), isNullablePointer(), CheckNullPointer::isPointerDeRef(), isSameExpression(), isSimpleExpr(), isType(), isVarDeclOp(), ExpressionAnalyzer::isVariable(), isVariableChangedByFunctionCall(), Scope::isVariableDeclaration(), isVariableExpression(), isVariableUsed(), isVarUsedInTree(), isVLAIndex(), isWithoutSideEffects(), CheckStl::iterators(), CheckLeakAutoVar::leakIfAllocated(), MultiValueFlowAnalyzer::match(), match(), multiComparePercent(), CheckCondition::multiCondition2(), notvar(), CheckNullPointer::nullConstantDereference(), parsedecl(), CheckUnusedFunctions::parseTokens(), FwdAnalysis::possiblyAliased(), clangimport::Data::Decl::ref(), CheckLeakAutoVar::ret(), ExpressionAnalyzer::setupExprVarIds(), Tokenizer::setVarId(), setVarIdClassDeclaration(), Tokenizer::setVarIdClassFunction(), Tokenizer::setVarIdPass1(), Tokenizer::setVarIdPass2(), setVarIdStructMembers(), Tokenizer::simplifyArrayAccessSyntax(), Tokenizer::simplifyRedundantParentheses(), Tokenizer::simplifyVarDecl(), singleIncrementInScope(), CheckStl::stlOutOfBounds(), MultiValueFlowAnalyzer::stopOnCondition(), useFunctionArgs(), CheckStl::uselessCalls(), CheckFunctions::useStandardLibrary(), CheckStl::useStlAlgorithm(), CheckVaarg::va_list_usage(), valueFlowAfterMove(), valueFlowArray(), valueFlowDynamicBufferSize(), valueFlowForLoopSimplify(), valueFlowForLoopSimplifyAfter(), valueFlowForwardConst(), valueFlowLifetime(), valueFlowNumber(), valueFlowSetConstantValue(), clangimport::Data::varDecl(), and CheckMemoryLeakInClass::variable().
|
private |
Definition at line 1338 of file token.h.
Referenced by swapWithNext(), and takeData().
|
private |
Definition at line 1340 of file token.h.
Referenced by addValue(), argumentType(), assignIndexes(), astOperand1(), astOperand2(), astParent(), astTop(), function(), getContainerSizeValue(), getInvalidValue(), getKnownValue(), getMaxValue(), getMinValue(), getMovedValue(), getValue(), getValueGE(), getValueLE(), getValueTokenMaxStrLength(), getValueTokenMinStrSize(), hasKnownIntValue(), hasKnownSymbolicValue(), hasKnownValue(), insertToken(), isUnaryPreOp(), move(), printValueFlow(), replace(), scopeInfo(), setValueType(), stringify(), stringifyList(), swapWithNext(), takeData(), Token(), type(), update_property_info(), and ~Token().
|
private |
Definition at line 1283 of file token.h.
Referenced by deleteNext(), deletePrevious(), swapWithNext(), takeData(), and update_property_info().
|
private |
Definition at line 1281 of file token.h.
Referenced by deleteNext(), deleteThis(), isUnaryPreOp(), and swapWithNext().
|
private |
Definition at line 1282 of file token.h.
Referenced by assignIndexes(), deletePrevious(), deleteThis(), findClosingBracket(), and isUnaryPreOp().
|
private |
Definition at line 1279 of file token.h.
Referenced by concatStr(), findClosingBracket(), findOpeningBracket(), insertToken(), isUpperCaseName(), simpleMatch(), strAt(), stringify(), strValue(), swapWithNext(), takeData(), update_property_char_string_literal(), update_property_info(), and update_property_isStandardType().
|
private |
Definition at line 154 of file token.h.
Referenced by deleteNext(), deletePrevious(), insertToken(), isC(), isCpp(), printValueFlow(), replace(), and update_property_info().
|
private |
Definition at line 1336 of file token.h.
Referenced by function(), getStrLength(), stringify(), strValue(), swapWithNext(), takeData(), type(), update_property_char_string_literal(), and update_property_info().