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

Method createSymbolDatabaseClassInfo

lib/symboldatabase.cpp:840–881  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

838}
839
840void SymbolDatabase::createSymbolDatabaseClassInfo()
841{
842 if (mTokenizer.isC())
843 return;
844
845 // fill in using info
846 for (Scope& scope : scopeList) {
847 for (Scope::UsingInfo& usingInfo : scope.usingList) {
848 // only find if not already found
849 if (usingInfo.scope == nullptr) {
850 // check scope for match
851 const Scope * const found = findScope(usingInfo.start->tokAt(2), &scope);
852 if (found) {
853 // set found scope
854 usingInfo.scope = found;
855 break;
856 }
857 }
858 }
859 }
860
861 // fill in base class info
862 for (Type& type : typeList) {
863 // finish filling in base class info
864 for (Type::BaseInfo & i : type.derivedFrom) {
865 const Type* found = findType(i.nameTok, type.enclosingScope, /*lookOutside*/ true);
866 if (found && found->findDependency(&type)) {
867 // circular dependency
868 //mTokenizer.syntaxError(nullptr);
869 } else {
870 i.type = found;
871 }
872 }
873 }
874
875 // fill in friend info
876 for (Type & type : typeList) {
877 for (Type::FriendInfo &friendInfo : type.friendList) {
878 friendInfo.type = findType(friendInfo.nameStart, type.enclosingScope);
879 }
880 }
881}
882
883
884void SymbolDatabase::createSymbolDatabaseVariableInfo()

Callers

nothing calls this directly

Calls 5

findScopeFunction · 0.85
findTypeFunction · 0.85
isCMethod · 0.80
findDependencyMethod · 0.80
tokAtMethod · 0.45

Tested by

no test coverage detected