aboutsummaryrefslogtreecommitdiff
path: root/lib/Parse/ParseObjc.cpp
diff options
context:
space:
mode:
authorFariborz Jahanian <fjahanian@apple.com>2012-08-09 21:12:39 +0000
committerFariborz Jahanian <fjahanian@apple.com>2012-08-09 21:12:39 +0000
commit6940972c33891ff5d2189fbf232dcdeee0e9daf8 (patch)
treebc028d62e5c8c09ec99db32755a30d622481c83e /lib/Parse/ParseObjc.cpp
parentcace2103efe3449c406bcdfd4874dfb1e94c811a (diff)
objective-C: refactoring of objc's delayed parsing.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@161620 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Parse/ParseObjc.cpp')
-rw-r--r--lib/Parse/ParseObjc.cpp25
1 files changed, 3 insertions, 22 deletions
diff --git a/lib/Parse/ParseObjc.cpp b/lib/Parse/ParseObjc.cpp
index 69e6d0a43f..70254b6db6 100644
--- a/lib/Parse/ParseObjc.cpp
+++ b/lib/Parse/ParseObjc.cpp
@@ -2864,7 +2864,6 @@ void Parser::ParseLexedObjCMethodDefs(LexedMethod &LM, bool parseMethod) {
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 @@ void Parser::ParseLexedObjCMethodDefs(LexedMethod &LM, bool parseMethod) {
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