Commit 1e1d8e45 authored by Roberto Raggi's avatar Roberto Raggi
Browse files

Use the Control created by CPlusPlus::CreateBindings.

parent 35c50dcb
...@@ -90,7 +90,6 @@ bool ClassOrNamespace::CompareName::operator()(const Name *name, const Name *oth ...@@ -90,7 +90,6 @@ bool ClassOrNamespace::CompareName::operator()(const Name *name, const Name *oth
// LookupContext // LookupContext
///////////////////////////////////////////////////////////////////// /////////////////////////////////////////////////////////////////////
LookupContext::LookupContext() LookupContext::LookupContext()
: _control(0)
{ } { }
LookupContext::LookupContext(Document::Ptr thisDocument, LookupContext::LookupContext(Document::Ptr thisDocument,
...@@ -99,7 +98,6 @@ LookupContext::LookupContext(Document::Ptr thisDocument, ...@@ -99,7 +98,6 @@ LookupContext::LookupContext(Document::Ptr thisDocument,
_thisDocument(thisDocument), _thisDocument(thisDocument),
_snapshot(snapshot) _snapshot(snapshot)
{ {
_control = _expressionDocument->control();
} }
LookupContext::LookupContext(Document::Ptr expressionDocument, LookupContext::LookupContext(Document::Ptr expressionDocument,
...@@ -109,12 +107,10 @@ LookupContext::LookupContext(Document::Ptr expressionDocument, ...@@ -109,12 +107,10 @@ LookupContext::LookupContext(Document::Ptr expressionDocument,
_thisDocument(thisDocument), _thisDocument(thisDocument),
_snapshot(snapshot) _snapshot(snapshot)
{ {
_control = _expressionDocument->control();
} }
LookupContext::LookupContext(const LookupContext &other) LookupContext::LookupContext(const LookupContext &other)
: _control(other._control), : _expressionDocument(other._expressionDocument),
_expressionDocument(other._expressionDocument),
_thisDocument(other._thisDocument), _thisDocument(other._thisDocument),
_snapshot(other._snapshot), _snapshot(other._snapshot),
_bindings(other._bindings) _bindings(other._bindings)
...@@ -122,7 +118,6 @@ LookupContext::LookupContext(const LookupContext &other) ...@@ -122,7 +118,6 @@ LookupContext::LookupContext(const LookupContext &other)
LookupContext &LookupContext::operator = (const LookupContext &other) LookupContext &LookupContext::operator = (const LookupContext &other)
{ {
_control = other._control;
_expressionDocument = other._expressionDocument; _expressionDocument = other._expressionDocument;
_thisDocument = other._thisDocument; _thisDocument = other._thisDocument;
_snapshot = other._snapshot; _snapshot = other._snapshot;
...@@ -150,11 +145,8 @@ void LookupContext::setBindings(QSharedPointer<CreateBindings> bindings) ...@@ -150,11 +145,8 @@ void LookupContext::setBindings(QSharedPointer<CreateBindings> bindings)
_bindings = bindings; _bindings = bindings;
} }
bool LookupContext::isValid() const
{ return _control != 0; }
Control *LookupContext::control() const Control *LookupContext::control() const
{ return _control; } { return bindings()->control(); }
Document::Ptr LookupContext::expressionDocument() const Document::Ptr LookupContext::expressionDocument() const
{ return _expressionDocument; } { return _expressionDocument; }
...@@ -391,6 +383,7 @@ void CreateBindings::lookupInScope(const Name *name, Scope *scope, ...@@ -391,6 +383,7 @@ void CreateBindings::lookupInScope(const Name *name, Scope *scope,
else if (s->name()->isQualifiedNameId()) else if (s->name()->isQualifiedNameId())
continue; // skip qualified ids. continue; // skip qualified ids.
#if 0
if (templateId && (s->isDeclaration() || s->isFunction())) { if (templateId && (s->isDeclaration() || s->isFunction())) {
FullySpecifiedType ty = GenTemplateInstance::instantiate(templateId, s, _control); FullySpecifiedType ty = GenTemplateInstance::instantiate(templateId, s, _control);
...@@ -415,6 +408,7 @@ void CreateBindings::lookupInScope(const Name *name, Scope *scope, ...@@ -415,6 +408,7 @@ void CreateBindings::lookupInScope(const Name *name, Scope *scope,
continue; continue;
} }
} }
#endif
result->append(s); result->append(s);
} }
......
...@@ -204,8 +204,6 @@ public: ...@@ -204,8 +204,6 @@ public:
LookupContext(const LookupContext &other); LookupContext(const LookupContext &other);
LookupContext &operator = (const LookupContext &other); LookupContext &operator = (const LookupContext &other);
bool isValid() const;
Document::Ptr expressionDocument() const; Document::Ptr expressionDocument() const;
Document::Ptr thisDocument() const; Document::Ptr thisDocument() const;
Document::Ptr document(const QString &fileName) const; Document::Ptr document(const QString &fileName) const;
...@@ -228,8 +226,6 @@ public: ...@@ -228,8 +226,6 @@ public:
static QList<const Name *> fullyQualifiedName(Symbol *symbol); static QList<const Name *> fullyQualifiedName(Symbol *symbol);
private: private:
Control *_control;
// The current expression. // The current expression.
Document::Ptr _expressionDocument; Document::Ptr _expressionDocument;
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment