diff options
author | Fariborz Jahanian <fjahanian@apple.com> | 2010-04-08 00:30:06 +0000 |
---|---|---|
committer | Fariborz Jahanian <fjahanian@apple.com> | 2010-04-08 00:30:06 +0000 |
commit | 60462098d424928f932582aa16dddaedda321151 (patch) | |
tree | 6f5a570e3ec12e129a54d7f9ad91e7261d0ef0db /clang/lib/Parse/ParseObjc.cpp | |
parent | 79f67a7495057878a1a3711859596611b0364c57 (diff) | |
download | bcm5719-llvm-60462098d424928f932582aa16dddaedda321151.tar.gz bcm5719-llvm-60462098d424928f932582aa16dddaedda321151.zip |
Patch to implement gcc's cstyle arguments in objc
methods. wip.
llvm-svn: 100734
Diffstat (limited to 'clang/lib/Parse/ParseObjc.cpp')
-rw-r--r-- | clang/lib/Parse/ParseObjc.cpp | 17 |
1 files changed, 13 insertions, 4 deletions
diff --git a/clang/lib/Parse/ParseObjc.cpp b/clang/lib/Parse/ParseObjc.cpp index 155e3520731..cd42aee255c 100644 --- a/clang/lib/Parse/ParseObjc.cpp +++ b/clang/lib/Parse/ParseObjc.cpp @@ -823,7 +823,7 @@ Parser::DeclPtrTy Parser::ParseObjCMethodDecl(SourceLocation mLoc, return DeclPtrTy(); } - llvm::SmallVector<Declarator, 8> CargNames; + llvm::SmallVector<DeclaratorChunk::ParamInfo, 8> CParamInfo; if (Tok.isNot(tok::colon)) { // If attributes exist after the method, parse them. if (getLang().ObjC2 && Tok.is(tok::kw___attribute)) @@ -834,7 +834,9 @@ Parser::DeclPtrTy Parser::ParseObjCMethodDecl(SourceLocation mLoc, DeclPtrTy Result = Actions.ActOnMethodDeclaration(mLoc, Tok.getLocation(), mType, IDecl, DSRet, ReturnType, Sel, - 0, CargNames, MethodAttrs.get(), + 0, + CParamInfo.data(), CParamInfo.size(), + MethodAttrs.get(), MethodImplKind); PD.complete(Result); return Result; @@ -897,7 +899,13 @@ Parser::DeclPtrTy Parser::ParseObjCMethodDecl(SourceLocation mLoc, // Parse the declarator. Declarator ParmDecl(DS, Declarator::PrototypeContext); ParseDeclarator(ParmDecl); - CargNames.push_back(ParmDecl); + IdentifierInfo *ParmII = ParmDecl.getIdentifier(); + DeclPtrTy Param = Actions.ActOnParamDeclarator(CurScope, ParmDecl); + CParamInfo.push_back(DeclaratorChunk::ParamInfo(ParmII, + ParmDecl.getIdentifierLoc(), + Param, + 0)); + } // FIXME: Add support for optional parmameter list... @@ -913,7 +921,8 @@ Parser::DeclPtrTy Parser::ParseObjCMethodDecl(SourceLocation mLoc, DeclPtrTy Result = Actions.ActOnMethodDeclaration(mLoc, Tok.getLocation(), mType, IDecl, DSRet, ReturnType, Sel, - &ArgInfos[0], CargNames, + &ArgInfos[0], + CParamInfo.data(), CParamInfo.size(), MethodAttrs.get(), MethodImplKind, isVariadic); PD.complete(Result); |