diff options
32 files changed, 1280 insertions, 1223 deletions
diff --git a/include/clang/Parse/Action.h b/include/clang/Parse/Action.h index 2f4d283950..f758d05792 100644 --- a/include/clang/Parse/Action.h +++ b/include/clang/Parse/Action.h @@ -47,7 +47,7 @@ namespace clang { template<> struct IsResultPtrLowBitFree<1> { static const bool value = true;}; template<> struct IsResultPtrLowBitFree<3> { static const bool value = true;}; template<> struct IsResultPtrLowBitFree<4> { static const bool value = true;}; - + /// Action - As the parser reads the input file and recognizes the productions /// of the grammar, it invokes methods on this class to turn the parsed input /// into something useful: e.g. a parse tree. @@ -69,7 +69,7 @@ public: // what types are required to be identical for the actions. typedef ActionBase::ExprTy ExprTy; typedef ActionBase::StmtTy StmtTy; - typedef void DeclTy; + typedef OpaquePtr<0> DeclPtrTy; typedef void TypeTy; typedef void AttrTy; typedef void BaseTy; @@ -85,7 +85,7 @@ public: typedef ActionResult<2> TypeResult; typedef ActionResult<3> BaseResult; typedef ActionResult<4> MemInitResult; - typedef ActionResult<5> DeclResult; + typedef ActionResult<5, DeclPtrTy> DeclResult; /// Same, but with ownership. typedef ASTOwningResult<&ActionBase::DeleteExpr> OwningExprResult; @@ -123,7 +123,7 @@ public: /// getDeclName - Return a pretty name for the specified decl if possible, or /// an empty string if not. This is used for pretty crash reporting. - virtual std::string getDeclName(DeclTy *D) { return ""; } + virtual std::string getDeclName(DeclPtrTy D) { return ""; } //===--------------------------------------------------------------------===// // Declaration Tracking Callbacks. @@ -134,7 +134,7 @@ public: /// An optional CXXScopeSpec can be passed to indicate the C++ scope (class or /// namespace) that the identifier must be a member of. /// i.e. for "foo::bar", 'II' will be "bar" and 'SS' will be "foo::". - virtual DeclTy *getTypeName(IdentifierInfo &II, SourceLocation NameLoc, + virtual TypeTy *getTypeName(IdentifierInfo &II, SourceLocation NameLoc, Scope *S, const CXXScopeSpec *SS = 0) = 0; /// isCurrentClassName - Return true if the specified name is the @@ -148,7 +148,7 @@ public: /// optional CXXScope can be passed to indicate the C++ scope in /// which the identifier will be found. virtual TemplateNameKind isTemplateName(IdentifierInfo &II, Scope *S, - DeclTy *&TemplateDecl, + DeclPtrTy &TemplateDecl, const CXXScopeSpec *SS = 0) = 0; /// ActOnCXXGlobalScopeSpecifier - Return the object that represents the @@ -212,16 +212,17 @@ public: /// LastInGroup is non-null for cases where one declspec has multiple /// declarators on it. For example in 'int A, B', ActOnDeclarator will be /// called with LastInGroup=A when invoked for B. - virtual DeclTy *ActOnDeclarator(Scope *S, Declarator &D,DeclTy *LastInGroup) { - return 0; + virtual DeclPtrTy ActOnDeclarator(Scope *S, Declarator &D, + DeclPtrTy LastInGroup) { + return DeclPtrTy(); } /// ActOnParamDeclarator - This callback is invoked when a parameter /// declarator is parsed. This callback only occurs for functions /// with prototypes. S is the function prototype scope for the /// parameters (C++ [basic.scope.proto]). - virtual DeclTy *ActOnParamDeclarator(Scope *S, Declarator &D) { - return 0; + virtual DeclPtrTy ActOnParamDeclarator(Scope *S, Declarator &D) { + return DeclPtrTy(); } /// AddInitializerToDecl - This action is called immediately after @@ -231,7 +232,7 @@ public: /// 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, ExprArg Init) { + virtual void AddInitializerToDecl(DeclPtrTy Dcl, ExprArg Init) { return; } @@ -239,19 +240,19 @@ public: /// if =delete is parsed. C++0x [dcl.fct.def]p10 /// Note that this can be called even for variable declarations. It's the /// action's job to reject it. - virtual void SetDeclDeleted(DeclTy *Dcl, SourceLocation DelLoc) { + virtual void SetDeclDeleted(DeclPtrTy Dcl, SourceLocation DelLoc) { return; } /// ActOnUninitializedDecl - This action is called immediately after /// ActOnDeclarator (when an initializer is *not* present). - virtual void ActOnUninitializedDecl(DeclTy *Dcl) { + virtual void ActOnUninitializedDecl(DeclPtrTy Dcl) { return; } /// FinalizeDeclaratorGroup - After a sequence of declarators are parsed, this /// gives the actions implementation a chance to process the group as a whole. - virtual DeclTy *FinalizeDeclaratorGroup(Scope *S, DeclTy *Group) { + virtual DeclPtrTy FinalizeDeclaratorGroup(Scope *S, DeclPtrTy Group) { return Group; } @@ -265,30 +266,31 @@ public: /// ActOnStartOfFunctionDef - This is called at the start of a function /// definition, instead of calling ActOnDeclarator. The Declarator includes /// information about formal arguments that are part of this function. - virtual DeclTy *ActOnStartOfFunctionDef(Scope *FnBodyScope, Declarator &D) { + virtual DeclPtrTy ActOnStartOfFunctionDef(Scope *FnBodyScope, Declarator &D) { // Default to ActOnDeclarator. return ActOnStartOfFunctionDef(FnBodyScope, - ActOnDeclarator(FnBodyScope, D, 0)); + ActOnDeclarator(FnBodyScope, D,DeclPtrTy())); } /// ActOnStartOfFunctionDef - This is called at the start of a function /// definition, after the FunctionDecl has already been created. - virtual DeclTy *ActOnStartOfFunctionDef(Scope *FnBodyScope, DeclTy *D) { + virtual DeclPtrTy ActOnStartOfFunctionDef(Scope *FnBodyScope, DeclPtrTy D) { return D; } - virtual void ActOnStartOfObjCMethodDef(Scope *FnBodyScope, DeclTy *D) { + virtual void ActOnStartOfObjCMethodDef(Scope *FnBodyScope, DeclPtrTy D) { return; } /// ActOnFinishFunctionBody - This is called when a function body has - /// completed parsing. Decl is the DeclTy returned by ParseStartOfFunctionDef. - virtual DeclTy *ActOnFinishFunctionBody(DeclTy *Decl, StmtArg Body) { + /// completed parsing. Decl is returned by ParseStartOfFunctionDef. + virtual DeclPtrTy ActOnFinishFunctionBody(DeclPtrTy Decl, StmtArg Body) { return Decl; } - virtual DeclTy *ActOnFileScopeAsmDecl(SourceLocation Loc, ExprArg AsmString) { - return 0; + virtual DeclPtrTy ActOnFileScopeAsmDecl(SourceLocation Loc, + ExprArg AsmString) { + return DeclPtrTy(); } /// ActOnPopScope - This callback is called immediately before the specified @@ -301,8 +303,8 @@ public: /// ParsedFreeStandingDeclSpec - This method is invoked when a declspec with /// no declarator (e.g. "struct foo;") is parsed. - virtual DeclTy *ParsedFreeStandingDeclSpec(Scope *S, DeclSpec &DS) { - return 0; + virtual DeclPtrTy ParsedFreeStandingDeclSpec(Scope *S, DeclSpec &DS) { + return DeclPtrTy(); } /// ActOnStartLinkageSpecification - Parsed the beginning of a C++ @@ -312,22 +314,22 @@ public: /// by Lang/StrSize. LBraceLoc, if valid, provides the location of /// the '{' brace. Otherwise, this linkage specification does not /// have any braces. - virtual DeclTy *ActOnStartLinkageSpecification(Scope *S, - SourceLocation ExternLoc, - SourceLocation LangLoc, - const char *Lang, - unsigned StrSize, - SourceLocation LBraceLoc) { - return 0; + virtual DeclPtrTy ActOnStartLinkageSpecification(Scope *S, + SourceLocation ExternLoc, + SourceLocation LangLoc, + const char *Lang, + unsigned StrSize, + SourceLocation LBraceLoc) { + return DeclPtrTy(); } /// ActOnFinishLinkageSpecification - Completely the definition of /// the C++ linkage specification LinkageSpec. If RBraceLoc is /// valid, it's the position of the closing '}' brace in a linkage /// specification that uses braces. - virtual DeclTy *ActOnFinishLinkageSpecification(Scope *S, - DeclTy *LinkageSpec, - SourceLocation RBraceLoc) { + virtual DeclPtrTy ActOnFinishLinkageSpecification(Scope *S, + DeclPtrTy LinkageSpec, + SourceLocation RBraceLoc) { return LinkageSpec; } @@ -342,7 +344,7 @@ public: /// ActOnTypeName - A type-name (type-id in C++) was parsed. virtual TypeResult ActOnTypeName(Scope *S, Declarator &D) { - return 0; + return TypeResult(); } enum TagKind { @@ -350,53 +352,54 @@ public: TK_Declaration, // Fwd decl of a tag: 'struct foo;' TK_Definition // Definition of a tag: 'struct foo { int X; } Y;' }; - virtual DeclTy *ActOnTag(Scope *S, unsigned TagSpec, TagKind TK, - SourceLocation KWLoc, const CXXScopeSpec &SS, - IdentifierInfo *Name, SourceLocation NameLoc, - AttributeList *Attr, AccessSpecifier AS) { + virtual DeclPtrTy ActOnTag(Scope *S, unsigned TagSpec, TagKind TK, + SourceLocation KWLoc, const CXXScopeSpec &SS, + IdentifierInfo *Name, SourceLocation NameLoc, + AttributeList *Attr, AccessSpecifier AS) { // TagType is an instance of DeclSpec::TST, indicating what kind of tag this // is (struct/union/enum/class). - return 0; + return DeclPtrTy(); } /// Act on @defs() element found when parsing a structure. ClassName is the /// name of the referenced class. - virtual void ActOnDefs(Scope *S, DeclTy *TagD, SourceLocation DeclStart, + virtual void ActOnDefs(Scope *S, DeclPtrTy TagD, SourceLocation DeclStart, IdentifierInfo *ClassName, - llvm::SmallVectorImpl<DeclTy*> &Decls) {} - virtual DeclTy *ActOnField(Scope *S, DeclTy *TagD, SourceLocation DeclStart, - Declarator &D, ExprTy *BitfieldWidth) { - return 0; + llvm::SmallVectorImpl<DeclPtrTy> &Decls) {} + virtual DeclPtrTy ActOnField(Scope *S, DeclPtrTy TagD, + SourceLocation DeclStart, + Declarator &D, ExprTy *BitfieldWidth) { + return DeclPtrTy(); } - virtual DeclTy *ActOnIvar(Scope *S, SourceLocation DeclStart, - Declarator &D, ExprTy *BitfieldWidth, - tok::ObjCKeywordKind visibility) { - return 0; + virtual DeclPtrTy ActOnIvar(Scope *S, SourceLocation DeclStart, + Declarator &D, ExprTy *BitfieldWidth, + tok::ObjCKeywordKind visibility) { + return DeclPtrTy(); } - virtual void ActOnFields(Scope* S, SourceLocation RecLoc, DeclTy *TagDecl, - DeclTy **Fields, unsigned NumFields, + virtual void ActOnFields(Scope* S, SourceLocation RecLoc, DeclPtrTy TagDecl, + DeclPtrTy *Fields, unsigned NumFields, SourceLocation LBrac, SourceLocation RBrac, AttributeList *AttrList) {} /// ActOnTagStartDefinition - Invoked when we have entered the /// scope of a tag's definition (e.g., for an enumeration, class, /// struct, or union). - virtual void ActOnTagStartDefinition(Scope *S, DeclTy *TagDecl) { } + virtual void ActOnTagStartDefinition(Scope *S, DeclPtrTy TagDecl) { } /// ActOnTagFinishDefinition - Invoked once we have finished parsing /// the definition of a tag (enumeration, class, struct, or union). - virtual void ActOnTagFinishDefinition(Scope *S, DeclTy *TagDecl) { } + virtual void ActOnTagFinishDefinition(Scope *S, DeclPtrTy TagDecl) { } - virtual DeclTy *ActOnEnumConstant(Scope *S, DeclTy *EnumDecl, - DeclTy *LastEnumConstant, - SourceLocation IdLoc, IdentifierInfo *Id, - SourceLocation EqualLoc, ExprTy *Val) { - return 0; + virtual DeclPtrTy ActOnEnumConstant(Scope *S, DeclPtrTy EnumDecl, + DeclPtrTy LastEnumConstant, + SourceLocation IdLoc, IdentifierInfo *Id, + SourceLocation EqualLoc, ExprTy *Val) { + return DeclPtrTy(); } - virtual void ActOnEnumBody(SourceLocation EnumLoc, DeclTy *EnumDecl, - DeclTy **Elements, unsigned NumElements) {} + virtual void ActOnEnumBody(SourceLocation EnumLoc, DeclPtrTy EnumDecl, + DeclPtrTy *Elements, unsigned NumElements) {} //===--------------------------------------------------------------------===// // Statement Parsing Callbacks. @@ -411,8 +414,8 @@ public: bool isStmtExpr) { return StmtEmpty(); } - virtual OwningStmtResult ActOnDeclStmt(DeclTy *Decl, SourceLocation StartLoc, - SourceLocation EndLoc) { + virtual OwningStmtResult ActOnDeclStmt(DeclPtrTy Decl,SourceLocation StartLoc, + SourceLocation EndLoc) { return StmtEmpty(); } @@ -521,7 +524,7 @@ public: // Objective-c statements virtual OwningStmtResult ActOnObjCAtCatchStmt(SourceLocation AtLoc, SourceLocation RParen, - DeclTy *Parm, StmtArg Body, + DeclPtrTy Parm, StmtArg Body, StmtArg CatchList) { return StmtEmpty(); } @@ -550,12 +553,12 @@ public: } // C++ Statements - virtual DeclTy *ActOnExceptionDeclarator(Scope *S, Declarator &D) { - return 0; + virtual DeclPtrTy ActOnExceptionDeclarator(Scope *S, Declarator &D) { + return DeclPtrTy(); } virtual OwningStmtResult ActOnCXXCatchBlock(SourceLocation CatchLoc, - DeclTy *ExceptionDecl, + DeclPtrTy ExceptionDecl, StmtArg HandlerBlock) { return StmtEmpty(); } @@ -658,7 +661,7 @@ public: tok::TokenKind OpKind, SourceLocation MemberLoc, IdentifierInfo &Member, - DeclTy *ObjCImpDecl) { + DeclPtrTy ObjCImpDecl) { return ExprEmpty(); } @@ -821,40 +824,40 @@ public: /// ActOnStartNamespaceDef - This is called at the start of a namespace /// definition. - virtual DeclTy *ActOnStartNamespaceDef(Scope *S, SourceLocation IdentLoc, - IdentifierInfo *Ident, - SourceLocation LBrace) { - return 0; + virtual DeclPtrTy ActOnStartNamespaceDef(Scope *S, SourceLocation IdentLoc, + IdentifierInfo *Ident, + SourceLocation LBrace) { + return DeclPtrTy(); } /// ActOnFinishNamespaceDef - This callback is called after a namespace is - /// exited. Decl is the DeclTy returned by ActOnStartNamespaceDef. - virtual void ActOnFinishNamespaceDef(DeclTy *Dcl,SourceLocation RBrace) { + /// exited. Decl is returned by ActOnStartNamespaceDef. + virtual void ActOnFinishNamespaceDef(DeclPtrTy Dcl, SourceLocation RBrace) { return; } /// ActOnUsingDirective - This is called when using-directive is parsed. - virtual DeclTy *ActOnUsingDirective(Scope *CurScope, - SourceLocation UsingLoc, - SourceLocation NamespcLoc, - const CXXScopeSpec &SS, - SourceLocation IdentLoc, - IdentifierInfo *NamespcName, - AttributeList *AttrList); + virtual DeclPtrTy ActOnUsingDirective(Scope *CurScope, + SourceLocation UsingLoc, + SourceLocation NamespcLoc, + const CXXScopeSpec &SS, + SourceLocation IdentLoc, + IdentifierInfo *NamespcName, + AttributeList *AttrList); /// ActOnNamespaceAliasDef - This is called when a namespace alias definition /// is parsed. - virtual DeclTy *ActOnNamespaceAliasDef(Scope *CurScope, - SourceLocation AliasLoc, - IdentifierInfo *Alias, - const CXXScopeSpec &SS, - SourceLocation NamespaceLoc, - IdentifierInfo *NamespaceName) { - return 0; + virtual DeclPtrTy ActOnNamespaceAliasDef(Scope *CurScope, + SourceLocation AliasLoc, + IdentifierInfo *Alias, + const CXXScopeSpec &SS, + SourceLocation NamespaceLoc, + IdentifierInfo *NamespaceName) { + return DeclPtrTy(); } /// ActOnParamDefaultArgument - Parse default argument for function parameter - virtual void ActOnParamDefaultArgument(DeclTy *param, + virtual void ActOnParamDefaultArgument(DeclPtrTy param, SourceLocation EqualLoc, ExprArg defarg) { } @@ -863,17 +866,17 @@ public: /// argument for a function parameter, but we can't parse it yet /// because we're inside a class definition. Note that this default /// argument will be parsed later. - virtual void ActOnParamUnparsedDefaultArgument(DeclTy *param, + virtual void ActOnParamUnparsedDefaultArgument(DeclPtrTy param, SourceLocation EqualLoc) { } /// ActOnParamDefaultArgumentError - Parsing or semantic analysis of /// the default argument for the parameter param failed. - virtual void ActOnParamDefaultArgumentError(DeclTy *param) { } + virtual void ActOnParamDefaultArgumentError(DeclPtrTy param) { } /// AddCXXDirectInitializerToDecl - This action is called immediately after /// ActOnDeclarator, when a C++ direct initializer is present. /// e.g: "int x(1);" - virtual void AddCXXDirectInitializerToDecl(DeclTy *Dcl, + virtual void AddCXXDirectInitializerToDecl(DeclPtrTy Dcl, SourceLocation LParenLoc, MultiExprArg Exprs, SourceLocation *CommaLocs, @@ -889,7 +892,8 @@ public: /// Method declaration as if we had just parsed the qualified method /// name. However, it should not bring the parameters into scope; /// that will be performed by ActOnDelayedCXXMethodParameter. - virtual void ActOnStartDelayedCXXMethodDeclaration(Scope *S, DeclTy *Method) { + virtual void ActOnStartDelayedCXXMethodDeclaration(Scope *S, + DeclPtrTy Method) { } /// ActOnDelayedCXXMethodParameter - We've already started a delayed @@ -897,7 +901,7 @@ public: /// function parameter into scope for use in parsing later parts of /// the method declaration. For example, we could see an /// ActOnParamDefaultArgument event for this parameter. - virtual void ActOnDelayedCXXMethodParameter(Scope *S, DeclTy *Param) { + virtual void ActOnDelayedCXXMethodParameter(Scope *S, DeclPtrTy Param) { } /// ActOnFinishDelayedCXXMethodDeclaration - We have finished @@ -906,14 +910,15 @@ public: /// ActOnStartOfFunctionDef action later (not necessarily /// immediately!) for this method, if it was also defined inside the /// class body. - virtual void ActOnFinishDelayedCXXMethodDeclaration(Scope *S, DeclTy *Method){ + virtual void ActOnFinishDelayedCXXMethodDeclaration(Scope *S, + DeclPtrTy Method) { } /// ActOnStaticAssertDeclaration - Parse a C++0x static_assert declaration. - virtual DeclTy *ActOnStaticAssertDeclaration(SourceLocation AssertLoc, - ExprArg AssertExpr, - ExprArg AssertMessageExpr) { - return 0; + virtual DeclPtrTy ActOnStaticAssertDeclaration(SourceLocation AssertLoc, + ExprArg AssertExpr, + ExprArg AssertMessageExpr) { + return DeclPtrTy(); } @@ -1014,7 +1019,7 @@ public: //===---------------------------- C++ Classes ---------------------------===// /// ActOnBaseSpecifier - Parsed a base specifier - virtual BaseResult ActOnBaseSpecifier(DeclTy *classdecl, + virtual BaseResult ActOnBaseSpecifier(DeclPtrTy classdecl, SourceRange SpecifierRange, bool Virtual, AccessSpecifier Access, TypeTy *basetype, @@ -1022,7 +1027,7 @@ public: return 0; } - virtual void ActOnBaseSpecifiers(DeclTy *ClassDecl, BaseTy **Bases, + virtual void ActOnBaseSpecifiers(DeclPtrTy ClassDecl, BaseTy **Bases, unsigned NumBases) { } @@ -1031,13 +1036,15 @@ public: /// specifies the bitfield width if there is one and 'Init' specifies the /// initializer if any. 'LastInGroup' is non-null for cases where one declspec /// has multiple declarators on it. - virtual DeclTy *ActOnCXXMemberDeclarator(Scope *S, AccessSpecifier AS, - Declarator &D, ExprTy *BitfieldWidth, - ExprTy *Init, DeclTy *LastInGroup) { - return 0; + virtual DeclPtrTy ActOnCXXMemberDeclarator(Scope *S, AccessSpecifier AS, + Declarator &D, + ExprTy *BitfieldWidth, + ExprTy *Init, + DeclPtrTy LastInGroup) { + return DeclPtrTy(); } - virtual MemInitResult ActOnMemInitializer(DeclTy *ConstructorDecl, + virtual MemInitResult ActOnMemInitializer(DeclPtrTy ConstructorDecl, Scope *S, IdentifierInfo *MemberOrBase, SourceLocation IdLoc, @@ -1054,15 +1061,15 @@ public: /// a well-formed program), ColonLoc is the location of the ':' that /// starts the constructor initializer, and MemInit/NumMemInits /// contains the individual member (and base) initializers. - virtual void ActOnMemInitializers(DeclTy *ConstructorDecl, + virtual void ActOnMemInitializers(DeclPtrTy ConstructorDecl, SourceLocation ColonLoc, - MemInitTy **MemInits, unsigned NumMemInits) { + MemInitTy **MemInits, unsigned NumMemInits){ } /// ActOnFinishCXXMemberSpecification - Invoked after all member declarators /// are parsed but *before* parsing of inline method definitions. virtual void ActOnFinishCXXMemberSpecification(Scope* S, SourceLocation RLoc, - DeclTy *TagDecl, + DeclPtrTy TagDecl, SourceLocation LBrac, SourceLocation RBrac) { } @@ -1081,17 +1088,17 @@ public: /// the number of enclosing templates (see /// ActOnTemplateParameterList) and the number of previous /// parameters within this template parameter list. - virtual DeclTy *ActOnTypeParameter(Scope *S, bool Typename, - SourceLocation KeyLoc, - IdentifierInfo *ParamName, - SourceLocation ParamNameLoc, - unsigned Depth, unsigned Position) { - return 0; + virtual DeclPtrTy ActOnTypeParameter(Scope *S, bool Typename, + SourceLocation KeyLoc, + IdentifierInfo *ParamName, + SourceLocation ParamNameLoc, + unsigned Depth, unsigned Position) { + return DeclPtrTy(); } /// ActOnTypeParameterDefault - Adds a default argument (the type /// Default) to the given template type parameter (TypeParam). - virtual void ActOnTypeParameterDefault(DeclTy *TypeParam, + virtual void ActOnTypeParameterDefault(DeclPtrTy TypeParam, SourceLocation EqualLoc, SourceLocation DefaultLoc, TypeTy *Default) { @@ -1104,15 +1111,15 @@ public: /// enclosing templates (see /// ActOnTemplateParameterList) and the number of previous /// parameters within this template parameter list. - virtual DeclTy *ActOnNonTypeTemplateParameter(Scope *S, Declarator &D, - unsigned Depth, - unsigned Position) { - return 0; + virtual DeclPtrTy ActOnNonTypeTemplateParameter(Scope *S, Declarator &D, + unsigned Depth, + unsigned Position) { + return DeclPtrTy(); } /// \brief Adds a default argument to the given non-type template /// parameter. - virtual void ActOnNonTypeTemplateParameterDefault(DeclTy *TemplateParam, + virtual void ActOnNonTypeTemplateParameterDefault(DeclPtrTy TemplateParam, SourceLocation EqualLoc, ExprArg Default) { } @@ -1123,19 +1130,19 @@ public: /// TemplateParams is the sequence of parameters required by the template, /// ParamName is the name of the parameter (null if unnamed), and ParamNameLoc /// is the source location of the identifier (if given). - virtual DeclTy *ActOnTemplateTemplateParameter(Scope *S, - SourceLocation TmpLoc, - TemplateParamsTy *Params, - IdentifierInfo *ParamName, - SourceLocation ParamNameLoc, - unsigned Depth, - unsigned Position) { - return 0; + virtual DeclPtrTy ActOnTemplateTemplateParameter(Scope *S, + SourceLocation TmpLoc, + TemplateParamsTy *Params, + IdentifierInfo *ParamName, + SourceLocation ParamNameLoc, + unsigned Depth, + unsigned Position) { + return DeclPtrTy(); } /// \brief Adds a default argument to the given template template /// parameter. - virtual void ActOnTemplateTemplateParameterDefault(DeclTy *TemplateParam, + virtual void ActOnTemplateTemplateParameterDefault(DeclPtrTy TemplateParam, SourceLocation EqualLoc, ExprArg Default) { } @@ -1174,7 +1181,7 @@ public: SourceLocation ExportLoc, SourceLocation TemplateLoc, SourceLocation LAngleLoc, - DeclTy **Params, unsigned NumParams, + DeclPtrTy *Params, unsigned NumParams, SourceLocation RAngleLoc) { return 0; } @@ -1188,7 +1195,7 @@ public: AttributeList *Attr, MultiTemplateParamsArg TemplateParameterLists, AccessSpecifier AS) { - return 0; + return DeclResult(); } /// \brief Form a class template specialization from a template and @@ -1204,14 +1211,14 @@ public: /// \param IsSpecialization true when we are naming the class /// template specialization as part of an explicit class /// specialization or class template partial specialization. - virtual TypeResult ActOnClassTemplateId(DeclTy *Template, + virtual TypeResult ActOnClassTemplateId(DeclPtrTy Template, SourceLocation TemplateLoc, SourceLocation LAngleLoc, ASTTemplateArgsPtr TemplateArgs, SourceLocation *TemplateArgLocs, SourceLocation RAngleLoc, const CXXScopeSpec *SS) { - return 0; + return TypeResult(); }; /// \brief Process the declaration or definition of an explicit @@ -1264,7 +1271,7 @@ public: ActOnClassTemplateSpecialization(Scope *S, unsigned TagSpec, TagKind TK, SourceLocation KWLoc, const CXXScopeSpec &SS, - DeclTy *Template, + DeclPtrTy Template, SourceLocation TemplateNameLoc, SourceLocation LAngleLoc, ASTTemplateArgsPtr TemplateArgs, @@ -1272,7 +1279,7 @@ public: SourceLocation RAngleLoc, AttributeList *Attr, MultiTemplateParamsArg TemplateParameterLists) { - return 0; + return DeclResult(); } /// \brief Called when the parser has parsed a C++ typename @@ -1285,7 +1292,7 @@ public: virtual TypeResult ActOnTypenameType(SourceLocation TypenameLoc, const CXXScopeSpec &SS, const IdentifierInfo &II, SourceLocation IdLoc) { - return 0; + return TypeResult(); } //===----------------------- Obj-C Declarations -------------------------===// @@ -1293,89 +1300,89 @@ public: // ActOnStartClassInterface - this action is called immediately after parsing |