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
This commit is contained in:
Fariborz Jahanian 2012-08-09 21:12:39 +00:00
Родитель cace2103ef
Коммит 6940972c33
1 изменённых файлов: 3 добавлений и 22 удалений

Просмотреть файл

@ -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