aboutsummaryrefslogtreecommitdiff
path: root/lib/Parse/ParseObjc.cpp
diff options
context:
space:
mode:
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