Commit 89dba0e5 authored by Roberto Raggi's avatar Roberto Raggi

Create symbols for the formal arguments.

parent 51645710
......@@ -1684,7 +1684,21 @@ bool Bind::visit(ParameterDeclarationAST *ast)
type = this->declarator(ast->declarator, type, &declaratorId);
// unsigned equal_token = ast->equal_token;
ExpressionTy expression = this->expression(ast->expression);
// Argument *symbol = ast->symbol;
unsigned sourceLocation = ast->firstToken();
if (declaratorId)
sourceLocation = declaratorId->firstToken();
const Name *argName = 0;
if (declaratorId && declaratorId->name)
argName = declaratorId->name->name;
Argument *arg = control()->newArgument(sourceLocation, argName);
arg->setType(type);
_scope->addMember(arg);
ast->symbol = arg;
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