forked from qt-creator/qt-creator
Use the new binder
This commit is contained in:
@@ -31,6 +31,7 @@
|
|||||||
#include "FastPreprocessor.h"
|
#include "FastPreprocessor.h"
|
||||||
#include "LookupContext.h"
|
#include "LookupContext.h"
|
||||||
#include "Overview.h"
|
#include "Overview.h"
|
||||||
|
#include "Bind.h"
|
||||||
|
|
||||||
#include <Control.h>
|
#include <Control.h>
|
||||||
#include <TranslationUnit.h>
|
#include <TranslationUnit.h>
|
||||||
@@ -545,21 +546,18 @@ void Document::check(CheckMode mode)
|
|||||||
if (! isParsed())
|
if (! isParsed())
|
||||||
parse();
|
parse();
|
||||||
|
|
||||||
Semantic semantic(_translationUnit);
|
_globalNamespace = _control->newNamespace(0);
|
||||||
|
Bind semantic(_translationUnit);
|
||||||
if (mode == FastCheck)
|
if (mode == FastCheck)
|
||||||
semantic.setSkipFunctionBodies(true);
|
semantic.setSkipFunctionBodies(true);
|
||||||
|
|
||||||
_globalNamespace = _control->newNamespace(0);
|
|
||||||
Scope *globals = _globalNamespace;
|
|
||||||
if (! _translationUnit->ast())
|
if (! _translationUnit->ast())
|
||||||
return; // nothing to do.
|
return; // nothing to do.
|
||||||
|
|
||||||
if (TranslationUnitAST *ast = _translationUnit->ast()->asTranslationUnit()) {
|
if (TranslationUnitAST *ast = _translationUnit->ast()->asTranslationUnit()) {
|
||||||
for (DeclarationListAST *decl = ast->declaration_list; decl; decl = decl->next) {
|
semantic(ast, _globalNamespace);
|
||||||
semantic.check(decl->value, globals);
|
|
||||||
}
|
|
||||||
} else if (ExpressionAST *ast = _translationUnit->ast()->asExpression()) {
|
} else if (ExpressionAST *ast = _translationUnit->ast()->asExpression()) {
|
||||||
semantic.check(ast, globals);
|
semantic(ast, _globalNamespace);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user