Doxygen
Loading...
Searching...
No Matches
SymbolResolver::Private Struct Reference
Collaboration diagram for SymbolResolver::Private:

Public Member Functions

 Private (const FileDef *f)
void reset ()
void setFileScope (const FileDef *fileScope)
const FileDeffileScope () const
const ClassDefgetResolvedTypeRec (LookupCache &cache, VisitedKeys &visitedKeys, const Definition *scope, const QCString &n, const MemberDef **pTypeDef, QCString *pTemplSpec, QCString *pResolvedType)
const DefinitiongetResolvedSymbolRec (LookupCache &cache, VisitedKeys &visitedKeys, const Definition *scope, const QCString &n, const QCString &args, bool checkCV, bool insideCode, bool onlyLinkable, const MemberDef **pTypeDef, QCString *pTemplSpec, QCString *pResolvedType)
int isAccessibleFrom (VisitedKeys &visitedKeys, AccessStack &accessStack, const Definition *scope, const Definition *item)
int isAccessibleFromWithExpScope (VisitedKeys &visitedKeys, VisitedNamespaces &visitedNamespaces, AccessStack &accessStack, const Definition *scope, const Definition *item, const QCString &explicitScopePart)

Public Attributes

QCString resolvedType
const MemberDeftypeDef = nullptr
QCString templateSpec

Private Member Functions

void getResolvedType (LookupCache &cache, VisitedKeys &visitedKeys, const Definition *scope, const Definition *d, const QCString &explicitScopePart, const ArgumentList *actTemplParams, int &minDistance, const ClassDef *&bestMatch, const MemberDef *&bestTypedef, QCString &bestTemplSpec, QCString &bestResolvedType)
void getResolvedSymbol (VisitedKeys &visitedKeys, const Definition *scope, const Definition *d, const QCString &args, bool checkCV, bool insideCode, const QCString &explicitScopePart, const QCString &strippedTemplateParams, bool forceCallable, int &minDistance, const Definition *&bestMatch, const MemberDef *&bestTypedef, QCString &bestTemplSpec, QCString &bestResolvedType)
const ClassDefnewResolveTypedef (LookupCache &cache, VisitedKeys &visitedKeys, const Definition *scope, const MemberDef *md, const MemberDef **pMemType, QCString *pTemplSpec, QCString *pResolvedType, const ArgumentList *actTemplParams=nullptr)
const DefinitionfollowPath (VisitedKeys &visitedKeys, const Definition *start, const QCString &path)
const DefinitionendOfPathIsUsedClass (const LinkedRefMap< const Definition > &dl, const QCString &localName)
bool accessibleViaUsingNamespace (VisitedKeys &visitedKeys, VisitedNamespaceKeys &visitedNamespaces, const LinkedRefMap< NamespaceDef > &nl, const Definition *item, const QCString &explicitScopePart="", int level=0)
bool accessibleViaUsingDefinition (VisitedKeys &visitedKeys, const LinkedRefMap< const Definition > &dl, const Definition *item, const QCString &explicitScopePart="")
QCString substTypedef (VisitedKeys &visitedKeys, const Definition *scope, const QCString &name, const MemberDef **pTypeDef=nullptr)

Private Attributes

const FileDefm_fileScope
std::unordered_map< std::string, const MemberDef * > m_resolvedTypedefs

Detailed Description

Definition at line 169 of file symbolresolver.cpp.

Constructor & Destructor Documentation

◆ Private()

SymbolResolver::Private::Private ( const FileDef * f)
inline

Definition at line 172 of file symbolresolver.cpp.

172: m_fileScope(f) {}

References m_fileScope.

Member Function Documentation

◆ accessibleViaUsingDefinition()

bool SymbolResolver::Private::accessibleViaUsingDefinition ( VisitedKeys & visitedKeys,
const LinkedRefMap< const Definition > & dl,
const Definition * item,
const QCString & explicitScopePart = "" )
private

Definition at line 1398 of file symbolresolver.cpp.

1402{
1403 AUTO_TRACE("item={} explicitScopePart={}",item?item->name():QCString(), explicitScopePart);
1404 for (const auto &ud : dl)
1405 {
1406 AUTO_TRACE_ADD("trying via used definition '{}'",ud->name());
1407 const Definition *sc = explicitScopePart.isEmpty() ? ud : followPath(visitedKeys,ud,explicitScopePart);
1408 if (sc && sc==item)
1409 {
1410 AUTO_TRACE_EXIT("true");
1411 return true;
1412 }
1413 }
1414 AUTO_TRACE_EXIT("false");
1415 return false;
1416}
virtual const QCString & name() const =0
bool isEmpty() const
Returns TRUE iff the string is empty.
Definition qcstring.h:163
#define AUTO_TRACE_ADD(...)
Definition docnode.cpp:48
#define AUTO_TRACE(...)
Definition docnode.cpp:47
#define AUTO_TRACE_EXIT(...)
Definition docnode.cpp:49
const Definition * followPath(VisitedKeys &visitedKeys, const Definition *start, const QCString &path)

References AUTO_TRACE, AUTO_TRACE_ADD, AUTO_TRACE_EXIT, followPath(), QCString::isEmpty(), and Definition::name().

Referenced by isAccessibleFrom().

◆ accessibleViaUsingNamespace()

bool SymbolResolver::Private::accessibleViaUsingNamespace ( VisitedKeys & visitedKeys,
VisitedNamespaceKeys & visitedNamespaces,
const LinkedRefMap< NamespaceDef > & nl,
const Definition * item,
const QCString & explicitScopePart = "",
int level = 0 )
private

Definition at line 1360 of file symbolresolver.cpp.

1367{
1368 AUTO_TRACE("item={} explicitScopePart={} level={}",item?item->name():QCString(), explicitScopePart, level);
1369 for (const auto &und : nl) // check used namespaces for the class
1370 {
1371 AUTO_TRACE_ADD("trying via used namespace '{}'",und->name());
1372 const Definition *sc = explicitScopePart.isEmpty() ? und : followPath(visitedKeys,und,explicitScopePart);
1373 if (sc && item->getOuterScope()==sc)
1374 {
1375 AUTO_TRACE_EXIT("true");
1376 return true;
1377 }
1378 if (item->getLanguage()==SrcLangExt::Cpp)
1379 {
1380 QCString key=und->qualifiedName();
1381 if (!und->getUsedNamespaces().empty() && std::find(visitedNamespaces.begin(),visitedNamespaces.end(),key.str())==std::end(visitedNamespaces))
1382 {
1383 visitedNamespaces.push_back(key.str());
1384 if (accessibleViaUsingNamespace(visitedKeys,visitedNamespaces,und->getUsedNamespaces(),item,explicitScopePart,level+1))
1385 {
1386 AUTO_TRACE_EXIT("true");
1387 return true;
1388 }
1389
1390 }
1391 }
1392 }
1393 AUTO_TRACE_EXIT("false");
1394 return false;
1395}
virtual SrcLangExt getLanguage() const =0
Returns the programming language this definition was written in.
virtual Definition * getOuterScope() const =0
const std::string & str() const
Definition qcstring.h:552
bool accessibleViaUsingNamespace(VisitedKeys &visitedKeys, VisitedNamespaceKeys &visitedNamespaces, const LinkedRefMap< NamespaceDef > &nl, const Definition *item, const QCString &explicitScopePart="", int level=0)

References accessibleViaUsingNamespace(), AUTO_TRACE, AUTO_TRACE_ADD, AUTO_TRACE_EXIT, followPath(), Definition::getLanguage(), Definition::getOuterScope(), QCString::isEmpty(), Definition::name(), and QCString::str().

Referenced by accessibleViaUsingNamespace(), isAccessibleFrom(), and isAccessibleFromWithExpScope().

◆ endOfPathIsUsedClass()

const Definition * SymbolResolver::Private::endOfPathIsUsedClass ( const LinkedRefMap< const Definition > & dl,
const QCString & localName )
private

Definition at line 1348 of file symbolresolver.cpp.

1349{
1350 for (const auto &d : dl)
1351 {
1352 if (d->localName()==localName)
1353 {
1354 return d;
1355 }
1356 }
1357 return nullptr;
1358}

Referenced by followPath().

◆ fileScope()

const FileDef * SymbolResolver::Private::fileScope ( ) const
inline

Definition at line 184 of file symbolresolver.cpp.

184{ return m_fileScope; }

References m_fileScope.

Referenced by setFileScope().

◆ followPath()

const Definition * SymbolResolver::Private::followPath ( VisitedKeys & visitedKeys,
const Definition * start,
const QCString & path )
private

Definition at line 1243 of file symbolresolver.cpp.

