]> granicus.if.org Git - clang/commitdiff
Start converting Action methods from Parse-prefix to ActOn-prefix.
authorSteve Naroff <snaroff@apple.com>
Sat, 15 Sep 2007 18:49:24 +0000 (18:49 +0000)
committerSteve Naroff <snaroff@apple.com>
Sat, 15 Sep 2007 18:49:24 +0000 (18:49 +0000)
The previous naming scheme was confusing, since it resulted in both the Parser and Action modules having methods with the same name. In addition, the Action module never does any parsing...

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@41986 91177308-0d34-0410-b5e6-96231b3b80d8

14 files changed:
Driver/PrintParserCallbacks.cpp
Parse/MinimalAction.cpp
Parse/ParseDecl.cpp
Parse/ParseExpr.cpp
Parse/ParseObjc.cpp
Parse/Parser.cpp
Sema/Sema.h
Sema/SemaDecl.cpp
Sema/SemaExpr.cpp
Sema/SemaType.cpp
clang.xcodeproj/project.pbxproj
include/clang/AST/Decl.h
include/clang/Parse/Action.h
include/clang/Parse/AttributeList.h

index 3e37514bb288705a9d0932f497d7fc64a803c502..0ed922371f08f87fa6b3884e1780b8fccf5ce9eb 100644 (file)
@@ -22,12 +22,12 @@ using namespace clang;
 namespace {
   class ParserPrintActions : public MinimalAction {
     
-    /// ParseDeclarator - This callback is invoked when a declarator is parsed
+    /// ActOnDeclarator - This callback is invoked when a declarator is parsed
     /// and 'Init' specifies the initializer if any.  This is for things like:
     /// "int X = 4" or "typedef int foo".
-    virtual DeclTy *ParseDeclarator(Scope *S, Declarator &D,
+    virtual DeclTy *ActOnDeclarator(Scope *S, Declarator &D,
                                     DeclTy *LastInGroup) {
-      std::cout << "ParseDeclarator ";
+      std::cout << "ActOnDeclarator ";
       if (IdentifierInfo *II = D.getIdentifier()) {
         std::cout << "'" << II->getName() << "'";
       } else {
@@ -36,7 +36,7 @@ namespace {
       std::cout << "\n";
       
       // Pass up to EmptyActions so that the symbol table is maintained right.
-      return MinimalAction::ParseDeclarator(S, D, LastInGroup);
+      return MinimalAction::ActOnDeclarator(S, D, LastInGroup);
     }
     
     /// PopScope - This callback is called immediately before the specified scope
index 377a2e7732bee90d8b308aaa73569acff37b439e..019e652dde801f875f9d66cadd38fdc9ec1a20aa 100644 (file)
@@ -39,11 +39,11 @@ MinimalAction::isTypeName(const IdentifierInfo &II, Scope *S) const {
   return 0;
 }
 
-/// ParseDeclarator - If this is a typedef declarator, we modify the
+/// ActOnDeclarator - If this is a typedef declarator, we modify the
 /// IdentifierInfo::FETokenInfo field to keep track of this fact, until S is
 /// popped.
 Action::DeclTy *
-MinimalAction::ParseDeclarator(Scope *S, Declarator &D, DeclTy *LastInGroup) {
+MinimalAction::ActOnDeclarator(Scope *S, Declarator &D, DeclTy *LastInGroup) {
   IdentifierInfo *II = D.getIdentifier();
   
   // If there is no identifier associated with this declarator, bail out.
index 9dd0d95d7908fed8914036a86508feb4d206e98e..7fbab64d11e3fcf22f1f0e5f37119f896bdf5c40 100644 (file)
@@ -33,7 +33,7 @@ Parser::TypeTy *Parser::ParseTypeName() {
   Declarator DeclaratorInfo(DS, Declarator::TypeNameContext);
   ParseDeclarator(DeclaratorInfo);
   
-  return Actions.ParseTypeName(CurScope, DeclaratorInfo).Val;
+  return Actions.ActOnTypeName(CurScope, DeclaratorInfo).Val;
 }
 
 /// ParseAttributes - Parse a non-empty attributes list.
@@ -265,7 +265,7 @@ ParseInitDeclaratorListAfterFirstDeclarator(Declarator &D) {
 
     // Inform the current actions module that we just parsed this declarator.
     // FIXME: pass asm & attributes.
-    LastDeclInGroup = Actions.ParseDeclarator(CurScope, D, LastDeclInGroup);
+    LastDeclInGroup = Actions.ActOnDeclarator(CurScope, D, LastDeclInGroup);
         
     // Parse declarator '=' initializer.
     ExprResult Init;
@@ -589,7 +589,7 @@ bool Parser::ParseTag(DeclTy *&Decl, unsigned TagType, SourceLocation StartLoc){
     TK = Action::TK_Declaration;
   else
     TK = Action::TK_Reference;
-  Decl = Actions.ParseTag(CurScope, TagType, TK, StartLoc, Name, NameLoc, Attr);
+  Decl = Actions.ActOnTag(CurScope, TagType, TK, StartLoc, Name, NameLoc, Attr);
   return false;
 }
 
@@ -686,7 +686,7 @@ void Parser::ParseStructDeclaration(DeclTy *TagDecl,
       DeclaratorInfo.AddAttributes(ParseAttributes());
     
     // Install the declarator into the current TagDecl.
-    DeclTy *Field = Actions.ParseField(CurScope, TagDecl, SpecQualLoc,
+    DeclTy *Field = Actions.ActOnField(CurScope, TagDecl, SpecQualLoc,
                                        DeclaratorInfo, BitfieldSize);
     FieldDecls.push_back(Field);
     
@@ -757,7 +757,7 @@ void Parser::ParseStructUnionBody(SourceLocation RecordLoc,
   
   MatchRHSPunctuation(tok::r_brace, LBraceLoc);
   
-  Actions.ProcessFieldDecls(RecordLoc,TagDecl,&FieldDecls[0],FieldDecls.size());
+  Actions.ActOnFields(RecordLoc,TagDecl,&FieldDecls[0],FieldDecls.size());
   
   AttributeList *AttrList = 0;
   // If attributes exist after struct contents, parse them.
@@ -830,7 +830,7 @@ void Parser::ParseEnumBody(SourceLocation StartLoc, DeclTy *EnumDecl) {
     }
     
     // Install the enumerator constant into EnumDecl.
-    DeclTy *EnumConstDecl = Actions.ParseEnumConstant(CurScope, EnumDecl,
+    DeclTy *EnumConstDecl = Actions.ActOnEnumConstant(CurScope, EnumDecl,
                                                       LastEnumConstDecl,
                                                       IdentLoc, Ident,
                                                       EqualLoc, AssignedVal);
@@ -848,7 +848,7 @@ void Parser::ParseEnumBody(SourceLocation StartLoc, DeclTy *EnumDecl) {
   // Eat the }.
   MatchRHSPunctuation(tok::r_brace, LBraceLoc);
 
-  Actions.ParseEnumBody(StartLoc, EnumDecl, &EnumConstantDecls[0],
+  Actions.ActOnEnumBody(StartLoc, EnumDecl, &EnumConstantDecls[0],
                         EnumConstantDecls.size());
   
   DeclTy *AttrList = 0;
@@ -1322,7 +1322,7 @@ void Parser::ParseParenDeclarator(Declarator &D) {
       // Inform the actions module about the parameter declarator, so it gets
       // added to the current scope.
       Action::TypeResult ParamTy =
-        Actions.ParseParamDeclaratorType(CurScope, ParmDecl);
+        Actions.ActOnParamDeclaratorType(CurScope, ParmDecl);
         
       // Remember this parsed parameter in ParamInfo.
       IdentifierInfo *ParmII = ParmDecl.getIdentifier();
index f030e5d91d5beb7b95b3a909ca831441954bc0fc..95c305ec088d75f25364e305f12792c27c562e89 100644 (file)
@@ -200,7 +200,7 @@ ParseExpressionWithLeadingIdentifier(const Token &IdTok) {
   //   primary-expression: identifier
   
   // Let the actions module handle the identifier.
-  ExprResult Res = Actions.ParseIdentifierExpr(CurScope, IdTok.getLocation(),
+  ExprResult Res = Actions.ActOnIdentifierExpr(CurScope, IdTok.getLocation(),
                                                *IdTok.getIdentifierInfo(),
                                                Tok.getKind() == tok::l_paren);
   
@@ -231,7 +231,7 @@ ParseAssignmentExprWithLeadingIdentifier(const Token &IdTok) {
   //   primary-expression: identifier
   
   // Let the actions module handle the identifier.
-  ExprResult Res = Actions.ParseIdentifierExpr(CurScope, IdTok.getLocation(),
+  ExprResult Res = Actions.ActOnIdentifierExpr(CurScope, IdTok.getLocation(),
                                                *IdTok.getIdentifierInfo(),
                                                Tok.getKind() == tok::l_paren);
   
@@ -513,7 +513,7 @@ Parser::ExprResult Parser::ParseCastExpression(bool isUnaryExpression) {
     // not.
     IdentifierInfo &II = *Tok.getIdentifierInfo();
     SourceLocation L = ConsumeToken();
-    Res = Actions.ParseIdentifierExpr(CurScope, L, II,
+    Res = Actions.ActOnIdentifierExpr(CurScope, L, II,
                                       Tok.getKind() == tok::l_paren);
     // These can be followed by postfix-expr pieces.
     return ParsePostfixExpressionSuffix(Res);
index 791057b627adbb74fa93732a029c3c109102b635..8fa071a3fe8d28830e64cad01270cf2cb22e0131 100644 (file)
@@ -659,9 +659,9 @@ void Parser::ParseObjCClassInstanceVariables(DeclTy *interfaceDecl) {
     }
   }
   if (AllIvarDecls.size()) {  // Check for {} - no ivars in braces
-    Actions.ProcessFieldDecls(LBraceLoc, interfaceDecl, 
-                             &AllIvarDecls[0], AllIvarDecls.size(),
-                              &AllVisibilities[0]);
+    Actions.ActOnFields(LBraceLoc, interfaceDecl, 
+                        &AllIvarDecls[0], AllIvarDecls.size(),
+                        &AllVisibilities[0]);
   }
   MatchRHSPunctuation(tok::r_brace, LBraceLoc);
   return;
index 21ef54da0ff0701861f4c81817f5d8682f79ada9..b9bcc929a5f6957e0511e7451c2b7a7c5a7d78b3 100644 (file)
@@ -242,7 +242,7 @@ void Parser::Initialize() {
     
     Declarator D(DS, Declarator::FileContext);
     D.SetIdentifier(PP.getIdentifierInfo("__builtin_va_list"),SourceLocation());
-    Actions.ParseDeclarator(CurScope, D, 0);
+    Actions.ActOnDeclarator(CurScope, D, 0);
   }
   
   if (Tok.getKind() == tok::eof &&
@@ -547,7 +547,7 @@ void Parser::ParseKNRParamDeclarations(Declarator &D) {
       
       // Ask the actions module to compute the type for this declarator.
       Action::TypeResult TR =
-        Actions.ParseParamDeclaratorType(CurScope, ParmDeclarator);
+        Actions.ActOnParamDeclaratorType(CurScope, ParmDeclarator);
 
       if (!TR.isInvalid && 
           // A missing identifier has already been diagnosed.
index a9e33f423a23e6424792476650179d06b2250204..e304f07eeaebb0081d885c4f0893dc65147f62c8 100644 (file)
@@ -130,15 +130,15 @@ public:
   //
   QualType GetTypeForDeclarator(Declarator &D, Scope *S);
   
-  virtual TypeResult ParseTypeName(Scope *S, Declarator &D);
+  virtual TypeResult ActOnTypeName(Scope *S, Declarator &D);
   
-  virtual TypeResult ParseParamDeclaratorType(Scope *S, Declarator &D);
+  virtual TypeResult ActOnParamDeclaratorType(Scope *S, Declarator &D);
 private:
   //===--------------------------------------------------------------------===//
   // Symbol table / Decl tracking callbacks: SemaDecl.cpp.
   //
   virtual DeclTy *isTypeName(const IdentifierInfo &II, Scope *S) const;
-  virtual DeclTy *ParseDeclarator(Scope *S, Declarator &D, DeclTy *LastInGroup);
+  virtual DeclTy *ActOnDeclarator(Scope *S, Declarator &D, DeclTy *LastInGroup);
   void AddInitializerToDecl(DeclTy *dcl, ExprTy *init);
   virtual DeclTy *FinalizeDeclaratorGroup(Scope *S, DeclTy *Group);
 
@@ -150,24 +150,24 @@ private:
   /// no declarator (e.g. "struct foo;") is parsed.
   virtual DeclTy *ParsedFreeStandingDeclSpec(Scope *S, DeclSpec &DS);  
   
-  virtual DeclTy *ParseTag(Scope *S, unsigned TagType, TagKind TK,
+  virtual DeclTy *ActOnTag(Scope *S, unsigned TagType, TagKind TK,
                            SourceLocation KWLoc, IdentifierInfo *Name,
                            SourceLocation NameLoc, AttributeList *Attr);
-  virtual DeclTy *ParseField(Scope *S, DeclTy *TagDecl,SourceLocation DeclStart,
+  virtual DeclTy *ActOnField(Scope *S, DeclTy *TagDecl,SourceLocation DeclStart,
                              Declarator &D, ExprTy *BitfieldWidth);
                                       
   // This is used for both record definitions and ObjC interface declarations.
-  virtual void ProcessFieldDecls(SourceLocation RecLoc, DeclTy *TagDecl,
+  virtual void ActOnFields(SourceLocation RecLoc, DeclTy *TagDecl,
                                  DeclTy **Fields, unsigned NumFields,
                                  tok::ObjCKeywordKind *visibility = 0);
-  virtual DeclTy *ParseEnumConstant(Scope *S, DeclTy *EnumDecl,
+  virtual DeclTy *ActOnEnumConstant(Scope *S, DeclTy *EnumDecl,
                                     DeclTy *LastEnumConstant,
                                     SourceLocation IdLoc, IdentifierInfo *Id,
                                     SourceLocation EqualLoc, ExprTy *Val);
-  virtual void ParseEnumBody(SourceLocation EnumLoc, DeclTy *EnumDecl,
+  virtual void ActOnEnumBody(SourceLocation EnumLoc, DeclTy *EnumDecl,
                              DeclTy **Elements, unsigned NumElements);
 private:
-  /// Subroutines of ParseDeclarator()...
+  /// Subroutines of ActOnDeclarator()...
   TypedefDecl *ParseTypedefDecl(Scope *S, Declarator &D, ScopedDecl *LastDecl);
   TypedefDecl *MergeTypeDefDecl(TypedefDecl *New, ScopedDecl *Old);
   FunctionDecl *MergeFunctionDecl(FunctionDecl *New, ScopedDecl *Old);
@@ -250,7 +250,7 @@ public:
   // Expression Parsing Callbacks: SemaExpr.cpp.
 
   // Primary Expressions.
-  virtual ExprResult ParseIdentifierExpr(Scope *S, SourceLocation Loc,
+  virtual ExprResult ActOnIdentifierExpr(Scope *S, SourceLocation Loc,
                                          IdentifierInfo &II,
                                          bool HasTrailingLParen);
   virtual ExprResult ParsePreDefinedExpr(SourceLocation Loc,
index b0a3a1266acacbb0a208f9921cf90210ce7abee8..b792b525cc494417c66ea7ebc2b59b0fec41d9fb 100644 (file)
@@ -430,7 +430,7 @@ bool Sema::CheckInitializer(Expr *&Init, QualType &DeclType, bool isStatic) {
 }
 
 Sema::DeclTy *
-Sema::ParseDeclarator(Scope *S, Declarator &D, DeclTy *lastDecl) {
+Sema::ActOnDeclarator(Scope *S, Declarator &D, DeclTy *lastDecl) {
   ScopedDecl *LastDeclarator = dyn_cast_or_null<ScopedDecl>((Decl *)lastDecl);
   IdentifierInfo *II = D.getIdentifier();
   
@@ -759,7 +759,7 @@ Sema::DeclTy *Sema::ParseStartOfFunctionDef(Scope *FnBodyScope, Declarator &D) {
   Scope *GlobalScope = FnBodyScope->getParent();
   
   FunctionDecl *FD =
-    static_cast<FunctionDecl*>(ParseDeclarator(GlobalScope, D, 0));
+    static_cast<FunctionDecl*>(ActOnDeclarator(GlobalScope, D, 0));
   CurFunctionDecl = FD;
   
   // Create Decl objects for each parameter, adding them to the FunctionDecl.
@@ -842,7 +842,7 @@ Decl *Sema::ImplicitlyDefineFunction(SourceLocation Loc, IdentifierInfo &II,
   while (S->getParent())
     S = S->getParent();
   
-  return static_cast<Decl*>(ParseDeclarator(S, D, 0));
+  return static_cast<Decl*>(ActOnDeclarator(S, D, 0));
 }
 
 
@@ -902,11 +902,11 @@ Sema::ObjcClassDeclaration(Scope *S, SourceLocation AtClassLoc,
 }
 
 
-/// ParseTag - This is invoked when we see 'struct foo' or 'struct {'.  In the
+/// ActOnTag - This is invoked when we see 'struct foo' or 'struct {'.  In the
 /// former case, Name will be non-null.  In the later case, Name will be null.
 /// TagType indicates what kind of tag this is. TK indicates whether this is a
 /// reference/declaration/definition of a tag.
-Sema::DeclTy *Sema::ParseTag(Scope *S, unsigned TagType, TagKind TK,
+Sema::DeclTy *Sema::ActOnTag(Scope *S, unsigned TagType, TagKind TK,
                              SourceLocation KWLoc, IdentifierInfo *Name,
                              SourceLocation NameLoc, AttributeList *Attr) {
   // If this is a use of an existing tag, it must have a name.
@@ -1004,9 +1004,9 @@ Sema::DeclTy *Sema::ParseTag(Scope *S, unsigned TagType, TagKind TK,
   return New;
 }
 
-/// ParseField - Each field of a struct/union/class is passed into this in order
+/// ActOnField - Each field of a struct/union/class is passed into this in order
 /// to create a FieldDecl object for it.
-Sema::DeclTy *Sema::ParseField(Scope *S, DeclTy *TagDecl,
+Sema::DeclTy *Sema::ActOnField(Scope *S, DeclTy *TagDecl,
                                SourceLocation DeclStart, 
                                Declarator &D, ExprTy *BitfieldWidth) {
   IdentifierInfo *II = D.getIdentifier();
@@ -1051,7 +1051,7 @@ Sema::DeclTy *Sema::ParseField(Scope *S, DeclTy *TagDecl,
   else if (isa<ObjcInterfaceDecl>(static_cast<Decl *>(TagDecl)))
     NewFD = new ObjcIvarDecl(Loc, II, T);
   else
-    assert(0 && "Sema::ParseField(): Unknown TagDecl");
+    assert(0 && "Sema::ActOnField(): Unknown TagDecl");
     
   if (D.getInvalidType() || InvalidDecl)
     NewFD->setInvalidDecl();
@@ -1080,9 +1080,9 @@ static void ObjcSetIvarVisibility(ObjcIvarDecl *OIvar,
   }
 }
 
-void Sema::ProcessFieldDecls(SourceLocation RecLoc, DeclTy *RecDecl,
-                             DeclTy **Fields, unsigned NumFields,
-                             tok::ObjCKeywordKind *visibility) {
+void Sema::ActOnFields(SourceLocation RecLoc, DeclTy *RecDecl,
+                       DeclTy **Fields, unsigned NumFields,
+                       tok::ObjCKeywordKind *visibility) {
   Decl *EnclosingDecl = static_cast<Decl*>(RecDecl);
   assert(EnclosingDecl && "missing record or interface decl");
   RecordDecl *Record = dyn_cast<RecordDecl>(EnclosingDecl);
@@ -1276,7 +1276,7 @@ Sema::DeclTy *Sema::ObjcBuildMethodDeclaration(SourceLocation MethodLoc,
                            AttrList, MethodType == tok::minus);
 }
 
-Sema::DeclTy *Sema::ParseEnumConstant(Scope *S, DeclTy *theEnumDecl,
+Sema::DeclTy *Sema::ActOnEnumConstant(Scope *S, DeclTy *theEnumDecl,
                                       DeclTy *lastEnumConst,
                                       SourceLocation IdLoc, IdentifierInfo *Id,
                                       SourceLocation EqualLoc, ExprTy *val) {
@@ -1352,7 +1352,7 @@ Sema::DeclTy *Sema::ParseEnumConstant(Scope *S, DeclTy *theEnumDecl,
   return New;
 }
 
-void Sema::ParseEnumBody(SourceLocation EnumLoc, DeclTy *EnumDeclX,
+void Sema::ActOnEnumBody(SourceLocation EnumLoc, DeclTy *EnumDeclX,
                          DeclTy **Elements, unsigned NumElements) {
   EnumDecl *Enum = cast<EnumDecl>(static_cast<Decl*>(EnumDeclX));
   assert(!Enum->isDefinition() && "Enum redefinitions can't reach here");
index d2d1f9567c24c476cf8413501c13bb9825c604b7..bc107451d69c94b23636c09e153216e6071d4770 100644 (file)
@@ -53,10 +53,10 @@ Sema::ParseStringLiteral(const Token *StringToks, unsigned NumStringToks) {
 }
 
 
-/// ParseIdentifierExpr - The parser read an identifier in expression context,
+/// ActOnIdentifierExpr - The parser read an identifier in expression context,
 /// validate it per-C99 6.5.1.  HasTrailingLParen indicates whether this
 /// identifier is used in an function call context.
-Sema::ExprResult Sema::ParseIdentifierExpr(Scope *S, SourceLocation Loc,
+Sema::ExprResult Sema::ActOnIdentifierExpr(Scope *S, SourceLocation Loc,
                                            IdentifierInfo &II,
                                            bool HasTrailingLParen) {
   // Could be enum-constant or decl.
@@ -646,7 +646,7 @@ ParseInitList(SourceLocation LBraceLoc, ExprTy **initlist, unsigned NumInit,
               SourceLocation RBraceLoc) {
   Expr **InitList = reinterpret_cast<Expr**>(initlist);
 
-  // Semantic analysis for initializers is done by ParseDeclarator() and
+  // Semantic analysis for initializers is done by ActOnDeclarator() and
   // CheckInitializer() - it requires knowledge of the object being intialized. 
   
   InitListExpr *e = new InitListExpr(LBraceLoc, InitList, NumInit, RBraceLoc);
@@ -1031,7 +1031,7 @@ Sema::AssignmentCheckResult
 Sema::CheckSingleAssignmentConstraints(QualType lhsType, Expr *&rExpr) {
   // This check seems unnatural, however it is necessary to insure the proper
   // conversion of functions/arrays. If the conversion were done for all
-  // DeclExpr's (created by ParseIdentifierExpr), it would mess up the unary
+  // DeclExpr's (created by ActOnIdentifierExpr), it would mess up the unary
   // expressions that surpress this implicit conversion (&, sizeof).
   DefaultFunctionArrayConversion(rExpr);
 
index bf8d48b553d7203ecfd0bff769a247cefa5a6d1f..5340928a19236e4ec42f5c70c30654ffaa6b82d8 100644 (file)
@@ -318,7 +318,7 @@ QualType Sema::GetTypeForDeclarator(Declarator &D, Scope *S) {
   return T;
 }
 
-Sema::TypeResult Sema::ParseTypeName(Scope *S, Declarator &D) {
+Sema::TypeResult Sema::ActOnTypeName(Scope *S, Declarator &D) {
   // C99 6.7.6: Type names have no identifier.  This is already validated by
   // the parser.
   assert(D.getIdentifier() == 0 && "Type name should have no identifier!");
@@ -334,7 +334,7 @@ Sema::TypeResult Sema::ParseTypeName(Scope *S, Declarator &D) {
 }
 
 // Called from Parser::ParseParenDeclarator().
-Sema::TypeResult Sema::ParseParamDeclaratorType(Scope *S, Declarator &D) {
+Sema::TypeResult Sema::ActOnParamDeclaratorType(Scope *S, Declarator &D) {
   // Note: parameters have identifiers, but we don't care about them here, we
   // just want the type converted.
   QualType T = GetTypeForDeclarator(D, S);
index 2386765c2660c77de83a6808e8781efea3112a8b..52139a3bdafc86dc1900fcbc10091a9fc2d0498b 100644 (file)
                08FB7793FE84155DC02AAC07 /* Project object */ = {
                        isa = PBXProject;
                        buildConfigurationList = 1DEB923508733DC60010E9CD /* Build configuration list for PBXProject "clang" */;
-                       compatibilityVersion = "Xcode 2.4";
                        hasScannedForEncodings = 1;
                        mainGroup = 08FB7794FE84155DC02AAC07 /* clang */;
                        projectDirPath = "";
index b8a9e56941c71bcab78b167eb88700502925c7a1..c47aec3596be31829ff9b0b6b1e2903f01549844 100644 (file)
@@ -317,7 +317,7 @@ private:
 };
 
 
-/// FieldDecl - An instance of this class is created by Sema::ParseField to 
+/// FieldDecl - An instance of this class is created by Sema::ActOnField to 
 /// represent a member of a struct/union/class.
 class FieldDecl : public Decl {
   /// Identifier - The identifier for this declaration (e.g. the name for the
index 141261b7cd2f26061e968014ea9d49d8d78e32a5..014c7818e3d753769ee0bb0bd36faf53a41787ce 100644 (file)
@@ -93,14 +93,14 @@ public:
   /// in the current scope.
   virtual DeclTy *isTypeName(const IdentifierInfo &II, Scope *S) const = 0;
   
-  /// ParseDeclarator - This callback is invoked when a declarator is parsed and
+  /// ActOnDeclarator - This callback is invoked when a declarator is parsed and
   /// 'Init' specifies the initializer if any.  This is for things like:
   /// "int X = 4" or "typedef int foo".
   ///
   /// LastInGroup is non-null for cases where one declspec has multiple
-  /// declarators on it.  For example in 'int A, B', ParseDeclarator will be
+  /// declarators on it.  For example in 'int A, B', ActOnDeclarator will be
   /// called with LastInGroup=A when invoked for B.
-  virtual DeclTy *ParseDeclarator(Scope *S, Declarator &D,DeclTy *LastInGroup) {
+  virtual DeclTy *ActOnDeclarator(Scope *S, Declarator &D,DeclTy *LastInGroup) {
     return 0;
   }
 
@@ -108,7 +108,7 @@ public:
   /// ParseDeclarator (when an initializer is present). The code is factored 
   /// this way to make sure we are able to handle the following:
   ///   void func() { int xx = xx; }
-  /// This allows ParseDeclarator to register "xx" prior to parsing the
+  /// This allows ActOnDeclarator to register "xx" prior to parsing the
   /// initializer. The declaration above should still result in a warning, 
   /// since the reference to "xx" is uninitialized.
   virtual void AddInitializerToDecl(DeclTy *Dcl, ExprTy *Init) {
@@ -121,11 +121,11 @@ public:
   }
 
   /// ParseStartOfFunctionDef - This is called at the start of a function
-  /// definition, instead of calling ParseDeclarator.  The Declarator includes
+  /// definition, instead of calling ActOnDeclarator.  The Declarator includes
   /// information about formal arguments that are part of this function.
   virtual DeclTy *ParseStartOfFunctionDef(Scope *FnBodyScope, Declarator &D) {
-    // Default to ParseDeclarator.
-    return ParseDeclarator(FnBodyScope, D, 0);
+    // Default to ActOnDeclarator.
+    return ActOnDeclarator(FnBodyScope, D, 0);
   }
 
   /// ParseFunctionDefBody - This is called when a function body has completed
@@ -155,11 +155,11 @@ public:
   // Type Parsing Callbacks.
   //===--------------------------------------------------------------------===//
   
-  virtual TypeResult ParseTypeName(Scope *S, Declarator &D) {
+  virtual TypeResult ActOnTypeName(Scope *S, Declarator &D) {
     return 0;
   }
   
-  virtual TypeResult ParseParamDeclaratorType(Scope *S, Declarator &D) {
+  virtual TypeResult ActOnParamDeclaratorType(Scope *S, Declarator &D) {
     return 0;
   }
   
@@ -168,7 +168,7 @@ public:
     TK_Declaration, // Fwd decl of a tag:   'struct foo;'
     TK_Definition   // Definition of a tag: 'struct foo { int X; } Y;'
   };
-  virtual DeclTy *ParseTag(Scope *S, unsigned TagType, TagKind TK,
+  virtual DeclTy *ActOnTag(Scope *S, unsigned TagType, TagKind TK,
                            SourceLocation KWLoc, IdentifierInfo *Name,
                            SourceLocation NameLoc, AttributeList *Attr) {
     // TagType is an instance of DeclSpec::TST, indicating what kind of tag this
@@ -176,20 +176,20 @@ public:
     return 0;
   }
   
-  virtual DeclTy *ParseField(Scope *S, DeclTy *TagDecl,SourceLocation DeclStart,
+  virtual DeclTy *ActOnField(Scope *S, DeclTy *TagDecl,SourceLocation DeclStart,
                              Declarator &D, ExprTy *BitfieldWidth) {
     return 0;
   }
-  virtual void ProcessFieldDecls(SourceLocation RecLoc, DeclTy *TagDecl,
+  virtual void ActOnFields(SourceLocation RecLoc, DeclTy *TagDecl,
                                  DeclTy **Fields, unsigned NumFields,
                                  tok::ObjCKeywordKind *visibility = 0) {}
-  virtual DeclTy *ParseEnumConstant(Scope *S, DeclTy *EnumDecl,
+  virtual DeclTy *ActOnEnumConstant(Scope *S, DeclTy *EnumDecl,
                                     DeclTy *LastEnumConstant,
                                     SourceLocation IdLoc, IdentifierInfo *Id,
                                     SourceLocation EqualLoc, ExprTy *Val) {
     return 0;
   }
-  virtual void ParseEnumBody(SourceLocation EnumLoc, DeclTy *EnumDecl,
+  virtual void ActOnEnumBody(SourceLocation EnumLoc, DeclTy *EnumDecl,
                              DeclTy **Elements, unsigned NumElements) {}
 
   //===--------------------------------------------------------------------===//
@@ -288,10 +288,10 @@ public:
   
   // Primary Expressions.
   
-  /// ParseIdentifierExpr - Parse an identifier in expression context.
+  /// ActOnIdentifierExpr - Parse an identifier in expression context.
   /// 'HasTrailingLParen' indicates whether or not the identifier has a '('
   /// token immediately after it.
-  virtual ExprResult ParseIdentifierExpr(Scope *S, SourceLocation Loc,
+  virtual ExprResult ActOnIdentifierExpr(Scope *S, SourceLocation Loc,
                                          IdentifierInfo &II,
                                          bool HasTrailingLParen) {
     return 0;
@@ -497,10 +497,10 @@ public:
   /// determine whether the name is a typedef or not in this scope.
   virtual DeclTy *isTypeName(const IdentifierInfo &II, Scope *S) const;
   
-  /// ParseDeclarator - If this is a typedef declarator, we modify the
+  /// ActOnDeclarator - If this is a typedef declarator, we modify the
   /// IdentifierInfo::FETokenInfo field to keep track of this fact, until S is
   /// popped.
-  virtual DeclTy *ParseDeclarator(Scope *S, Declarator &D, DeclTy *LastInGroup);
+  virtual DeclTy *ActOnDeclarator(Scope *S, Declarator &D, DeclTy *LastInGroup);
   
   /// PopScope - When a scope is popped, if any typedefs are now out-of-scope,
   /// they are removed from the IdentifierInfo::FETokenInfo field.
index 8bde7d08fd00f9a4ecdae8432d1d310a5faec952..d4a94b6c52693e5792c7b933e940b2e17efcd9a1 100644 (file)
@@ -44,7 +44,7 @@ public:
       // FIXME: before we delete the vector, we need to make sure the Expr's 
       // have been deleted. Since Action::ExprTy is "void", we are dependent
       // on the actions module for actually freeing the memory. The specific
-      // hooks are ParseDeclarator, ParseTypeName, ParseParamDeclaratorType, 
+      // hooks are ActOnDeclarator, ActOnTypeName, ActOnParamDeclaratorType, 
       // ParseField, ParseTag. Once these routines have freed the expression, 
       // they should zero out the Args slot (to indicate the memory has been 
       // freed). If any element of the vector is non-null, we should assert.