Bug 1621789 - Handle DependentScopeDeclRefExpr in MozsearchIndexer. r=andi

Differential Revision: https://phabricator.services.mozilla.com/D179326
This commit is contained in:
Botond Ballo 2023-05-29 16:16:47 +00:00
parent a3c41c4d0c
commit 11e68ffe93

View File

@ -2028,7 +2028,7 @@ public:
}
}
// Alsoo record this location so that if we have instantiations, we can
// Also record this location so that if we have instantiations, we can
// gather more accurate results from them.
if (TemplateStack) {
TemplateStack->visitDependent(Loc);
@ -2036,6 +2036,23 @@ public:
return true;
}
bool VisitDependentScopeDeclRefExpr(DependentScopeDeclRefExpr *E) {
SourceLocation Loc = E->getLocation();
normalizeLocation(&Loc);
if (!isInterestingLocation(Loc)) {
return true;
}
for (const NamedDecl *D : Resolver->resolveDeclRefExpr(E)) {
if (const EnumConstantDecl *E = dyn_cast<EnumConstantDecl>(D)) {
std::string Mangled = getMangledName(CurMangleContext, E);
visitIdentifier("use", "enum", getQualifiedName(E), Loc, Mangled,
E->getType(), getContext(Loc));
}
}
return true;
}
void enterSourceFile(SourceLocation Loc) {
normalizeLocation(&Loc);
FileInfo* newFile = getFileInfo(Loc);