[cfe-commits] r161620 - /cfe/trunk/lib/Parse/ParseObjc.cpp
Fariborz Jahanian
fjahanian at apple.com
Thu Aug 9 14:12:39 PDT 2012
Author: fjahanian
Date: Thu Aug 9 16:12:39 2012
New Revision: 161620
URL: http://llvm.org/viewvc/llvm-project?rev=161620&view=rev
Log:
objective-C: refactoring of objc's delayed parsing.
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=161620&r1=161619&r2=161620&view=diff
==============================================================================
--- cfe/trunk/lib/Parse/ParseObjc.cpp (original)
+++ cfe/trunk/lib/Parse/ParseObjc.cpp Thu Aug 9 16:12:39 2012
@@ -2864,7 +2864,6 @@
ConsumeAnyToken();
assert(Tok.is(tok::l_brace) && "Inline objective-c method not starting with '{'");
- SourceLocation BraceLoc = Tok.getLocation();
// Enter a scope for the method or c-fucntion body.
ParseScope BodyScope(this,
parseMethod
@@ -2877,27 +2876,9 @@
Actions.ActOnStartOfObjCMethodDef(getCurScope(), MCDecl);
else
Actions.ActOnStartOfFunctionDef(getCurScope(), MCDecl);
-
- if (SkipFunctionBodies && trySkippingFunctionBody()) {
- BodyScope.Exit();
- (void)Actions.ActOnFinishFunctionBody(MCDecl, 0);
- return;
- }
-
- StmtResult FnBody(ParseCompoundStatementBody());
-
- // If the function body could not be parsed, make a bogus compoundstmt.
- if (FnBody.isInvalid()) {
- Sema::CompoundScopeRAII CompoundScope(Actions);
- FnBody = Actions.ActOnCompoundStmt(BraceLoc, BraceLoc,
- MultiStmtArg(Actions), false);
- }
-
- // Leave the function body scope.
- BodyScope.Exit();
-
- (void)Actions.ActOnFinishFunctionBody(MCDecl, FnBody.take());
-
+
+ MCDecl = ParseFunctionStatementBody(MCDecl, BodyScope);
+
if (Tok.getLocation() != OrigLoc) {
// Due to parsing error, we either went over the cached tokens or
// there are still cached tokens left. If it's the latter case skip the
More information about the cfe-commits
mailing list