diff options
author | Roberto Raggi <roberto.raggi@nokia.com> | 2010-08-13 10:57:12 +0200 |
---|---|---|
committer | Roberto Raggi <roberto.raggi@nokia.com> | 2010-08-13 10:57:12 +0200 |
commit | fc17a4226b13c983584817f52dfb2de81259f467 (patch) | |
tree | 3dc2e4c8800719a3b3b373e8a8b8bdf7036b741d /src/shared/cplusplus | |
parent | 65681dfbe198e3cb58370ad1b35ae7cda77197f7 (diff) | |
download | qt-creator-fc17a4226b13c983584817f52dfb2de81259f467.tar.gz |
Process simple declarations.
Diffstat (limited to 'src/shared/cplusplus')
-rw-r--r-- | src/shared/cplusplus/Bind.cpp | 28 |
1 files changed, 25 insertions, 3 deletions
diff --git a/src/shared/cplusplus/Bind.cpp b/src/shared/cplusplus/Bind.cpp index ebaac0a934..efd3ebc772 100644 --- a/src/shared/cplusplus/Bind.cpp +++ b/src/shared/cplusplus/Bind.cpp @@ -1504,12 +1504,34 @@ bool Bind::visit(SimpleDeclarationAST *ast) for (SpecifierListAST *it = ast->decl_specifier_list; it; it = it->next) { type = this->specifier(it->value, type); } + + List<Declaration *> **symbolTail = &ast->symbols; + for (DeclaratorListAST *it = ast->declarator_list; it; it = it->next) { DeclaratorIdAST *declaratorId = 0; - FullySpecifiedType declTy = this->declarator(it->value, type, &declaratorId); + FullySpecifiedType declTy = this->declarator(it->value, type.qualifiedType(), &declaratorId); + + const Name *declName = 0; + unsigned sourceLocation = ast->firstToken(); + if (declaratorId && declaratorId->name) { + sourceLocation = declaratorId->firstToken(); + declName = declaratorId->name->name; + } + + Declaration *decl = control()->newDeclaration(sourceLocation, declName); + decl->setType(declTy); + if (_scope->isClass()) { + decl->setVisibility(_visibility); + + if (Function *funTy = decl->type()->asFunctionType()) { + funTy->setMethodKey(_methodKey); + } + } + _scope->addMember(decl); + + *symbolTail = new (translationUnit()->memoryPool()) List<Declaration *>(decl); + symbolTail = &(*symbolTail)->next; } - // unsigned semicolon_token = ast->semicolon_token; - // List<Declaration *> *symbols = ast->symbols; return false; } |