aboutsummaryrefslogtreecommitdiff
path: root/Parse/ParseObjc.cpp
diff options
context:
space:
mode:
authorFariborz Jahanian <fjahanian@apple.com>2007-10-31 23:53:01 +0000
committerFariborz Jahanian <fjahanian@apple.com>2007-10-31 23:53:01 +0000
commitf1de0ca05e2df6f23bd559028693a12d1ebdaaf6 (patch)
treed96d939dd0bca45a74bd3165e9b6b8ba586b87f5 /Parse/ParseObjc.cpp
parent50b5a30db40322880340e957ad7d6d8d60bb4c5b (diff)
1) More additions for objective-c's qualifier type.
2) Fixed a test failure (which should have failed all along!). git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@43589 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'Parse/ParseObjc.cpp')
-rw-r--r--Parse/ParseObjc.cpp23
1 files changed, 14 insertions, 9 deletions
diff --git a/Parse/ParseObjc.cpp b/Parse/ParseObjc.cpp
index 301b04148a..69124f2939 100644
--- a/Parse/ParseObjc.cpp
+++ b/Parse/ParseObjc.cpp
@@ -471,14 +471,13 @@ bool Parser::isObjCPropertyAttribute() {
/// objc-type-qualifier
/// objc-type-qualifiers objc-type-qualifier
///
-Parser::TypeTy *Parser::ParseObjCTypeName() {
+Parser::TypeTy *Parser::ParseObjCTypeName(ObjcDeclSpec &DS) {
assert(Tok.is(tok::l_paren) && "expected (");
SourceLocation LParenLoc = ConsumeParen(), RParenLoc;
TypeTy *Ty = 0;
// Parse type qualifiers, in, inout, etc.
- ObjcDeclSpec DS;
ParseObjcTypeQualifierList(DS);
if (isTypeSpecifierQualifier()) {
@@ -528,8 +527,9 @@ Parser::DeclTy *Parser::ParseObjCMethodDecl(SourceLocation mLoc,
{
// Parse the return type.
TypeTy *ReturnType = 0;
+ ObjcDeclSpec DSRet;
if (Tok.is(tok::l_paren))
- ReturnType = ParseObjCTypeName();
+ ReturnType = ParseObjCTypeName(DSRet);
SourceLocation selLoc;
IdentifierInfo *SelIdent = ParseObjCSelector(selLoc);
if (Tok.isNot(tok::colon)) {
@@ -546,12 +546,13 @@ Parser::DeclTy *Parser::ParseObjCMethodDecl(SourceLocation mLoc,
Selector Sel = PP.getSelectorTable().getNullarySelector(SelIdent);
return Actions.ActOnMethodDeclaration(mLoc, Tok.getLocation(),
- mType, ReturnType, Sel,
- 0, 0, MethodAttrs, MethodImplKind);
+ mType, DSRet, ReturnType, Sel,
+ 0, 0, 0, MethodAttrs, MethodImplKind);
}
llvm::SmallVector<IdentifierInfo *, 12> KeyIdents;
llvm::SmallVector<Action::TypeTy *, 12> KeyTypes;
+ llvm::SmallVector<ObjcDeclSpec, 12> ArgTypeQuals;
llvm::SmallVector<IdentifierInfo *, 12> ArgNames;
Action::TypeTy *TypeInfo;
@@ -564,11 +565,14 @@ Parser::DeclTy *Parser::ParseObjCMethodDecl(SourceLocation mLoc,
break;
}
ConsumeToken(); // Eat the ':'.
- if (Tok.is(tok::l_paren)) // Parse the argument type.
- TypeInfo = ParseObjCTypeName();
+ ObjcDeclSpec DSType;
+ if (Tok.is(tok::l_paren)) { // Parse the argument type.
+ TypeInfo = ParseObjCTypeName(DSType);
+ }
else
TypeInfo = 0;
KeyTypes.push_back(TypeInfo);
+ ArgTypeQuals.push_back(DSType);
// If attributes exist before the argument name, parse them.
if (getLang().ObjC2 && Tok.is(tok::kw___attribute))
@@ -613,8 +617,9 @@ Parser::DeclTy *Parser::ParseObjCMethodDecl(SourceLocation mLoc,
Selector Sel = PP.getSelectorTable().getSelector(KeyIdents.size(),
&KeyIdents[0]);
return Actions.ActOnMethodDeclaration(mLoc, Tok.getLocation(),
- mType, ReturnType, Sel,
- &KeyTypes[0], &ArgNames[0],
+ mType, DSRet, ReturnType, Sel,
+ &ArgTypeQuals[0], &KeyTypes[0],
+ &ArgNames[0],
MethodAttrs, MethodImplKind);
}