Cppcheck
|
Whole program analysis (ctu=Cross Translation Unit) More...
Classes | |
class | FileInfo |
Functions | |
CPPCHECKLIB std::string | toString (const std::list< FileInfo::UnsafeUsage > &unsafeUsage) |
CPPCHECKLIB std::string | getFunctionId (const Tokenizer &tokenizer, const Function *function) |
CPPCHECKLIB FileInfo * | getFileInfo (const Tokenizer &tokenizer) |
Parse current TU and extract file info. More... | |
CPPCHECKLIB std::list< FileInfo::UnsafeUsage > | getUnsafeUsage (const Tokenizer &tokenizer, const Settings &settings, bool(*isUnsafeUsage)(const Settings &settings, const Token *argtok, MathLib::bigint *value)) |
CPPCHECKLIB std::list< FileInfo::UnsafeUsage > | loadUnsafeUsageListFromXml (const tinyxml2::XMLElement *xmlElement) |
Variables | |
int | maxCtuDepth = 2 |
Whole program analysis (ctu=Cross Translation Unit)
CTU::FileInfo * CTU::getFileInfo | ( | const Tokenizer & | tokenizer | ) |
Parse current TU and extract file info.
Definition at line 309 of file ctu.cpp.
References Function::argCount(), Token::astOperand1(), Scope::bodyEnd, Scope::bodyStart, ValueFlow::Value::BUFFER_SIZE, CTU::FileInfo::CallBase::callArgNr, CTU::FileInfo::FunctionCall::callArgumentExpression, CTU::FileInfo::FunctionCall::callArgValue, CTU::FileInfo::CallBase::callFunctionName, CTU::FileInfo::CallBase::callId, CTU::FileInfo::FunctionCall::callValuePath, CTU::FileInfo::FunctionCall::callValueType, Scope::eFunction, Token::expressionString(), TokenList::file(), Check::FileInfo::FileInfo(), Scope::function, getArguments(), Function::getArgumentVar(), getFunctionId(), Tokenizer::getSettings(), Tokenizer::getSymbolDatabase(), isCallFunction(), Scope::isExecutable(), ValueFlow::Value::isInconclusive(), Token::isUnaryOp(), Tokenizer::list, CTU::FileInfo::CallBase::location, CTU::FileInfo::NestedCall::myArgNr, Token::next(), None, Settings::platform, ValueType::pointer, ValueType::reference, SymbolDatabase::scopeList, Scope::type, ValueType::typeSize(), ValueFlow::Value::UNINIT, Token::values(), Variable::valueType(), Token::valueType(), ValueFlow::Value::valueType, Token::variable(), and CTU::FileInfo::FunctionCall::warning.
Referenced by CppCheck::checkNormalTokens().
Definition at line 60 of file ctu.cpp.
References TokenList::file(), and Tokenizer::list.
Referenced by getFileInfo(), and getUnsafeUsage().
std::list< CTU::FileInfo::UnsafeUsage > CTU::getUnsafeUsage | ( | const Tokenizer & | tokenizer, |
const Settings & | settings, | ||
bool(*)(const Settings &settings, const Token *argtok, MathLib::bigint *value) | isUnsafeUsage | ||
) |
Definition at line 472 of file ctu.cpp.
References Scope::eFunction, Scope::function, getFunctionId(), Tokenizer::getSymbolDatabase(), getUnsafeFunction(), Scope::isExecutable(), isUnsafeUsage(), SymbolDatabase::scopeList, Token::str(), and Scope::type.
Referenced by CheckBufferOverrun::getFileInfo(), CheckNullPointer::getFileInfo(), and CheckUninitVar::getFileInfo().
std::list< CTU::FileInfo::UnsafeUsage > CTU::loadUnsafeUsageListFromXml | ( | const tinyxml2::XMLElement * | xmlElement | ) |
Definition at line 257 of file ctu.cpp.
References ATTR_LOC_COLUMN, ATTR_LOC_FILENAME, ATTR_LOC_LINENR, ATTR_MY_ARGNAME, ATTR_MY_ARGNR, ATTR_MY_ID, ATTR_VALUE, CTU::FileInfo::Location::column, error, CTU::FileInfo::Location::fileName, CTU::FileInfo::Location::lineNumber, CTU::FileInfo::UnsafeUsage::location, CTU::FileInfo::UnsafeUsage::myArgNr, CTU::FileInfo::UnsafeUsage::myArgumentName, CTU::FileInfo::UnsafeUsage::myId, readAttrInt(), readAttrString(), and CTU::FileInfo::UnsafeUsage::value.
Referenced by CheckBufferOverrun::loadFileInfoFromXml(), CheckNullPointer::loadFileInfoFromXml(), and CheckUninitVar::loadFileInfoFromXml().
std::string CTU::toString | ( | const std::list< FileInfo::UnsafeUsage > & | unsafeUsage | ) |
|
extern |
Definition at line 58 of file ctu.cpp.
Referenced by CppCheck::analyseWholeProgram(), findPath(), and ProjectFile::setMaxCtuDepth().