Cppcheck
|
#include "checkunusedvar.h"
#include "astutils.h"
#include "errortypes.h"
#include "fwdanalysis.h"
#include "library.h"
#include "settings.h"
#include "symboldatabase.h"
#include "token.h"
#include "tokenize.h"
#include "utils.h"
#include "valueflow.h"
#include <algorithm>
#include <list>
#include <set>
#include <utility>
#include <vector>
Go to the source code of this file.
Classes | |
class | Variables |
This class is used create a list of variables within a function. More... | |
class | Variables::VariableUsage |
Store information about variable usage. More... | |
Functions | |
static bool | isRaiiClassScope (const Scope *classScope) |
Is scope a raii class scope. More... | |
static bool | isRaiiClass (const ValueType *valueType, bool cpp, bool defaultReturn=true) |
Is ValueType a raii class? More... | |
static const Token * | doAssignment (Variables &variables, const Token *tok, bool dereference, const Scope *scope) |
static bool | isPartOfClassStructUnion (const Token *tok) |
static bool | isVarDecl (const Token *tok) |
static const Token * | skipBrackets (const Token *tok) |
static const Token * | skipBracketsAndMembers (const Token *tok) |
static void | useFunctionArgs (const Token *tok, Variables &variables) |
Variables | |
static const CWE | CWE563 (563U) |
static const CWE | CWE665 (665U) |
|
static |
Definition at line 396 of file checkunusedvar.cpp.
References Variables::VariableUsage::_assignments, Variables::VariableUsage::_var, Variables::alias(), Variables::array, Variables::clearAliases(), Variables::eraseAll(), Scope::eSwitch, Variables::find(), Token::isAssignmentOp(), Token::isName(), Token::link(), Token::Match(), Variables::VariableUsage::mType, Token::next(), nonneg, Variables::pointer, Variables::pointerArray, Variables::read(), Variables::readAliases(), Variables::readAll(), Variables::reference, replace(), Variable::scope(), Variables::standard, Token::str(), Token::strAt(), Token::tokAt(), Scope::type, Variables::use(), and Token::varId().
Referenced by CheckUnusedVar::checkFunctionVariableUsage_iterateScopes().
|
static |
Definition at line 630 of file checkunusedvar.cpp.
References Token::link(), Token::previous(), Token::str(), and Token::strAt().
Referenced by CheckUnusedVar::checkFunctionVariableUsage_iterateScopes().
|
static |
Is ValueType a raii class?
Definition at line 56 of file checkunusedvar.cpp.
References Type::classScope, isRaiiClassScope(), ValueType::smartPointerType, ValueType::type, and ValueType::typeScope.
Referenced by CheckUnusedVar::checkFunctionVariableUsage().
|
static |
Is scope a raii class scope.
Definition at line 50 of file checkunusedvar.cpp.
References Scope::getDestructor().
Referenced by isRaiiClass().
|
static |
Definition at line 644 of file checkunusedvar.cpp.
References Token::variable().
Referenced by CheckUnusedVar::checkFunctionVariableUsage_iterateScopes().
Definition at line 650 of file checkunusedvar.cpp.
References Token::link(), and Token::str().
Referenced by CheckUnusedVar::checkFunctionVariableUsage_iterateScopes().
Definition at line 659 of file checkunusedvar.cpp.
References Token::link(), Token::Match(), Token::str(), and Token::tokAt().
Referenced by CheckUnusedVar::checkFunctionVariableUsage_iterateScopes().
Definition at line 672 of file checkunusedvar.cpp.
References Token::astOperand1(), Token::astOperand2(), Token::Match(), ValueType::pointer, Token::str(), Variables::use(), Token::valueType(), Token::variable(), and Token::varId().
Referenced by CheckUnusedVar::checkFunctionVariableUsage_iterateScopes().
|
static |
|
static |
Referenced by CheckUnusedVar::unassignedVariableError().