Commit bbae6f84 authored by Roberto Raggi's avatar Roberto Raggi

Create symbols for the fwd class declarations

parent 8e1e0bde
......@@ -609,7 +609,7 @@ public:
unsigned semicolon_token;
public:
List<Declaration *> *symbols;
List<Symbol *> *symbols;
public:
SimpleDeclarationAST()
......
......@@ -1569,7 +1569,28 @@ bool Bind::visit(SimpleDeclarationAST *ast)
type = this->specifier(it->value, type);
}
List<Declaration *> **symbolTail = &ast->symbols;
List<Symbol *> **symbolTail = &ast->symbols;
if (! ast->declarator_list) {
ElaboratedTypeSpecifierAST *elabTypeSpec = 0;
for (SpecifierListAST *it = ast->decl_specifier_list; ! elabTypeSpec && it; it = it->next)
elabTypeSpec = it->value->asElaboratedTypeSpecifier();
if (elabTypeSpec && tokenKind(elabTypeSpec->classkey_token) != T_TYPENAME) {
unsigned sourceLocation = elabTypeSpec->firstToken();
const Name *name = 0;
if (elabTypeSpec->name) {
sourceLocation = elabTypeSpec->name->firstToken();
name = elabTypeSpec->name->name;
}
ForwardClassDeclaration *decl = control()->newForwardClassDeclaration(sourceLocation, name);
_scope->addMember(decl);
*symbolTail = new (translationUnit()->memoryPool()) List<Symbol *>(decl);
symbolTail = &(*symbolTail)->next;
}
}
for (DeclaratorListAST *it = ast->declarator_list; it; it = it->next) {
DeclaratorIdAST *declaratorId = 0;
......@@ -1601,7 +1622,7 @@ bool Bind::visit(SimpleDeclarationAST *ast)
_scope->addMember(decl);
*symbolTail = new (translationUnit()->memoryPool()) List<Declaration *>(decl);
*symbolTail = new (translationUnit()->memoryPool()) List<Symbol *>(decl);
symbolTail = &(*symbolTail)->next;
}
return false;
......
......@@ -187,7 +187,7 @@ bool CheckDeclaration::visit(SimpleDeclarationAST *ast)
const bool isQ_SIGNAL = ast->qt_invokable_token && tokenKind(ast->qt_invokable_token) == T_Q_SIGNAL;
const bool isQ_INVOKABLE = ast->qt_invokable_token && tokenKind(ast->qt_invokable_token) == T_Q_INVOKABLE;
List<Declaration *> **decl_it = &ast->symbols;
List<Symbol *> **decl_it = &ast->symbols;
for (DeclaratorListAST *it = ast->declarator_list; it; it = it->next) {
const Name *name = 0;
FullySpecifiedType declTy = semantic()->check(it->value, qualTy,
......@@ -230,7 +230,7 @@ bool CheckDeclaration::visit(SimpleDeclarationAST *ast)
FullySpecifiedType initTy = semantic()->check(it->value->initializer, _scope);
}
*decl_it = new (translationUnit()->memoryPool()) List<Declaration *>();
*decl_it = new (translationUnit()->memoryPool()) List<Symbol *>();
(*decl_it)->value = symbol;
decl_it = &(*decl_it)->next;
......@@ -841,7 +841,7 @@ bool CheckDeclaration::visit(ObjCPropertyDeclarationAST *ast)
}
List<ObjCPropertyDeclaration *> **lastSymbols = &ast->symbols;
for (List<Declaration*> *iter = simpleDecl->symbols; iter; iter = iter->next) {
for (List<Symbol *> *iter = simpleDecl->symbols; iter; iter = iter->next) {
ObjCPropertyDeclaration *propDecl = control()->newObjCPropertyDeclaration(ast->firstToken(),
iter->value->name());
propDecl->setType(iter->value->type());
......
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