diff options
author | Roberto Raggi <roberto.raggi@nokia.com> | 2010-08-06 11:29:41 +0200 |
---|---|---|
committer | Roberto Raggi <roberto.raggi@nokia.com> | 2010-08-06 11:35:00 +0200 |
commit | 463f83630f8a5797cec1bd7dac354a3557572efb (patch) | |
tree | 90ca5406ef5453193593bcaaf522ee3bb744b8e4 /src/shared/cplusplus | |
parent | 517d4f630db653b14903ff68becd5769fcb86090 (diff) | |
download | qt-creator-463f83630f8a5797cec1bd7dac354a3557572efb.tar.gz |
Speed up the comutation of the local members.
Diffstat (limited to 'src/shared/cplusplus')
-rw-r--r-- | src/shared/cplusplus/CheckDeclaration.cpp | 8 | ||||
-rw-r--r-- | src/shared/cplusplus/CheckExpression.cpp | 2 |
2 files changed, 3 insertions, 7 deletions
diff --git a/src/shared/cplusplus/CheckDeclaration.cpp b/src/shared/cplusplus/CheckDeclaration.cpp index 98e8616f70..5eb98735d1 100644 --- a/src/shared/cplusplus/CheckDeclaration.cpp +++ b/src/shared/cplusplus/CheckDeclaration.cpp @@ -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())) { diff --git a/src/shared/cplusplus/CheckExpression.cpp b/src/shared/cplusplus/CheckExpression.cpp index 6a24d3a51d..27e05390c0 100644 --- a/src/shared/cplusplus/CheckExpression.cpp +++ b/src/shared/cplusplus/CheckExpression.cpp @@ -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; |