1245{
1246 AUTO_TRACE("start={},path={}",start?start->name():QCString(), path);
1247 int is=0,ps=0,l=0;
1248
1249 const Definition *current=start;
1250 // for each part of the explicit scope
1251 while ((is=getScopeFragment(path,ps,&l))!=-1)
1252 {
1253 // try to resolve the part if it is a typedef
1254 const MemberDef *memTypeDef=nullptr;
1255 QCString qualScopePart = substTypedef(visitedKeys,current,path.mid(is,l),&memTypeDef);
1256 AUTO_TRACE_ADD("qualScopePart={} memTypeDef={}",qualScopePart,memTypeDef?memTypeDef->name():"");
1257 const Definition *next = nullptr;
1258 if (memTypeDef)
1259 {
1260 const ClassDef *type = newResolveTypedef(getTypeLookupCache(),visitedKeys,m_fileScope,memTypeDef,nullptr,nullptr,nullptr);
1261 if (type)
1262 {
1263 AUTO_TRACE_EXIT("type={}",type->name());
1264 return type;
1265 }
1266 }
1267 else if (m_fileScope)
1268 {
1269 next = endOfPathIsUsedClass(m_fileScope->getUsedDefinitions(),qualScopePart);
1270 }
1271 if (next==nullptr)
1272 {
1273 next = current->findInnerCompound(qualScopePart);
1274 }
1275 AUTO_TRACE_ADD("Looking for {} inside {} result={}",
1276 qualScopePart, current->name(), next?next->name():QCString());
1277 if (next==nullptr)
1278 {
1279 next = current->findInnerCompound(qualScopePart+"-p");
1280 }
1281 if (current->definitionType()==Definition::TypeClass)
1282 {
1283 const MemberDef *classMember = toClassDef(current)->getMemberByName(qualScopePart);
1284 if (classMember && classMember->isEnumerate())
1285 {
1286 next = classMember;
1287 }
1288 }
1289 else if (current!=Doxygen::globalScope && current->definitionType()==Definition::TypeNamespace)
1290 {
1291 const MemberDef *namespaceMember = toNamespaceDef(current)->getMemberByName(qualScopePart);
1292 if (namespaceMember && namespaceMember->isEnumerate())
1293 {
1294 next = namespaceMember;
1295 }
1296 }
1297 else if (current==Doxygen::globalScope || current->definitionType()==Definition::TypeFile)
1298 {
1299 auto &range = Doxygen::symbolMap->find(qualScopePart);
1300 for (Definition *def : range)
1301 {
1302 const Definition *outerScope = def->getOuterScope();
1303 if (
1304 (outerScope==Doxygen::globalScope || // global scope or
1305 (outerScope && // anonymous namespace in the global scope
1306 outerScope->name().startsWith("anonymous_namespace{") &&
1307 outerScope->getOuterScope()==Doxygen::globalScope
1308 )
1309 ) &&
1310 (def->definitionType()==Definition::TypeClass ||
1311 def->definitionType()==Definition::TypeMember ||
1312 def->definitionType()==Definition::TypeNamespace
1313 )
1314 )
1315 {
1316 next=def;
1317 break;
1318 }
1319 }
1320 }
1321 if (next==nullptr) // failed to follow the path
1322 {
1324 {
1325 next = endOfPathIsUsedClass(
1326 (toNamespaceDef(current))->getUsedDefinitions(),qualScopePart);
1327 }
1328 else if (current->definitionType()==Definition::TypeFile)
1329 {
1330 next = endOfPathIsUsedClass(
1331 (toFileDef(current))->getUsedDefinitions(),qualScopePart);
1332 }
1333 current = next;
1334 if (current==nullptr) break;
1335 }
1336 else // continue to follow scope
1337 {
1338 current = next;
1339 AUTO_TRACE_ADD("current={}",current->name());
1340 }
1341 ps=is+l;
1342 }
1343
1344 AUTO_TRACE_EXIT("result={}",current?current->name():QCString());
1345 return current; // path could be followed
1346}
virtual const MemberDef * getMemberByName(const QCString &) const =0
Returns the member with the given name.
virtual DefType definitionType() const =0
virtual const Definition * findInnerCompound(const QCString &name) const =0
static NamespaceDefMutable * globalScope
Definition doxygen.h:120
static SymbolMap< Definition > * symbolMap
Definition doxygen.h:124
virtual bool isEnumerate() const =0
virtual const MemberDef * getMemberByName(const QCString &) const =0
bool startsWith(const char *s) const
Definition qcstring.h:507
QCString mid(size_t index, size_t len=static_cast< size_t >(-1)) const
Definition qcstring.h:241
const VectorPtr & find(const QCString &name)
Definition symbolmap.h:75
ClassDef * toClassDef(Definition *d)
FileDef * toFileDef(Definition *d)
Definition filedef.cpp:1966
NamespaceDef * toNamespaceDef(Definition *d)
const ClassDef * newResolveTypedef(LookupCache &cache, VisitedKeys &visitedKeys, const Definition *scope, const MemberDef *md, const MemberDef **pMemType, QCString *pTemplSpec, QCString *pResolvedType, const ArgumentList *actTemplParams=nullptr)
const Definition * endOfPathIsUsedClass(const LinkedRefMap< const Definition > &dl, const QCString &localName)
QCString substTypedef(VisitedKeys &visitedKeys, const Definition *scope, const QCString &name, const MemberDef **pTypeDef=nullptr)
static LookupCache & getTypeLookupCache()
int getScopeFragment(const QCString &s, int p, int *l)
Definition util.cpp:4638

References AUTO_TRACE, AUTO_TRACE_ADD, AUTO_TRACE_EXIT, Definition::definitionType(), endOfPathIsUsedClass(), Definition::findInnerCompound(), ClassDef::getMemberByName(), NamespaceDef::getMemberByName(), Definition::getOuterScope(), getScopeFragment(), getTypeLookupCache(), Doxygen::globalScope, MemberDef::isEnumerate(), m_fileScope, QCString::mid(), Definition::name(), newResolveTypedef(), QCString::startsWith(), substTypedef(), Doxygen::symbolMap, toClassDef(), toFileDef(), toNamespaceDef(), Definition::TypeClass, Definition::TypeFile, Definition::TypeMember, and Definition::TypeNamespace.

Referenced by accessibleViaUsingDefinition(), accessibleViaUsingNamespace(), and isAccessibleFromWithExpScope().

◆ getResolvedSymbol()

void SymbolResolver::Private::getResolvedSymbol ( VisitedKeys & visitedKeys,
const Definition * scope,
const Definition * d,
const QCString & args,
bool checkCV,
bool insideCode,
const QCString & explicitScopePart,
const QCString & strippedTemplateParams,
bool forceCallable,
int & minDistance,
const Definition *& bestMatch,
const MemberDef *& bestTypedef,
QCString & bestTemplSpec,
QCString & bestResolvedType )
private

Definition at line 811 of file symbolresolver.cpp.

827{
828 AUTO_TRACE("scope={} sym={}",scope->name(),d->qualifiedName());
829 // only look at classes and members that are enums or typedefs
830 VisitedNamespaces visitedNamespaces;
831 AccessStack accessStack;
832 // test accessibility of definition within scope.
833 int distance = isAccessibleFromWithExpScope(visitedKeys,visitedNamespaces,accessStack,scope,d,explicitScopePart+strippedTemplateParams);
834 if (distance==-1 && !strippedTemplateParams.isEmpty())
835 {
836 distance = isAccessibleFromWithExpScope(visitedKeys,visitedNamespaces,accessStack,scope,d,explicitScopePart);
837 }
838 AUTO_TRACE_ADD("distance={}",distance);
839 if (distance!=-1) // definition is accessible
840 {
841 // see if we are dealing with a class or a typedef
842 if (args.isEmpty() && !forceCallable && d->definitionType()==Definition::TypeClass) // d is a class
843 {
844 const ClassDef *cd = toClassDef(d);
845 if (!cd->isTemplateArgument()) // skip classes that
846 // are only there to
847 // represent a template
848 // argument
849 {
850 if (distance<minDistance) // found a definition that is "closer"
851 {
852 AUTO_TRACE_ADD("found symbol={} at distance={} minDistance={}",d->name(),distance,minDistance);
853 minDistance=distance;
854 bestMatch = d;
855 bestTypedef = nullptr;
856 bestTemplSpec.clear();
857 bestResolvedType = cd->qualifiedName();
858 }
859 else if (distance==minDistance &&
860 m_fileScope && bestMatch &&
861 !m_fileScope->getUsedNamespaces().empty() &&
864 )
865 {
866 // in case the distance is equal it could be that a class X
867 // is defined in a namespace and in the global scope. When searched
868 // in the global scope the distance is 0 in both cases. We have
869 // to choose one of the definitions: we choose the one in the
870 // namespace if the fileScope imports namespaces and the definition
871 // found was in a namespace while the best match so far isn't.
872 // Just a non-perfect heuristic but it could help in some situations
873 // (kdecore code is an example).
874 AUTO_TRACE_ADD("found symbol={} at distance={} minDistance={}",d->name(),distance,minDistance);
875 minDistance=distance;
876 bestMatch = d;
877 bestTypedef = nullptr;
878 bestTemplSpec.clear();
879 bestResolvedType = cd->qualifiedName();
880 }
881 }
882 else
883 {
884 AUTO_TRACE_ADD("class with template arguments");
885 }
886 }
888 {
889 const MemberDef *md = toMemberDef(d);
890
891 bool match = true;
892 AUTO_TRACE_ADD("member={} args={} isCallable()={}",md->name(),argListToString(md->argumentList()),md->isCallable());
893 if (md->isCallable() && !args.isEmpty())
894 {
895 QCString actArgs;
896 if (md->isArtificial() && md->formalTemplateArguments()) // for members of an instantiated template we need to replace
897 // the formal arguments by the actual ones before matching
898 // See issue #10640
899 {
901 }
902 else
903 {
904 actArgs = args;
905 }
906 std::unique_ptr<ArgumentList> argList = stringToArgumentList(md->getLanguage(),actArgs);
907 const ArgumentList &mdAl = md->argumentList();
908 match = matchArguments2(md->getOuterScope(),md->getFileDef(),md->typeString(),&mdAl,
909 scope, md->getFileDef(),md->typeString(),argList.get(),
910 checkCV,md->getLanguage());
911 AUTO_TRACE_ADD("match={}",match);
912 }
913
914 if (match && distance<minDistance)
915 {
916 AUTO_TRACE_ADD("found symbol={} at distance={} minDistance={}",md->name(),distance,minDistance);
917 minDistance=distance;
918 bestMatch = md;
919 bestTypedef = md;
920 bestTemplSpec = "";
921 bestResolvedType = md->qualifiedName();
922 }
923 }
927 {
928 if (distance<minDistance) // found a definition that is "closer"
929 {
930 AUTO_TRACE_ADD("found symbol={} at distance={} minDistance={}",d->name(),distance,minDistance);
931 minDistance=distance;
932 bestMatch = d;
933 bestTypedef = nullptr;
934 bestTemplSpec.clear();
935 bestResolvedType.clear();
936 }
937 }
938 } // if definition accessible
939 else
940 {
941 AUTO_TRACE_ADD("not accessible");
942 }
943 AUTO_TRACE_EXIT("bestMatch sym={} distance={}",
944 bestMatch?bestMatch->name():QCString("<none>"),bestResolvedType);
945}
virtual bool isTemplateArgument() const =0
virtual QCString qualifiedName() const =0
virtual bool isArtificial() const =0
virtual QCString typeString() const =0
virtual const FileDef * getFileDef() const =0
virtual const ArgumentList & argumentList() const =0
virtual std::optional< ArgumentList > formalTemplateArguments() const =0
virtual bool isCallable() const =0
void clear()
Definition qcstring.h:182
std::unique_ptr< ArgumentList > stringToArgumentList(SrcLangExt lang, const QCString &argsString, QCString *extraTypeChars=nullptr)
Definition defargs.l:822
MemberDef * toMemberDef(Definition *d)
bool match(std::string_view str, Match &match, const Ex &re)
Matches a given string str for a match against regular expression re.
Definition regex.cpp:855
int isAccessibleFromWithExpScope(VisitedKeys &visitedKeys, VisitedNamespaces &visitedNamespaces, AccessStack &accessStack, const Definition *scope, const Definition *item, const QCString &explicitScopePart)
std::unordered_map< std::string, const Definition * > VisitedNamespaces
bool matchArguments2(const Definition *srcScope, const FileDef *srcFileScope, const QCString &srcReturnType, const ArgumentList *srcAl, const Definition *dstScope, const FileDef *dstFileScope, const QCString &dstReturnType, const ArgumentList *dstAl, bool checkCV, SrcLangExt lang)
Definition util.cpp:2016
QCString substituteTemplateArgumentsInString(const QCString &nm, const ArgumentList &formalArgs, const ArgumentList *actualArgs)
Definition util.cpp:4364
QCString argListToString(const ArgumentList &al, bool useCanonicalType, bool showDefVals)
Definition util.cpp:1249

