Enable lazy lookup.

This commit is contained in:
Roberto Raggi
2010-05-05 14:07:10 +02:00
parent e821be344d
commit b84db9ba88
3 changed files with 8 additions and 10 deletions

View File

@@ -41,7 +41,7 @@
#include <QtDebug>
#define CPLUSPLUS_NO_LAZY_LOOKUP
//#define CPLUSPLUS_NO_LAZY_LOOKUP
using namespace CPlusPlus;
@@ -229,7 +229,7 @@ QList<Symbol *> LookupContext::lookup(const Name *name, Scope *scope) const
}
ClassOrNamespace::ClassOrNamespace(CreateBindings *factory, ClassOrNamespace *parent)
: _factory(factory), _parent(parent), _flushing(false)
: _factory(factory), _parent(parent)
{
}
@@ -483,13 +483,12 @@ ClassOrNamespace *ClassOrNamespace::nestedClassOrNamespace(const QByteArray &nam
void ClassOrNamespace::flush()
{
#ifndef CPLUSPLUS_NO_LAZY_LOOKUP
if (! _flushing) {
_flushing = true;
if (! _todo.isEmpty()) {
const QList<Symbol *> todo = _todo;
_todo.clear();
while (! _todo.isEmpty()) {
Symbol *member = _todo.takeFirst();
foreach (Symbol *member, todo)
_factory->process(member, this);
}
}
#endif
}