Some work on `find references of a symbol'.

This commit is contained in:
Roberto Raggi
2009-09-25 14:19:43 +02:00
parent 20ff553b59
commit b3cf5ae50a
4 changed files with 90 additions and 73 deletions

View File

@@ -467,7 +467,7 @@ void LookupContext::expandFunction(Function *function,
}
void LookupContext::expandObjCMethod(ObjCMethod *method,
const QList<Scope *> &visibleScopes,
const QList<Scope *> &,
QList<Scope *> *expandedScopes) const
{
if (! expandedScopes->contains(method->arguments()))
@@ -519,7 +519,7 @@ Symbol *LookupContext::canonicalSymbol(const QList<Symbol *> &candidates)
Symbol *c = candidates.at(i);
if (! c->scope()->isClassScope())
continue; // ### or break?
continue;
else if (Function *f = c->type()->asFunctionType()) {
if (f->isVirtual())
@@ -533,3 +533,13 @@ Symbol *LookupContext::canonicalSymbol(const QList<Symbol *> &candidates)
return canonicalSymbol(candidate);
}
Symbol *LookupContext::canonicalSymbol(const QList<QPair<FullySpecifiedType, Symbol *> > &results)
{
QList<Symbol *> candidates;
QPair<FullySpecifiedType, Symbol *> result;
foreach (result, results) {
candidates.append(result.second); // ### not exacly.
}
return canonicalSymbol(candidates);
}