23#include <unordered_map>
36#if !ENABLE_SYMBOLRESOLVER_TRACING
40#define AUTO_TRACE(...) (void)0
41#define AUTO_TRACE_ADD(...) (void)0
42#define AUTO_TRACE_EXIT(...) (void)0
63 std::lock_guard lock(stats.
mutex);
88 if (cacheSize<0) cacheSize=0;
89 if (cacheSize>9) cacheSize=9;
90 return 65536u << cacheSize;
96 return wrapper.cache();
102 return wrapper.cache();
136 m_elements.emplace_back(scope,fileScope,item);
140 m_elements.emplace_back(scope,fileScope,item,expScope);
149 [&](
const AccessElem &e) { return e.scope==scope && e.fileScope==fileScope && e.item==item; });
155 [&](
const AccessElem &e) { return e.scope==scope && e.fileScope==fileScope && e.item==item && e.expScope==expScope; });
229 const DString &explicitScopePart);
236 const DString &explicitScopePart,
251 const DString &explicitScopePart,
252 const DString &strippedTemplateParams,
281 const DString &explicitScopePart=
"",
286 const DString &explicitScopePart=
""
308 if (n.
empty())
return nullptr;
310 DString strippedTemplateParams;
313 std::unique_ptr<ArgumentList> actTemplParams;
314 if (!strippedTemplateParams.
empty())
321 if (qualifierIndex!=-1)
324 explicitScopePart=name.
left(qualifierIndex);
327 name=name.
mid(qualifierIndex+2);
343 bool hasUsingStatements =
353 size_t scopeNameLen = scope->
name().
length()+1;
354 size_t nameLen = name.
length()+1;
355 size_t explicitPartLen = explicitScopePart.
length();
373 if (hasUsingStatements)
385 if (std::find(visitedKeys.begin(),visitedKeys.end(),key.
str())!=std::end(visitedKeys))
393 visitedKeys.push_back(key.
str());
399 if (pTemplSpec) *pTemplSpec=pval->
templSpec;
400 if (pTypeDef) *pTypeDef=pval->
typeDef;
402 AUTO_TRACE_EXIT(
"found cached name={} templSpec={} typeDef={} resolvedTypedef={}",
414 int minDistance=10000;
420 getResolvedType(cache,visitedKeys,scope,d,explicitScopePart,actTemplParams.get(),
421 minDistance,bestMatch,bestTypedef,bestTemplSpec,bestResolvedType);
423 if (minDistance==0)
break;
428 *pTypeDef = bestTypedef;
432 *pTemplSpec = bestTemplSpec;
436 *pResolvedType = bestResolvedType;
440 visitedKeys.erase(std::remove(visitedKeys.begin(), visitedKeys.end(), key.
str()), visitedKeys.end());
442 AUTO_TRACE_EXIT(
"found name={} templSpec={} typeDef={} resolvedTypedef={}",
464 AUTO_TRACE(
"scope={} name={} args={} checkCV={} insideCode={}",
465 scope->
name(),n,args,checkCV,insideCode);
466 if (n.
empty())
return nullptr;
468 DString strippedTemplateParams;
471 std::unique_ptr<ArgumentList> actTemplParams;
472 if (!strippedTemplateParams.
empty())
479 if (qualifierIndex!=-1)
482 explicitScopePart=name.
left(qualifierIndex);
485 name=name.
mid(qualifierIndex+2);
487 AUTO_TRACE_ADD(
"qualifierIndex={} name={} explicitScopePart={} strippedTemplateParams={}",
488 qualifierIndex,name,explicitScopePart,strippedTemplateParams);
502 AUTO_TRACE_ADD(
"no symbols with name '{}' (including unspecialized)",name);
507 bool hasUsingStatements =
518 size_t nameLen = name.
length()+1;
519 size_t explicitPartLen = explicitScopePart.
length();
520 size_t strippedTemplateParamsLen = strippedTemplateParams.
length();
521 size_t fileScopeLen = hasUsingStatements ? 1+
m_fileScope->absFilePath().length() : 0;
522 size_t argsLen = args.
length()+1;
527 key.reserve(scopeNameLen+nameLen+explicitPartLen+strippedTemplateParamsLen+fileScopeLen+argsLen);
535 key+=explicitScopePart.
str();
536 key+=strippedTemplateParams.
str();
542 if (hasUsingStatements)
557 if (std::find(visitedKeys.begin(),visitedKeys.end(),key)!=std::end(visitedKeys))
564 visitedKeys.push_back(key);
569 if (pTemplSpec) *pTemplSpec=pval->
templSpec;
570 if (pTypeDef) *pTypeDef=pval->
typeDef;
572 AUTO_TRACE_EXIT(
"found cached name={} templSpec={} typeDef={} resolvedTypedef={}",
583 int minDistance=10000;
586 auto skipDefinition = [
this,&explicitScopePart](
const Definition *d) ->
bool {
594 explicitScopePart.
empty())
616 d->isLinkableInProject() ||
623 if (skipDefinition(d))
continue;
624 getResolvedSymbol(visitedKeys,scope,d,args,checkCV,insideCode,explicitScopePart,strippedTemplateParams,
false,
625 minDistance,bestMatch,bestTypedef,bestTemplSpec,bestResolvedType);
627 if (minDistance==0)
break;
632 if (bestMatch==
nullptr && args==
"()")
638 if (skipDefinition(d))
continue;
640 minDistance,bestMatch,bestTypedef,bestTemplSpec,bestResolvedType);
642 if (minDistance==0)
break;
648 *pTypeDef = bestTypedef;
652 *pTemplSpec = bestTemplSpec;
656 *pResolvedType = bestResolvedType;
659 cache.
insert(key,
LookupInfo(bestMatch,bestTypedef,bestTemplSpec,bestResolvedType));
660 visitedKeys.erase(std::remove(visitedKeys.begin(),visitedKeys.end(),key),visitedKeys.end());
662 AUTO_TRACE_EXIT(
"found name={} templSpec={} typeDef={} resolvedTypedef={}",
676 const DString &explicitScopePart,
698 accessStack,scope,d,explicitScopePart);
713 if (distance<minDistance)
715 AUTO_TRACE_ADD(
"found symbol={} at distance={} minDistance={}",cd->
name(),distance,minDistance);
716 minDistance=distance;
718 bestTypedef =
nullptr;
719 bestTemplSpec.
clear();
722 else if (distance==minDistance &&
737 AUTO_TRACE_ADD(
"found symbol={} at distance={} minDistance={}",cd->
name(),distance,minDistance);
738 minDistance=distance;
740 bestTypedef =
nullptr;
741 bestTemplSpec.
clear();
763 if (distance<minDistance)
767 minDistance=distance;
772 AUTO_TRACE_ADD(
"found symbol={} at distance={} minDistance={}",cd->
name(),distance,minDistance);
775 bestTemplSpec = spec;
776 bestResolvedType = type;
782 bestTypedef = enumType;
791 bestTemplSpec = spec;
792 bestResolvedType = type;
799 bestTemplSpec.
clear();
800 bestResolvedType.
clear();
815 if (distance<minDistance)
817 AUTO_TRACE_ADD(
"found enum={} at distance={} minDistance={}",md->
name(),distance,minDistance);
818 minDistance=distance;
833 bestMatch?bestMatch->
name():
DString(
"<none>"),bestResolvedType);
844 const DString &explicitScopePart,
845 const DString &strippedTemplateParams,
859 int distance =
isAccessibleFromWithExpScope(visitedKeys,visitedNamespaces,accessStack,scope,d,explicitScopePart+strippedTemplateParams);
860 if (distance==-1 && !strippedTemplateParams.
empty())
876 if (distance<minDistance)
878 AUTO_TRACE_ADD(
"found symbol={} at distance={} minDistance={}",d->
name(),distance,minDistance);
879 minDistance=distance;
881 bestTypedef =
nullptr;
882 bestTemplSpec.
clear();
885 else if (distance==minDistance &&
900 AUTO_TRACE_ADD(
"found symbol={} at distance={} minDistance={}",d->
name(),distance,minDistance);
901 minDistance=distance;
903 bestTypedef =
nullptr;
904 bestTemplSpec.
clear();
940 if (match && distance<minDistance)
942 AUTO_TRACE_ADD(
"found symbol={} at distance={} minDistance={}",md->
name(),distance,minDistance);
943 minDistance=distance;
954 if (distance<minDistance)
956 AUTO_TRACE_ADD(
"found symbol={} at distance={} minDistance={}",d->
name(),distance,minDistance);
957 minDistance=distance;
959 bestTypedef =
nullptr;
960 bestTemplSpec.
clear();
961 bestResolvedType.
clear();
970 bestMatch?bestMatch->
name():
DString(
"<none>"),bestResolvedType);
1011 actTemplParams && !actTemplParams->
empty())
1017 int tl=
static_cast<int>(type.
length());
1019 while (ip>=0 && (type.
at(ip)==
'*' || type.
at(ip)==
'&' || type.
at(ip)==
' '))
1023 type=type.
left(ip+1);
1029 tl=
static_cast<int>(type.
length());
1030 while (sp<tl && type.
at(sp)==
' ') sp++;
1033 &memTypeDef,
nullptr,pResolvedType);
1035 if (memTypeDef && memTypeDef->
isTypedef())
1041 else if (memTypeDef && memTypeDef->
isEnumerate() && pMemType)
1043 *pMemType = memTypeDef;
1046 if (result==
nullptr)
1049 size_t si = type.
rfind(
"::");
1050 size_t i = type.
find(
'<');
1053 if (pTemplSpec) *pTemplSpec = type.
mid(i);
1058 i=type.
find(
'<',si);
1065 if (pTemplSpec) *pTemplSpec = type.
mid(i);
1078 if (sp>0) pResolvedType->
prepend(typedefValue.
left(sp));
1079 if (ip<tl-1) pResolvedType->
append(typedefValue.
right(tl-ip-1));
1083 *pResolvedType = typedefValue;
1097 pTemplSpec ? *pTemplSpec :
DString(),
1098 pResolvedType ? *pResolvedType :
DString()
1107 pTemplSpec ? *pTemplSpec :
"<nullptr>",
1108 pResolvedType ? *pResolvedType :
"<nullptr>"
1119 const DString &explicitScopePart)
1122 AUTO_TRACE(
"scope={} item={} explictScopePart={}",
1124 if (explicitScopePart.
empty())
1146 bool nestedClassInsideBaseClass =
1152 bool enumValueWithinEnum =
1157 if (itemScope==newScope)
1161 else if (nestedClassInsideBaseClass)
1174 else if (enumValueWithinEnum)
1184 visitedNamespaces.emplace(newScope->
name().
str(),newScope);
1200 if (visitedNamespaces.find(nd->name().str())==visitedNamespaces.end())
1226 result = (i==-1) ? -1 : i+2;
1259 result= (i==-1) ? -1 : i+2;
1282 AUTO_TRACE_ADD(
"qualScopePart={} memTypeDef={}",qualScopePart,memTypeDef?memTypeDef->
name():
"");
1318 if (namespaceMember && namespaceMember->
isEnumerate())
1320 next = namespaceMember;
1357 (
toFileDef(current))->getUsedDefinitions(),qualScopePart);
1360 if (current==
nullptr)
break;
1376 for (
const auto &d : dl)
1378 if (d->localName()==localName)
1391 const DString &explicitScopePart,
1394 AUTO_TRACE(
"item={} explicitScopePart={} level={}",item?item->
name():
DString(), explicitScopePart, level);
1395 for (
const auto &und : nl)
1406 DString key=und->qualifiedName();
1407 if (!und->getUsedNamespaces().empty() && std::find(visitedNamespaces.begin(),visitedNamespaces.end(),key.
str())==std::end(visitedNamespaces))
1409 visitedNamespaces.push_back(key.
str());
1427 const DString &explicitScopePart)
1430 for (
const auto &ud : dl)
1449 AUTO_TRACE(
"scope={} item={} item.definitionType={}",
1470 if ((itemIsMember || itemIsClass) &&
1472 (itemScope && itemScope->
name().
startsWith(
"anonymous_namespace{"))
1480 else if (itemIsClass)
1487 bool memberAccessibleFromScope =
1493 bool nestedClassInsideBaseClass =
1499 bool enumValueOfStrongEnum =
1507 if (itemScope==scope || memberAccessibleFromScope || nestedClassInsideBaseClass || enumValueOfStrongEnum)
1509 AUTO_TRACE_ADD(
"memberAccessibleFromScope={} nestedClassInsideBaseClass={} enumValueOfStrongEnum={}",
1510 memberAccessibleFromScope, nestedClassInsideBaseClass, enumValueOfStrongEnum);
1511 int distanceToBase=0;
1512 if (nestedClassInsideBaseClass)
1518 else if (memberAccessibleFromScope &&
1525 result+=distanceToBase;
1604 result= (i==-1) ? -1 : i+2;
1619 if (name.
empty())
return result;
1626 int minDistance=10000;
1629 const int maxAddrSize = 20;
1630 char ptr_str[maxAddrSize];
1631 int num = snprintf(ptr_str,maxAddrSize,
"%p:",(
void *)scope);
1633 key.reserve(num+name.
length()+1);
1640 if (pTypeDef) *pTypeDef = it->second.second;
1641 return it->second.first;
1658 if (distance!=-1 && distance<minDistance)
1661 minDistance=distance;
1671 if (pTypeDef) *pTypeDef=bestMatch;
1677 g_substMap.emplace(key,std::make_pair(result,bestMatch));
1699 bool mayBeUnlinkable,
1702 AUTO_TRACE(
"scope={} name={} mayBeUnlinkable={} mayBeHidden={}",
1703 scope?scope->
name():
DString(), name, mayBeUnlinkable, mayBeHidden);
1707 p->fileScope() ?
p->fileScope()->getLanguage() :
1710 if (scope==
nullptr ||
1715 ((lang==SrcLangExt::Java || lang==SrcLangExt::CSharp) &&
DString(name).find(
"::")!=
DString::npos)
1730 result =
p->getResolvedTypeRec(
getTypeLookupCache(),visitedKeys,scope,lookupName,&
p->typeDef,&
p->templateSpec,&
p->resolvedType);
1731 if (result==
nullptr)
1738 if (!mayBeUnlinkable && result && !result->
isLinkable())
1740 if (!mayBeHidden || !result->
isHidden())
1757 AUTO_TRACE(
"scope={} name={} args={} checkCV={} insideCode={}",
1758 scope?scope->
name():
DString(), name, args, checkCV, insideCode);
1762 const Definition *result =
p->getResolvedSymbolRec(
getSymbolLookupCache(),visitedKeys,scope,name,args,checkCV,insideCode,onlyLinkable,&
p->typeDef,&
p->templateSpec,&
p->resolvedType);
1775 int result =
p->isAccessibleFrom(visitedKeys,accessStack,scope,item);
1781 const DString &explicitScopePart)
1783 AUTO_TRACE(
"scope={} item={} explicitScopePart={}",
1789 int result =
p->isAccessibleFromWithExpScope(visitedKeys,visitedNamespaces,accessStack,scope,item,explicitScopePart);
1796 p->setFileScope(fileScope);
1806 return p->templateSpec;
1811 return p->resolvedType;
1825 for (
const auto &ci : cache)
1830 elementsToRemove.push_back(ci.first);
1833 for (
const auto &k : elementsToRemove)
1842 for (
const auto &ci : cache)
1847 elementsToRemove.push_back(ci.first);
1850 for (
const auto &k : elementsToRemove)
1872 return std::max(0,std::min(r-16,9));
1884 msg(
"type lookup cache used {}/{} hits={} misses={}\n",
1889 msg(
"symbol lookup cache used {}/{} hits={} misses={}\n",
1896 int cacheParam = std::max(typeCacheParam,symbolCacheParam);
1899 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.