forked from OSchip/llvm-project
Patch to parse objective-c's @compatibility_alias directive.
llvm-svn: 41709
This commit is contained in:
parent
d9a1de4c72
commit
d8e12d3df3
|
@ -41,7 +41,7 @@ Parser::DeclTy *Parser::ParseObjCAtDirectives() {
|
|||
case tok::objc_end:
|
||||
return ParseObjCAtEndDeclaration(AtLoc);
|
||||
case tok::objc_compatibility_alias:
|
||||
return ParseObjCAtAliasDeclaration();
|
||||
return ParseObjCAtAliasDeclaration(AtLoc);
|
||||
case tok::objc_synthesize:
|
||||
return ParseObjCPropertySynthesize(AtLoc);
|
||||
case tok::objc_dynamic:
|
||||
|
@ -762,8 +762,26 @@ Parser::DeclTy *Parser::ParseObjCAtEndDeclaration(SourceLocation atLoc) {
|
|||
|
||||
return 0;
|
||||
}
|
||||
Parser::DeclTy *Parser::ParseObjCAtAliasDeclaration() {
|
||||
assert(0 && "Unimp");
|
||||
|
||||
/// compatibility-alias-decl:
|
||||
/// @compatibility_alias alias-name class-name ';'
|
||||
///
|
||||
Parser::DeclTy *Parser::ParseObjCAtAliasDeclaration(SourceLocation atLoc) {
|
||||
assert(Tok.isObjCAtKeyword(tok::objc_compatibility_alias) &&
|
||||
"ParseObjCAtAliasDeclaration(): Expected @compatibility_alias");
|
||||
ConsumeToken(); // consume compatibility_alias
|
||||
if (Tok.getKind() != tok::identifier) {
|
||||
Diag(Tok, diag::err_expected_ident);
|
||||
return 0;
|
||||
}
|
||||
ConsumeToken(); // consume alias-name
|
||||
if (Tok.getKind() != tok::identifier) {
|
||||
Diag(Tok, diag::err_expected_ident);
|
||||
return 0;
|
||||
}
|
||||
ConsumeToken(); // consume class-name;
|
||||
if (Tok.getKind() != tok::semi)
|
||||
Diag(Tok, diag::err_expected_semi_after, "@synthesize");
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
|
|
@ -264,7 +264,7 @@ private:
|
|||
DeclTy *ParseObjCAtProtocolDeclaration(SourceLocation atLoc);
|
||||
DeclTy *ParseObjCAtImplementationDeclaration(SourceLocation atLoc);
|
||||
DeclTy *ParseObjCAtEndDeclaration(SourceLocation atLoc);
|
||||
DeclTy *ParseObjCAtAliasDeclaration();
|
||||
DeclTy *ParseObjCAtAliasDeclaration(SourceLocation atLoc);
|
||||
DeclTy *ParseObjCPropertySynthesize(SourceLocation atLoc);
|
||||
DeclTy *ParseObjCPropertyDynamic(SourceLocation atLoc);
|
||||
|
||||
|
|
Loading…
Reference in New Issue