aboutsummaryrefslogtreecommitdiffstats
path: root/src/libs/cplusplus/LookupItem.cpp
diff options
context:
space:
mode:
authorRoberto Raggi <[email protected]>2010-07-16 11:03:39 +0200
committerRoberto Raggi <[email protected]>2010-07-16 11:04:52 +0200
commitfff4203a46559e0afc751785e25eb702d8c8a608 (patch)
tree53e4a813426e6f2d4fc4603936e34601c8e30c11 /src/libs/cplusplus/LookupItem.cpp
parent41236d29d328950d9240d4e3a5e2c98d3214b65b (diff)
Introduced helpers to rewrite types and names.
Done-with: Erik Verbruggen
Diffstat (limited to 'src/libs/cplusplus/LookupItem.cpp')
-rw-r--r--src/libs/cplusplus/LookupItem.cpp18
1 files changed, 15 insertions, 3 deletions
diff --git a/src/libs/cplusplus/LookupItem.cpp b/src/libs/cplusplus/LookupItem.cpp
index 2502c02790b..1bc49303a31 100644
--- a/src/libs/cplusplus/LookupItem.cpp
+++ b/src/libs/cplusplus/LookupItem.cpp
@@ -44,11 +44,16 @@ uint CPlusPlus::qHash(const CPlusPlus::LookupItem &key)
}
LookupItem::LookupItem()
- : _scope(0), _declaration(0)
+ : _scope(0), _declaration(0), _binding(0)
{ }
FullySpecifiedType LookupItem::type() const
-{ return _type; }
+{
+ if (! _type && _declaration)
+ return _declaration->type();
+
+ return _type;
+}
void LookupItem::setType(const FullySpecifiedType &type)
{ _type = type; }
@@ -70,9 +75,16 @@ Scope *LookupItem::scope() const
void LookupItem::setScope(Scope *scope)
{ _scope = scope; }
+ClassOrNamespace *LookupItem::binding() const
+{ return _binding; }
+
+void LookupItem::setBinding(ClassOrNamespace *binding)
+{ _binding = binding; }
+
bool LookupItem::operator == (const LookupItem &other) const
{
- if (_type == other._type && _declaration == other._declaration && _scope == other._scope)
+ if (_type == other._type && _declaration == other._declaration && _scope == other._scope
+ && _binding == other._binding)
return true;
return false;