rename some "Parse" actions to "ActOn". Move code around in
ParseFunctionDefinition so that ActOnFunctionDefBody is always
called if ActOnStartOfFunctionDef is called. This fixes a crash
reported by Nuno Lopes.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@42793 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/Sema/Sema.h b/Sema/Sema.h
index 70997b0..9baad3a 100644
--- a/Sema/Sema.h
+++ b/Sema/Sema.h
@@ -154,8 +154,8 @@
void AddInitializerToDecl(DeclTy *dcl, ExprTy *init);
virtual DeclTy *FinalizeDeclaratorGroup(Scope *S, DeclTy *Group);
- virtual DeclTy *ParseStartOfFunctionDef(Scope *S, Declarator &D);
- virtual DeclTy *ParseFunctionDefBody(DeclTy *Decl, StmtTy *Body);
+ virtual DeclTy *ActOnStartOfFunctionDef(Scope *S, Declarator &D);
+ virtual DeclTy *ActOnFunctionDefBody(DeclTy *Decl, StmtTy *Body);
virtual void PopScope(SourceLocation Loc, Scope *S);
/// ParsedFreeStandingDeclSpec - This method is invoked when a declspec with
diff --git a/Sema/SemaDecl.cpp b/Sema/SemaDecl.cpp
index 2a006d8..c3b3652 100644
--- a/Sema/SemaDecl.cpp
+++ b/Sema/SemaDecl.cpp
@@ -768,7 +768,7 @@
}
-Sema::DeclTy *Sema::ParseStartOfFunctionDef(Scope *FnBodyScope, Declarator &D) {
+Sema::DeclTy *Sema::ActOnStartOfFunctionDef(Scope *FnBodyScope, Declarator &D) {
assert(CurFunctionDecl == 0 && "Function parsing confused");
assert(D.getTypeObject(0).Kind == DeclaratorChunk::Function &&
"Not a function declarator!");
@@ -819,7 +819,7 @@
return FD;
}
-Sema::DeclTy *Sema::ParseFunctionDefBody(DeclTy *D, StmtTy *Body) {
+Sema::DeclTy *Sema::ActOnFunctionDefBody(DeclTy *D, StmtTy *Body) {
FunctionDecl *FD = static_cast<FunctionDecl*>(D);
FD->setBody((Stmt*)Body);