References argListToString(), MemberDef::argumentList(), AUTO_TRACE, AUTO_TRACE_ADD, AUTO_TRACE_EXIT, QCString::clear(), Definition::definitionType(), MemberDef::formalTemplateArguments(), MemberDef::getFileDef(), Definition::getLanguage(), Definition::getOuterScope(), Doxygen::globalScope, SymbolResolver::isAccessibleFromWithExpScope(), Definition::isArtificial(), MemberDef::isCallable(), QCString::isEmpty(), ClassDef::isTemplateArgument(), m_fileScope, matchArguments2(), Definition::name(), Definition::qualifiedName(), stringToArgumentList(), substituteTemplateArgumentsInString(), toClassDef(), toMemberDef(), Definition::TypeClass, Definition::TypeFile, Definition::TypeMember, Definition::TypeModule, Definition::TypeNamespace, and MemberDef::typeString().

Referenced by getResolvedSymbolRec().

◆ getResolvedSymbolRec()

const Definition * SymbolResolver::Private::getResolvedSymbolRec ( LookupCache & cache,
VisitedKeys & visitedKeys,
const Definition * scope,
const QCString & n,
const QCString & args,
bool checkCV,
bool insideCode,
bool onlyLinkable,
const MemberDef ** pTypeDef,
QCString * pTemplSpec,
QCString * pResolvedType )

Definition at line 445 of file symbolresolver.cpp.

457{
458 AUTO_TRACE("scope={} name={} args={} checkCV={} insideCode={}",
459 scope->name(),n,args,checkCV,insideCode);
460 if (n.isEmpty()) return nullptr;
461 QCString explicitScopePart;
462 QCString strippedTemplateParams;
463 QCString scopeName=scope!=Doxygen::globalScope ? scope->name() : QCString();
464 QCString name=stripTemplateSpecifiersFromScope(n,TRUE,&strippedTemplateParams,scopeName);
465 std::unique_ptr<ArgumentList> actTemplParams;
466 if (!strippedTemplateParams.isEmpty()) // template part that was stripped
467 {
468 actTemplParams = stringToArgumentList(scope->getLanguage(),strippedTemplateParams);
469 }
470
471 int qualifierIndex = computeQualifiedIndex(name);
472 //printf("name=%s qualifierIndex=%d\n",qPrint(name),qualifierIndex);
473 if (qualifierIndex!=-1) // qualified name
474 {
475 // split off the explicit scope part
476 explicitScopePart=name.left(qualifierIndex);
477 // todo: improve namespace alias substitution
478 replaceNamespaceAliases(explicitScopePart);
479 name=name.mid(qualifierIndex+2);
480 }
481 AUTO_TRACE_ADD("qualifierIndex={} name={} explicitScopePart={} strippedTemplateParams={}",
482 qualifierIndex,name,explicitScopePart,strippedTemplateParams);
483
484 if (name.isEmpty())
485 {
486 AUTO_TRACE_EXIT("empty name qualifierIndex={}",qualifierIndex);
487 return nullptr; // empty name
488 }
489
490 int i=0;
491 const auto &range1 = Doxygen::symbolMap->find(name);
492 const auto &range = (range1.empty() && (i=name.find('<'))!=-1) ? Doxygen::symbolMap->find(name.left(i)) : range1;
493 if (range.empty())
494 {
495 AUTO_TRACE_ADD("no symbols with name '{}' (including unspecialized)",name);
496 return nullptr;
497 }
498 AUTO_TRACE_ADD("{} -> {} candidates",name,range.size());
499
500 bool hasUsingStatements =
501 (m_fileScope && (!m_fileScope->getUsedNamespaces().empty() ||
502 !m_fileScope->getUsedDefinitions().empty())
503 );
504 // Since it is often the case that the same name is searched in the same
505 // scope over an over again (especially for the linked source code generation)
506 // we use a cache to collect previous results. This is possible since the
507 // result of a lookup is deterministic. As the key we use the concatenated
508 // scope, the name to search for and the explicit scope prefix. The speedup
509 // achieved by this simple cache can be enormous.
510 size_t scopeNameLen = scope!=Doxygen::globalScope ? scope->name().length()+1 : 0;
511 size_t nameLen = name.length()+1;
512 size_t explicitPartLen = explicitScopePart.length();
513 size_t strippedTemplateParamsLen = strippedTemplateParams.length();
514 size_t fileScopeLen = hasUsingStatements ? 1+m_fileScope->absFilePath().length() : 0;
515 size_t argsLen = args.length()+1;
516
517 // below is a more efficient coding of
518 // QCString key=scope->name()+"+"+name+"+"+explicitScopePart+args+typesOnly?'T':'F';
519 std::string key;
520 key.reserve(scopeNameLen+nameLen+explicitPartLen+strippedTemplateParamsLen+fileScopeLen+argsLen);
521 if (scope!=Doxygen::globalScope)
522 {
523 key+=scope->name().str();
524 key+='+';
525 }
526 key+=name.str();
527 key+='+';
528 key+=explicitScopePart.str();
529 key+=strippedTemplateParams.str();
530
531 // if a file scope is given and it contains using statements we should
532 // also use the file part in the key (as a class name can be in
533 // two different namespaces and a using statement in a file can select
534 // one of them).
535 if (hasUsingStatements)
536 {
537 // below is a more efficient coding of
538 // key+="+"+m_fileScope->name();
539 key+='+';
540 key+=m_fileScope->absFilePath().str();
541 }
542 if (argsLen>0)
543 {
544 key+='+';
545 key+=args.str();
546 }
547
548 const Definition *bestMatch=nullptr;
549 {
550 if (std::find(visitedKeys.begin(),visitedKeys.end(),key)!=std::end(visitedKeys))
551 {
552 // we are already in the middle of find the definition for this key.
553 // avoid recursion
554 return nullptr;
555 }
556 // remember the key
557 visitedKeys.push_back(key);
558 LookupInfo *pval = cache.find(key);
559 AUTO_TRACE_ADD("key={} found={}",key,pval!=nullptr);
560 if (pval)
561 {
562 if (pTemplSpec) *pTemplSpec=pval->templSpec;
563 if (pTypeDef) *pTypeDef=pval->typeDef;
564 if (pResolvedType) *pResolvedType=pval->resolvedType;
565 AUTO_TRACE_EXIT("found cached name={} templSpec={} typeDef={} resolvedTypedef={}",
566 pval->definition?pval->definition->name():QCString(),
567 pval->templSpec,
568 pval->typeDef?pval->typeDef->name():QCString(),
569 pval->resolvedType);
570 return pval->definition;
571 }
572
573 const MemberDef *bestTypedef=nullptr;
574 QCString bestTemplSpec;
575 QCString bestResolvedType;
576 int minDistance=10000; // init at "infinite"
577
578 for (Definition *d : range)
579 {
580 if (isCodeSymbol(d->definitionType()) &&
581 (!onlyLinkable ||
582 d->isLinkable() ||
583 d->isLinkableInProject() ||
584 (d->definitionType()==Definition::TypeFile &&
585 (toFileDef(d))->generateSourceFile()
586 ) // undocumented file that has source code we can link to
587 )
588 )
589 {
590 if (d->definitionType()==Definition::TypeMember)
591 {
592 const MemberDef *emd = dynamic_cast<const MemberDef *>(d);
593 if (emd && emd->isEnumValue() && emd->getEnumScope() && emd->getEnumScope()->isStrong() && explicitScopePart.isEmpty())
594 {
595 // skip lookup for strong enum values without explicit scope, see issue #11799
596 continue;
597 }
598 }
599 getResolvedSymbol(visitedKeys,scope,d,args,checkCV,insideCode,explicitScopePart,strippedTemplateParams,false,
600 minDistance,bestMatch,bestTypedef,bestTemplSpec,bestResolvedType);
601 }
602 if (minDistance==0) break; // we can stop reaching if we already reached distance 0
603 }
604
605 // in case we are looking for e.g. func() and the real function is func(int x) we also
606 // accept func(), see example 036 in the test set.
607 if (bestMatch==nullptr && args=="()")
608 {
609 for (Definition *d : range)
610 {
611 if (isCodeSymbol(d->definitionType()))
612 {
613 getResolvedSymbol(visitedKeys,scope,d,QCString(),false,insideCode,explicitScopePart,strippedTemplateParams,true,
614 minDistance,bestMatch,bestTypedef,bestTemplSpec,bestResolvedType);
615 }
616 if (minDistance==0) break; // we can stop reaching if we already reached distance 0
617 }
618 }
619
620 if (pTypeDef)
621 {
622 *pTypeDef = bestTypedef;
623 }
624 if (pTemplSpec)
625 {
626 *pTemplSpec = bestTemplSpec;
627 }
628 if (pResolvedType)
629 {
630 *pResolvedType = bestResolvedType;
631 }
632
633 cache.insert(key,LookupInfo(bestMatch,bestTypedef,bestTemplSpec,bestResolvedType));
634 visitedKeys.erase(std::remove(visitedKeys.begin(),visitedKeys.end(),key),visitedKeys.end());
635
636 AUTO_TRACE_EXIT("found name={} templSpec={} typeDef={} resolvedTypedef={}",
637 bestMatch?bestMatch->name():QCString(),
638 bestTemplSpec,
639 bestTypedef?bestTypedef->name():QCString(),
640 bestResolvedType);
641 }
642 return bestMatch;
643}
V * insert(const K &key, V &&value)
Inserts value under key in the cache.
Definition cache.h:44
V * find(const K &key)
Definition cache.h:105
virtual bool isStrong() const =0
virtual const MemberDef * getEnumScope() const =0
virtual bool isEnumValue() const =0
int find(char c, int index=0, bool cs=TRUE) const
Definition qcstring.cpp:43
size_t length() const
Returns the length of the string, not counting the 0-terminator.
Definition qcstring.h:166
QCString left(size_t len) const
Definition qcstring.h:229
void replaceNamespaceAliases(QCString &name)
#define TRUE
Definition qcstring.h:37
QCString resolvedType
Definition doxygen.h:62
const Definition * definition
Definition doxygen.h:59
QCString templSpec
Definition doxygen.h:61
const MemberDef * typeDef
Definition doxygen.h:60
void getResolvedSymbol(VisitedKeys &visitedKeys, const Definition *scope, const Definition *d, const QCString &args, bool checkCV, bool insideCode, const QCString &explicitScopePart, const QCString &strippedTemplateParams, bool forceCallable, int &minDistance, const Definition *&bestMatch, const MemberDef *&bestTypedef, QCString &bestTemplSpec, QCString &bestResolvedType)
static bool isCodeSymbol(Definition::DefType defType)
int computeQualifiedIndex(const QCString &name)
Return the index of the last :: in the string name that is still before the first <.
Definition util.cpp:6842
QCString stripTemplateSpecifiersFromScope(const QCString &fullName, bool parentOnly, QCString *pLastScopeStripped, QCString scopeName, bool allowArtificial)
Definition util.cpp:4526

