forked from qt-creator/qt-creator
C++: Get rid of {Name,Type}::isEqualTo()
...since it's superseded by the class Matcher. For consistency, rename FullySpecifiedType::isEqualTo() to match(). Change-Id: I07640f9218d814e0350265de45f05929e5d595a9 Reviewed-by: Erik Verbruggen <erik.verbruggen@digia.com>
This commit is contained in:
@@ -744,7 +744,7 @@ bool CheckSymbols::hasVirtualDestructor(Class *klass) const
|
||||
continue;
|
||||
if (s->name()->isDestructorNameId()) {
|
||||
if (Function *funTy = s->type()->asFunctionType()) {
|
||||
if (funTy->isVirtual() && id->isEqualTo(s->identifier()))
|
||||
if (funTy->isVirtual() && id->match(s->identifier()))
|
||||
return true;
|
||||
}
|
||||
}
|
||||
@@ -1419,7 +1419,7 @@ bool CheckSymbols::isConstructorDeclaration(Symbol *declaration)
|
||||
{
|
||||
Class *clazz = declaration->enclosingClass();
|
||||
if (clazz && clazz->name())
|
||||
return declaration->name()->isEqualTo(clazz->name());
|
||||
return declaration->name()->match(clazz->name());
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -593,7 +593,7 @@ bool isQPrivateSignal(const Symbol *symbol)
|
||||
if (FullySpecifiedType type = symbol->type()) {
|
||||
if (NamedType *namedType = type->asNamedType()) {
|
||||
if (const Name *name = namedType->name()) {
|
||||
if (name->isEqualTo(&qPrivateSignalIdentifier))
|
||||
if (name->match(&qPrivateSignalIdentifier))
|
||||
return true;
|
||||
}
|
||||
}
|
||||
@@ -1785,7 +1785,7 @@ bool CppCompletionAssistProcessor::completeConstructorOrFunction(const QList<CPl
|
||||
continue; // skip
|
||||
|
||||
if (Function *funTy = member->type()->asFunctionType()) {
|
||||
if (memberName->isEqualTo(className)) {
|
||||
if (memberName->match(className)) {
|
||||
// it's a ctor.
|
||||
functions.append(funTy);
|
||||
}
|
||||
@@ -1813,7 +1813,7 @@ bool CppCompletionAssistProcessor::completeConstructorOrFunction(const QList<CPl
|
||||
bool newOverload = true;
|
||||
|
||||
foreach (Function *f, functions) {
|
||||
if (fun->isEqualTo(f)) {
|
||||
if (fun->match(f)) {
|
||||
newOverload = false;
|
||||
break;
|
||||
}
|
||||
|
||||
@@ -148,7 +148,7 @@ QList<Function *> FunctionUtils::overrides(Function *function, Class *functionsC
|
||||
Function *candidateFunc = candidate->type()->asFunctionType();
|
||||
if (!candidateName || !candidateFunc)
|
||||
continue;
|
||||
if (candidateName->isEqualTo(referenceName)
|
||||
if (candidateName->match(referenceName)
|
||||
&& candidateFunc->isSignatureEqualTo(function)) {
|
||||
result << candidateFunc;
|
||||
}
|
||||
|
||||
@@ -112,7 +112,7 @@ protected:
|
||||
{
|
||||
if (!ast->lbrace_token || !ast->rbrace_token)
|
||||
return true;
|
||||
if (!ast->symbol || !ast->symbol->isEqualTo(_clazz))
|
||||
if (!ast->symbol || !ast->symbol->match(_clazz))
|
||||
return true;
|
||||
|
||||
QList<AccessRange> ranges = collectAccessRanges(
|
||||
|
||||
@@ -70,11 +70,11 @@ public:
|
||||
{
|
||||
if (_oper) {
|
||||
if (const Name *name = fun->unqualifiedName()) {
|
||||
if (_oper->isEqualTo(name))
|
||||
if (_oper->match(name))
|
||||
_result.append(fun);
|
||||
}
|
||||
} else if (Function *decl = _declaration->type()->asFunctionType()) {
|
||||
if (fun->isEqualTo(decl))
|
||||
if (fun->match(decl))
|
||||
_result.append(fun);
|
||||
}
|
||||
|
||||
@@ -175,7 +175,7 @@ Function *SymbolFinder::findMatchingDefinition(Symbol *declaration,
|
||||
|
||||
foreach (Function *fun, viableFunctions) {
|
||||
if (!(fun->unqualifiedName()
|
||||
&& fun->unqualifiedName()->isEqualTo(declaration->unqualifiedName()))) {
|
||||
&& fun->unqualifiedName()->match(declaration->unqualifiedName()))) {
|
||||
continue;
|
||||
}
|
||||
if (fun->argumentCount() == declarationTy->argumentCount()) {
|
||||
@@ -187,7 +187,7 @@ Function *SymbolFinder::findMatchingDefinition(Symbol *declaration,
|
||||
for (; argIt < argc; ++argIt) {
|
||||
Symbol *arg = fun->argumentAt(argIt);
|
||||
Symbol *otherArg = declarationTy->argumentAt(argIt);
|
||||
if (!arg->type().isEqualTo(otherArg->type()))
|
||||
if (!arg->type().match(otherArg->type()))
|
||||
break;
|
||||
}
|
||||
|
||||
@@ -252,7 +252,7 @@ static void findDeclarationOfSymbol(Symbol *s,
|
||||
{
|
||||
if (Declaration *decl = s->asDeclaration()) {
|
||||
if (Function *declFunTy = decl->type()->asFunctionType()) {
|
||||
if (functionType->isEqualTo(declFunTy))
|
||||
if (functionType->match(declFunTy))
|
||||
typeMatch->prepend(decl);
|
||||
else if (functionType->argumentCount() == declFunTy->argumentCount())
|
||||
argumentCountMatch->prepend(decl);
|
||||
@@ -316,7 +316,7 @@ void SymbolFinder::findMatchingDeclaration(const LookupContext &context,
|
||||
|
||||
if (funcId) {
|
||||
for (Symbol *s = scope->find(funcId); s; s = s->next()) {
|
||||
if (!s->name() || !funcId->isEqualTo(s->identifier()) || !s->type()->isFunctionType())
|
||||
if (!s->name() || !funcId->match(s->identifier()) || !s->type()->isFunctionType())
|
||||
continue;
|
||||
findDeclarationOfSymbol(s, functionType, typeMatch, argumentCountMatch, nameMatch);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user