[cfe-commits] r61964 - in /cfe/trunk: include/clang/Parse/Action.h lib/Parse/ParseObjc.cpp lib/Sema/Sema.h lib/Sema/SemaDeclObjC.cpp
Fariborz Jahanian
fjahanian at apple.com
Thu Jan 8 16:38:19 PST 2009
Author: fjahanian
Date: Thu Jan 8 18:38:19 2009
New Revision: 61964
URL: http://llvm.org/viewvc/llvm-project?rev=61964&view=rev
Log:
Adding support for ObjC methods which have c-style
parameter list. This is work in progress.
Modified:
cfe/trunk/include/clang/Parse/Action.h
cfe/trunk/lib/Parse/ParseObjc.cpp
cfe/trunk/lib/Sema/Sema.h
cfe/trunk/lib/Sema/SemaDeclObjC.cpp
Modified: cfe/trunk/include/clang/Parse/Action.h
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/include/clang/Parse/Action.h?rev=61964&r1=61963&r2=61964&view=diff
==============================================================================
--- cfe/trunk/include/clang/Parse/Action.h (original)
+++ cfe/trunk/include/clang/Parse/Action.h Thu Jan 8 18:38:19 2009
@@ -1133,6 +1133,7 @@
ObjCDeclSpec *ArgQT, // for arguments' in inout etc.
TypeTy **ArgTypes, // non-zero when Sel.getNumArgs() > 0
IdentifierInfo **ArgNames, // non-zero when Sel.getNumArgs() > 0
+ llvm::SmallVectorImpl<Declarator> &Cdecls, // c-style args
AttributeList *AttrList, // optional
// tok::objc_not_keyword, tok::objc_optional, tok::objc_required
tok::ObjCKeywordKind impKind,
Modified: cfe/trunk/lib/Parse/ParseObjc.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Parse/ParseObjc.cpp?rev=61964&r1=61963&r2=61964&view=diff
==============================================================================
--- cfe/trunk/lib/Parse/ParseObjc.cpp (original)
+++ cfe/trunk/lib/Parse/ParseObjc.cpp Thu Jan 8 18:38:19 2009
@@ -684,6 +684,7 @@
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 @@
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 @@
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 @@
return Actions.ActOnMethodDeclaration(mLoc, Tok.getLocation(),
mType, IDecl, DSRet, ReturnType, Sel,
&ArgTypeQuals[0], &KeyTypes[0],
- &ArgNames[0], MethodAttrs,
+ &ArgNames[0], CargNames,
+ MethodAttrs,
MethodImplKind, isVariadic);
}
Modified: cfe/trunk/lib/Sema/Sema.h
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Sema/Sema.h?rev=61964&r1=61963&r2=61964&view=diff
==============================================================================
--- cfe/trunk/lib/Sema/Sema.h (original)
+++ cfe/trunk/lib/Sema/Sema.h Thu Jan 8 18:38:19 2009
@@ -1208,6 +1208,7 @@
// optional arguments. The number of types/arguments is obtained
// from the Sel.getNumArgs().
ObjCDeclSpec *ArgQT, TypeTy **ArgTypes, IdentifierInfo **ArgNames,
+ llvm::SmallVectorImpl<Declarator> &Cdecls,
AttributeList *AttrList, tok::ObjCKeywordKind MethodImplKind,
bool isVariadic = false);
Modified: cfe/trunk/lib/Sema/SemaDeclObjC.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Sema/SemaDeclObjC.cpp?rev=61964&r1=61963&r2=61964&view=diff
==============================================================================
--- cfe/trunk/lib/Sema/SemaDeclObjC.cpp (original)
+++ cfe/trunk/lib/Sema/SemaDeclObjC.cpp Thu Jan 8 18:38:19 2009
@@ -1272,6 +1272,7 @@
// optional arguments. The number of types/arguments is obtained
// from the Sel.getNumArgs().
ObjCDeclSpec *ArgQT, TypeTy **ArgTypes, IdentifierInfo **ArgNames,
+ llvm::SmallVectorImpl<Declarator> &Cdecls,
AttributeList *AttrList, tok::ObjCKeywordKind MethodDeclKind,
bool isVariadic) {
Decl *ClassDecl = static_cast<Decl*>(classDecl);
More information about the cfe-commits
mailing list