References AUTO_TRACE, AUTO_TRACE_ADD, AUTO_TRACE_EXIT, computeQualifiedIndex(), LookupInfo::definition, Cache< K, V >::find(), QCString::find(), MemberDef::getEnumScope(), Definition::getLanguage(), getResolvedSymbol(), Doxygen::globalScope, Cache< K, V >::insert(), isCodeSymbol(), QCString::isEmpty(), MemberDef::isEnumValue(), MemberDef::isStrong(), QCString::left(), QCString::length(), m_fileScope, QCString::mid(), Definition::name(), replaceNamespaceAliases(), LookupInfo::resolvedType, QCString::size(), QCString::str(), stringToArgumentList(), stripTemplateSpecifiersFromScope(), Doxygen::symbolMap, LookupInfo::templSpec, toFileDef(), TRUE, LookupInfo::typeDef, Definition::TypeFile, and Definition::TypeMember.

◆ getResolvedType()

void SymbolResolver::Private::getResolvedType ( LookupCache & cache,
VisitedKeys & visitedKeys,
const Definition * scope,
const Definition * d,
const QCString & explicitScopePart,
const ArgumentList * actTemplParams,
int & minDistance,
const ClassDef *& bestMatch,
const MemberDef *& bestTypedef,
QCString & bestTemplSpec,
QCString & bestResolvedType )
private

Definition at line 645 of file symbolresolver.cpp.

658{
659 AUTO_TRACE("scope={} sym={} explicitScope={}",scope->name(),d->qualifiedName(),explicitScopePart);
660 // only look at classes and members that are enums or typedefs
663 ((toMemberDef(d))->isTypedef() ||
664 (toMemberDef(d))->isEnumerate())
665 )
666 )
667 {
668 VisitedNamespaces visitedNamespaces;
669 AccessStack accessStack;
670 // test accessibility of definition within scope.
671 int distance = isAccessibleFromWithExpScope(visitedKeys,visitedNamespaces,
672 accessStack,scope,d,explicitScopePart);
673 AUTO_TRACE_ADD("distance={}",distance);
674 if (distance!=-1) // definition is accessible
675 {
676 // see if we are dealing with a class or a typedef
677 if (d->definitionType()==Definition::TypeClass) // d is a class
678 {
679 const ClassDef *cd = toClassDef(d);
680 //printf("cd=%s\n",qPrint(cd->name()));
681 if (!cd->isTemplateArgument()) // skip classes that
682 // are only there to
683 // represent a template
684 // argument
685 {
686 //printf("is not a templ arg\n");
687 if (distance<minDistance) // found a definition that is "closer"
688 {
689 AUTO_TRACE_ADD("found symbol={} at distance={} minDistance={}",cd->name(),distance,minDistance);
690 minDistance=distance;
691 bestMatch = cd;
692 bestTypedef = nullptr;
693 bestTemplSpec.clear();
694 bestResolvedType = cd->qualifiedName();
695 }
696 else if (distance==minDistance &&
697 m_fileScope && bestMatch &&
698 !m_fileScope->getUsedNamespaces().empty() &&
701 )
702 {
703 // in case the distance is equal it could be that a class X
704 // is defined in a namespace and in the global scope. When searched
705 // in the global scope the distance is 0 in both cases. We have
706 // to choose one of the definitions: we choose the one in the
707 // namespace if the fileScope imports namespaces and the definition
708 // found was in a namespace while the best match so far isn't.
709 // Just a non-perfect heuristic but it could help in some situations
710 // (kdecore code is an example).
711 AUTO_TRACE_ADD("found symbol={} at distance={} minDistance={}",cd->name(),distance,minDistance);
712 minDistance=distance;
713 bestMatch = cd;
714 bestTypedef = nullptr;
715 bestTemplSpec.clear();
716 bestResolvedType = cd->qualifiedName();
717 }
718 }
719 else
720 {
721 //printf(" is a template argument!\n");
722 }
723 }
725 {
726 const MemberDef *md = toMemberDef(d);
727 AUTO_TRACE_ADD("member={} isTypeDef={}",md->name(),md->isTypedef());
728 if (md->isTypedef()) // d is a typedef
729 {
730 QCString args=md->argsString();
731 if (args.isEmpty()) // do not expand "typedef t a[4];"
732 {
733 // we found a symbol at this distance, but if it didn't
734 // resolve to a class, we still have to make sure that
735 // something at a greater distance does not match, since
736 // that symbol is hidden by this one.
737 if (distance<minDistance)
738 {
739 QCString spec;
740 QCString type;
741 minDistance=distance;
742 const MemberDef *enumType = nullptr;
743 const ClassDef *cd = newResolveTypedef(cache,visitedKeys,scope,md,&enumType,&spec,&type,actTemplParams);
744 if (cd) // type resolves to a class
745 {
746 AUTO_TRACE_ADD("found symbol={} at distance={} minDistance={}",cd->name(),distance,minDistance);
747 bestMatch = cd;
748 bestTypedef = md;
749 bestTemplSpec = spec;
750 bestResolvedType = type;
751 }
752 else if (enumType) // type resolves to a member type
753 {
754 AUTO_TRACE_ADD("found enum");
755 bestMatch = nullptr;
756 bestTypedef = enumType;
757 bestTemplSpec = "";
758 bestResolvedType = enumType->qualifiedName();
759 }
760 else if (md->isReference()) // external reference
761 {
762 AUTO_TRACE_ADD("found external reference");
763 bestMatch = nullptr;
764 bestTypedef = md;
765 bestTemplSpec = spec;
766 bestResolvedType = type;
767 }
768 else
769 {
770 AUTO_TRACE_ADD("no match");
771 bestMatch = nullptr;
772 bestTypedef = md;
773 bestTemplSpec.clear();
774 bestResolvedType.clear();
775 }
776 }
777 else
778 {
779 //printf(" not the best match %d min=%d\n",distance,minDistance);
780 }
781 }
782 else
783 {
784 AUTO_TRACE_ADD("skipping complex typedef");
785 }
786 }
787 else if (md->isEnumerate())
788 {
789 if (distance<minDistance)
790 {
791 AUTO_TRACE_ADD("found enum={} at distance={} minDistance={}",md->name(),distance,minDistance);
792 minDistance=distance;
793 bestMatch = nullptr;
794 bestTypedef = md;
795 bestTemplSpec = "";
796 bestResolvedType = md->qualifiedName();
797 }
798 }
799 }
800 } // if definition accessible
801 else
802 {
803 AUTO_TRACE_ADD("not accessible");
804 }
805 } // if definition is a class or member
806 AUTO_TRACE_EXIT("bestMatch sym={} type={}",
807 bestMatch?bestMatch->name():QCString("<none>"),bestResolvedType);
808}
virtual bool isReference() const =0
virtual bool isTypedef() const =0
virtual QCString argsString() const =0

