[cfe-commits] r54013 - /cfe/trunk/lib/Parse/ParseObjc.cpp

Steve Naroff snaroff at apple.com
Fri Jul 25 07:30:29 PDT 2008


Author: snaroff
Date: Fri Jul 25 09:30:25 2008
New Revision: 54013

URL: http://llvm.org/viewvc/llvm-project?rev=54013&view=rev
Log:
Fix Parser::ParseObjCMethodDefinition(). Only call the actions module for valid MDecl's.

Modified:
    cfe/trunk/lib/Parse/ParseObjc.cpp

Modified: cfe/trunk/lib/Parse/ParseObjc.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Parse/ParseObjc.cpp?rev=54013&r1=54012&r2=54013&view=diff

==============================================================================
--- cfe/trunk/lib/Parse/ParseObjc.cpp (original)
+++ cfe/trunk/lib/Parse/ParseObjc.cpp Fri Jul 25 09:30:25 2008
@@ -1292,8 +1292,10 @@
   EnterScope(Scope::FnScope|Scope::DeclScope);
   
   // Tell the actions module that we have entered a method definition with the
-  // specified Declarator for the method.
-  Actions.ObjCActOnStartOfMethodDef(CurScope, MDecl);
+  // specified Declarator for the method. If we don't have an MDecl, avoid
+  // calling the actions module.
+  if (MDecl)
+    Actions.ObjCActOnStartOfMethodDef(CurScope, MDecl);
   
   StmtResult FnBody = ParseCompoundStatementBody();
   
@@ -1305,7 +1307,8 @@
   ExitScope();
   
   // TODO: Pass argument information.
-  Actions.ActOnFinishFunctionBody(MDecl, FnBody.Val);
+  if (MDecl)
+    Actions.ActOnFinishFunctionBody(MDecl, FnBody.Val);
   return MDecl;
 }
 





More information about the cfe-commits mailing list