summaryrefslogtreecommitdiffstats
path: root/clang
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
commite84858ccf9aa4dee74686140a5a2f6905bb36673 (patch)
treef9ec6b89877fbb58e50483082165cabf4efad9f3 /clang
parentb54c19a7549d296741d5d228dee4a34bdfef2338 (diff)
downloadbcm5719-llvm-e84858ccf9aa4dee74686140a5a2f6905bb36673.tar.gz
bcm5719-llvm-e84858ccf9aa4dee74686140a5a2f6905bb36673.zip
Adding support for ObjC methods which have c-style
parameter list. This is work in progress. llvm-svn: 61964
Diffstat (limited to 'clang')
-rw-r--r--clang/include/clang/Parse/Action.h1
-rw-r--r--clang/lib/Parse/ParseObjc.cpp10
-rw-r--r--clang/lib/Sema/Sema.h1
-rw-r--r--clang/lib/Sema/SemaDeclObjC.cpp1
4 files changed, 9 insertions, 4 deletions
diff --git a/clang/include/clang/Parse/Action.h b/clang/include/clang/Parse/Action.h
index 4c524f48d2d..257d62f46be 100644
--- a/clang/include/clang/Parse/Action.h
+++ b/clang/include/clang/Parse/Action.h
@@ -1133,6 +1133,7 @@ public:
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,
diff --git a/clang/lib/Parse/ParseObjc.cpp b/clang/lib/Parse/ParseObjc.cpp
index cc13a5e0ae1..f52ecfb7fb1 100644
--- a/clang/lib/Parse/ParseObjc.cpp
+++ b/clang/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);
}
diff --git a/clang/lib/Sema/Sema.h b/clang/lib/Sema/Sema.h
index 61be6445d12..bd7e0364a7a 100644
--- a/clang/lib/Sema/Sema.h
+++ b/clang/lib/Sema/Sema.h
@@ -1208,6 +1208,7 @@ public:
// 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);
diff --git a/clang/lib/Sema/SemaDeclObjC.cpp b/clang/lib/Sema/SemaDeclObjC.cpp
index 7623c08e152..3dfcb3a8012 100644
--- a/clang/lib/Sema/SemaDeclObjC.cpp
+++ b/clang/lib/Sema/SemaDeclObjC.cpp
@@ -1272,6 +1272,7 @@ Sema::DeclTy *Sema::ActOnMethodDeclaration(
// 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);
OpenPOWER on IntegriCloud