MCPcopy Create free account
hub / github.com/cppcheck-opensource/cppcheck / createSymbolDatabaseSetTypePointers

Method createSymbolDatabaseSetTypePointers

lib/symboldatabase.cpp:1245–1267  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1243}
1244
1245void SymbolDatabase::createSymbolDatabaseSetTypePointers()
1246{
1247 std::unordered_set<std::string> typenames;
1248 for (const Type &t : typeList) {
1249 typenames.insert(t.name());
1250 }
1251
1252 // Set type pointers
1253 for (Token* tok = mTokenizer.list.front(); tok != mTokenizer.list.back(); tok = tok->next()) {
1254 if (!tok->isName() || tok->varId() || tok->function() || tok->type() || tok->enumerator())
1255 continue;
1256
1257 if (Token::simpleMatch(tok->next(), "<"))
1258 continue;
1259
1260 if (typenames.find(tok->str()) == typenames.end())
1261 continue;
1262
1263 const Type *type = findVariableType(tok->scope(), tok);
1264 if (type)
1265 tok->type(type);
1266 }
1267}
1268
1269void SymbolDatabase::createSymbolDatabaseSetSmartPointerType()
1270{

Callers

nothing calls this directly

Calls 10

frontMethod · 0.80
nextMethod · 0.80
typeMethod · 0.80
scopeMethod · 0.80
simpleMatchFunction · 0.70
nameMethod · 0.45
functionMethod · 0.45
findMethod · 0.45
strMethod · 0.45
endMethod · 0.45

Tested by

no test coverage detected