From 17fd33bdabe4b7c72b1f268767968dd945089335 Mon Sep 17 00:00:00 2001 From: Roberto Raggi Date: Tue, 11 May 2010 11:26:27 +0200 Subject: Store the declaration (if any) associated with the LookupItem. --- src/libs/cplusplus/LookupItem.cpp | 16 +++++++++++----- 1 file changed, 11 insertions(+), 5 deletions(-) (limited to 'src/libs/cplusplus/LookupItem.cpp') diff --git a/src/libs/cplusplus/LookupItem.cpp b/src/libs/cplusplus/LookupItem.cpp index c5e43674ef..a4ddfa77b7 100644 --- a/src/libs/cplusplus/LookupItem.cpp +++ b/src/libs/cplusplus/LookupItem.cpp @@ -44,11 +44,11 @@ uint CPlusPlus::qHash(const CPlusPlus::LookupItem &key) } LookupItem::LookupItem() - : _lastVisibleSymbol(0) + : _lastVisibleSymbol(0), _declaration(0) { } -LookupItem::LookupItem(const FullySpecifiedType &type, Symbol *lastVisibleSymbol) - : _type(type), _lastVisibleSymbol(lastVisibleSymbol) +LookupItem::LookupItem(const FullySpecifiedType &type, Symbol *lastVisibleSymbol, Symbol *declaration) + : _type(type), _lastVisibleSymbol(lastVisibleSymbol), _declaration(declaration) { } FullySpecifiedType LookupItem::type() const @@ -57,6 +57,12 @@ FullySpecifiedType LookupItem::type() const void LookupItem::setType(const FullySpecifiedType &type) { _type = type; } +Symbol *LookupItem::declaration() const +{ return _declaration; } + +void LookupItem::setDeclaration(Symbol *declaration) +{ _declaration = declaration; } + Symbol *LookupItem::lastVisibleSymbol() const { return _lastVisibleSymbol; } @@ -65,8 +71,8 @@ void LookupItem::setLastVisibleSymbol(Symbol *symbol) bool LookupItem::operator == (const LookupItem &other) const { - if (_type == other._type) - return _lastVisibleSymbol == other._lastVisibleSymbol; + if (_type == other._type && _declaration == other._declaration && _lastVisibleSymbol == other._lastVisibleSymbol) + return true; return false; } -- cgit v1.2.3