References MemberDef::argsString(), AUTO_TRACE, AUTO_TRACE_ADD, AUTO_TRACE_EXIT, QCString::clear(), Definition::definitionType(), Definition::getOuterScope(), Doxygen::globalScope, SymbolResolver::isAccessibleFromWithExpScope(), QCString::isEmpty(), MemberDef::isEnumerate(), Definition::isReference(), ClassDef::isTemplateArgument(), MemberDef::isTypedef(), m_fileScope, Definition::name(), newResolveTypedef(), Definition::qualifiedName(), toClassDef(), toMemberDef(), Definition::TypeClass, Definition::TypeMember, and Definition::TypeNamespace.

◆ getResolvedTypeRec()

const ClassDef * SymbolResolver::Private::getResolvedTypeRec ( LookupCache & cache,
VisitedKeys & visitedKeys,
const Definition * scope,
const QCString & n,
const MemberDef ** pTypeDef,
QCString * pTemplSpec,
QCString * pResolvedType )

Definition at line 292 of file symbolresolver.cpp.

300{
301 AUTO_TRACE("scope={} name={}",scope->name(),n);
302 if (n.isEmpty()) return nullptr;
303 QCString explicitScopePart;
304 QCString strippedTemplateParams;
305 QCString scopeName=scope!=Doxygen::globalScope ? scope->name() : QCString();
306 QCString name=stripTemplateSpecifiersFromScope(n,TRUE,&strippedTemplateParams,scopeName);
307 std::unique_ptr<ArgumentList> actTemplParams;
308 if (!strippedTemplateParams.isEmpty()) // template part that was stripped
309 {
310 actTemplParams = stringToArgumentList(scope->getLanguage(),strippedTemplateParams);
311 }
312
313 int qualifierIndex = computeQualifiedIndex(name);
314 //printf("name=%s qualifierIndex=%d\n",qPrint(name),qualifierIndex);
315 if (qualifierIndex!=-1) // qualified name
316 {
317 // split off the explicit scope part
318 explicitScopePart=name.left(qualifierIndex);
319 // todo: improve namespace alias substitution
320 replaceNamespaceAliases(explicitScopePart);
321 name=name.mid(qualifierIndex+2);
322 }
323
324 if (name.isEmpty())
325 {
326 AUTO_TRACE_EXIT("empty name");
327 return nullptr; // empty name
328 }
329
330 auto &range = Doxygen::symbolMap->find(name);
331 if (range.empty())
332 {
333 AUTO_TRACE_EXIT("no symbol with this name");
334 return nullptr;
335 }
336
337 bool hasUsingStatements =
338 (m_fileScope && (!m_fileScope->getUsedNamespaces().empty() ||
339 !m_fileScope->getUsedDefinitions().empty())
340 );
341 // Since it is often the case that the same name is searched in the same
342 // scope over an over again (especially for the linked source code generation)
343 // we use a cache to collect previous results. This is possible since the
344 // result of a lookup is deterministic. As the key we use the concatenated
345 // scope, the name to search for and the explicit scope prefix. The speedup
346 // achieved by this simple cache can be enormous.
347 size_t scopeNameLen = scope->name().length()+1;
348 size_t nameLen = name.length()+1;
349 size_t explicitPartLen = explicitScopePart.length();
350 size_t fileScopeLen = hasUsingStatements ? 1+m_fileScope->absFilePath().length() : 0;
351
352 // below is a more efficient coding of
353 // QCString key=scope->name()+"+"+name+"+"+explicitScopePart+args+typesOnly?'T':'F';
354 QCString key(scopeNameLen+nameLen+explicitPartLen+fileScopeLen, QCString::ExplicitSize);
355 char *pk=key.rawData();
356 qstrcpy(pk,scope->name().data()); *(pk+scopeNameLen-1)='+';
357 pk+=scopeNameLen;
358 qstrcpy(pk,name.data()); *(pk+nameLen-1)='+';
359 pk+=nameLen;
360 qstrcpy(pk,explicitScopePart.data());
361 pk+=explicitPartLen;
362
363 // if a file scope is given and it contains using statements we should
364 // also use the file part in the key (as a class name can be in
365 // two different namespaces and a using statement in a file can select
366 // one of them).
367 if (hasUsingStatements)
368 {
369 // below is a more efficient coding of
370 // key+="+"+m_fileScope->name();
371 *pk++='+';
372 qstrcpy(pk,m_fileScope->absFilePath().data());
373 pk+=fileScopeLen-1;
374 }
375 *pk='\0';
376
377 const ClassDef *bestMatch=nullptr;
378 {
379 if (std::find(visitedKeys.begin(),visitedKeys.end(),key.str())!=std::end(visitedKeys))
380 {
381 // we are already in the middle of find the definition for this key.
382 // avoid recursion
383 AUTO_TRACE_EXIT("recursion detected");
384 return nullptr;
385 }
386 // remember the key
387 visitedKeys.push_back(key.str());
388
389 LookupInfo *pval = cache.find(key.str());
390 AUTO_TRACE_ADD("key={} found={}",key,pval!=nullptr);
391 if (pval)
392 {
393 if (pTemplSpec) *pTemplSpec=pval->templSpec;
394 if (pTypeDef) *pTypeDef=pval->typeDef;
395 if (pResolvedType) *pResolvedType=pval->resolvedType;
396 AUTO_TRACE_EXIT("found cached name={} templSpec={} typeDef={} resolvedTypedef={}",
397 pval->definition?pval->definition->name():QCString(),
398 pval->templSpec,
399 pval->typeDef?pval->typeDef->name():QCString(),
400 pval->resolvedType);
401
402 return toClassDef(pval->definition);
403 }
404
405 const MemberDef *bestTypedef=nullptr;
406 QCString bestTemplSpec;
407 QCString bestResolvedType;
408 int minDistance=10000; // init at "infinite"
409
410 for (Definition *d : range)
411 {
412 if (isCodeSymbol(d->definitionType()))
413 {
414 getResolvedType(cache,visitedKeys,scope,d,explicitScopePart,actTemplParams.get(),
415 minDistance,bestMatch,bestTypedef,bestTemplSpec,bestResolvedType);
416 }
417 if (minDistance==0) break; // we can stop reaching if we already reached distance 0
418 }
419
420 if (pTypeDef)
421 {
422 *pTypeDef = bestTypedef;
423 }
424 if (pTemplSpec)
425 {
426 *pTemplSpec = bestTemplSpec;
427 }
428 if (pResolvedType)
429 {
430 *pResolvedType = bestResolvedType;
431 }
432
433 cache.insert(key.str(),LookupInfo(bestMatch,bestTypedef,bestTemplSpec,bestResolvedType));
434 visitedKeys.erase(std::remove(visitedKeys.begin(), visitedKeys.end(), key.str()), visitedKeys.end());
435
436 AUTO_TRACE_EXIT("found name={} templSpec={} typeDef={} resolvedTypedef={}",
437 bestMatch?bestMatch->name():QCString(),
438 bestTemplSpec,
439 bestTypedef?bestTypedef->name():QCString(),
440 bestResolvedType);
441 }
442 return bestMatch;
443}
@ ExplicitSize
Definition qcstring.h:146
const char * data() const
Returns a pointer to the contents of the string in the form of a 0-terminated C string.
Definition qcstring.h:172
QCString getResolvedType() const
In case a call to resolveClass() points to a typedef or using declaration.
char * qstrcpy(char *dst, const char *src)
Definition qcstring.h:61

References AUTO_TRACE, AUTO_TRACE_ADD, AUTO_TRACE_EXIT, computeQualifiedIndex(), QCString::data(), LookupInfo::definition, QCString::ExplicitSize, Cache< K, V >::find(), Definition::getLanguage(), SymbolResolver::getResolvedType(), Doxygen::globalScope, Cache< K, V >::insert(), isCodeSymbol(), QCString::isEmpty(), QCString::left(), QCString::length(), m_fileScope, QCString::mid(), Definition::name(), qstrcpy(), QCString::rawData(), replaceNamespaceAliases(), LookupInfo::resolvedType, QCString::str(), stringToArgumentList(), stripTemplateSpecifiersFromScope(), Doxygen::symbolMap, LookupInfo::templSpec, toClassDef(), TRUE, and LookupInfo::typeDef.

Referenced by newResolveTypedef().

◆ isAccessibleFrom()

int SymbolResolver::Private::isAccessibleFrom ( VisitedKeys & visitedKeys,
AccessStack & accessStack,
const Definition * scope,
const Definition * item )

Definition at line 1418 of file symbolresolver.cpp.

