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();
145 m_elements.emplace_back(scope,fileScope,item);
149 m_elements.emplace_back(scope,fileScope,item,expScope);
158 [&](
const AccessElem &e) { return e.scope==scope && e.fileScope==fileScope && e.item==item; });
164 [&](
const AccessElem &e) { return e.scope==scope && e.fileScope==fileScope && e.item==item && e.expScope==expScope; });
238 const DString &explicitScopePart);
245 const DString &explicitScopePart,
260 const DString &explicitScopePart,
261 const DString &strippedTemplateParams,
290 const DString &explicitScopePart=
"",
295 const DString &explicitScopePart=
""
317 if (n.
empty())
return nullptr;
319 DString strippedTemplateParams;
322 std::unique_ptr<ArgumentList> actTemplParams;
323 if (!strippedTemplateParams.
empty())
330 if (qualifierIndex!=-1)
333 explicitScopePart=name.
left(qualifierIndex);
336 name=name.
mid(qualifierIndex+2);
352 bool hasUsingStatements =
362 size_t scopeNameLen = scope->
name().
length()+1;
363 size_t nameLen = name.
length()+1;
364 size_t explicitPartLen = explicitScopePart.
length();
382 if (hasUsingStatements)
394 if (std::find(visitedKeys.begin(),visitedKeys.end(),key.
str())!=std::end(visitedKeys))
402 visitedKeys.push_back(key.
str());
408 if (pTemplSpec) *pTemplSpec=pval->
templSpec;
409 if (pTypeDef) *pTypeDef=pval->
typeDef;
411 AUTO_TRACE_EXIT(
"found cached name={} templSpec={} typeDef={} resolvedTypedef={}",
423 int minDistance=10000;
429 getResolvedType(cache,visitedKeys,scope,d,explicitScopePart,actTemplParams.get(),
430 minDistance,bestMatch,bestTypedef,bestTemplSpec,bestResolvedType);
432 if (minDistance==0)
break;
437 *pTypeDef = bestTypedef;
441 *pTemplSpec = bestTemplSpec;
445 *pResolvedType = bestResolvedType;
449 visitedKeys.erase(std::remove(visitedKeys.begin(), visitedKeys.end(), key.
str()), visitedKeys.end());
451 AUTO_TRACE_EXIT(
"found name={} templSpec={} typeDef={} resolvedTypedef={}",
473 AUTO_TRACE(
"scope={} name={} args={} checkCV={} insideCode={}",
474 scope->
name(),n,args,checkCV,insideCode);
475 if (n.
empty())
return nullptr;
477 DString strippedTemplateParams;
480 std::unique_ptr<ArgumentList> actTemplParams;
481 if (!strippedTemplateParams.
empty())
488 if (qualifierIndex!=-1)
491 explicitScopePart=name.
left(qualifierIndex);
494 name=name.
mid(qualifierIndex+2);
496 AUTO_TRACE_ADD(
"qualifierIndex={} name={} explicitScopePart={} strippedTemplateParams={}",
497 qualifierIndex,name,explicitScopePart,strippedTemplateParams);
511 AUTO_TRACE_ADD(
"no symbols with name '{}' (including unspecialized)",name);
516 bool hasUsingStatements =
527 size_t nameLen = name.
length()+1;
528 size_t explicitPartLen = explicitScopePart.
length();
529 size_t strippedTemplateParamsLen = strippedTemplateParams.
length();
530 bool resultDependsOnFileScope = hasUsingStatements ||
532 size_t fileScopeLen = resultDependsOnFileScope ? 1+
m_fileScope->absFilePath().length() : 0;
533 size_t argsLen = args.
length()+1;
538 key.reserve(scopeNameLen+nameLen+explicitPartLen+strippedTemplateParamsLen+fileScopeLen+argsLen);
546 key+=explicitScopePart.
str();
547 key+=strippedTemplateParams.
str();
554 if (resultDependsOnFileScope)
569 if (std::find(visitedKeys.begin(),visitedKeys.end(),key)!=std::end(visitedKeys))
576 visitedKeys.push_back(key);
581 if (pTemplSpec) *pTemplSpec=pval->
templSpec;
582 if (pTypeDef) *pTypeDef=pval->
typeDef;
584 AUTO_TRACE_EXIT(
"found cached name={} templSpec={} typeDef={} resolvedTypedef={}",
595 int minDistance=10000;
598 auto skipDefinition = [
this,&explicitScopePart](
const Definition *d) ->
bool {
606 explicitScopePart.
empty())
627 d->isLinkableInProject() ||
634 if (skipDefinition(d))
continue;
635 getResolvedSymbol(visitedKeys,scope,d,args,checkCV,insideCode,explicitScopePart,strippedTemplateParams,
false,
636 minDistance,bestMatch,bestTypedef,bestTemplSpec,bestResolvedType);
638 if (minDistance==0)
break;
643 if (bestMatch==
nullptr && args==
"()")
649 if (skipDefinition(d))
continue;
651 minDistance,bestMatch,bestTypedef,bestTemplSpec,bestResolvedType);
653 if (minDistance==0)
break;
659 *pTypeDef = bestTypedef;
663 *pTemplSpec = bestTemplSpec;
667 *pResolvedType = bestResolvedType;
670 cache.
insert(key,
LookupInfo(bestMatch,bestTypedef,bestTemplSpec,bestResolvedType));
671 visitedKeys.erase(std::remove(visitedKeys.begin(),visitedKeys.end(),key),visitedKeys.end());
673 AUTO_TRACE_EXIT(
"found name={} templSpec={} typeDef={} resolvedTypedef={}",
687 const DString &explicitScopePart,
709 accessStack,scope,d,explicitScopePart);
724 if (distance<minDistance)
726 AUTO_TRACE_ADD(
"found symbol={} at distance={} minDistance={}",cd->
name(),distance,minDistance);
727 minDistance=distance;
729 bestTypedef =
nullptr;
730 bestTemplSpec.
clear();
733 else if (distance==minDistance &&
748 AUTO_TRACE_ADD(
"found symbol={} at distance={} minDistance={}",cd->
name(),distance,minDistance);
749 minDistance=distance;
751 bestTypedef =
nullptr;
752 bestTemplSpec.
clear();
774 if (distance<minDistance)
778 minDistance=distance;
783 AUTO_TRACE_ADD(
"found symbol={} at distance={} minDistance={}",cd->
name(),distance,minDistance);
786 bestTemplSpec = spec;
787 bestResolvedType = type;
793 bestTypedef = enumType;
802 bestTemplSpec = spec;
803 bestResolvedType = type;
810 bestTemplSpec.
clear();
811 bestResolvedType.
clear();
826 if (distance<minDistance)
828 AUTO_TRACE_ADD(
"found enum={} at distance={} minDistance={}",md->
name(),distance,minDistance);
829 minDistance=distance;
844 bestMatch?bestMatch->
name():
DString(
"<none>"),bestResolvedType);
855 const DString &explicitScopePart,
856 const DString &strippedTemplateParams,
870 int distance =
isAccessibleFromWithExpScope(visitedKeys,visitedNamespaces,accessStack,scope,d,explicitScopePart+strippedTemplateParams);
871 if (distance==-1 && !strippedTemplateParams.
empty())
887 if (distance<minDistance)
889 AUTO_TRACE_ADD(
"found symbol={} at distance={} minDistance={}",d->
name(),distance,minDistance);
890 minDistance=distance;
892 bestTypedef =
nullptr;
893 bestTemplSpec.
clear();
896 else if (distance==minDistance &&
911 AUTO_TRACE_ADD(
"found symbol={} at distance={} minDistance={}",d->
name(),distance,minDistance);
912 minDistance=distance;
914 bestTypedef =
nullptr;
915 bestTemplSpec.
clear();
951 if (match && distance<minDistance)
953 AUTO_TRACE_ADD(
"found symbol={} at distance={} minDistance={}",md->
name(),distance,minDistance);
954 minDistance=distance;
965 if (distance<minDistance)
967 AUTO_TRACE_ADD(
"found symbol={} at distance={} minDistance={}",d->
name(),distance,minDistance);
968 minDistance=distance;
970 bestTypedef =
nullptr;
971 bestTemplSpec.
clear();
972 bestResolvedType.
clear();
981 bestMatch?bestMatch->
name():
DString(
"<none>"),bestResolvedType);
1022 actTemplParams && !actTemplParams->
empty())
1028 int tl=
static_cast<int>(type.
length());
1030 while (ip>=0 && (type.
at(ip)==
'*' || type.
at(ip)==
'&' || type.
at(ip)==
' '))
1034 type=type.
left(ip+1);
1040 tl=
static_cast<int>(type.
length());
1041 while (sp<tl && type.
at(sp)==
' ') sp++;
1044 &memTypeDef,
nullptr,pResolvedType);
1046 if (memTypeDef && memTypeDef->
isTypedef())
1052 else if (memTypeDef && memTypeDef->
isEnumerate() && pMemType)
1054 *pMemType = memTypeDef;
1057 if (result==
nullptr)
1060 size_t si = type.
rfind(
"::");
1061 size_t i = type.
find(
'<');
1064 if (pTemplSpec) *pTemplSpec = type.
mid(i);
1069 i=type.
find(
'<',si);
1076 if (pTemplSpec) *pTemplSpec = type.
mid(i);
1089 if (sp>0) pResolvedType->
prepend(typedefValue.
left(sp));
1090 if (ip<tl-1) pResolvedType->
append(typedefValue.
right(tl-ip-1));
1094 *pResolvedType = typedefValue;
1108 pTemplSpec ? *pTemplSpec :
DString(),
1109 pResolvedType ? *pResolvedType :
DString()
1118 pTemplSpec ? *pTemplSpec :
"<nullptr>",
1119 pResolvedType ? *pResolvedType :
"<nullptr>"
1130 const DString &explicitScopePart)
1133 AUTO_TRACE(
"scope={} item={} explictScopePart={}",
1135 if (explicitScopePart.
empty())
1157 bool nestedClassInsideBaseClass =
1163 bool enumValueWithinEnum =
1168 if (itemScope==newScope)
1172 else if (nestedClassInsideBaseClass)
1185 else if (enumValueWithinEnum)
1195 visitedNamespaces.emplace(newScope->
name().
str(),newScope);
1211 if (visitedNamespaces.find(nd->name().str())==visitedNamespaces.end())
1237 result = (i==-1) ? -1 : i+2;
1270 result= (i==-1) ? -1 : i+2;
1293 AUTO_TRACE_ADD(
"qualScopePart={} memTypeDef={}",qualScopePart,memTypeDef?memTypeDef->
name():
"");
1329 if (namespaceMember && namespaceMember->
isEnumerate())
1331 next = namespaceMember;
1368 (
toFileDef(current))->getUsedDefinitions(),qualScopePart);
1371 if (current==
nullptr)
break;
1387 for (
const auto &d : dl)
1389 if (d->localName()==localName)
1402 const DString &explicitScopePart,
1405 AUTO_TRACE(
"item={} explicitScopePart={} level={}",item?item->
name():
DString(), explicitScopePart, level);
1406 for (
const auto &und : nl)
1417 DString key=und->qualifiedName();
1418 if (!und->getUsedNamespaces().empty() && std::find(visitedNamespaces.begin(),visitedNamespaces.end(),key.
str())==std::end(visitedNamespaces))
1420 visitedNamespaces.push_back(key.
str());
1438 const DString &explicitScopePart)
1441 for (
const auto &ud : dl)
1460 AUTO_TRACE(
"scope={} item={} item.definitionType={}",
1481 if ((itemIsMember || itemIsClass) &&
1483 (itemScope && itemScope->
name().
startsWith(
"anonymous_namespace{"))
1491 else if (itemIsClass)
1498 bool memberAccessibleFromScope =
1504 bool nestedClassInsideBaseClass =
1510 bool enumValueOfStrongEnum =
1518 if (itemScope==scope || memberAccessibleFromScope || nestedClassInsideBaseClass || enumValueOfStrongEnum)
1520 AUTO_TRACE_ADD(
"memberAccessibleFromScope={} nestedClassInsideBaseClass={} enumValueOfStrongEnum={}",
1521 memberAccessibleFromScope, nestedClassInsideBaseClass, enumValueOfStrongEnum);
1522 int distanceToBase=0;
1523 if (nestedClassInsideBaseClass)
1529 else if (memberAccessibleFromScope &&
1536 result+=distanceToBase;
1615 result= (i==-1) ? -1 : i+2;
1630 if (name.
empty())
return result;
1637 int minDistance=10000;
1640 const int maxAddrSize = 20;
1641 char ptr_str[maxAddrSize];
1642 int num = snprintf(ptr_str,maxAddrSize,
"%p:",(
void *)scope);
1644 key.reserve(num+name.
length()+1);
1651 if (pTypeDef) *pTypeDef = it->second.second;
1652 return it->second.first;
1669 if (distance!=-1 && distance<minDistance)
1672 minDistance=distance;
1682 if (pTypeDef) *pTypeDef=bestMatch;
1688 g_substMap.emplace(key,std::make_pair(result,bestMatch));
1710 bool mayBeUnlinkable,
1713 AUTO_TRACE(
"scope={} name={} mayBeUnlinkable={} mayBeHidden={}",
1714 scope?scope->
name():
DString(), name, mayBeUnlinkable, mayBeHidden);
1718 p->fileScope() ?
p->fileScope()->getLanguage() :
1721 if (scope==
nullptr ||
1726 ((lang==SrcLangExt::Java || lang==SrcLangExt::CSharp) &&
DString(name).find(
"::")!=
DString::npos)
1741 result =
p->getResolvedTypeRec(
getTypeLookupCache(),visitedKeys,scope,lookupName,&
p->typeDef,&
p->templateSpec,&
p->resolvedType);
1742 if (result==
nullptr)
1749 if (!mayBeUnlinkable && result && !result->
isLinkable())
1751 if (!mayBeHidden || !result->
isHidden())
1768 AUTO_TRACE(
"scope={} name={} args={} checkCV={} insideCode={}",
1769 scope?scope->
name():
DString(), name, args, checkCV, insideCode);
1773 const Definition *result =
p->getResolvedSymbolRec(
getSymbolLookupCache(),visitedKeys,scope,name,args,checkCV,insideCode,onlyLinkable,&
p->typeDef,&
p->templateSpec,&
p->resolvedType);
1786 int result =
p->isAccessibleFrom(visitedKeys,accessStack,scope,item);
1792 const DString &explicitScopePart)
1794 AUTO_TRACE(
"scope={} item={} explicitScopePart={}",
1800 int result =
p->isAccessibleFromWithExpScope(visitedKeys,visitedNamespaces,accessStack,scope,item,explicitScopePart);
1807 p->setFileScope(fileScope);
1817 return p->templateSpec;
1822 return p->resolvedType;
1836 for (
const auto &ci : cache)
1841 elementsToRemove.push_back(ci.first);
1844 for (
const auto &k : elementsToRemove)
1853 for (
const auto &ci : cache)
1858 elementsToRemove.push_back(ci.first);
1861 for (
const auto &k : elementsToRemove)
1883 return std::max(0,std::min(r-16,9));
1895 msg(
"type lookup cache used {}/{} hits={} misses={}\n",
1900 msg(
"symbol lookup cache used {}/{} hits={} misses={}\n",
1907 int cacheParam = std::max(typeCacheParam,symbolCacheParam);
1910 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 bool isFileLocalStatic(const Definition *d)
Returns true for a static function or variable that is not a class member, so it is only visible with...
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.