aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJohn McCall <rjmccall@apple.com>2010-09-03 02:10:08 +0000
committerJohn McCall <rjmccall@apple.com>2010-09-03 02:10:08 +0000
commit8c465e6494d16a19127873dc9bdc55177ac6b6fd (patch)
tree42f1593da6c9d9347b61ba516dfeaf0294f4cc67
parentdb50547fd526329d00fa1fee4e7ac90f2624c6e0 (diff)
Devirtualize Sema, kill off DeleteExpr and DeleteStmt, and reformat.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@112945 91177308-0d34-0410-b5e6-96231b3b80d8
-rw-r--r--include/clang/Sema/Sema.h1688
-rw-r--r--lib/Sema/Sema.cpp5
-rw-r--r--lib/Sema/SemaDecl.cpp2
-rw-r--r--lib/Sema/SemaDeclCXX.cpp2
-rw-r--r--lib/Sema/SemaExpr.cpp3
-rw-r--r--lib/Sema/SemaStmt.cpp2
6 files changed, 812 insertions, 890 deletions
diff --git a/include/clang/Sema/Sema.h b/include/clang/Sema/Sema.h
index 90f7f98348..4741028cb0 100644
--- a/include/clang/Sema/Sema.h
+++ b/include/clang/Sema/Sema.h
@@ -174,7 +174,7 @@ public:
QualType getType() const { return getCanonicalTypeInternal(); }
TypeSourceInfo *getTypeSourceInfo() const { return DeclInfo; }
- virtual void getAsStringInternal(std::string &Str,
+ void getAsStringInternal(std::string &Str,
const PrintingPolicy &Policy) const;
static bool classof(const Type *T) {
@@ -490,7 +490,7 @@ public:
Sema(Preprocessor &pp, ASTContext &ctxt, ASTConsumer &consumer,
bool CompleteTranslationUnit = true,
CodeCompleteConsumer *CompletionConsumer = 0);
- virtual ~Sema();
+ ~Sema();
/// \brief Perform initialization that occurs after the parser has been
/// initialized but before it parses anything.
@@ -536,14 +536,11 @@ public:
/// \brief Build a partial diagnostic.
PartialDiagnostic PDiag(unsigned DiagID = 0); // in SemaInternal.h
- virtual void DeleteExpr(Expr *E);
- virtual void DeleteStmt(Stmt *S);
-
ExprResult Owned(Expr* E) { return E; }
ExprResult Owned(ExprResult R) { return R; }
StmtResult Owned(Stmt* S) { return S; }
- virtual void ActOnEndOfTranslationUnit();
+ void ActOnEndOfTranslationUnit();
Scope *getScopeForContext(DeclContext *Ctx);
@@ -620,7 +617,7 @@ public:
const FunctionProtoType *Target, SourceLocation TargetLoc,
const FunctionProtoType *Source, SourceLocation SourceLoc);
- virtual TypeResult ActOnTypeName(Scope *S, Declarator &D);
+ TypeResult ActOnTypeName(Scope *S, Declarator &D);
bool RequireCompleteType(SourceLocation Loc, QualType T,
const PartialDiagnostic &PD,
@@ -644,18 +641,18 @@ public:
void DiagnoseUseOfUnimplementedSelectors();
- virtual ParsedType getTypeName(IdentifierInfo &II, SourceLocation NameLoc,
- Scope *S, CXXScopeSpec *SS = 0,
- bool isClassName = false,
- ParsedType ObjectType = ParsedType());
- virtual TypeSpecifierType isTagName(IdentifierInfo &II, Scope *S);
- virtual bool DiagnoseUnknownTypeName(const IdentifierInfo &II,
- SourceLocation IILoc,
- Scope *S,
- CXXScopeSpec *SS,
- ParsedType &SuggestedType);
+ ParsedType getTypeName(IdentifierInfo &II, SourceLocation NameLoc,
+ Scope *S, CXXScopeSpec *SS = 0,
+ bool isClassName = false,
+ ParsedType ObjectType = ParsedType());
+ TypeSpecifierType isTagName(IdentifierInfo &II, Scope *S);
+ bool DiagnoseUnknownTypeName(const IdentifierInfo &II,
+ SourceLocation IILoc,
+ Scope *S,
+ CXXScopeSpec *SS,
+ ParsedType &SuggestedType);
- virtual Decl *ActOnDeclarator(Scope *S, Declarator &D);
+ Decl *ActOnDeclarator(Scope *S, Declarator &D);
Decl *HandleDeclarator(Scope *S, Declarator &D,
MultiTemplateParamsArg TemplateParameterLists,
@@ -690,7 +687,7 @@ public:
bool &Redeclaration,
bool &OverloadableAttrRequired);
void CheckMain(FunctionDecl *FD);
- virtual Decl *ActOnParamDeclarator(Scope *S, Declarator &D);
+ Decl *ActOnParamDeclarator(Scope *S, Declarator &D);
ParmVarDecl *BuildParmVarDeclForTypedef(DeclContext *DC,
SourceLocation Loc,
QualType T);
@@ -700,13 +697,13 @@ public:
SourceLocation NameLoc,
StorageClass SC,
StorageClass SCAsWritten);
- virtual void ActOnParamDefaultArgument(Decl *param,
+ void ActOnParamDefaultArgument(Decl *param,
+ SourceLocation EqualLoc,
+ Expr *defarg);
+ void ActOnParamUnparsedDefaultArgument(Decl *param,
SourceLocation EqualLoc,
- Expr *defarg);
- virtual void ActOnParamUnparsedDefaultArgument(Decl *param,
- SourceLocation EqualLoc,
- SourceLocation ArgLoc);
- virtual void ActOnParamDefaultArgumentError(Decl *param);
+ SourceLocation ArgLoc);
+ void ActOnParamDefaultArgumentError(Decl *param);
bool SetParamDefaultArgument(ParmVarDecl *Param, Expr *DefaultArg,
SourceLocation EqualLoc);
@@ -715,23 +712,22 @@ public:
// argument locations.
llvm::DenseMap<ParmVarDecl *,SourceLocation> UnparsedDefaultArgLocs;
- virtual void AddInitializerToDecl(Decl *dcl, Expr *init);
+ void AddInitializerToDecl(Decl *dcl, Expr *init);
void AddInitializerToDecl(Decl *dcl, Expr *init, bool DirectInit);
void ActOnUninitializedDecl(Decl *dcl, bool TypeContainsUndeducedAuto);
- virtual void ActOnInitializerError(Decl *Dcl);
- virtual void SetDeclDeleted(Decl *dcl, SourceLocation DelLoc);
- virtual DeclGroupPtrTy FinalizeDeclaratorGroup(Scope *S, const DeclSpec &DS,
- Decl **Group,
- unsigned NumDecls);
- virtual void ActOnFinishKNRParamDeclarations(Scope *S, Declarator &D,
- SourceLocation LocAfterDecls);
- virtual Decl *ActOnStartOfFunctionDef(Scope *S, Declarator &D);
- virtual Decl *ActOnStartOfFunctionDef(Scope *S, Decl *D);
- virtual void ActOnStartOfObjCMethodDef(Scope *S, Decl *D);
-
- virtual Decl *ActOnFinishFunctionBody(Decl *Decl, Stmt *Body);
- Decl *ActOnFinishFunctionBody(Decl *Decl, Stmt *Body,
- bool IsInstantiation);
+ void ActOnInitializerError(Decl *Dcl);
+ void SetDeclDeleted(Decl *dcl, SourceLocation DelLoc);
+ DeclGroupPtrTy FinalizeDeclaratorGroup(Scope *S, const DeclSpec &DS,
+ Decl **Group,
+ unsigned NumDecls);
+ void ActOnFinishKNRParamDeclarations(Scope *S, Declarator &D,
+ SourceLocation LocAfterDecls);
+ Decl *ActOnStartOfFunctionDef(Scope *S, Declarator &D);
+ Decl *ActOnStartOfFunctionDef(Scope *S, Decl *D);
+ void ActOnStartOfObjCMethodDef(Scope *S, Decl *D);
+
+ Decl *ActOnFinishFunctionBody(Decl *Decl, Stmt *Body);
+ Decl *ActOnFinishFunctionBody(Decl *Decl, Stmt *Body, bool IsInstantiation);
/// \brief Diagnose any unused parameters in the given sequence of
/// ParmVarDecl pointers.
@@ -739,20 +735,20 @@ public:
ParmVarDecl * const *End);
void DiagnoseInvalidJumps(Stmt *Body);
- virtual Decl *ActOnFileScopeAsmDecl(SourceLocation Loc, Expr *expr);
+ Decl *ActOnFileScopeAsmDecl(SourceLocation Loc, Expr *expr);
/// Scope actions.
- virtual void ActOnPopScope(SourceLocation Loc, Scope *S);
- virtual void ActOnTranslationUnitScope(Scope *S);
+ void ActOnPopScope(SourceLocation Loc, Scope *S);
+ void ActOnTranslationUnitScope(Scope *S);
/// ParsedFreeStandingDeclSpec - This method is invoked when a declspec with
/// no declarator (e.g. "struct foo;") is parsed.
- virtual Decl *ParsedFreeStandingDeclSpec(Scope *S, AccessSpecifier AS,
- DeclSpec &DS);
+ Decl *ParsedFreeStandingDeclSpec(Scope *S, AccessSpecifier AS,
+ DeclSpec &DS);
- virtual Decl *BuildAnonymousStructOrUnion(Scope *S, DeclSpec &DS,
- AccessSpecifier AS,
- RecordDecl *Record);
+ Decl *BuildAnonymousStructOrUnion(Scope *S, DeclSpec &DS,
+ AccessSpecifier AS,
+ RecordDecl *Record);
bool isAcceptableTagRedeclaration(const TagDecl *Previous,
TagTypeKind NewTag,
@@ -766,27 +762,26 @@ public:
TUK_Friend // Friend declaration: 'friend struct foo;'
};
- virtual Decl *ActOnTag(Scope *S, unsigned TagSpec, TagUseKind TUK,
- SourceLocation KWLoc, CXXScopeSpec &SS,
- IdentifierInfo *Name, SourceLocation NameLoc,
- AttributeList *Attr, AccessSpecifier AS,
- MultiTemplateParamsArg TemplateParameterLists,
- bool &OwnedDecl, bool &IsDependent);
+ Decl *ActOnTag(Scope *S, unsigned TagSpec, TagUseKind TUK,
+ SourceLocation KWLoc, CXXScopeSpec &SS,
+ IdentifierInfo *Name, SourceLocation NameLoc,
+ AttributeList *Attr, AccessSpecifier AS,
+ MultiTemplateParamsArg TemplateParameterLists,
+ bool &OwnedDecl, bool &IsDependent);
- virtual TypeResult ActOnDependentTag(Scope *S,
- unsigned TagSpec,
- TagUseKind TUK,
- const CXXScopeSpec &SS,
- IdentifierInfo *Name,
- SourceLocation TagLoc,
- SourceLocation NameLoc);
+ TypeResult ActOnDependentTag(Scope *S,
+ unsigned TagSpec,
+ TagUseKind TUK,
+ const CXXScopeSpec &SS,
+ IdentifierInfo *Name,
+ SourceLocation TagLoc,
+ SourceLocation NameLoc);
- virtual void ActOnDefs(Scope *S, Decl *TagD, SourceLocation DeclStart,
- IdentifierInfo *ClassName,
- llvm::SmallVectorImpl<Decl *> &Decls);
- virtual Decl *ActOnField(Scope *S, Decl *TagD,
- SourceLocation DeclStart,
- Declarator &D, Expr *BitfieldWidth);
+ void ActOnDefs(Scope *S, Decl *TagD, SourceLocation DeclStart,
+ IdentifierInfo *ClassName,
+ llvm::SmallVectorImpl<Decl *> &Decls);
+ Decl *ActOnField(Scope *S, Decl *TagD, SourceLocation DeclStart,
+ Declarator &D, Expr *BitfieldWidth);
FieldDecl *HandleField(Scope *S, RecordDecl *TagD, SourceLocation DeclStart,
Declarator &D, Expr *BitfieldWidth,
@@ -810,39 +805,37 @@ public:
bool CheckNontrivialField(FieldDecl *FD);
void DiagnoseNontrivial(const RecordType* Record, CXXSpecialMember mem);
CXXSpecialMember getSpecialMember(const CXXMethodDecl *MD);
- virtual void ActOnLastBitfield(SourceLocation DeclStart, Decl *IntfDecl,
+ void ActOnLastBitfield(SourceLocation DeclStart, Decl *IntfDecl,
llvm::SmallVectorImpl<Decl *> &AllIvarDecls);
- virtual Decl *ActOnIvar(Scope *S, SourceLocation DeclStart,
- Decl *IntfDecl,
- Declarator &D, Expr *BitfieldWidth,
- tok::ObjCKeywordKind visibility);
+ Decl *ActOnIvar(Scope *S, SourceLocation DeclStart, Decl *IntfDecl,
+ Declarator &D, Expr *BitfieldWidth,
+ tok::ObjCKeywordKind visibility);
// This is used for both record definitions and ObjC interface declarations.
- virtual void ActOnFields(Scope* S,
- SourceLocation RecLoc, Decl *TagDecl,
- Decl **Fields, unsigned NumFields,
- SourceLocation LBrac, SourceLocation RBrac,
- AttributeList *AttrList);
+ void ActOnFields(Scope* S, SourceLocation RecLoc, Decl *TagDecl,
+ Decl **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, Decl *TagDecl);
+ void ActOnTagStartDefinition(Scope *S, Decl *TagDecl);
/// ActOnStartCXXMemberDeclarations - Invoked when we have parsed a
/// C++ record definition's base-specifiers clause and are starting its
/// member declarations.
- virtual void ActOnStartCXXMemberDeclarations(Scope *S, Decl *TagDecl,
- SourceLocation LBraceLoc);
+ void ActOnStartCXXMemberDeclarations(Scope *S, Decl *TagDecl,
+ SourceLocation LBraceLoc);
/// ActOnTagFinishDefinition - Invoked once we have finished parsing
/// the definition of a tag (enumeration, class, struct, or union).
- virtual void ActOnTagFinishDefinition(Scope *S, Decl *TagDecl,
- SourceLocation RBraceLoc);
+ void ActOnTagFinishDefinition(Scope *S, Decl *TagDecl,
+ SourceLocation RBraceLoc);
/// ActOnTagDefinitionError - Invoked when there was an unrecoverable
/// error parsing the definition of a tag.
- virtual void ActOnTagDefinitionError(Scope *S, Decl *TagDecl);
+ void ActOnTagDefinitionError(Scope *S, Decl *TagDecl);
EnumConstantDecl *CheckEnumConstant(EnumDecl *Enum,
EnumConstantDecl *LastEnumConst,
@@ -850,14 +843,13 @@ public:
IdentifierInfo *Id,
Expr *val);
- virtual Decl *ActOnEnumConstant(Scope *S, Decl *EnumDecl,
- Decl *LastEnumConstant,
- SourceLocation IdLoc, IdentifierInfo *Id,
- SourceLocation EqualLoc, Expr *Val);
- virtual void ActOnEnumBody(SourceLocation EnumLoc, SourceLocation LBraceLoc,
- SourceLocation RBraceLoc, Decl *EnumDecl,
- Decl **Elements, unsigned NumElements,
- Scope *S, AttributeList *Attr);
+ Decl *ActOnEnumConstant(Scope *S, Decl *EnumDecl, Decl *LastEnumConstant,
+ SourceLocation IdLoc, IdentifierInfo *Id,
+ SourceLocation EqualLoc, Expr *Val);
+ void ActOnEnumBody(SourceLocation EnumLoc, SourceLocation LBraceLoc,
+ SourceLocation RBraceLoc, Decl *EnumDecl,
+ Decl **Elements, unsigned NumElements,
+ Scope *S, AttributeList *Attr);
DeclContext *getContainingDC(DeclContext *DC);
@@ -1093,8 +1085,8 @@ public:
DeclAccessPair FoundDecl,
FunctionDecl *Fn);
ExprResult FixOverloadedFunctionReference(ExprResult,
- DeclAccessPair FoundDecl,
- FunctionDecl *Fn);
+ DeclAccessPair FoundDecl,
+ FunctionDecl *Fn);
void AddOverloadedCallCandidates(UnresolvedLookupExpr *ULE,
Expr **Args, unsigned NumArgs,
@@ -1102,25 +1094,25 @@ public:
bool PartialOverloading = false);
ExprResult BuildOverloadedCallExpr(Scope *S, Expr *Fn,
- UnresolvedLookupExpr *ULE,
- SourceLocation LParenLoc,
- Expr **Args, unsigned NumArgs,
- SourceLocation *CommaLocs,
- SourceLocation RParenLoc);
+ UnresolvedLookupExpr *ULE,
+ SourceLocation LParenLoc,
+ Expr **Args, unsigned NumArgs,
+ SourceLocation *CommaLocs,
+ SourceLocation RParenLoc);
ExprResult CreateOverloadedUnaryOp(SourceLocation OpLoc,
- unsigned Opc,
- const UnresolvedSetImpl &Fns,
- Expr *input);
+ unsigned Opc,
+ const UnresolvedSetImpl &Fns,
+ Expr *input);
ExprResult CreateOverloadedBinOp(SourceLocation OpLoc,
- unsigned Opc,
- const UnresolvedSetImpl &Fns,
- Expr *LHS, Expr *RHS);
+ unsigned Opc,
+ const UnresolvedSetImpl &Fns,
+ Expr *LHS, Expr *RHS);
ExprResult CreateOverloadedArraySubscriptExpr(SourceLocation LLoc,
- SourceLocation RLoc,
- Expr *Base,Expr *Idx);
+ SourceLocation RLoc,
+ Expr *Base,Expr *Idx);
ExprResult
BuildCallToMemberFunction(Scope *S, Expr *MemExpr,
@@ -1134,7 +1126,7 @@ public:
SourceLocation RParenLoc);
ExprResult BuildOverloadedArrowExpr(Scope *S, Expr *Base,
- SourceLocation OpLoc);
+ SourceLocation OpLoc);
/// CheckCallReturnType - Checks that a call expression's return type is
/// complete. Returns true on failure. The location passed in is the location
@@ -1378,17 +1370,17 @@ public:
/// Called by ActOnProperty to handle @property declarations in
//// class extensions.
Decl *HandlePropertyInClassExtension(Scope *S,
- ObjCCategoryDecl *CDecl,
- SourceLocation AtLoc,
- FieldDeclarator &FD,
- Selector GetterSel,
- Selector SetterSel,
- const bool isAssign,
- const bool isReadWrite,
- const unsigned Attributes,
- bool *isOverridingProperty,
- TypeSourceInfo *T,
- tok::ObjCKeywordKind MethodImplKind);
+ ObjCCategoryDecl *CDecl,
+ SourceLocation AtLoc,
+ FieldDeclarator &FD,
+ Selector GetterSel,
+ Selector SetterSel,
+ const bool isAssign,
+ const bool isReadWrite,
+ const unsigned Attributes,
+ bool *isOverridingProperty,
+ TypeSourceInfo *T,
+ tok::ObjCKeywordKind MethodImplKind);
/// Called by ActOnProperty and HandlePropertyInClassExtension to
/// handle creating the ObjcPropertyDecl for a category or @interface.
@@ -1518,127 +1510,113 @@ public:
return FullExprArg(ActOnFinishFullExpr(Arg).release());
}
- virtual StmtResult ActOnExprStmt(FullExprArg Expr);
+ StmtResult ActOnExprStmt(FullExprArg Expr);
- virtual StmtResult ActOnNullStmt(SourceLocation SemiLoc);
- virtual StmtResult ActOnCompoundStmt(SourceLocation L, SourceLocation R,
+ StmtResult ActOnNullStmt(SourceLocation SemiLoc);
+ StmtResult ActOnCompoundStmt(SourceLocation L, SourceLocation R,
MultiStmtArg Elts,
bool isStmtExpr);
- virtual StmtResult ActOnDeclStmt(DeclGroupPtrTy Decl,
+ StmtResult ActOnDeclStmt(DeclGroupPtrTy Decl,
SourceLocation StartLoc,
SourceLocation EndLoc);
- virtual void ActOnForEachDeclStmt(DeclGroupPtrTy Decl);
- virtual StmtResult ActOnCaseStmt(SourceLocation CaseLoc, Expr *LHSVal,
+ void ActOnForEachDeclStmt(DeclGroupPtrTy Decl);
+ StmtResult ActOnCaseStmt(SourceLocation CaseLoc, Expr *LHSVal,
SourceLocation DotDotDotLoc, Expr *RHSVal,
SourceLocation ColonLoc);
- virtual void ActOnCaseStmtBody(Stmt *CaseStmt, Stmt *SubStmt);
+ void ActOnCaseStmtBody(Stmt *CaseStmt, Stmt *SubStmt);
- virtual StmtResult ActOnDefaultStmt(SourceLocation DefaultLoc,
+ StmtResult ActOnDefaultStmt(SourceLocation DefaultLoc,
SourceLocation ColonLoc,
Stmt *SubStmt, Scope *CurScope);
- virtual StmtResult ActOnLabelStmt(SourceLocation IdentLoc,
+ StmtResult ActOnLabelStmt(SourceLocation IdentLoc,
IdentifierInfo *II,
SourceLocation ColonLoc,
Stmt *SubStmt);
- virtual StmtResult ActOnIfStmt(SourceLocation IfLoc,
+ StmtResult ActOnIfStmt(SourceLocation IfLoc,
FullExprArg CondVal, Decl *CondVar,
Stmt *ThenVal,
SourceLocation ElseLoc, Stmt *ElseVal);
- virtual StmtResult ActOnStartOfSwitchStmt(SourceLocation SwitchLoc,
+ StmtResult ActOnStartOfSwitchStmt(SourceLocation SwitchLoc,
Expr *Cond,
Decl *CondVar);
- virtual StmtResult ActOnFinishSwitchStmt(SourceLocation SwitchLoc,
+ StmtResult ActOnFinishSwitchStmt(SourceLocation SwitchLoc,
Stmt *Switch, Stmt *Body);
- virtual StmtResult ActOnWhileStmt(SourceLocation WhileLoc,
+ StmtResult ActOnWhileStmt(SourceLocation WhileLoc,
FullExprArg Cond,
Decl *CondVar, Stmt *Body);
- virtual StmtResult ActOnDoStmt(SourceLocation DoLoc, Stmt *Body,
+ StmtResult ActOnDoStmt(SourceLocation DoLoc, Stmt *Body,
SourceLocation WhileLoc,
SourceLocation CondLParen, Expr *Cond,
SourceLocation CondRParen);
- virtual StmtResult ActOnForStmt(SourceLocation ForLoc,
- SourceLocation LParenLoc,
- Stmt *First, FullExprArg Second,
- Decl *SecondVar,
- FullExprArg Third,
- SourceLocation RParenLoc,
- Stmt *Body);
- virtual StmtResult ActOnObjCForCollectionStmt(SourceLocation ForColLoc,
- SourceLocation LParenLoc,
- Stmt *First, Expr *Second,
- SourceLocation RParenLoc, Stmt *Body);
-
- virtual StmtResult ActOnGotoStmt(SourceLocation GotoLoc,
- SourceLocation LabelLoc,
- IdentifierInfo *LabelII);
- virtual StmtResult ActOnIndirectGotoStmt(SourceLocation GotoLoc,
- SourceLocation StarLoc,
- Expr *DestExp);
- virtual StmtResult ActOnContinueStmt(SourceLocation ContinueLoc,
- Scope *CurScope);
- virtual StmtResult ActOnBreakStmt(SourceLocation GotoLoc,
- Scope *CurScope);
-
- virtual StmtResult ActOnReturnStmt(SourceLocation ReturnLoc,
- Expr *RetValExp);
- StmtResult ActOnBlockReturnStmt(SourceLocation ReturnLoc,
- Expr *RetValExp);
-
- virtual StmtResult ActOnAsmStmt(SourceLocation AsmLoc,
- bool IsSimple,
- bool IsVolatile,
- unsigned NumOutputs,
- unsigned NumInputs,
- IdentifierInfo **Names,
- MultiExprArg Constraints,
- MultiExprArg Exprs,
- Expr *AsmString,
- MultiExprArg Clobbers,
- SourceLocation RParenLoc,
- bool MSAsm = false);
+ StmtResult ActOnForStmt(SourceLocation ForLoc,
+ SourceLocation LParenLoc,
+ Stmt *First, FullExprArg Second,
+ Decl *SecondVar,
+ FullExprArg Third,
+ SourceLocation RParenLoc,
+ Stmt *Body);
+ StmtResult ActOnObjCForCollectionStmt(SourceLocation ForColLoc,
+ SourceLocation LParenLoc,
+ Stmt *First, Expr *Second,
+ SourceLocation RParenLoc, Stmt *Body);
+
+ StmtResult ActOnGotoStmt(SourceLocation GotoLoc,
+ SourceLocation LabelLoc,
+ IdentifierInfo *LabelII);
+ StmtResult ActOnIndirectGotoStmt(SourceLocation GotoLoc,
+ SourceLocation StarLoc,
+ Expr *DestExp);
+ StmtResult ActOnContinueStmt(SourceLocation ContinueLoc, Scope *CurScope);
+ StmtResult ActOnBreakStmt(SourceLocation GotoLoc, Scope *CurScope);
+
+ StmtResult ActOnReturnStmt(SourceLocation ReturnLoc, Expr *RetValExp);
+ StmtResult ActOnBlockReturnStmt(SourceLocation ReturnLoc, Expr *RetValExp);
+
+ StmtResult ActOnAsmStmt(SourceLocation AsmLoc,
+ bool IsSimple, bool IsVolatile,
+ unsigned NumOutputs, unsigned NumInputs,
+ IdentifierInfo **Names,
+ MultiExprArg Constraints,
+ MultiExprArg Exprs,
+ Expr *AsmString,
+ MultiExprArg Clobbers,
+ SourceLocation RParenLoc,
+ bool MSAsm = false);
VarDecl *BuildObjCExceptionDecl(TypeSourceInfo *TInfo, QualType ExceptionType,
IdentifierInfo *Name, SourceLocation NameLoc,
bool Invalid = false);
- virtual Decl *ActOnObjCExceptionDecl(Scope *S, Declarator &D);
+ Decl *ActOnObjCExceptionDecl(Scope *S, Declarator &D);
- virtual StmtResult ActOnObjCAtCatchStmt(SourceLocation AtLoc,
- SourceLocation RParen,
- Decl *Parm, Stmt *Body);
+ StmtResult ActOnObjCAtCatchStmt(SourceLocation AtLoc, SourceLocation RParen,
+ Decl *Parm, Stmt *Body);
- virtual StmtResult ActOnObjCAtFinallyStmt(SourceLocation AtLoc,
- Stmt *Body);
+ StmtResult ActOnObjCAtFinallyStmt(SourceLocation AtLoc, Stmt *Body);
- virtual StmtResult ActOnObjCAtTryStmt(SourceLocation AtLoc,
- Stmt *Try,
- MultiStmtArg Catch,
- Stmt *Finally);
+ StmtResult ActOnObjCAtTryStmt(SourceLocation AtLoc, Stmt *Try,
+ MultiStmtArg Catch, Stmt *Finally);
- virtual StmtResult BuildObjCAtThrowStmt(SourceLocation AtLoc,
- Expr *Throw);
- virtual StmtResult ActOnObjCAtThrowStmt(SourceLocation AtLoc,
- Expr *Throw,
- Scope *CurScope);
- virtual StmtResult ActOnObjCAtSynchronizedStmt(SourceLocation AtLoc,
- Expr *SynchExpr,
- Stmt *SynchBody);
+ StmtResult BuildObjCAtThrowStmt(SourceLocation AtLoc, Expr *Throw);
+ StmtResult ActOnObjCAtThrowStmt(SourceLocation AtLoc, Expr *Throw,
+ Scope *CurScope);
+ StmtResult ActOnObjCAtSynchronizedStmt(SourceLocation AtLoc,
+ Expr *SynchExpr,
+ Stmt *SynchBody);
VarDecl *BuildExceptionDeclaration(Scope *S, QualType ExDeclType,
TypeSourceInfo *TInfo,
IdentifierInfo *Name,
SourceLocation Loc,
SourceRange Range);
- virtual Decl *ActOnExceptionDeclarator(Scope *S, Declarator &D);
-
- virtual StmtResult ActOnCXXCatchBlock(SourceLocation CatchLoc,
- Decl *ExDecl,
- Stmt *HandlerBlock);
- virtual StmtResult ActOnCXXTryBlock(SourceLocation TryLoc,
- Stmt *TryBlock,
- MultiStmtArg Handlers);
+ Decl *ActOnExceptionDeclarator(Scope *S, Declarator &D);
+
+ StmtResult ActOnCXXCatchBlock(SourceLocation CatchLoc,
+ Decl *ExDecl, Stmt *HandlerBlock);
+ StmtResult ActOnCXXTryBlock(SourceLocation TryLoc, Stmt *TryBlock,
+ MultiStmtArg Handlers);
void DiagnoseReturnInConstructorExceptionHandler(CXXTryStmt *TryBlock);
bool ShouldWarnIfUnusedFileScopedDecl(const DeclaratorDecl *D) const;
@@ -1670,43 +1648,37 @@ public:
void DiagnoseSentinelCalls(NamedDecl *D, SourceLocation Loc,
Expr **Args, unsigned NumArgs);
- virtual void
- PushExpressionEvaluationContext(ExpressionEvaluationContext NewContext);
+ void PushExpressionEvaluationContext(ExpressionEvaluationContext NewContext);
- virtual void PopExpressionEvaluationContext();
+ void PopExpressionEvaluationContext();
void MarkDeclarationReferenced(SourceLocation Loc, Decl *D);
void MarkDeclarationsReferencedInType(SourceLocation Loc, QualType T);
bool DiagRuntimeBehavior(SourceLocation Loc, const PartialDiagnostic &PD);
// Primary Expressions.
- virtual SourceRange getExprRange(Expr *E) const;
+ SourceRange getExprRange(Expr *E) const;
- virtual ExprResult ActOnIdExpression(Scope *S,
- CXXScopeSpec &SS,
- UnqualifiedId &Name,
- bool HasTrailingLParen,
- bool IsAddressOfOperand);
+ ExprResult ActOnIdExpression(Scope *S, CXXScopeSpec &SS, UnqualifiedId &Name,
+ bool HasTrailingLParen, bool IsAddressOfOperand);
bool DiagnoseEmptyLookup(Scope *S, CXXScopeSpec &SS, LookupResult &R,
CorrectTypoContext CTC = CTC_Unknown);
- ExprResult LookupInObjCMethod(LookupResult &R,
- Scope *S,
- IdentifierInfo *II,
- bool AllowBuiltinCreation=false);
+ ExprResult LookupInObjCMethod(LookupResult &R, Scope *S, IdentifierInfo *II,
+ bool AllowBuiltinCreation=false);
ExprResult ActOnDependentIdExpression(const CXXScopeSpec &SS,
- const DeclarationNameInfo &NameInfo,
- bool isAddressOfOperand,
+ const DeclarationNameInfo &NameInfo,
+ bool isAddressOfOperand,
const TemplateArgumentListInfo *TemplateArgs);
ExprResult BuildDeclRefExpr(ValueDecl *D, QualType Ty,
- SourceLocation Loc,
- const CXXScopeSpec *SS = 0);
+ SourceLocation Loc,
+ const CXXScopeSpec *SS = 0);
ExprResult BuildDeclRefExpr(ValueDecl *D, QualType Ty,
- const DeclarationNameInfo &NameInfo,
- const CXXScopeSpec *SS = 0);
+ const DeclarationNameInfo &NameInfo,
+ const CXXScopeSpec *SS = 0);
VarDecl *BuildAnonymousStructUnionMemberPath(FieldDecl *Field,
llvm::SmallVectorImpl<FieldDecl *> &Path);
ExprResult
@@ -1718,9 +1690,9 @@ public:
LookupResult &R,
const TemplateArgumentListInfo *TemplateArgs);
ExprResult BuildImplicitMemberExpr(const CXXScopeSpec &SS,
- LookupResult &R,
+ LookupResult &R,
const TemplateArgumentListInfo *TemplateArgs,
- bool IsDefiniteInstance);
+ bool IsDefiniteInstance);
bool UseArgumentDependentLookup(const CXXScopeSpec &SS,
const LookupResult &R,
bool HasTrailingLParen);
@@ -1732,44 +1704,39 @@ public:
const TemplateArgumentListInfo *TemplateArgs);
ExprResult BuildDeclarationNameExpr(const CXXScopeSpec &SS,
- LookupResult &R,
- bool ADL);
+ LookupResult &R,
+ bool ADL);
ExprResult BuildDeclarationNameExpr(const CXXScopeSpec &SS,
- const DeclarationNameInfo &NameInfo,
- NamedDecl *D);
-
- virtual ExprResult ActOnPredefinedExpr(SourceLocation Loc,
- tok::TokenKind Kind);
- virtual ExprResult ActOnNumericConstant(const Token &);
- virtual ExprResult ActOnCharacterConstant(const Token &);
- virtual ExprResult ActOnParenExpr(SourceLocation L, SourceLocation R,
- Expr *Val);
- virtual ExprResult ActOnParenOrParenListExpr(SourceLocation L,
- SourceLocation R,
- MultiExprArg Val,
- ParsedType TypeOfCast
- = ParsedType());
+ const DeclarationNameInfo &NameInfo,
+ NamedDecl *D);
+
+ ExprResult ActOnPredefinedExpr(SourceLocation Loc, tok::TokenKind Kind);
+ ExprResult ActOnNumericConstant(const Token &);
+ ExprResult ActOnCharacterConstant(const Token &);
+ ExprResult ActOnParenExpr(SourceLocation L, SourceLocation R, Expr *Val);
+ ExprResult ActOnParenOrParenListExpr(SourceLocation L,
+ SourceLocation R,
+ MultiExprArg Val,
+ ParsedType TypeOfCast = ParsedType());
/// ActOnStringLiteral - The specified tokens were lexed as pasted string
/// fragments (e.g. "foo" "bar" L"baz").
- virtual ExprResult ActOnStringLiteral(const Token *Toks,
- unsigned NumToks);
+ ExprResult ActOnStringLiteral(const Token *Toks, unsigned NumToks);
// Binary/Unary Operators. 'Tok' is the token for the operator.
- ExprResult CreateBuiltinUnaryOp(SourceLocation OpLoc,
- unsigned OpcIn,
+ ExprResult CreateBuiltinUnaryOp(SourceLocation OpLoc, unsigned OpcIn,
Expr *InputArg);
ExprResult BuildUnaryOp(Scope *S, SourceLocation OpLoc,
UnaryOperatorKind Opc, Expr *input);
- virtual ExprResult ActOnUnaryOp(Scope *S, SourceLocation OpLoc,
- tok::TokenKind Op, Expr *Input);
+ ExprResult ActOnUnaryOp(Scope *S, SourceLocation OpLoc,
+ tok::TokenKind Op, Expr *Input);
ExprResult CreateSizeOfAlignOfExpr(TypeSourceInfo *T,
SourceLocation OpLoc,
bool isSizeOf, SourceRange R);
ExprResult CreateSizeOfAlignOfExpr(Expr *E, SourceLocation OpLoc,
bool isSizeOf, SourceRange R);
- virtual ExprResult
+ ExprResult
ActOnSizeOfAlignOfExpr(SourceLocation OpLoc, bool isSizeof, bool isType,
void *TyOrEx, const SourceRange &ArgRange);
@@ -1777,65 +1744,55 @@ public:
bool CheckSizeOfAlignOfOperand(QualType type, SourceLocation OpLoc,
const SourceRange &R, bool isSizeof);
- virtual ExprResult ActOnPostfixUnaryOp(Scope *S, SourceLocation OpLoc,
- tok::TokenKind Kind,
- Expr *Input);
-
- virtual ExprResult ActOnArraySubscriptExpr(Scope *S, Expr *Base,
- SourceLocation LLoc,
- Expr *Idx,
- SourceLocation RLoc);
- ExprResult CreateBuiltinArraySubscriptExpr(Expr *Base,
- SourceLocation LLoc,
- Expr *Idx,
- SourceLocation RLoc);
-
- ExprResult BuildMemberReferenceExpr(Expr *Base,
- QualType BaseType,
- SourceLocation OpLoc,
- bool IsArrow,
- CXXScopeSpec &SS,
- NamedDecl *FirstQualifierInScope,
+ ExprResult ActOnPostfixUnaryOp(Scope *S, SourceLocation OpLoc,
+ tok::TokenKind Kind, Expr *Input);
+
+ ExprResult ActOnArraySubscriptExpr(Scope *S, Expr *Base, SourceLocation LLoc,
+ Expr *Idx, SourceLocation RLoc);
+ ExprResult CreateBuiltinArraySubscriptExpr(Expr *Base, SourceLocation LLoc,
+ Expr *Idx, SourceLocation RLoc);
+
+ ExprResult BuildMemberReferenceExpr(Expr *Base, QualType BaseType,
+ SourceLocation OpLoc, bool IsArrow,
+ CXXScopeSpec &SS,
+ NamedDecl *FirstQualifierInScope,
const DeclarationNameInfo &NameInfo,
const TemplateArgumentListInfo *TemplateArgs);
- ExprResult BuildMemberReferenceExpr(Expr *Base,
- QualType BaseType,
- SourceLocation OpLoc, bool IsArrow,
- const CXXScopeSpec &SS,
- NamedDecl *FirstQualifierInScope,
-