Speed up the comutation of the local members.

This commit is contained in:
Roberto Raggi
2010-08-06 11:29:41 +02:00
parent 517d4f630d
commit 463f83630f
5 changed files with 154 additions and 180 deletions

View File

@@ -187,12 +187,8 @@ bool CheckDeclaration::visit(SimpleDeclarationAST *ast)
_scope, &name);
unsigned location = semantic()->location(it->value);
if (! location) {
if (it->value)
location = it->value->firstToken();
else
location = ast->firstToken();
}
if (! location)
location = ast->firstToken();
Function *fun = 0;
if (declTy && 0 != (fun = declTy->asFunctionType())) {

View File

@@ -123,7 +123,7 @@ bool CheckExpression::visit(ConditionAST *ast)
const Name *name = 0;
FullySpecifiedType declTy = semantic()->check(ast->declarator, typeSpecTy.qualifiedType(),
_scope, &name);
Declaration *decl = control()->newDeclaration(ast->declarator->firstToken(), name);
Declaration *decl = control()->newDeclaration(semantic()->location(ast->declarator), name);
decl->setType(declTy);
_scope->enterSymbol(decl);
return false;