Store the declaration (if any) associated with the LookupItem.

This commit is contained in:
Roberto Raggi
2010-05-11 11:26:27 +02:00
parent 37fde0c9d4
commit 17fd33bdab
4 changed files with 41 additions and 21 deletions

View File

@@ -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;
}