Get rid of the old Semantic pass.

This commit is contained in:
Roberto Raggi
2010-08-13 16:17:44 +02:00
parent 6659e3ecba
commit 0540aa362d
26 changed files with 20 additions and 4256 deletions

View File

@@ -36,7 +36,6 @@
#include <Control.h>
#include <TranslationUnit.h>
#include <DiagnosticClient.h>
#include <Semantic.h>
#include <Literals.h>
#include <Symbols.h>
#include <Names.h>

View File

@@ -32,7 +32,6 @@
#include "LookupContext.h"
#include "CppDocument.h"
#include "Semantic.h"
#include "TypeOfExpression.h"
#include <ASTVisitor.h>
#include <QtCore/QSet>

View File

@@ -31,7 +31,6 @@
#include "Overview.h"
#include <Scope.h>
#include <Semantic.h>
#include <Literals.h>
#include <Symbols.h>

View File

@@ -75,7 +75,7 @@ ResolveExpression::ResolveExpression(const LookupContext &context)
: ASTVisitor(context.expressionDocument()->translationUnit()),
_scope(0),
_context(context),
sem(context.expressionDocument()->translationUnit())
bind(context.expressionDocument()->translationUnit())
{ }
ResolveExpression::~ResolveExpression()
@@ -174,7 +174,7 @@ bool ResolveExpression::visit(BinaryExpressionAST *ast)
bool ResolveExpression::visit(CastExpressionAST *ast)
{
Scope *dummyScope = _context.expressionDocument()->globalNamespace();
FullySpecifiedType ty = sem.check(ast->type_id, dummyScope);
FullySpecifiedType ty = bind(ast->type_id, dummyScope);
addResult(ty, _scope);
return false;
}
@@ -199,7 +199,7 @@ bool ResolveExpression::visit(ConditionalExpressionAST *ast)
bool ResolveExpression::visit(CppCastExpressionAST *ast)
{
Scope *dummyScope = _context.expressionDocument()->globalNamespace();
FullySpecifiedType ty = sem.check(ast->type_id, dummyScope);
FullySpecifiedType ty = bind(ast->type_id, dummyScope);
addResult(ty, _scope);
return false;
}
@@ -221,8 +221,7 @@ bool ResolveExpression::visit(NewExpressionAST *ast)
{
if (ast->new_type_id) {
Scope *dummyScope = _context.expressionDocument()->globalNamespace();
FullySpecifiedType ty = sem.check(ast->new_type_id->type_specifier_list, dummyScope);
ty = sem.check(ast->new_type_id->ptr_operator_list, ty, dummyScope);
FullySpecifiedType ty = bind(ast->new_type_id, dummyScope);
FullySpecifiedType ptrTy(control()->pointerType(ty));
addResult(ptrTy, _scope);
}

View File

@@ -33,8 +33,8 @@
#include "LookupContext.h"
#include <ASTVisitor.h>
#include <Semantic.h>
#include <FullySpecifiedType.h>
#include <Bind.h>
namespace CPlusPlus {
@@ -115,9 +115,8 @@ protected:
private:
Scope *_scope;
LookupContext _context;
Semantic sem;
Bind bind;
QList<LookupItem> _results;
Symbol *_declSymbol;
};
} // end of namespace CPlusPlus