1422{
1423 AUTO_TRACE("scope={} item={} item.definitionType={}",
1424 scope?scope->name():QCString(), item?item->name():QCString(),
1425 item?(int)item->definitionType():-1);
1426
1427 if (accessStack.find(scope,m_fileScope,item))
1428 {
1429 AUTO_TRACE_EXIT("already processed!");
1430 return -1;
1431 }
1432 accessStack.push(scope,m_fileScope,item);
1433
1434 int result=0; // assume we found it
1435 int i=0;
1436
1437 const Definition *itemScope=item->getOuterScope();
1438 bool itemIsMember = item->definitionType()==Definition::TypeMember;
1439 bool itemIsClass = item->definitionType()==Definition::TypeClass;
1440
1441 // if item is a global member and scope points to a specific file
1442 // we adjust the scope so the file gets preference over members with the same name in
1443 // other files.
1444 if ((itemIsMember || itemIsClass) &&
1445 (itemScope==Doxygen::globalScope || // global
1446 (itemScope && itemScope->name().startsWith("anonymous_namespace{")) // member of an anonymous namespace
1447 ) &&
1449 {
1450 if (itemIsMember)
1451 {
1452 itemScope = toMemberDef(item)->getFileDef();
1453 }
1454 else if (itemIsClass)
1455 {
1456 itemScope = toClassDef(item)->getFileDef();
1457 }
1458 AUTO_TRACE_ADD("adjusting scope to {}",itemScope?itemScope->name():QCString());
1459 }
1460
1461 bool memberAccessibleFromScope =
1462 (itemIsMember && // a member
1463 itemScope && itemScope->definitionType()==Definition::TypeClass && // of a class
1464 scope->definitionType()==Definition::TypeClass && // accessible
1465 (toClassDef(scope))->isAccessibleMember(toMemberDef(item)) // from scope
1466 );
1467 bool nestedClassInsideBaseClass =
1468 (itemIsClass && // a nested class
1469 itemScope && itemScope->definitionType()==Definition::TypeClass && // inside a base
1470 scope->definitionType()==Definition::TypeClass && // class of scope
1471 (toClassDef(scope))->isBaseClass(toClassDef(itemScope),TRUE)
1472 );
1473 bool enumValueOfStrongEnum =
1474 (itemIsMember &&
1475 toMemberDef(item)->isStrongEnumValue() &&
1477 toMemberDef(scope)->isEnumerate() &&
1478 scope==toMemberDef(item)->getEnumScope()
1479 );
1480
1481 if (itemScope==scope || memberAccessibleFromScope || nestedClassInsideBaseClass || enumValueOfStrongEnum)
1482 {
1483 AUTO_TRACE_ADD("memberAccessibleFromScope={} nestedClassInsideBaseClass={} enumValueOfStrongEnum={}",
1484 memberAccessibleFromScope, nestedClassInsideBaseClass, enumValueOfStrongEnum);
1485 int distanceToBase=0;
1486 if (nestedClassInsideBaseClass)
1487 {
1488 result++; // penalty for base class to prevent
1489 // this is preferred over nested class in this class
1490 // see bug 686956
1491 }
1492 else if (memberAccessibleFromScope &&
1493 itemScope &&
1494 itemScope->definitionType()==Definition::TypeClass &&
1496 (distanceToBase=toClassDef(scope)->isBaseClass(toClassDef(itemScope),TRUE))>0
1497 )
1498 {
1499 result+=distanceToBase; // penalty if member is accessible via a base class
1500 }
1501 }
1502 else if (scope==Doxygen::globalScope)
1503 {
1504 if (itemScope &&
1506 toNamespaceDef(itemScope)->isAnonymous() &&
1507 itemScope->getOuterScope()==Doxygen::globalScope)
1508 { // item is in an anonymous namespace in the global scope and we are
1509 // looking in the global scope
1510 AUTO_TRACE_ADD("found in anonymous namespace");
1511 result++;
1512 goto done;
1513 }
1514 if (m_fileScope)
1515 {
1516 if (accessibleViaUsingDefinition(visitedKeys,m_fileScope->getUsedDefinitions(),item))
1517 {
1518 AUTO_TRACE_ADD("found via used class");
1519 goto done;
1520 }
1521 VisitedNamespaceKeys visitedNamespaceKeys;
1522 if (accessibleViaUsingNamespace(visitedKeys,visitedNamespaceKeys,m_fileScope->getUsedNamespaces(),item))
1523 {
1524 AUTO_TRACE_ADD("found via used namespace");
1525 goto done;
1526 }
1527 }
1528 AUTO_TRACE_ADD("reached global scope");
1529 result=-1; // not found in path to globalScope
1530 }
1531 else // keep searching
1532 {
1533 // check if scope is a namespace, which is using other classes and namespaces
1535 {
1536 const NamespaceDef *nscope = toNamespaceDef(scope);
1537 if (accessibleViaUsingDefinition(visitedKeys,nscope->getUsedDefinitions(),item))
1538 {
1539 AUTO_TRACE_ADD("found via used class");
1540 goto done;
1541 }
1542 VisitedNamespaceKeys visitedNamespaceKeys;
1543 if (accessibleViaUsingNamespace(visitedKeys,visitedNamespaceKeys,nscope->getUsedNamespaces(),item,QCString()))
1544 {
1545 AUTO_TRACE_ADD("found via used namespace");
1546 goto done;
1547 }
1548 }
1549 else if (scope->definitionType()==Definition::TypeFile)
1550 {
1551 const FileDef *nfile = toFileDef(scope);
1552 if (accessibleViaUsingDefinition(visitedKeys,nfile->getUsedDefinitions(),item))
1553 {
1554 AUTO_TRACE_ADD("found via used class");
1555 goto done;
1556 }
1557 VisitedNamespaceKeys visitedNamespaceKeys;
1558 if (accessibleViaUsingNamespace(visitedKeys,visitedNamespaceKeys,nfile->getUsedNamespaces(),item,QCString()))
1559 {
1560 AUTO_TRACE_ADD("found via used namespace");
1561 goto done;
1562 }
1563 }
1564 // repeat for the parent scope
1565 const Definition *parentScope = scope->getOuterScope();
1566 if (parentScope==Doxygen::globalScope)
1567 {
1569 {
1570 const FileDef *fd = toClassDef(scope)->getFileDef();
1571 if (fd)
1572 {
1573 parentScope = fd;
1574 }
1575 }
1576 }
1577 i=isAccessibleFrom(visitedKeys,accessStack,parentScope,item);
1578 result= (i==-1) ? -1 : i+2;
1579 }
1580done:
1581 AUTO_TRACE_EXIT("result={}",result);
1582 accessStack.pop();
1583 return result;
1584}
bool find(const Definition *scope, const FileDef *fileScope, const Definition *item)
void push(const Definition *scope, const FileDef *fileScope, const Definition *item)
virtual FileDef * getFileDef() const =0
Returns the namespace this compound is in, or 0 if it has a global scope.
virtual const LinkedRefMap< NamespaceDef > & getUsedNamespaces() const =0
virtual const LinkedRefMap< const Definition > & getUsedDefinitions() const =0
virtual bool isStrongEnumValue() const =0
virtual const LinkedRefMap< NamespaceDef > & getUsedNamespaces() const =0
virtual const LinkedRefMap< const Definition > & getUsedDefinitions() const =0
bool accessibleViaUsingDefinition(VisitedKeys &visitedKeys, const LinkedRefMap< const Definition > &dl, const Definition *item, const QCString &explicitScopePart="")
int isAccessibleFrom(VisitedKeys &visitedKeys, AccessStack &accessStack, const Definition *scope, const Definition *item)
StringVector VisitedNamespaceKeys

References accessibleViaUsingDefinition(), accessibleViaUsingNamespace(), AUTO_TRACE, AUTO_TRACE_ADD, AUTO_TRACE_EXIT, Definition::definitionType(), AccessStack::find(), MemberDef::getEnumScope(), ClassDef::getFileDef(), MemberDef::getFileDef(), Definition::getOuterScope(), FileDef::getUsedDefinitions(), NamespaceDef::getUsedDefinitions(), FileDef::getUsedNamespaces(), NamespaceDef::getUsedNamespaces(), Doxygen::globalScope, SymbolResolver::isAccessibleFrom(), MemberDef::isEnumerate(), MemberDef::isStrongEnumValue(), m_fileScope, Definition::name(), AccessStack::pop(), AccessStack::push(), QCString::startsWith(), toClassDef(), toFileDef(), toMemberDef(), toNamespaceDef(), TRUE, Definition::TypeClass, Definition::TypeFile, Definition::TypeMember, and Definition::TypeNamespace.

◆ isAccessibleFromWithExpScope()

int SymbolResolver::Private::isAccessibleFromWithExpScope ( VisitedKeys & visitedKeys,
VisitedNamespaces & visitedNamespaces,
AccessStack & accessStack,
const Definition * scope,
const Definition * item,
const QCString & explicitScopePart )

Definition at line 1087 of file symbolresolver.cpp.

1094{
1095 int result=0; // assume we found it
1096 AUTO_TRACE("scope={} item={} explictScopePart={}",
1097 scope?scope->name():QCString(), item?item->name():QCString(), explicitScopePart);
1098 if (explicitScopePart.isEmpty())
1099 {
1100 // handle degenerate case where there is no explicit scope.
1101 result = isAccessibleFrom(visitedKeys,accessStack,scope,item);
1102 AUTO_TRACE_EXIT("result={}",result);
1103 return result;
1104 }
1105
1106 if (accessStack.find(scope,m_fileScope,item,explicitScopePart))
1107 {
1108 AUTO_TRACE_EXIT("already found");
1109 return -1;
1110 }
1111 accessStack.push(scope,m_fileScope,item,explicitScopePart);
1112
1113 const Definition *newScope = followPath(visitedKeys,scope,explicitScopePart);
1114 if (newScope) // explicitScope is inside scope => newScope is the result
1115 {
1116 Definition *itemScope = item->getOuterScope();
1117
1118 AUTO_TRACE_ADD("scope traversal successful newScope={}",newScope->name());
1119
1120 bool nestedClassInsideBaseClass =
1121 itemScope &&
1122 itemScope->definitionType()==Definition::TypeClass &&
1124 (toClassDef(newScope))->isBaseClass(toClassDef(itemScope),TRUE);
1125
1126 bool enumValueWithinEnum =
1128 toMemberDef(item)->isEnumValue() &&
1129 toMemberDef(item)->getEnumScope()==newScope;
1130
1131 if (itemScope==newScope) // exact match of scopes => distance==0
1132 {
1133 AUTO_TRACE_ADD("found scope match");
1134 }
1135 else if (nestedClassInsideBaseClass)
1136 {
1137 // inheritance is also ok. Example: looking for B::I, where
1138 // class A { public: class I {} };
1139 // class B : public A {}
1140 // but looking for B::I, where
1141 // class A { public: class I {} };
1142 // class B { public: class I {} };
1143 // will find A::I, so we still prefer a direct match and give this one a distance of 1
1144 result=1;
1145
1146 AUTO_TRACE_ADD("{} is a bass class of {}",scope->name(),newScope->name());
1147 }
1148 else if (enumValueWithinEnum)
1149 {
1150 AUTO_TRACE_ADD("found enum value inside enum");
1151 result=1;
1152 }
1153 else
1154 {
1155 int i=-1;
1157 {
1158 visitedNamespaces.emplace(newScope->name().str(),newScope);
1159 // this part deals with the case where item is a class
1160 // A::B::C but is explicit referenced as A::C, where B is imported
1161 // in A via a using directive.
1162 //printf("newScope is a namespace: %s!\n",qPrint(newScope->name()));
1163 const NamespaceDef *nscope = toNamespaceDef(newScope);
1164 for (const auto &ud : nscope->getUsedDefinitions())
1165 {
1166 if (ud==item)
1167 {
1168 AUTO_TRACE_ADD("found in used definition {}",ud->name());
1169 goto done;
1170 }
1171 }
1172 for (const auto &nd : nscope->getUsedNamespaces())
1173 {
1174 if (visitedNamespaces.find(nd->name().str())==visitedNamespaces.end())
1175 {
1176 i = isAccessibleFromWithExpScope(visitedKeys,visitedNamespaces,accessStack,scope,item,nd->name());
1177 if (i!=-1)
1178 {
1179 AUTO_TRACE_ADD("found in used namespace {}",nd->name());
1180 goto done;
1181 }
1182 }
1183 }
1184 }
1185#if 0 // this caused problems resolving A::f() in the docs when there was a A::f(int) but also a
1186 // global function f() that exactly matched the argument list.
1187 else if (isParentScope(scope,newScope) && newScope->definitionType()==Definition::TypeClass)
1188 {
1189 // if we a look for a type B and have explicit scope A, then it is also fine if B
1190 // is found at the global scope.
1191 result = 1;
1192 goto done;
1193 }
1194#endif
1195 // repeat for the parent scope
1196 if (scope!=Doxygen::globalScope)
1197 {
1198 i = isAccessibleFromWithExpScope(visitedKeys,visitedNamespaces,accessStack,scope->getOuterScope(),item,explicitScopePart);
1199 }
1200 result = (i==-1) ? -1 : i+2;
1201 }
1202 }
1203 else // failed to resolve explicitScope
1204 {
1205 AUTO_TRACE_ADD("failed to resolve explicitScope");
1207 {
1208 const NamespaceDef *nscope = toNamespaceDef(scope);
1209 VisitedNamespaceKeys locVisitedNamespaceKeys;
1210 if (accessibleViaUsingNamespace(visitedKeys,locVisitedNamespaceKeys,nscope->getUsedNamespaces(),item,explicitScopePart))
1211 {
1212 AUTO_TRACE_ADD("found in used class");
1213 goto done;
1214 }
1215 }
1216 if (scope==Doxygen::globalScope)
1217 {
1218 if (m_fileScope)
1219 {
1220 VisitedNamespaceKeys locVisitedNamespaceKeys;
1221 if (accessibleViaUsingNamespace(visitedKeys,locVisitedNamespaceKeys,m_fileScope->getUsedNamespaces(),item,explicitScopePart))
1222 {
1223 AUTO_TRACE_ADD("found in used namespace");
1224 goto done;
1225 }
1226 }
1227 AUTO_TRACE_ADD("not found in this scope");
1228 result=-1;
1229 }
1230 else // continue by looking into the parent scope
1231 {
1232 int i=isAccessibleFromWithExpScope(visitedKeys,visitedNamespaces,accessStack,scope->getOuterScope(),item,explicitScopePart);
1233 result= (i==-1) ? -1 : i+2;
1234 }
1235 }
1236
1237done:
1238 AUTO_TRACE_EXIT("result={}",result);
1239 accessStack.pop();
1240 return result;
1241}

References accessibleViaUsingNamespace(), AUTO_TRACE, AUTO_TRACE_ADD, AUTO_TRACE_EXIT, Definition::definitionType(), AccessStack::find(), followPath(), MemberDef::getEnumScope(), Definition::getOuterScope(), NamespaceDef::getUsedDefinitions(), NamespaceDef::getUsedNamespaces(), Doxygen::globalScope, SymbolResolver::isAccessibleFrom(), SymbolResolver::isAccessibleFromWithExpScope(), QCString::isEmpty(), MemberDef::isEnumValue(), m_fileScope, Definition::name(), AccessStack::pop(), AccessStack::push(), QCString::str(), toClassDef(), toMemberDef(), toNamespaceDef(), TRUE, Definition::TypeClass, Definition::TypeMember, and Definition::TypeNamespace.

◆ newResolveTypedef()

const ClassDef * SymbolResolver::Private::newResolveTypedef ( LookupCache & cache,
VisitedKeys & visitedKeys,
const Definition * scope,
const MemberDef * md,
const MemberDef ** pMemType,
QCString * pTemplSpec,
QCString * pResolvedType,
const ArgumentList * actTemplParams = nullptr )
private

Definition at line 948 of file symbolresolver.cpp.

957{
958 AUTO_TRACE("md={}",md->qualifiedName());
959 std::lock_guard lock(g_cacheTypedefMutex);
960 bool isCached = md->isTypedefValCached(); // value already cached
961 if (isCached)
962 {
963 AUTO_TRACE_EXIT("cached typedef={} resolvedTypedef={} templSpec={}",
964 md->getCachedTypedefVal() ? md->getCachedTypedefVal()->name() : QCString(),
967
968 if (pTemplSpec) *pTemplSpec = md->getCachedTypedefTemplSpec();
969 if (pResolvedType) *pResolvedType = md->getCachedResolvedTypedef();
970 return md->getCachedTypedefVal();
971 }
972
973 QCString qname = md->qualifiedName();
974 if (m_resolvedTypedefs.find(qname.str())!=m_resolvedTypedefs.end())
975 {
976 AUTO_TRACE_EXIT("already being processed");
977 return nullptr; // typedef already done
978 }
979
980 auto typedef_it = m_resolvedTypedefs.emplace(qname.str(),md).first; // put on the trace list
981
982 const ClassDef *typeClass = md->getClassDef();
983 QCString type = md->typeString(); // get the "value" of the typedef
984 if (typeClass && typeClass->isTemplate() &&
985 actTemplParams && !actTemplParams->empty())
986 {
988 typeClass->templateArguments(),actTemplParams);
989 }
990 QCString typedefValue = type;
991 int tl=static_cast<int>(type.length());
992 int ip=tl-1; // remove * and & at the end
993 while (ip>=0 && (type.at(ip)=='*' || type.at(ip)=='&' || type.at(ip)==' '))
994 {
995 ip--;
996 }
997 type=type.left(ip+1);
998 type.stripPrefix("const "); // strip leading "const"
999 type.stripPrefix("volatile "); // strip leading "volatile"
1000 type.stripPrefix("struct "); // strip leading "struct"
1001 type.stripPrefix("union "); // strip leading "union"
1002 int sp=0;
1003 tl=static_cast<int>(type.length()); // length may have been changed
1004 while (sp<tl && type.at(sp)==' ') sp++;
1005 const MemberDef *memTypeDef = nullptr;
1006 const ClassDef *result = getResolvedTypeRec(cache,visitedKeys,md->getOuterScope(),type,
1007 &memTypeDef,nullptr,pResolvedType);
1008 // if type is a typedef then return what it resolves to.
1009 if (memTypeDef && memTypeDef->isTypedef())
1010 {
1011 AUTO_TRACE_ADD("resolving typedef");
1012 result=newResolveTypedef(cache,visitedKeys,m_fileScope,memTypeDef,pMemType,pTemplSpec,nullptr);
1013 goto done;
1014 }
1015 else if (memTypeDef && memTypeDef->isEnumerate() && pMemType)
1016 {
1017 *pMemType = memTypeDef;
1018 }
1019
1020 if (result==nullptr)
1021 {
1022 // try unspecialized version if type is template
1023 int si=type.findRev("::");
1024 int i=type.find('<');
1025 if (si==-1 && i!=-1) // typedef of a template => try the unspecialized version
1026 {
1027 if (pTemplSpec) *pTemplSpec = type.mid(i);
1028 result = getResolvedTypeRec(cache,visitedKeys,md->getOuterScope(),type.left(i),nullptr,nullptr,pResolvedType);
1029 }
1030 else if (si!=-1) // A::B
1031 {
1032 i=type.find('<',si);
1033 if (i==-1) // Something like A<T>::B => lookup A::B
1034 {
1035 i=static_cast<int>(type.length());
1036 }
1037 else // Something like A<T>::B<S> => lookup A::B, spec=<S>
1038 {
1039 if (pTemplSpec) *pTemplSpec = type.mid(i);
1040 }
1041 result = getResolvedTypeRec(cache,visitedKeys,md->getOuterScope(),
1042 stripTemplateSpecifiersFromScope(type.left(i),FALSE),nullptr,nullptr,pResolvedType);
1043 }
1044 }
1045
1046done:
1047 if (pResolvedType)
1048 {
1049 if (result && result->definitionType()==Definition::TypeClass)
1050 {
1051 *pResolvedType = result->qualifiedName();
1052 if (sp>0) pResolvedType->prepend(typedefValue.left(sp));
1053 if (ip<tl-1) pResolvedType->append(typedefValue.right(tl-ip-1));
1054 }
1055 else
1056 {
1057 *pResolvedType = typedefValue;
1058 }
1059 }
1060
1061 // remember computed value for next time
1062 if (result && result->getDefFileName()!="<code>")
1063 // this check is needed to prevent that temporary classes that are
1064 // introduced while parsing code fragments are being cached here.
1065 {
1066 AUTO_TRACE_ADD("caching typedef relation {}->{}",md->name(),result->name());
1067 MemberDefMutable *mdm = toMemberDefMutable(const_cast<MemberDef*>(md));
1068 if (mdm)
1069 {
1070 mdm->cacheTypedefVal(result,
1071 pTemplSpec ? *pTemplSpec : QCString(),
1072 pResolvedType ? *pResolvedType : QCString()
1073 );
1074 }
1075 }
1076
1077 m_resolvedTypedefs.erase(typedef_it); // remove from the trace list
1078
1079 AUTO_TRACE_EXIT("result={} pTemplSpec={} pResolvedType={}",
1080 result ? result->name() : QCString(),
1081 pTemplSpec ? *pTemplSpec : "<nullptr>",
1082 pResolvedType ? *pResolvedType : "<nullptr>"
1083 );
1084 return result;
1085}
bool empty() const
Definition arguments.h:99
virtual const ArgumentList & templateArguments() const =0
Returns the template arguments of this class.
virtual bool isTemplate() const =0
Returns TRUE if this class is a template.
virtual QCString getDefFileName() const =0
virtual QCString getCachedResolvedTypedef() const =0
virtual const ClassDef * getCachedTypedefVal() const =0
virtual const ClassDef * getClassDef() const =0
virtual QCString getCachedTypedefTemplSpec() const =0
virtual bool isTypedefValCached() const =0
virtual void cacheTypedefVal(const ClassDef *val, const QCString &templSpec, const QCString &resolvedType)=0
QCString & prepend(const char *s)
Definition qcstring.h:422
char & at(size_t i)
Returns a reference to the character at index i.
Definition qcstring.h:593
QCString & append(char c)
Definition qcstring.h:396
QCString right(size_t len) const
Definition qcstring.h:234
int findRev(char c, int index=-1, bool cs=TRUE) const
Definition qcstring.cpp:96
bool stripPrefix(const QCString &prefix)
Definition qcstring.h:213
MemberDefMutable * toMemberDefMutable(Definition *d)
#define FALSE
Definition qcstring.h:34
const ClassDef * getResolvedTypeRec(LookupCache &cache, VisitedKeys &visitedKeys, const Definition *scope, const QCString &n, const MemberDef **pTypeDef, QCString *pTemplSpec, QCString *pResolvedType)
std::unordered_map< std::string, const MemberDef * > m_resolvedTypedefs
static std::recursive_mutex g_cacheTypedefMutex

References QCString::append(), QCString::at(), AUTO_TRACE, AUTO_TRACE_ADD, AUTO_TRACE_EXIT, MemberDefMutable::cacheTypedefVal(), Definition::definitionType(), ArgumentList::empty(), FALSE, QCString::find(), QCString::findRev(), g_cacheTypedefMutex, MemberDef::getCachedResolvedTypedef(), MemberDef::getCachedTypedefTemplSpec(), MemberDef::getCachedTypedefVal(), MemberDef::getClassDef(), Definition::getDefFileName(), Definition::getOuterScope(), getResolvedTypeRec(), MemberDef::isEnumerate(), ClassDef::isTemplate(), MemberDef::isTypedef(), MemberDef::isTypedefValCached(), QCString::left(), QCString::length(), m_fileScope, m_resolvedTypedefs, QCString::mid(), Definition::name(), newResolveTypedef(), QCString::prepend(), Definition::qualifiedName(), QCString::right(), QCString::str(), QCString::stripPrefix(), stripTemplateSpecifiersFromScope(), substituteTemplateArgumentsInString(), ClassDef::templateArguments(), toMemberDefMutable(), Definition::TypeClass, and MemberDef::typeString().

Referenced by followPath(), getResolvedType(), and newResolveTypedef().

◆ reset()

void SymbolResolver::Private::reset ( )
inline

Definition at line 173 of file symbolresolver.cpp.

174 {
175 m_resolvedTypedefs.clear();
176 resolvedType.clear();
177 typeDef = nullptr;
178 templateSpec.clear();
179 }
const MemberDef * typeDef

References m_resolvedTypedefs, resolvedType, templateSpec, and typeDef.

◆ setFileScope()

void SymbolResolver::Private::setFileScope ( const FileDef * fileScope)
inline

Definition at line 180 of file symbolresolver.cpp.

181 {
183 }
const FileDef * fileScope() const

References fileScope(), and m_fileScope.

◆ substTypedef()

QCString SymbolResolver::Private::substTypedef ( VisitedKeys & visitedKeys,
const Definition * scope,
const QCString & name,
const MemberDef ** pTypeDef = nullptr )
private

Definition at line 1586 of file symbolresolver.cpp.

1590{
1591 AUTO_TRACE("scope={} name={}",scope?scope->name():QCString(), name);
1592 QCString result=name;
1593 if (name.isEmpty()) return result;
1594
1595 auto &range = Doxygen::symbolMap->find(name);
1596 if (range.empty())
1597 return result; // no matches
1598
1599 MemberDef *bestMatch=nullptr;
1600 int minDistance=10000; // init at "infinite"
1601
1602 std::string key;
1603 const int maxAddrSize = 20;
1604 char ptr_str[maxAddrSize];
1605 int num = qsnprintf(ptr_str,maxAddrSize,"%p:",(void *)scope);
1606 assert(num>0);
1607 key.reserve(num+name.length()+1);
1608 key+=ptr_str;
1609 key+=name.str();
1610 {
1611 auto it = g_substMap.find(key);
1612 if (it!=g_substMap.end())
1613 {
1614 if (pTypeDef) *pTypeDef = it->second.second;
1615 return it->second.first;
1616 }
1617 }
1618
1619 for (Definition *d : range)
1620 {
1621 // only look at members
1622 if (d->definitionType()==Definition::TypeMember)
1623 {
1624 // that are also typedefs
1625 MemberDef *md = toMemberDef(d);
1626 if (md->isTypedef()) // d is a typedef
1627 {
1628 VisitedNamespaces visitedNamespaces;
1629 AccessStack accessStack;
1630 // test accessibility of typedef within scope.
1631 int distance = isAccessibleFromWithExpScope(visitedKeys,visitedNamespaces,accessStack,scope,d,"");
1632 if (distance!=-1 && distance<minDistance)
1633 // definition is accessible and a better match
1634 {
1635 minDistance=distance;
1636 bestMatch = md;
1637 }
1638 }
1639 }
1640 }
1641
1642 if (bestMatch)
1643 {
1644 result = bestMatch->typeString();
1645 if (pTypeDef) *pTypeDef=bestMatch;
1646 }
1647
1648 // cache the result of the computation to give a faster answers next time, especially relevant
1649 // if `range` has many arguments (i.e. there are many symbols with the same name in different contexts)
1650 {
1651 g_substMap.emplace(key,std::make_pair(result,bestMatch));
1652 }
1653
1654 AUTO_TRACE_EXIT("result={}",result);
1655 return result;
1656}
#define qsnprintf
Definition qcstring.h:49
THREAD_LOCAL std::unordered_map< std::string, std::pair< QCString, const MemberDef * > > g_substMap

References AUTO_TRACE, AUTO_TRACE_EXIT, g_substMap, SymbolResolver::isAccessibleFromWithExpScope(), QCString::isEmpty(), MemberDef::isTypedef(), QCString::length(), Definition::name(), qsnprintf, QCString::str(), Doxygen::symbolMap, toMemberDef(), Definition::TypeMember, and MemberDef::typeString().

Referenced by followPath().

Member Data Documentation

◆ m_fileScope

◆ m_resolvedTypedefs

std::unordered_map<std::string,const MemberDef*> SymbolResolver::Private::m_resolvedTypedefs
private

Definition at line 287 of file symbolresolver.cpp.

Referenced by newResolveTypedef(), and reset().

◆ resolvedType

QCString SymbolResolver::Private::resolvedType

Definition at line 186 of file symbolresolver.cpp.

Referenced by reset().

◆ templateSpec

QCString SymbolResolver::Private::templateSpec

Definition at line 188 of file symbolresolver.cpp.

Referenced by reset().

◆ typeDef

const MemberDef* SymbolResolver::Private::typeDef = nullptr

Definition at line 187 of file symbolresolver.cpp.

Referenced by reset().


The documentation for this struct was generated from the following file: