Commit eb1baa9e authored by Erik Verbruggen's avatar Erik Verbruggen
Browse files

Fix to selector parameter position.

parent 5723682b
...@@ -666,22 +666,22 @@ bool CheckDeclaration::visit(ObjCMethodDeclarationAST *ast) ...@@ -666,22 +666,22 @@ bool CheckDeclaration::visit(ObjCMethodDeclarationAST *ast)
return false; return false;
FullySpecifiedType ty = semantic()->check(ast->method_prototype, _scope); FullySpecifiedType ty = semantic()->check(ast->method_prototype, _scope);
ObjCMethod *methodType = ty.type()->asObjCMethodType(); ObjCMethod *methodTy = ty.type()->asObjCMethodType();
if (!methodType) if (!methodTy)
return false; return false;
Symbol *symbol; Symbol *symbol;
if (ast->function_body) { if (ast->function_body) {
if (!semantic()->skipFunctionBodies()) { if (!semantic()->skipFunctionBodies()) {
semantic()->check(ast->function_body, methodType->members()); semantic()->check(ast->function_body, methodTy->members());
} }
symbol = methodType; symbol = methodTy;
} else { } else {
Declaration *decl = control()->newDeclaration(ast->firstToken(), methodType->name()); Declaration *decl = control()->newDeclaration(ast->firstToken(), methodTy->name());
decl->setType(methodType); decl->setType(methodTy);
symbol = decl; symbol = decl;
symbol->setStorage(methodType->storage()); symbol->setStorage(methodTy->storage());
} }
symbol->setStartOffset(tokenAt(ast->firstToken()).offset); symbol->setStartOffset(tokenAt(ast->firstToken()).offset);
......
...@@ -97,10 +97,11 @@ FullySpecifiedType CheckDeclarator::check(PtrOperatorListAST *ptrOperators, ...@@ -97,10 +97,11 @@ FullySpecifiedType CheckDeclarator::check(PtrOperatorListAST *ptrOperators,
FullySpecifiedType CheckDeclarator::check(ObjCMethodPrototypeAST *methodPrototype, FullySpecifiedType CheckDeclarator::check(ObjCMethodPrototypeAST *methodPrototype,
Scope *scope) Scope *scope)
{ {
FullySpecifiedType previousType = switchFullySpecifiedType(FullySpecifiedType());
Scope *previousScope = switchScope(scope); Scope *previousScope = switchScope(scope);
accept(methodPrototype); accept(methodPrototype);
(void) switchScope(previousScope); (void) switchScope(previousScope);
return _fullySpecifiedType; return switchFullySpecifiedType(previousType);
} }
DeclaratorAST *CheckDeclarator::switchDeclarator(DeclaratorAST *declarator) DeclaratorAST *CheckDeclarator::switchDeclarator(DeclaratorAST *declarator)
......
...@@ -423,7 +423,7 @@ bool CheckName::visit(ObjCMessageArgumentDeclarationAST *ast) ...@@ -423,7 +423,7 @@ bool CheckName::visit(ObjCMessageArgumentDeclarationAST *ast)
_name = control()->nameId(id); _name = control()->nameId(id);
ast->name = _name; ast->name = _name;
Argument *arg = control()->newArgument(ast->firstToken(), _name); Argument *arg = control()->newArgument(ast->param_name_token, _name);
ast->argument = arg; ast->argument = arg;
arg->setType(type); arg->setType(type);
arg->setInitializer(0); arg->setInitializer(0);
......
Supports Markdown
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