Commit fc17a422 authored by Roberto Raggi's avatar Roberto Raggi

Process simple declarations.

parent 65681dfb
......@@ -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;
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment