From: Steve Naroff Date: Tue, 2 Oct 2007 22:39:18 +0000 (+0000) Subject: Rename several ObjC action methods to use the "ActOn" prefix (still a few more to... X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=37e58d104d7756f7c18f525b74e46b8eeec8ef81;p=clang Rename several ObjC action methods to use the "ActOn" prefix (still a few more to do). Remove Action::ObjCStartCategoryInterface/ObjCFinishInterface - they are unused. . git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@42559 91177308-0d34-0410-b5e6-96231b3b80d8 --- diff --git a/Parse/MinimalAction.cpp b/Parse/MinimalAction.cpp index d9fc5c539c..dc0a9cc4e9 100644 --- a/Parse/MinimalAction.cpp +++ b/Parse/MinimalAction.cpp @@ -93,10 +93,10 @@ MinimalAction::ObjcStartProtoInterface(Scope* S, return 0; } -/// ObjcClassDeclaration - +/// ActOnForwardClassDeclaration - /// Scope will always be top level file scope. Action::DeclTy * -MinimalAction::ObjcClassDeclaration(Scope *S, SourceLocation AtClassLoc, +MinimalAction::ActOnForwardClassDeclaration(Scope *S, SourceLocation AtClassLoc, IdentifierInfo **IdentList, unsigned NumElts) { for (unsigned i = 0; i != NumElts; ++i) { TypeNameInfo *TI = @@ -110,11 +110,11 @@ MinimalAction::ObjcClassDeclaration(Scope *S, SourceLocation AtClassLoc, return 0; } -/// ObjcForwardProtocolDeclaration - +/// ActOnForwardProtocolDeclaration - /// Scope will always be top level file scope. Action::DeclTy * -MinimalAction::ObjcForwardProtocolDeclaration(Scope *S, SourceLocation AtClassLoc, - IdentifierInfo **IdentList, unsigned NumElts) { +MinimalAction::ActOnForwardProtocolDeclaration(Scope *S, + SourceLocation AtClassLoc, IdentifierInfo **IdentList, unsigned NumElts) { for (unsigned i = 0; i != NumElts; ++i) { TypeNameInfo *TI = new TypeNameInfo(1, IdentList[i]->getFETokenInfo()); diff --git a/Parse/ParseObjc.cpp b/Parse/ParseObjc.cpp index cda2ab5fe6..eaf198fc92 100644 --- a/Parse/ParseObjc.cpp +++ b/Parse/ParseObjc.cpp @@ -80,7 +80,7 @@ Parser::DeclTy *Parser::ParseObjCAtClassDeclaration(SourceLocation atLoc) { if (ExpectAndConsume(tok::semi, diag::err_expected_semi_after, "@class")) return 0; - return Actions.ObjcClassDeclaration(CurScope, atLoc, + return Actions.ActOnForwardClassDeclaration(CurScope, atLoc, &ClassNames[0], ClassNames.size()); } @@ -684,9 +684,9 @@ Parser::DeclTy *Parser::ParseObjCMethodDecl(tok::TokenKind mType, methodAttrs = ParseAttributes(); Selector Sel = ObjcGetKeywordSelector(KeyIdents); - return Actions.ObjcBuildMethodDeclaration(mLoc, mType, ReturnType, Sel, - &KeyTypes[0], &ArgNames[0], - methodAttrs, MethodImplKind); + return Actions.ActOnMethodDeclaration(mLoc, mType, ReturnType, Sel, + &KeyTypes[0], &ArgNames[0], + methodAttrs, MethodImplKind); } else if (!selIdent) { Diag(Tok, diag::err_expected_ident); // missing selector name. } @@ -695,8 +695,8 @@ Parser::DeclTy *Parser::ParseObjCMethodDecl(tok::TokenKind mType, methodAttrs = ParseAttributes(); Selector Sel = ObjcGetUnarySelector(selIdent); - return Actions.ObjcBuildMethodDeclaration(mLoc, mType, ReturnType, Sel, - 0, 0, methodAttrs, MethodImplKind); + return Actions.ActOnMethodDeclaration(mLoc, mType, ReturnType, Sel, + 0, 0, methodAttrs, MethodImplKind); } /// objc-protocol-refs: @@ -866,9 +866,9 @@ Parser::DeclTy *Parser::ParseObjCAtProtocolDeclaration(SourceLocation AtLoc) { return 0; } if (ProtocolRefs.size() > 0) - return Actions.ObjcForwardProtocolDeclaration(CurScope, AtLoc, - &ProtocolRefs[0], - ProtocolRefs.size()); + return Actions.ActOnForwardProtocolDeclaration(CurScope, AtLoc, + &ProtocolRefs[0], + ProtocolRefs.size()); // Last, and definitely not least, parse a protocol declaration. if (Tok.getKind() == tok::less) { if (ParseObjCProtocolReferences(ProtocolRefs)) diff --git a/Sema/Sema.h b/Sema/Sema.h index e9dc4d0cb2..6e87331b96 100644 --- a/Sema/Sema.h +++ b/Sema/Sema.h @@ -415,19 +415,19 @@ public: IdentifierInfo *CatName, SourceLocation CatLoc); - virtual DeclTy *ObjcClassDeclaration(Scope *S, SourceLocation AtClassLoc, - IdentifierInfo **IdentList, - unsigned NumElts); - - virtual DeclTy *ObjcForwardProtocolDeclaration(Scope *S, - SourceLocation AtProtocolLoc, - IdentifierInfo **IdentList, - unsigned NumElts); + virtual DeclTy *ActOnForwardClassDeclaration(Scope *S, SourceLocation Loc, + IdentifierInfo **IdentList, + unsigned NumElts); + + virtual DeclTy *ActOnForwardProtocolDeclaration(Scope *S, + SourceLocation AtProtocolLoc, + IdentifierInfo **IdentList, + unsigned NumElts); virtual void ObjcAddMethodsToClass(Scope* S, DeclTy *ClassDecl, DeclTy **allMethods, unsigned allNum); - virtual DeclTy *ObjcBuildMethodDeclaration(SourceLocation MethodLoc, + virtual DeclTy *ActOnMethodDeclaration(SourceLocation MethodLoc, tok::TokenKind MethodType, TypeTy *ReturnType, Selector Sel, // optional arguments. The number of types/arguments is obtained // from the Sel.getNumArgs(). diff --git a/Sema/SemaDecl.cpp b/Sema/SemaDecl.cpp index 82c4596022..69e8b832a5 100644 --- a/Sema/SemaDecl.cpp +++ b/Sema/SemaDecl.cpp @@ -1006,10 +1006,10 @@ Sema::DeclTy *Sema::ObjcStartProtoInterface(Scope* S, return PDecl; } -/// ObjcForwardProtocolDeclaration - +/// ActOnForwardProtocolDeclaration - /// Scope will always be top level file scope. Action::DeclTy * -Sema::ObjcForwardProtocolDeclaration(Scope *S, SourceLocation AtProtocolLoc, +Sema::ActOnForwardProtocolDeclaration(Scope *S, SourceLocation AtProtocolLoc, IdentifierInfo **IdentList, unsigned NumElts) { ObjcForwardProtocolDecl *FDecl = new ObjcForwardProtocolDecl(AtProtocolLoc, NumElts); @@ -1343,11 +1343,12 @@ void Sema::ImplCategoryMethodsVsIntfMethods(ObjcCategoryImplDecl *CatImplDecl, CatClassDecl->getCatName()->getName()); } -/// ObjcClassDeclaration - +/// ActOnForwardClassDeclaration - /// Scope will always be top level file scope. Action::DeclTy * -Sema::ObjcClassDeclaration(Scope *S, SourceLocation AtClassLoc, - IdentifierInfo **IdentList, unsigned NumElts) { +Sema::ActOnForwardClassDeclaration(Scope *S, SourceLocation AtClassLoc, + IdentifierInfo **IdentList, unsigned NumElts) +{ ObjcClassDecl *CDecl = new ObjcClassDecl(AtClassLoc, NumElts); for (unsigned i = 0; i != NumElts; ++i) { @@ -1750,7 +1751,7 @@ void Sema::ObjcAddMethodsToClass(Scope* S, DeclTy *ClassDecl, return; } -Sema::DeclTy *Sema::ObjcBuildMethodDeclaration(SourceLocation MethodLoc, +Sema::DeclTy *Sema::ActOnMethodDeclaration(SourceLocation MethodLoc, tok::TokenKind MethodType, TypeTy *ReturnType, Selector Sel, // optional arguments. The number of types/arguments is obtained // from the Sel.getNumArgs(). diff --git a/clang.xcodeproj/project.pbxproj b/clang.xcodeproj/project.pbxproj index 6389e5fbc4..314ed3ea3c 100644 --- a/clang.xcodeproj/project.pbxproj +++ b/clang.xcodeproj/project.pbxproj @@ -737,7 +737,6 @@ 08FB7793FE84155DC02AAC07 /* Project object */ = { isa = PBXProject; buildConfigurationList = 1DEB923508733DC60010E9CD /* Build configuration list for PBXProject "clang" */; - compatibilityVersion = "Xcode 2.4"; hasScannedForEncodings = 1; mainGroup = 08FB7794FE84155DC02AAC07 /* clang */; projectDirPath = ""; diff --git a/include/clang/Parse/Action.h b/include/clang/Parse/Action.h index 73580badd8..f353dff24e 100644 --- a/include/clang/Parse/Action.h +++ b/include/clang/Parse/Action.h @@ -476,7 +476,7 @@ public: SourceLocation CatLoc) { return 0; } - virtual DeclTy *ObjcBuildMethodDeclaration(SourceLocation MethodLoc, + virtual DeclTy *ActOnMethodDeclaration(SourceLocation MethodLoc, tok::TokenKind MethodType, TypeTy *ReturnType, Selector Sel, // optional arguments. The number of types/arguments is obtained // from the Sel.getNumArgs(). @@ -500,26 +500,20 @@ public: SourceLocation lbrac, SourceLocation rbrac, ExprTy **ArgExprs) { return 0; } - virtual DeclTy *ObjcClassDeclaration(Scope *S, SourceLocation AtClassLoc, - IdentifierInfo **IdentList, - unsigned NumElts) { + virtual DeclTy *ActOnForwardClassDeclaration(Scope *S, + SourceLocation AtClassLoc, + IdentifierInfo **IdentList, + unsigned NumElts) { return 0; } - virtual DeclTy *ObjcForwardProtocolDeclaration(Scope *S, - SourceLocation AtProtocolLoc, - IdentifierInfo **IdentList, - unsigned NumElts) { + virtual DeclTy *ActOnForwardProtocolDeclaration(Scope *S, + SourceLocation AtProtocolLoc, + IdentifierInfo **IdentList, + unsigned NumElts) { return 0; } - virtual void ObjCStartCategoryInterface() { // FIXME - return; - } - virtual void ObjCFinishInterface() { - return; - } - //===----------------------- Obj-C Expressions --------------------------===// virtual ExprResult ParseObjCStringLiteral(ExprTy *string) { return 0; @@ -555,14 +549,15 @@ public: /// they are removed from the IdentifierInfo::FETokenInfo field. virtual void PopScope(SourceLocation Loc, Scope *S); - virtual DeclTy *ObjcClassDeclaration(Scope *S, SourceLocation AtClassLoc, - IdentifierInfo **IdentList, - unsigned NumElts); + virtual DeclTy *ActOnForwardClassDeclaration(Scope *S, + SourceLocation AtClassLoc, + IdentifierInfo **IdentList, + unsigned NumElts); - virtual DeclTy *ObjcForwardProtocolDeclaration(Scope *S, - SourceLocation AtProtocolLoc, - IdentifierInfo **IdentList, - unsigned NumElts); + virtual DeclTy *ActOnForwardProtocolDeclaration(Scope *S, + SourceLocation AtProtocolLoc, + IdentifierInfo **IdentList, + unsigned NumElts); virtual DeclTy *ObjcStartClassInterface(Scope* S, SourceLocation AtInterafceLoc, IdentifierInfo *ClassName, SourceLocation ClassLoc,