16#include <unordered_map>
32#if !ENABLE_SYMBOLRESOLVER_TRACING
36#define AUTO_TRACE(...) (void)0
37#define AUTO_TRACE_ADD(...) (void)0
38#define AUTO_TRACE_EXIT(...) (void)0
59 std::lock_guard lock(stats.
mutex);
84 if (cacheSize<0) cacheSize=0;
85 if (cacheSize>9) cacheSize=9;
86 return 65536u << cacheSize;
92 return wrapper.cache();
98 return wrapper.cache();
132 m_elements.emplace_back(scope,fileScope,item);
136 m_elements.emplace_back(scope,fileScope,item,expScope);
145 [&](
const AccessElem &e) { return e.scope==scope && e.fileScope==fileScope && e.item==item; });
151 [&](
const AccessElem &e) { return e.scope==scope && e.fileScope==fileScope && e.item==item && e.expScope==expScope; });
225 const DString &explicitScopePart);
232 const DString &explicitScopePart,
247 const DString &explicitScopePart,
248 const DString &strippedTemplateParams,
277 const DString &explicitScopePart=
"",
282 const DString &explicitScopePart=
""
304 if (n.
empty())
return nullptr;
306 DString strippedTemplateParams;
309 std::unique_ptr<ArgumentList> actTemplParams;
310 if (!strippedTemplateParams.
empty())
317 if (qualifierIndex!=-1)
320 explicitScopePart=name.
left(qualifierIndex);
323 name=name.
mid(qualifierIndex+2);
339 bool hasUsingStatements =
349 size_t scopeNameLen = scope->
name().
length()+1;
350 size_t nameLen = name.
length()+1;
351 size_t explicitPartLen = explicitScopePart.
length();
369 if (hasUsingStatements)
381 if (std::find(visitedKeys.begin(),visitedKeys.end(),key.
str())!=std::end(visitedKeys))
389 visitedKeys.push_back(key.
str());
395 if (pTemplSpec) *pTemplSpec=pval->
templSpec;
396 if (pTypeDef) *pTypeDef=pval->
typeDef;
398 AUTO_TRACE_EXIT(
"found cached name={} templSpec={} typeDef={} resolvedTypedef={}",
410 int minDistance=10000;
416 getResolvedType(cache,visitedKeys,scope,d,explicitScopePart,actTemplParams.get(),
417 minDistance,bestMatch,bestTypedef,bestTemplSpec,bestResolvedType);
419 if (minDistance==0)
break;
424 *pTypeDef = bestTypedef;
428 *pTemplSpec = bestTemplSpec;
432 *pResolvedType = bestResolvedType;
436 visitedKeys.erase(std::remove(visitedKeys.begin(), visitedKeys.end(), key.
str()), visitedKeys.end());
438 AUTO_TRACE_EXIT(
"found name={} templSpec={} typeDef={} resolvedTypedef={}",
460 AUTO_TRACE(
"scope={} name={} args={} checkCV={} insideCode={}",
461 scope->
name(),n,args,checkCV,insideCode);
462 if (n.
empty())
return nullptr;
464 DString strippedTemplateParams;
467 std::unique_ptr<ArgumentList> actTemplParams;
468 if (!strippedTemplateParams.
empty())
475 if (qualifierIndex!=-1)
478 explicitScopePart=name.
left(qualifierIndex);
481 name=name.
mid(qualifierIndex+2);
483 AUTO_TRACE_ADD(
"qualifierIndex={} name={} explicitScopePart={} strippedTemplateParams={}",
484 qualifierIndex,name,explicitScopePart,strippedTemplateParams);
498 AUTO_TRACE_ADD(
"no symbols with name '{}' (including unspecialized)",name);
503 bool hasUsingStatements =
514 size_t nameLen = name.
length()+1;
515 size_t explicitPartLen = explicitScopePart.
length();
516 size_t strippedTemplateParamsLen = strippedTemplateParams.
length();
517 size_t fileScopeLen = hasUsingStatements ? 1+
m_fileScope->absFilePath().length() : 0;
518 size_t argsLen = args.
length()+1;
523 key.reserve(scopeNameLen+nameLen+explicitPartLen+strippedTemplateParamsLen+fileScopeLen+argsLen);
531 key+=explicitScopePart.
str();
532 key+=strippedTemplateParams.
str();
538 if (hasUsingStatements)
553 if (std::find(visitedKeys.begin(),visitedKeys.end(),key)!=std::end(visitedKeys))
560 visitedKeys.push_back(key);
565 if (pTemplSpec) *pTemplSpec=pval->
templSpec;
566 if (pTypeDef) *pTypeDef=pval->
typeDef;
568 AUTO_TRACE_EXIT(
"found cached name={} templSpec={} typeDef={} resolvedTypedef={}",
579 int minDistance=10000;
582 auto skipDefinition = [
this,&explicitScopePart](
const Definition *d) ->
bool {
590 explicitScopePart.
empty())
612 d->isLinkableInProject() ||
619 if (skipDefinition(d))
continue;
620 getResolvedSymbol(visitedKeys,scope,d,args,checkCV,insideCode,explicitScopePart,strippedTemplateParams,
false,
621 minDistance,bestMatch,bestTypedef,bestTemplSpec,bestResolvedType);
623 if (minDistance==0)
break;
628 if (bestMatch==
nullptr && args==
"()")
634 if (skipDefinition(d))
continue;
636 minDistance,bestMatch,bestTypedef,bestTemplSpec,bestResolvedType);
638 if (minDistance==0)
break;
644 *pTypeDef = bestTypedef;
648 *pTemplSpec = bestTemplSpec;
652 *pResolvedType = bestResolvedType;
655 cache.
insert(key,
LookupInfo(bestMatch,bestTypedef,bestTemplSpec,bestResolvedType));
656 visitedKeys.erase(std::remove(visitedKeys.begin(),visitedKeys.end(),key),visitedKeys.end());
658 AUTO_TRACE_EXIT(
"found name={} templSpec={} typeDef={} resolvedTypedef={}",
672 const DString &explicitScopePart,
694 accessStack,scope,d,explicitScopePart);
709 if (distance<minDistance)
711 AUTO_TRACE_ADD(
"found symbol={} at distance={} minDistance={}",cd->
name(),distance,minDistance);
712 minDistance=distance;
714 bestTypedef =
nullptr;
715 bestTemplSpec.
clear();
718 else if (distance==minDistance &&
733 AUTO_TRACE_ADD(
"found symbol={} at distance={} minDistance={}",cd->
name(),distance,minDistance);
734 minDistance=distance;
736 bestTypedef =
nullptr;
737 bestTemplSpec.
clear();
759 if (distance<minDistance)
763 minDistance=distance;
768 AUTO_TRACE_ADD(
"found symbol={} at distance={} minDistance={}",cd->
name(),distance,minDistance);
771 bestTemplSpec = spec;
772 bestResolvedType = type;
778 bestTypedef = enumType;
787 bestTemplSpec = spec;
788 bestResolvedType = type;
795 bestTemplSpec.
clear();
796 bestResolvedType.
clear();
811 if (distance<minDistance)
813 AUTO_TRACE_ADD(
"found enum={} at distance={} minDistance={}",md->
name(),distance,minDistance);
814 minDistance=distance;
829 bestMatch?bestMatch->
name():
DString(
"<none>"),bestResolvedType);
840 const DString &explicitScopePart,
841 const DString &strippedTemplateParams,
855 int distance =
isAccessibleFromWithExpScope(visitedKeys,visitedNamespaces,accessStack,scope,d,explicitScopePart+strippedTemplateParams);
856 if (distance==-1 && !strippedTemplateParams.
empty())
872 if (distance<minDistance)
874 AUTO_TRACE_ADD(
"found symbol={} at distance={} minDistance={}",d->
name(),distance,minDistance);
875 minDistance=distance;
877 bestTypedef =
nullptr;
878 bestTemplSpec.
clear();
881 else if (distance==minDistance &&
896 AUTO_TRACE_ADD(
"found symbol={} at distance={} minDistance={}",d->
name(),distance,minDistance);
897 minDistance=distance;
899 bestTypedef =
nullptr;
900 bestTemplSpec.
clear();
936 if (match && distance<minDistance)
938 AUTO_TRACE_ADD(
"found symbol={} at distance={} minDistance={}",md->
name(),distance,minDistance);
939 minDistance=distance;
950 if (distance<minDistance)
952 AUTO_TRACE_ADD(
"found symbol={} at distance={} minDistance={}",d->
name(),distance,minDistance);
953 minDistance=distance;
955 bestTypedef =
nullptr;
956 bestTemplSpec.
clear();
957 bestResolvedType.
clear();
966 bestMatch?bestMatch->
name():
DString(
"<none>"),bestResolvedType);
1007 actTemplParams && !actTemplParams->
empty())
1013 int tl=
static_cast<int>(type.
length());
1015 while (ip>=0 && (type.
at(ip)==
'*' || type.
at(ip)==
'&' || type.
at(ip)==
' '))
1019 type=type.
left(ip+1);
1025 tl=
static_cast<int>(type.
length());
1026 while (sp<tl && type.
at(sp)==
' ') sp++;
1029 &memTypeDef,
nullptr,pResolvedType);
1031 if (memTypeDef && memTypeDef->
isTypedef())
1037 else if (memTypeDef && memTypeDef->
isEnumerate() && pMemType)
1039 *pMemType = memTypeDef;
1042 if (result==
nullptr)
1045 size_t si = type.
rfind(
"::");
1046 size_t i = type.
find(
'<');
1049 if (pTemplSpec) *pTemplSpec = type.
mid(i);
1054 i=type.
find(
'<',si);
1061 if (pTemplSpec) *pTemplSpec = type.
mid(i);
1074 if (sp>0) pResolvedType->
prepend(typedefValue.
left(sp));
1075 if (ip<tl-1) pResolvedType->
append(typedefValue.
right(tl-ip-1));
1079 *pResolvedType = typedefValue;
1093 pTemplSpec ? *pTemplSpec :
DString(),
1094 pResolvedType ? *pResolvedType :
DString()
1103 pTemplSpec ? *pTemplSpec :
"<nullptr>",
1104 pResolvedType ? *pResolvedType :
"<nullptr>"
1115 const DString &explicitScopePart)
1118 AUTO_TRACE(
"scope={} item={} explictScopePart={}",
1120 if (explicitScopePart.
empty())
1142 bool nestedClassInsideBaseClass =
1148 bool enumValueWithinEnum =
1153 if (itemScope==newScope)
1157 else if (nestedClassInsideBaseClass)
1170 else if (enumValueWithinEnum)
1180 visitedNamespaces.emplace(newScope->
name().
str(),newScope);
1196 if (visitedNamespaces.find(nd->name().str())==visitedNamespaces.end())
1222 result = (i==-1) ? -1 : i+2;
1255 result= (i==-1) ? -1 : i+2;
1278 AUTO_TRACE_ADD(
"qualScopePart={} memTypeDef={}",qualScopePart,memTypeDef?memTypeDef->
name():
"");
1314 if (namespaceMember && namespaceMember->
isEnumerate())
1316 next = namespaceMember;
1353 (
toFileDef(current))->getUsedDefinitions(),qualScopePart);
1356 if (current==
nullptr)
break;
1372 for (
const auto &d : dl)
1374 if (d->localName()==localName)
1387 const DString &explicitScopePart,
1390 AUTO_TRACE(
"item={} explicitScopePart={} level={}",item?item->
name():
DString(), explicitScopePart, level);
1391 for (
const auto &und : nl)
1402 DString key=und->qualifiedName();
1403 if (!und->getUsedNamespaces().empty() && std::find(visitedNamespaces.begin(),visitedNamespaces.end(),key.
str())==std::end(visitedNamespaces))
1405 visitedNamespaces.push_back(key.
str());
1423 const DString &explicitScopePart)
1426 for (
const auto &ud : dl)
1445 AUTO_TRACE(
"scope={} item={} item.definitionType={}",
1466 if ((itemIsMember || itemIsClass) &&
1468 (itemScope && itemScope->
name().
startsWith(
"anonymous_namespace{"))
1476 else if (itemIsClass)
1483 bool memberAccessibleFromScope =
1489 bool nestedClassInsideBaseClass =
1495 bool enumValueOfStrongEnum =
1503 if (itemScope==scope || memberAccessibleFromScope || nestedClassInsideBaseClass || enumValueOfStrongEnum)
1505 AUTO_TRACE_ADD(
"memberAccessibleFromScope={} nestedClassInsideBaseClass={} enumValueOfStrongEnum={}",
1506 memberAccessibleFromScope, nestedClassInsideBaseClass, enumValueOfStrongEnum);
1507 int distanceToBase=0;
1508 if (nestedClassInsideBaseClass)
1514 else if (memberAccessibleFromScope &&
1521 result+=distanceToBase;
1600 result= (i==-1) ? -1 : i+2;
1615 if (name.
empty())
return result;
1622 int minDistance=10000;
1625 const int maxAddrSize = 20;
1626 char ptr_str[maxAddrSize];
1627 int num = snprintf(ptr_str,maxAddrSize,
"%p:",(
void *)scope);
1629 key.reserve(num+name.
length()+1);
1636 if (pTypeDef) *pTypeDef = it->second.second;
1637 return it->second.first;
1654 if (distance!=-1 && distance<minDistance)
1657 minDistance=distance;
1667 if (pTypeDef) *pTypeDef=bestMatch;
1673 g_substMap.emplace(key,std::make_pair(result,bestMatch));
1695 bool mayBeUnlinkable,
1698 AUTO_TRACE(
"scope={} name={} mayBeUnlinkable={} mayBeHidden={}",
1699 scope?scope->
name():
DString(), name, mayBeUnlinkable, mayBeHidden);
1703 p->fileScope() ?
p->fileScope()->getLanguage() :
1706 if (scope==
nullptr ||
1711 ((lang==SrcLangExt::Java || lang==SrcLangExt::CSharp) &&
DString(name).find(
"::")!=
DString::npos)
1726 result =
p->getResolvedTypeRec(
getTypeLookupCache(),visitedKeys,scope,lookupName,&
p->typeDef,&
p->templateSpec,&
p->resolvedType);
1727 if (result==
nullptr)
1734 if (!mayBeUnlinkable && result && !result->
isLinkable())
1736 if (!mayBeHidden || !result->
isHidden())
1753 AUTO_TRACE(
"scope={} name={} args={} checkCV={} insideCode={}",
1754 scope?scope->
name():
DString(), name, args, checkCV, insideCode);
1758 const Definition *result =
p->getResolvedSymbolRec(
getSymbolLookupCache(),visitedKeys,scope,name,args,checkCV,insideCode,onlyLinkable,&
p->typeDef,&
p->templateSpec,&
p->resolvedType);
1771 int result =
p->isAccessibleFrom(visitedKeys,accessStack,scope,item);
1777 const DString &explicitScopePart)
1779 AUTO_TRACE(
"scope={} item={} explicitScopePart={}",
1785 int result =
p->isAccessibleFromWithExpScope(visitedKeys,visitedNamespaces,accessStack,scope,item,explicitScopePart);
1792 p->setFileScope(fileScope);
1802 return p->templateSpec;
1807 return p->resolvedType;
1821 for (
const auto &ci : cache)
1826 elementsToRemove.push_back(ci.first);
1829 for (
const auto &k : elementsToRemove)
1838 for (
const auto &ci : cache)
1843 elementsToRemove.push_back(ci.first);
1846 for (
const auto &k : elementsToRemove)
1868 return std::max(0,std::min(r-16,9));
1880 msg(
"type lookup cache used {}/{} hits={} misses={}\n",
1885 msg(
"symbol lookup cache used {}/{} hits={} misses={}\n",
1892 int cacheParam = std::max(typeCacheParam,symbolCacheParam);
1895 msg(
"Note: based on cache misses the ideal setting for LOOKUP_CACHE_SIZE is {} at the cost of higher memory usage.\n",cacheParam);
Helper class representing the stack of items considered while resolving the scope.
void push(const Definition *scope, const FileDef *fileScope, const Definition *item, const DString &expScope)
bool find(const Definition *scope, const FileDef *fileScope, const Definition *item, const DString &expScope)
std::vector< AccessElem > m_elements
bool find(const Definition *scope, const FileDef *fileScope, const Definition *item)
void push(const Definition *scope, const FileDef *fileScope, const Definition *item)
This class represents an function or template argument list.
V * insert(const K &key, V &&value)
Inserts value under key in the cache.
size_t capacity() const
Returns the maximum number of values that can be stored in the cache.
size_t size() const
Returns the number of values stored in the cache.
uint64_t misses() const
Returns how many of the find() calls did not found a value in the cache.
uint64_t hits() const
Returns how many of the find() calls did find a value in the cache.
A abstract class representing of a compound symbol.
virtual const MemberDef * getMemberByName(const DString &) const =0
Returns the member with the given name.
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 bool isTemplateArgument() const =0
virtual FileDef * getFileDef() const =0
Returns the file in which this compound's definition can be found.
A String class for use with Doxygen wrapping std::string and adding some additional functionality off...
size_t rfind(char c, size_t pos=npos) const
DString mid(size_t index, size_t len=npos) const
bool empty() const
Returns true iff the string is empty (std::string compatible alias for isEmpty()).
char * rawData()
Returns a writable pointer to the data.
static constexpr size_t npos
value used to indicate 'not found' or 'to the end of the string', matching std::string::npos
char & at(size_t i)
Returns a reference to the character at index i.
DString right(size_t len) const
size_t size() const
Returns the length of the string, not counting the 0-terminator.
DString & prepend(const char *s)
size_t find(char c, size_t pos=0) const
DString stripWhiteSpace() const
returns a copy of this string with leading and trailing whitespace removed
DString left(size_t len) const
const std::string & str() const
bool stripPrefix(const DString &prefix)
const char * data() const
Returns a pointer to the contents of the string in the form of a 0-terminated C string.
bool startsWith(const char *s) const
size_t length() const
Returns the length of the string, not counting the 0-terminator.
The common base class of all entity definitions found in the sources.
virtual SrcLangExt getLanguage() const =0
Returns the programming language this definition was written in.
virtual DString getDefFileName() const =0
virtual bool isLinkable() const =0
virtual DefType definitionType() const =0
virtual const DString & name() const =0
virtual DString qualifiedName() const =0
virtual bool isHidden() const =0
virtual bool isArtificial() const =0
virtual Definition * getOuterScope() const =0
virtual bool isReference() const =0
virtual const Definition * findInnerCompound(const DString &name) const =0
static NamespaceDefMutable * globalScope
static SymbolMap< Definition > * symbolMap
A model of a file symbol.
virtual DString absFilePath() const =0
virtual const LinkedRefMap< NamespaceDef > & getUsedNamespaces() const =0
virtual const LinkedRefMap< const Definition > & getUsedDefinitions() const =0
Container class representing a vector of objects with keys.
A model of a class/file/namespace member symbol.
virtual DString argsString() const =0
virtual const ClassDef * getCachedTypedefVal() const =0
virtual const ClassDef * getClassDef() const =0
virtual DString getCachedResolvedTypedef() const =0
virtual bool isTypedef() const =0
virtual const FileDef * getFileDef() const =0
virtual const ArgumentList & argumentList() const =0
virtual bool isStrongEnumValue() const =0
virtual bool isStatic() const =0
virtual bool isTypedefValCached() const =0
virtual std::optional< ArgumentList > formalTemplateArguments() const =0
virtual DString getCachedTypedefTemplSpec() const =0
virtual bool isEnumerate() const =0
virtual bool isStrong() const =0
virtual DString typeString() const =0
virtual bool isCallable() const =0
virtual const MemberDef * getEnumScope() const =0
virtual bool isEnumValue() const =0
virtual void cacheTypedefVal(const ClassDef *val, const DString &templSpec, const DString &resolvedType)=0
An abstract interface of a namespace symbol.
virtual const MemberDef * getMemberByName(const DString &) const =0
virtual const LinkedRefMap< NamespaceDef > & getUsedNamespaces() const =0
virtual const LinkedRefMap< const Definition > & getUsedDefinitions() const =0
const VectorPtr & find(const DString &name)
static void showCacheUsage()
Show usage of the type lookup cache.
ClearScope
Clear the type lookup cache for the current thread.
int isAccessibleFrom(const Definition *scope, const Definition *item)
Checks if symbol item is accessible from within scope.
static void clearTypeLookupCache(ClearScope scope)
const ClassDef * resolveClass(const Definition *scope, const DString &name, bool maybeUnlinkable=false, bool mayBeHidden=false)
Find the class definition matching name within the scope set.
const Definition * resolveSymbol(const Definition *scope, const DString &name, const DString &args=DString(), bool checkCV=false, bool insideCode=false, bool onlyLinkable=false)
Find the symbool definition matching name within the scope set.
DString getResolvedType() const
In case a call to resolveClass() points to a typedef or using declaration.
std::unique_ptr< Private > p
int isAccessibleFromWithExpScope(const Definition *scope, const Definition *item, const DString &explicitScopePart)
Check if symbol item is accessible from within scope, where it has to match the explicitScopePart.
SymbolResolver(const FileDef *fileScope=nullptr)
DString getTemplateSpec() const
In case a call to resolveClass() points to a template specialization, the template part is return via...
void setFileScope(const FileDef *fd)
Sets or updates the file scope using when resolving symbols.
const MemberDef * getTypedef() const
In case a call to resolveClass() resolves to a type member (e.g. an enum) this method will return it.
ClassDef * getClass(const DString &n)
ClassDef * toClassDef(Definition *d)
#define Config_getInt(name)
#define Config_getBool(name)
std::vector< std::string > StringVector
std::unique_ptr< ArgumentList > stringToArgumentList(SrcLangExt lang, const DString &argsString, DString *extraTypeChars=nullptr)
#define AUTO_TRACE_ADD(...)
#define AUTO_TRACE_EXIT(...)
char * dstrcpy(char *dst, const char *src)
const char * qPrint(const char *s)
FileDef * toFileDef(Definition *d)
MemberDefMutable * toMemberDefMutable(Definition *d)
MemberDef * toMemberDef(Definition *d)
void replaceNamespaceAliases(DString &name)
NamespaceDef * toNamespaceDef(Definition *d)
const FileDef * fileScope
AccessElem(const Definition *d, const FileDef *f, const Definition *i)
AccessElem(const Definition *d, const FileDef *f, const Definition *i, const DString &e)
CacheStatistics & m_statistics
Cache< std::string, LookupInfo > m_cache
CacheStatsWrapper(CacheStatistics &stats, size_t capacity)
const Definition * definition
const MemberDef * typeDef
const MemberDef * typeDef
const FileDef * m_fileScope
const ClassDef * newResolveTypedef(LookupCache &cache, VisitedKeys &visitedKeys, const Definition *scope, const MemberDef *md, const MemberDef **pMemType, DString *pTemplSpec, DString *pResolvedType, const ArgumentList *actTemplParams=nullptr)
int isAccessibleFrom(VisitedKeys &visitedKeys, AccessStack &accessStack, const Definition *scope, const Definition *item)
Private(const FileDef *f)
const ClassDef * getResolvedTypeRec(LookupCache &cache, VisitedKeys &visitedKeys, const Definition *scope, const DString &n, const MemberDef **pTypeDef, DString *pTemplSpec, DString *pResolvedType)
bool accessibleViaUsingNamespace(VisitedKeys &visitedKeys, VisitedNamespaceKeys &visitedNamespaces, const LinkedRefMap< NamespaceDef > &nl, const Definition *item, const DString &explicitScopePart="", int level=0)
bool accessibleViaUsingDefinition(VisitedKeys &visitedKeys, const LinkedRefMap< const Definition > &dl, const Definition *item, const DString &explicitScopePart="")
const FileDef * fileScope() const
void setFileScope(const FileDef *fileScope)
const Definition * endOfPathIsUsedClass(const LinkedRefMap< const Definition > &dl, const DString &localName)
void getResolvedType(LookupCache &cache, VisitedKeys &visitedKeys, const Definition *scope, const Definition *d, const DString &explicitScopePart, const ArgumentList *actTemplParams, int &minDistance, const ClassDef *&bestMatch, const MemberDef *&bestTypedef, DString &bestTemplSpec, DString &bestResolvedType)
const Definition * followPath(VisitedKeys &visitedKeys, const Definition *start, const DString &path)
void getResolvedSymbol(VisitedKeys &visitedKeys, const Definition *scope, const Definition *d, const DString &args, bool checkCV, bool insideCode, const DString &explicitScopePart, const DString &strippedTemplateParams, bool forceCallable, int &minDistance, const Definition *&bestMatch, const MemberDef *&bestTypedef, DString &bestTemplSpec, DString &bestResolvedType)
int isAccessibleFromWithExpScope(VisitedKeys &visitedKeys, VisitedNamespaces &visitedNamespaces, AccessStack &accessStack, const Definition *scope, const Definition *item, const DString &explicitScopePart)
DString substTypedef(VisitedKeys &visitedKeys, const Definition *scope, const DString &name, const MemberDef **pTypeDef=nullptr)
std::unordered_map< std::string, const MemberDef * > m_resolvedTypedefs
const Definition * getResolvedSymbolRec(LookupCache &cache, VisitedKeys &visitedKeys, const Definition *scope, const DString &n, const DString &args, bool checkCV, bool insideCode, bool onlyLinkable, const MemberDef **pTypeDef, DString *pTemplSpec, DString *pResolvedType)
StringVector VisitedNamespaceKeys
static bool isCodeSymbol(Definition::DefType defType)
static std::recursive_mutex g_cacheTypedefMutex
static void mergeStatistics(CacheStatistics &stats, LookupCache &cache)
std::unordered_map< std::string, const Definition * > VisitedNamespaces
static LookupCache & getTypeLookupCache()
static int computeIdealCacheParam(size_t v)
static LookupCache & getSymbolLookupCache()
static size_t getCacheSize()
THREAD_LOCAL std::unordered_map< std::string, std::pair< DString, const MemberDef * > > g_substMap
static CacheStatistics g_symbolCacheStatistics
static CacheStatistics g_typeCacheStatistics
Cache< std::string, LookupInfo > LookupCache
DString substituteTemplateArgumentsInString(const DString &nm, const ArgumentList &formalArgs, const ArgumentList *actualArgs)
int computeQualifiedIndex(const DString &name)
Return the index of the last :: in the string name that is still before the first <.
bool matchArguments2(const Definition *srcScope, const FileDef *srcFileScope, const DString &srcReturnType, const ArgumentList *srcAl, const Definition *dstScope, const FileDef *dstFileScope, const DString &dstReturnType, const ArgumentList *dstAl, bool checkCV, SrcLangExt lang)
DString stripTemplateSpecifiersFromScope(const DString &fullName, bool parentOnly, DString *pLastScopeStripped, DString scopeName, bool allowArtificial)
DString argListToString(const ArgumentList &al, bool useCanonicalType, bool showDefVals)
DString mangleCSharpGenericName(const DString &name)
int getScopeFragment(const DString &s, int p, int *l)
A bunch of utility functions.