aboutsummaryrefslogtreecommitdiff
path: root/lib/Parse/ParseObjc.cpp
diff options
context:
space:
mode:
authorFariborz Jahanian <fjahanian@apple.com>2009-01-09 00:38:19 +0000
committerFariborz Jahanian <fjahanian@apple.com>2009-01-09 00:38:19 +0000
commit439c65892cc8629bbf541e0b8bda6b64cbcc4e6b (patch)
tree8486926a0166876ab7d68f9e1274a465820bd66d /lib/Parse/ParseObjc.cpp
parentf890191057ac0ab5d1178ded62c660ff03151b04 (diff)
Adding support for ObjC methods which have c-style
parameter list. This is work in progress. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@61964 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Parse/ParseObjc.cpp')
-rw-r--r--lib/Parse/ParseObjc.cpp10
1 files changed, 6 insertions, 4 deletions
diff --git a/lib/Parse/ParseObjc.cpp b/lib/Parse/ParseObjc.cpp
index cc13a5e0ae..f52ecfb7fb 100644
--- a/lib/Parse/ParseObjc.cpp
+++ b/lib/Parse/ParseObjc.cpp
@@ -684,6 +684,7 @@ Parser::DeclTy *Parser::ParseObjCMethodDecl(SourceLocation mLoc,
return 0;
}
+ llvm::SmallVector<Declarator, 8> CargNames;
if (Tok.isNot(tok::colon)) {
// If attributes exist after the method, parse them.
AttributeList *MethodAttrs = 0;
@@ -693,7 +694,8 @@ Parser::DeclTy *Parser::ParseObjCMethodDecl(SourceLocation mLoc,
Selector Sel = PP.getSelectorTable().getNullarySelector(SelIdent);
return Actions.ActOnMethodDeclaration(mLoc, Tok.getLocation(),
mType, IDecl, DSRet, ReturnType, Sel,
- 0, 0, 0, MethodAttrs, MethodImplKind);
+ 0, 0, 0, CargNames,
+ MethodAttrs, MethodImplKind);
}
llvm::SmallVector<IdentifierInfo *, 12> KeyIdents;
@@ -748,13 +750,12 @@ Parser::DeclTy *Parser::ParseObjCMethodDecl(SourceLocation mLoc,
ConsumeToken();
break;
}
- // FIXME: implement this...
- // Parse the c-style argument declaration-specifier.
DeclSpec DS;
ParseDeclarationSpecifiers(DS);
// Parse the declarator.
Declarator ParmDecl(DS, Declarator::PrototypeContext);
ParseDeclarator(ParmDecl);
+ CargNames.push_back(ParmDecl);
}
// FIXME: Add support for optional parmameter list...
@@ -768,7 +769,8 @@ Parser::DeclTy *Parser::ParseObjCMethodDecl(SourceLocation mLoc,
return Actions.ActOnMethodDeclaration(mLoc, Tok.getLocation(),
mType, IDecl, DSRet, ReturnType, Sel,
&ArgTypeQuals[0], &KeyTypes[0],
- &ArgNames[0], MethodAttrs,
+ &ArgNames[0], CargNames,
+ MethodAttrs,
MethodImplKind, isVariadic);
}