aboutsummaryrefslogtreecommitdiff
path: root/lib/Parse/ParseObjc.cpp
AgeCommit message (Collapse)Author
2008-10-20more simplifications to error recovery in ParseObjCPropertyAttributeChris Lattner
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@57815 91177308-0d34-0410-b5e6-96231b3b80d8
2008-10-20move some code around to make it fall through more, no functionality change.Chris Lattner
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@57813 91177308-0d34-0410-b5e6-96231b3b80d8
2008-10-20reject properties completely in objc1 instead of emitting Chris Lattner
weird errors about property attributes being unknown. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@57812 91177308-0d34-0410-b5e6-96231b3b80d8
2008-10-20More property attribute recovery improvements. Instead of this:Chris Lattner
crash.m:8:12: error: type name requires a specifier or qualifier @property (readonlyx, getter=isAwesome) int _awesome; ^ crash.m:8:29: error: expected ';' at end of declaration list @property (readonlyx, getter=isAwesome) int _awesome; ^ crash.m:8:39: error: expected identifier or '(' @property (readonlyx, getter=isAwesome) int _awesome; ^ we now get: crash.m:8:12: error: unknown property attribute 'readonlyx' @property (readonlyx, getter=isAwesome) int _awesome; ^ Also, we can eliminate isObjCPropertyAttribute now. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@57811 91177308-0d34-0410-b5e6-96231b3b80d8
2008-10-20significantly simplify and clean up error recovery in Chris Lattner
ParseObjCPropertyAttribute. Before, on this code (where a comma was forgotten): @property (readonly getter=isAwesome) int _awesome; we emitted: crash.m:9:11: error: expected ')' @property (readonly getter=isAwesome) int _awesome; ^ crash.m:9:37: error: type name requires a specifier or qualifier @property (readonly getter=isAwesome) int _awesome; ^ crash.m:9:37: error: expected identifier or '(' crash.m:9:37: error: expected ';' at end of declaration list crash.m:9:1: error: @property requires fields to be named @property (readonly getter=isAwesome) int _awesome; ^ now we emit: crash.m:9:21: error: expected ')' @property (readonly getter=isAwesome) int _awesome; ^ crash.m:9:11: error: to match this '(' @property (readonly getter=isAwesome) int _awesome; ^ git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@57809 91177308-0d34-0410-b5e6-96231b3b80d8
2008-10-20fix a crash on unnamed properties like:Chris Lattner
@property (readonly) int : 4; git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@57805 91177308-0d34-0410-b5e6-96231b3b80d8
2008-10-20simplify some code by using ExpectAndConsume. When an errorChris Lattner
occurs, skip to an @ or ; instead of to a } or ;. Properties don't necessarily live in {}'s. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@57804 91177308-0d34-0410-b5e6-96231b3b80d8
2008-10-20refactor a bunch of code:Chris Lattner
Check for @end in ParseObjCInterfaceDeclList instead of in each caller Handle @required and @optional with the same code Add some fixmes about some apparently objc2 code that is being accepted in objc1. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@57803 91177308-0d34-0410-b5e6-96231b3b80d8
2008-10-20fix some minor error recovery bugs in ParseObjCInterfaceDeclListChris Lattner
where it would reject @required in non-protocols, but then go ahead and tag methods with required anyway. Instead, if we see this in something other than a protocol, just ignore the request. Also, improve error recovery a bit when we see something bogus inside an interface. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@57798 91177308-0d34-0410-b5e6-96231b3b80d8
2008-10-20restructure the body of the ParseObjCInterfaceDeclList loopChris Lattner
to make it easier to understand. No functionality change. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@57797 91177308-0d34-0410-b5e6-96231b3b80d8
2008-10-03Pass postfix attributes to ActOnFields.Daniel Dunbar
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@56992 91177308-0d34-0410-b5e6-96231b3b80d8
2008-09-26Enter a new scope for a @try block.Ted Kremenek
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@56668 91177308-0d34-0410-b5e6-96231b3b80d8
2008-09-26Parser support for prefix __attribute__ on @protocol.Daniel Dunbar
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@56642 91177308-0d34-0410-b5e6-96231b3b80d8
2008-09-26Have @finally introduce a new scope.Ted Kremenek
Fixes: <rdar://problem/6248119> @finally doesn't introduce a new scope git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@56629 91177308-0d34-0410-b5e6-96231b3b80d8
2008-09-19Fix rdar://6222856: the receiver of a message expr is anChris Lattner
arbitrary expr, not just a assign expr. The grammar comment was right, the code was just wrong. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@56353 91177308-0d34-0410-b5e6-96231b3b80d8
2008-08-26Synthesize property setter method as we do for getter.Daniel Dunbar
- Also, fix Parser to construct proper SetterName selector (should be lifted out of parser though). git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@55352 91177308-0d34-0410-b5e6-96231b3b80d8
2008-08-23Reserved C++ words are valid selectors in Objective-C++Anders Carlsson
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@55253 91177308-0d34-0410-b5e6-96231b3b80d8
2008-08-23we already have a handle on the 'in' keyword, don't bother getting two.Chris Lattner
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@55217 91177308-0d34-0410-b5e6-96231b3b80d8
2008-08-23Fix a FIXME by not creating an invalid AST on erroneous input. Also Chris Lattner
make diagnostic output in some other malformed cases significantly more useful. This fixes PR2708 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@55215 91177308-0d34-0410-b5e6-96231b3b80d8
2008-08-05Move AsmLabel into Declarator instead of just a parameter toDaniel Dunbar
ActOnDeclarator. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@54353 91177308-0d34-0410-b5e6-96231b3b80d8
2008-08-05Fix rdar://6124613 a crash on invalid code.Chris Lattner
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@54340 91177308-0d34-0410-b5e6-96231b3b80d8
2008-08-05Add more Parser/Sema support for GCC asm-label extension.Daniel Dunbar
- ActOnDeclarator now takes an additional parameter which is the AsmLabel if used. Its unfortunate that this bubbles up this high, but we cannot just lump it in as an attribute without mistakenly *accepting* it as an attribute. - The actual asm-label itself is, however, encoded as an AsmLabelAttr on the FunctionDecl. - Slightly improved parser error recovery on malformed asm-labels. - CodeGen support still missing... git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@54339 91177308-0d34-0410-b5e6-96231b3b80d8
2008-07-26Pull protocol resolution of out ActOnStartClassInterface, this is also the Chris Lattner
last client of the old ParseObjCProtocolReferences, so it also removes it. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@54094 91177308-0d34-0410-b5e6-96231b3b80d8
2008-07-26refactor protocol resolution out of ActOnStartCategoryInterfaceChris Lattner
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@54093 91177308-0d34-0410-b5e6-96231b3b80d8
2008-07-26pull protocol resolution out into ActOnStartProtocolInterface.Chris Lattner
This temporarily duplicates ParseObjCProtocolReferences, but it will be removed in the future. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@54092 91177308-0d34-0410-b5e6-96231b3b80d8
2008-07-25gcc requires a semicolon at the end of an interface, unlike its extension ↵Chris Lattner
for structs. rdar://6095245. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@54044 91177308-0d34-0410-b5e6-96231b3b80d8
2008-07-25Move fix in r54013 from the parser to sema.Steve Naroff
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@54032 91177308-0d34-0410-b5e6-96231b3b80d8
2008-07-25Fix Parser::ParseObjCMethodDefinition(). Only call the actions module for ↵Steve Naroff
valid MDecl's. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@54013 91177308-0d34-0410-b5e6-96231b3b80d8
2008-07-21minor cleanup to the actions interface to pass around SmallVectorImpl insteadChris Lattner
of a specific smallvector size. Fix protocol lists to pass down proper location info, so we get diagnostics like this: t.m:3:35: error: cannot find protocol definition for 'NSCopying', referenced by 'NSWhatever' @interface NSWhatever : NSObject <NSCopying> ^ instead of this: t.m:3:44: error: cannot find protocol definition for 'NSCopying', referenced by 'NSWhatever' @interface NSWhatever : NSObject <NSCopying> ^ Add a new IdentifierLocPair typedef which is just a pair<IdentifierInfo*, SourceLocation> git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@53883 91177308-0d34-0410-b5e6-96231b3b80d8
2008-06-06Initial work on additional memory collection for ObjC AST objects. We nowTed Kremenek
have Destroy methods of ObjcMethodDecl and ObjCInterfaceDecl which recursively destroy their owned Decls and Stmts. There are a few cases where it is not clear what to do (FIXMEs included in the patch). git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@52050 91177308-0d34-0410-b5e6-96231b3b80d8
2008-06-04Parser::ParseObjCSynchronizedStmt() needs to Enter/Exit a decl scope.Steve Naroff
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@51963 91177308-0d34-0410-b5e6-96231b3b80d8
2008-06-03Fix parser bug/FIXME with @catch.Steve Naroff
<rdar://problem/5980846> clang on xcode: error: declarator requires an identifier (for @catch) git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@51895 91177308-0d34-0410-b5e6-96231b3b80d8
2008-05-22Make sure the source location for @property points the the @-sign (not the ↵Steve Naroff
decl spec). Also added a FIXME related to how we represent @properties in the ObjCInterfaceDecl AST. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@51450 91177308-0d34-0410-b5e6-96231b3b80d8
2008-05-07This patch introduces declaration of getter methods for ObjC2'sFariborz Jahanian
properties. Couple of property tests will fail with this patch. Will fix them next. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@50818 91177308-0d34-0410-b5e6-96231b3b80d8
2008-05-06Patch to refactor setter/getter names of property attributes into SelectorFariborz Jahanian
(was IdentifierInfo * before). This will make method declartations whole lot easier. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@50747 91177308-0d34-0410-b5e6-96231b3b80d8
2008-05-05percolate @optional/@required protocols down to ASTs forFariborz Jahanian
properties declared in the protocol. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@50662 91177308-0d34-0410-b5e6-96231b3b80d8
2008-04-29Default visbility for instance variables is protected.Fariborz Jahanian
Patch by Emerson Murhpy-Hill. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@50452 91177308-0d34-0410-b5e6-96231b3b80d8
2008-04-21Support for @dynamic AST build.Fariborz Jahanian
More property semantics checking. First test case for ObjC2's property implementation. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@50057 91177308-0d34-0410-b5e6-96231b3b80d8
2008-04-18Initial work for property implementation declarations.Fariborz Jahanian
Mostly semantic checking in this patch. This is on going and incomplete. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@49882 91177308-0d34-0410-b5e6-96231b3b80d8
2008-04-14New AST representation for each objc2's property declaration.Fariborz Jahanian
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@49699 91177308-0d34-0410-b5e6-96231b3b80d8
2008-04-11AST generation for objc2's property declarations.Fariborz Jahanian
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@49565 91177308-0d34-0410-b5e6-96231b3b80d8
2008-04-11Minor changes per Chris L's review.Fariborz Jahanian
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@49539 91177308-0d34-0410-b5e6-96231b3b80d8
2008-04-10Patch for:Fariborz Jahanian
1) objc ivar processing is split out of ActOnField into its own ActOnIvar method. 2) the new objc ivar action takes visibility info directly, eliminating AllVisibilities in ParseObjCClassInstanceVariables. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@49506 91177308-0d34-0410-b5e6-96231b3b80d8
2008-04-10refactor Parser::ParseStructDeclaration to return a vector of uninterpreted Chris Lattner
declarators. This allows the clients (C structs, objc classes, objc properties, [future] C++ classes) etc, to do custom processing before invoking an action. This has two benefits in the short term: 1) objc ivar processing should be split out of ActOnField into its own ActOn method. 2) the new objc ivar action can take visibility info directly, eliminating AllVisibilities in ParseObjCClassInstanceVariables. 3) objc properties can pass their own special sauce down to sema as well. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@49468 91177308-0d34-0410-b5e6-96231b3b80d8
2008-04-07move sorting of qualifying protocols from the parser intoChris Lattner
sema. This allows clients of the parser to have the unmolested list if desired, and guarantees that noone can create an ObjCQualifiedInterfaceType with an unsorted list. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@49310 91177308-0d34-0410-b5e6-96231b3b80d8
2008-03-17clean up property memory allocation to move it into the ast classesChris Lattner
like the rest of the classes. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@48434 91177308-0d34-0410-b5e6-96231b3b80d8
2008-03-16minor cleanups, make getNumInstanceMethods always return unsigned.Chris Lattner
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@48423 91177308-0d34-0410-b5e6-96231b3b80d8
2008-03-15Make a major restructuring of the clang tree: introduce a top-levelChris Lattner
lib dir and move all the libraries into it. This follows the main llvm tree, and allows the libraries to be built in parallel. The top level now enforces that all the libs are built before Driver, but we don't care what order the libs are built in. This speeds up parallel builds, particularly incremental ones. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@48402 91177308-0d34-0410-b5e6-96231b3b80d8