From 7edde41d7e4c977c0cbd7706c05b396b0bdc6453 Mon Sep 17 00:00:00 2001 From: Roberto Raggi Date: Wed, 12 May 2010 15:29:02 +0200 Subject: [PATCH] Get rid of deprected method ResolveExpression::resolveBaseExpression(). --- src/libs/cplusplus/ResolveExpression.cpp | 117 ----------------------- src/libs/cplusplus/ResolveExpression.h | 4 - 2 files changed, 121 deletions(-) diff --git a/src/libs/cplusplus/ResolveExpression.cpp b/src/libs/cplusplus/ResolveExpression.cpp index 1dfe831d91d..360f093364a 100644 --- a/src/libs/cplusplus/ResolveExpression.cpp +++ b/src/libs/cplusplus/ResolveExpression.cpp @@ -625,123 +625,6 @@ ClassOrNamespace *ResolveExpression::baseExpression(const QList &bas return 0; } - -QList -ResolveExpression::resolveBaseExpression(const QList &baseResults, int accessOp, - bool *replacedDotOperator) const -{ - QList results; - - if (baseResults.isEmpty()) - return results; - - LookupItem result = baseResults.first(); - FullySpecifiedType ty = result.type().simplified(); - Scope *scope = result.scope(); - - if (Function *funTy = ty->asFunctionType()) { - if (funTy->isAmbiguous()) - ty = funTy->returnType().simplified(); - } - - if (accessOp == T_ARROW) { - if (NamedType *namedTy = ty->asNamedType()) { - const Name *arrowAccessOp = control()->operatorNameId(OperatorNameId::ArrowOp); - - foreach (Symbol *declaration, _context.lookup(namedTy->name(), result.scope())) { - if (PointerType *ptrTy = declaration->type()->asPointerType()) { - FullySpecifiedType elementTy = ptrTy->elementType().simplified(); - - if (elementTy->isNamedType() || elementTy->isClassType()) { - LookupItem item; - item.setType(elementTy); - item.setDeclaration(declaration); - results.append(item); - } - - } else if (const NamedType *nt = declaration->type()->asNamedType()) { -#warning fix this code - qWarning() << Q_FUNC_INFO << __LINE__; - Symbol *declaration = _context.lookup(nt->name(), result.scope()).first(); - - if (PointerType *ptrTy = declaration->type()->asPointerType()) { - FullySpecifiedType elementTy = ptrTy->elementType().simplified(); - - if (elementTy->isNamedType() || elementTy->isClassType()) { - LookupItem item; - item.setType(elementTy); - item.setDeclaration(declaration); - results.append(item); - } - } - } - } - - if (ClassOrNamespace *b = _context.classOrNamespace(namedTy->name(), result.scope())) { - foreach (Symbol *overload, b->find(arrowAccessOp)) { - if (Function *funTy = overload->type()->asFunctionType()) { - FullySpecifiedType f = instantiate(namedTy->name(), funTy); - FullySpecifiedType retTy = f->asFunctionType()->returnType().simplified(); - - if (PointerType *ptrTy = retTy->asPointerType()) { - FullySpecifiedType elementTy = ptrTy->elementType().simplified(); - - LookupItem item; - item.setType(elementTy); - item.setDeclaration(overload); - results.append(item); - } - } - } - } - - } else if (PointerType *ptrTy = ty->asPointerType()) { - FullySpecifiedType elementTy = ptrTy->elementType().simplified(); - - if (elementTy->isNamedType() || elementTy->isClassType()) { - LookupItem item; - item.setType(elementTy); - item.setScope(scope); - results.append(item); - } - } - } else if (accessOp == T_DOT) { - if (replacedDotOperator) { - if (PointerType *ptrTy = ty->asPointerType()) { - *replacedDotOperator = true; - ty = ptrTy->elementType().simplified(); - } else if (ArrayType *arrTy = ty->asArrayType()) { - *replacedDotOperator = true; - ty = arrTy->elementType().simplified(); - } - } - - if (NamedType *namedTy = ty->asNamedType()) { - if (ClassOrNamespace *binding = _context.classOrNamespace(namedTy->name(), result.scope())) { - foreach (Symbol *s, binding->symbols()) { - LookupItem item; - item.setType(s->type()); - item.setDeclaration(s); - results.append(item); - } - } - - } else if (Function *fun = ty->asFunctionType()) { - Scope *funScope = fun->scope(); - - if (funScope && (funScope->isBlockScope() || funScope->isNamespaceScope())) { - FullySpecifiedType retTy = fun->returnType().simplified(); - LookupItem item; - item.setType(retTy); - item.setDeclaration(fun); - results.append(item); - } - } - } - - return removeDuplicates(results); -} - FullySpecifiedType ResolveExpression::instantiate(const Name *className, Symbol *candidate) const { return GenTemplateInstance::instantiate(className, candidate, _context.control()); diff --git a/src/libs/cplusplus/ResolveExpression.h b/src/libs/cplusplus/ResolveExpression.h index da35618a71d..830b210815d 100644 --- a/src/libs/cplusplus/ResolveExpression.h +++ b/src/libs/cplusplus/ResolveExpression.h @@ -51,10 +51,6 @@ public: int accessOp, bool *replacedDotOperator = 0) const; - Q_DECL_DEPRECATED QList resolveBaseExpression(const QList &baseResults, - int accessOp, - bool *replacedDotOperator = 0) const; - protected: ClassOrNamespace *findClass(const FullySpecifiedType &ty, Scope *scope) const;