summaryrefslogtreecommitdiffstats
path: root/clang/lib/Parse/ParseObjc.cpp
Commit message (Collapse)AuthorAgeFilesLines
...
* Restore 'atomic' as an attribute of objcFariborz Jahanian2011-06-111-0/+2
| | | | | | properties. llvm-svn: 132866
* Remove 'atomic' as a property attribute keyword.Fariborz Jahanian2011-06-081-2/+0
| | | | | | | It is not a sanctioned keyword and is assumed as default. // rdar://8790791 llvm-svn: 132753
* Fixes an instance method meta-data generation bug inFariborz Jahanian2011-04-221-1/+1
| | | | | | | | | | | ObjC NeXt runtime where method pointer registered in metadata belongs to an unrelated method. Ast part of this fix, I turned at @end missing warning (for class implementations) into an error as we can never be sure that meta-data being generated is correct. // rdar://9072317 llvm-svn: 130019
* fix the second part of rdar://8366474 - clang fails to parse ObjC selectors ↵Chris Lattner2011-03-261-2/+2
| | | | | | with '::', when :: isn't the first part of the selector. llvm-svn: 128344
* Fix the recovery from missing semis on @property declarations to not consumeJohn McCall2011-03-261-2/+1
| | | | | | | | the following '@'. Conceivably, we could skip tokens until something that can validly start an @interface declaration here, but it's not clear that it matters. llvm-svn: 128325
* Insomniac refactoring: change how the parser allocates attributes so thatJohn McCall2011-03-241-18/+23
| | | | | | | | | AttributeLists do not accumulate over the lifetime of parsing, but are instead reused. Also make the arguments array not require a separate allocation, and make availability attributes store their stuff in augmented memory, too. llvm-svn: 128209
* Call out ObjC parameter types as a different kind of declarator contextJohn McCall2011-03-231-1/+1
| | | | | | from a normal type-spec, just for completeness. llvm-svn: 128185
* Make sure that we always pop a function's scope *before* we callDouglas Gregor2011-03-161-6/+8
| | | | | | | | | | | ActOnFinishFunctionBody/ActOnBlockStmtExpr. This way, we ensure that we diagnose undefined labels before the jump-scope checker gets run, since the jump-scope checker requires (as its invariant) that all of the GotoStmts be wired up correctly. Fixes PR9495. llvm-svn: 127738
* Place duplicate argument declaration in inFariborz Jahanian2011-03-121-7/+11
| | | | | | | method prototypes under the -Wduplicate-method-arg and turn it off by default. llvm-svn: 127552
* Clarify the context in which an Objective-C type name is being parsedDouglas Gregor2011-03-081-6/+9
| | | | | | | by using an enumeration rather than a boolean value. No functionality change. llvm-svn: 127259
* Implement a special code-completion pattern for "IBAction". FixesDouglas Gregor2011-02-151-1/+1
| | | | | | <rdar://problem/8767704>. llvm-svn: 125604
* Fix scoping of method declarations and issue Fariborz Jahanian2011-02-091-5/+14
| | | | | | | warning when same parameter name used multiple times. // rdar://8877730 llvm-svn: 125229
* Fix warnings found by gcc-4.6, from -Wunused-but-set-variable andJeffrey Yasskin2011-01-181-4/+6
| | | | | | -Wint-to-pointer-cast. llvm-svn: 123719
* Use Parser::ExpectAndConsume() uniformly to eat semicolons afterDouglas Gregor2011-01-051-16/+4
| | | | | | | | | Objective-C declarations and statements. Fixes <rdar://problem/8814576> (wrong source line for diagnostics about missing ';'), and now we actually consume the ';' at the end of a @compatibility_alias directive! llvm-svn: 122855
* Rename MaybeSkipFunctionBodyForCodeCompletion -> ↵Argyrios Kyrtzidis2011-01-041-2/+3
| | | | | | | | trySkippingFunctionBodyForCodeCompletion and check isCodeCompletionEnabled() before doing the call. Suggestions by Chris. llvm-svn: 122792
* When in code-completion, skip obj-c method bodies for speed up.Argyrios Kyrtzidis2011-01-031-0/+3
| | | | llvm-svn: 122781
* Refactor how we collect attributes during parsing, and add slots for attributesJohn McCall2010-12-241-24/+32
| | | | | | | on array and function declarators. This is pretty far from complete, and I'll revisit it later if someone doesn't beat me to it. llvm-svn: 122535
* Fix a major inconsistency in the representation of Objective-CDouglas Gregor2010-12-211-9/+4
| | | | | | | | | | | | | | | | | | | | classes, categories, protocols, and class extensions, where the methods and properties of these entities would be inserted into the DeclContext in an ordering that doesn't necessarily reflect source order. The culprits were Sema::ActOnMethodDeclaration(), which did not perform the insertion of the just-created method declaration into the DeclContext for these Objective-C entities, and Sema::ActOnAtEnd(), which inserted all method declarations at the *end* of the DeclContext. With this fix in hand, clean up the code-completion actions for property setters/getters that worked around this brokenness in the AST. Fixes <rdar://problem/8062781>, where this problem manifested as poor token-annotation information, but this would have struck again in many other places. llvm-svn: 122347
* Warn when synthesizing a property which isFariborz Jahanian2010-12-171-0/+2
| | | | | | | implicitly atomic under -Wimplicit-atomic-properties flag. // rdar://8774580 llvm-svn: 122095
* fix typoChris Lattner2010-12-171-1/+1
| | | | llvm-svn: 122041
* When parsing something that looks like an ill-formedDouglas Gregor2010-11-191-3/+4
| | | | | | | | protocol-qualifier list without a leading type (e.g., <#blah#>), don't complain about it being an archaic protocol-qualifier list unless it actually parses as one. llvm-svn: 119805
* For an Objective-C @synthesize statement, e.g.,Douglas Gregor2010-11-171-3/+4
| | | | | | | | | @synthesize foo = _foo; keep track of the location of the ivar ("_foo"). Teach libclang to visit the ivar as a member reference. llvm-svn: 119447
* Region-allocate all AttributeList objects from a factory object instead of ↵Ted Kremenek2010-11-101-15/+6
| | | | | | | | | | | | | | | | | | | | | | | | manually managing them using new/delete and OwningPtrs. After memory profiling Clang, I witnessed periodic leaks of these objects; digging deeper into the code, it was clear that our management of these objects was a mess. The ownership rules were murky at best, and not always followed. Worse, there are plenty of error paths where we could screw up. This patch introduces AttributeList::Factory, which is a factory class that creates AttributeList objects and then blows them away all at once. While conceptually simple, most of the changes in this patch just have to do with migrating over to the new interface. Most of the changes have resulted in some nice simplifications. This new strategy currently holds on to all AttributeList objects during the lifetime of the Parser object. This is easily tunable. If we desire to have more bound the lifetime of AttributeList objects more precisely, we can have the AttributeList::Factory object (in Parser) push/pop its underlying allocator as we enter/leave key methods in the Parser. This means that we get simple memory management while still having the ability to finely control memory use if necessary. Note that because AttributeList objects are now BumpPtrAllocated, we may reduce malloc() traffic in many large files with attributes. This fixes the leak reported in: <rdar://problem/8650003> llvm-svn: 118675
* Issues good diagnostic when @end is missing.Fariborz Jahanian2010-11-091-0/+1
| | | | | | // rdar://8283484 llvm-svn: 118629
* Diagnose a coherant message when @interfaceFariborz Jahanian2010-11-021-1/+6
| | | | | | | does not terminate with @end. // rdar: //7824372 llvm-svn: 117991
* Teach the C++ simple-type-specifier parser and tentative parses aboutDouglas Gregor2010-10-211-0/+17
| | | | | | protocol-qualified types such as id<Protocol>. llvm-svn: 117081
* Fix spelling error.Cameron Esfahani2010-10-121-1/+1
| | | | llvm-svn: 116283
* Use ParseObjCSelectorPiece for parsing getter and setter names in @property ↵Anders Carlsson2010-10-021-10/+17
| | | | | | declarations. Fixes PR8169. llvm-svn: 115411
* Refactor code completion for expressions that occur as arguments inDouglas Gregor2010-09-201-6/+36
| | | | | | | | Objective-C message sends. There is no functionality change here; this is prep work for using the parameter types to help guide the expression results when code-completing the argument. llvm-svn: 114375
* Implement automatic bracket insertion for Objective-C class messageDouglas Gregor2010-09-161-0/+29
| | | | | | | | | | | | | | | | sends. These are far trickier than instance messages, because we typically have something like NSArray alloc] where it appears to be a declaration of a variable named "alloc" up until we see the ']' (or a ':'), and at that point we can't backtrace. So, we use a combination of syntactic and semantic disambiguation to treat this as a message send only when the type is an Objective-C type and it has the syntax of a class message send (which would otherwise be ill-formed). llvm-svn: 114057
* Initialize TypeOrExpr to NULL to silence a false-positive uninitialized warningNick Lewycky2010-09-151-1/+1
| | | | | | from certain GCC's. Patch by Neil Vachharajani! llvm-svn: 113995
* Implement bracket insertion for Objective-C instance message sends asDouglas Gregor2010-09-151-0/+7
| | | | | | | | | | | | | | | | | | | | | | | part of parser recovery. For example, given: a method1:arg]; we detect after parsing the expression "a" that we have the start of a message send expression. We pretend we've seen a '[' prior to the a, then parse the remainder as a message send. We'll then give a diagnostic+fix-it such as: fixit-objc-message.m:17:3: error: missing '[' at start of message send expression a method1:arg]; ^ [ The algorithm here is very simple, and always assumes that the open bracket goes at the beginning of the message send. It also only works for non-super instance message sends at this time. llvm-svn: 113968
* Improve recovery when there is a stray ']' or ')' before the ';' atDouglas Gregor2010-09-071-1/+1
| | | | | | the end of a statement. Fixes <rdar://problem/6896493>. llvm-svn: 113202
* Use std::string instead of llvm::StringRef to avoid dangling ref.Fariborz Jahanian2010-09-031-1/+1
| | | | | | Per Chris's comment. llvm-svn: 112979
* Use getSpelling to get original text of theFariborz Jahanian2010-09-031-55/+21
| | | | | | c++ operator token. (radar 8328250). llvm-svn: 112977
* Patch to allow alternative representation of c++Fariborz Jahanian2010-09-031-1/+56
| | | | | | | operators (and, or, etc.) to be used as selectors to match g++'s behavior. llvm-svn: 112935
* handle :: in selectors in objc++ mode, rdar://8366474Chris Lattner2010-08-271-3/+7
| | | | llvm-svn: 112307
* One who seeks knowledge learns something new every day.John McCall2010-08-261-21/+21
| | | | | | | | | One who seeks the Tao unlearns something new every day. Less and less remains until you arrive at non-action. When you arrive at non-action, nothing will be left undone. llvm-svn: 112244
* Implement code completion for @selector expressionsDouglas Gregor2010-08-261-0/+18
| | | | llvm-svn: 112186
* OwningExprResult -> ExprResult. This patch brought to you byJohn McCall2010-08-241-29/+28
| | | | | | | M-x query-replace-regexp \(Sema::\|Action::\|Parser::\|\)Owning\(Expr\|Stmt\)Result -> \2Result llvm-svn: 111903
* Abstract out passing around types and kill off ActionBase.John McCall2010-08-241-15/+18
| | | | llvm-svn: 111901
* Provide code completion results for the context-sensitive Objective-CDouglas Gregor2010-08-241-5/+10
| | | | | | keywords "in", "out", "inout", "byref", "bycopy", and "oneway". llvm-svn: 111884
* Kill off ExprArg (now just Expr*) and StmtArg (now just Stmt*).John McCall2010-08-231-21/+19
| | | | llvm-svn: 111863
* Handling remaining rule for synthesize bitfields inFariborz Jahanian2010-08-231-1/+2
| | | | | | | | class extensions (nonfragile-abi2).For every class @interface and class extension @interface, if the last ivar is a bitfield of any type, then add an implicit `char :0` ivar to the end of that interface. llvm-svn: 111857
* Introduce a new code-completion point when we're parsing aDouglas Gregor2010-08-231-3/+3
| | | | | | | | | declarator. Here, we can only see a few things (e.g., cvr-qualifiers, nested name specifiers) and we do not want to provide other non-macro completions. Previously, we would end up in recovery mode and would provide a large number of non-relevant completions. llvm-svn: 111818
* Sundry incremental steps towards killing off Action.John McCall2010-08-231-5/+5
| | | | llvm-svn: 111795
* DeclPtrTy -> Decl *John McCall2010-08-211-90/+90
| | | | llvm-svn: 111733
* Another step in the process of making the parser depend on Sema:John McCall2010-08-201-3/+3
| | | | | | | | | - move DeclSpec &c into the Sema library - move ParseAST into the Parse library Reflect this change in a thousand different includes. Reflect this change in the link orders. llvm-svn: 111667
* Once code completion has completed, pass a "completion context" on toDouglas Gregor2010-08-111-3/+3
| | | | | | | the code-completion consumer. The consumer can use this information to augument, filter, or display the code-completion results. llvm-svn: 110858
* atch for implementation of objective-c's -WselectorFariborz Jahanian2010-07-221-1/+2
| | | | | | | warning flag in clang. Little more to do for a PCH issue. Radar 6507158. llvm-svn: 109129
OpenPOWER on IntegriCloud