| 2383 | } |
| 2384 | |
| 2385 | void SymbolDatabase::debugSymbolDatabase() const |
| 2386 | { |
| 2387 | if (!mSettings.debugnormal && !mSettings.debugwarnings) |
| 2388 | return; |
| 2389 | for (const Token* tok = mTokenizer.list.front(); tok != mTokenizer.list.back(); tok = tok->next()) { |
| 2390 | if (tok->astParent() && tok->astParent()->getTokenDebug() == tok->getTokenDebug()) |
| 2391 | continue; |
| 2392 | if (tok->getTokenDebug() == TokenDebug::ValueType) { |
| 2393 | |
| 2394 | std::string msg = "Value type is "; |
| 2395 | ErrorPath errorPath; |
| 2396 | if (tok->valueType()) { |
| 2397 | msg += tok->valueType()->str(); |
| 2398 | errorPath.insert(errorPath.end(), tok->valueType()->debugPath.cbegin(), tok->valueType()->debugPath.cend()); |
| 2399 | |
| 2400 | } else { |
| 2401 | msg += "missing"; |
| 2402 | } |
| 2403 | errorPath.emplace_back(tok, ""); |
| 2404 | mErrorLogger.reportErr( |
| 2405 | {std::move(errorPath), &mTokenizer.list, Severity::debug, "valueType", msg, CWE{0}, Certainty::normal}); |
| 2406 | } |
| 2407 | } |
| 2408 | } |
| 2409 | |
| 2410 | Variable::Variable(const Token *name_, const std::string &clangType, const Token *typeStart, |
| 2411 | const Token *typeEnd, nonneg int index_, AccessControl access_, |