From 849639d8b548519cc5a00c0c9253f0c0d525060d Mon Sep 17 00:00:00 2001 From: Argyrios Kyrtzidis Date: Tue, 7 Feb 2012 16:50:53 +0000 Subject: Make parsing of objc @implementations more robust. Parsing of @implementations was based on modifying global state from the parser; the logic for late parsing of methods was spread in multiple places making it difficult to have a robust error recovery. -it was difficult to ensure that we don't neglect parsing the lexed methods. -it was difficult to setup the original objc container context for parsing the lexed methods after completing ParseObjCAtImplementationDeclaration and returning to top level context. Enhance parsing of @implementations by centralizing it in Parser::ParseObjCAtImplementationDeclaration(). ParseObjCAtImplementationDeclaration now returns only after an @implementation is fully parsed; all the data and logic for late parsing of methods is now in one place. This allows us to provide code-completion for late parsed methods with mis-matched braces. rdar://10775381 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@149987 91177308-0d34-0410-b5e6-96231b3b80d8 --- lib/Parse/ParseAST.cpp | 4 ---- 1 file changed, 4 deletions(-) (limited to 'lib/Parse/ParseAST.cpp') diff --git a/lib/Parse/ParseAST.cpp b/lib/Parse/ParseAST.cpp index b4023983af..7e087ef7ea 100644 --- a/lib/Parse/ParseAST.cpp +++ b/lib/Parse/ParseAST.cpp @@ -96,10 +96,6 @@ void clang::ParseAST(Sema &S, bool PrintStats) { if (Abort) return; - - // Check for any pending objective-c implementation decl. - while ((ADecl = P.FinishPendingObjCActions())) - Consumer->HandleTopLevelDecl(ADecl.get()); // Process any TopLevelDecls generated by #pragma weak. for (SmallVector::iterator -- cgit v1.2.1