summaryrefslogtreecommitdiffstats
path: root/clang/lib/Parse/ParseObjc.cpp
Commit message (Collapse)AuthorAgeFilesLines
* Modified the Objective-C lexer and parser (only Sean Callanan2014-12-091-2/+8
| | | | | | | | | | | | | | | | in debugger mode) to accept @import declarations and pass them to the debugger. In the preprocessor, accept import declarations if the debugger is enabled, but don't actually load the module, just pass the import path on to the preprocessor callbacks. In the Objective-C parser, if it sees an import declaration in statement context (usual for LLDB), ignore it and return a NullStmt. llvm-svn: 223855
* Enable ActOnIdExpression to use delayed typo correction for non-C++ codeKaelyn Takata2014-11-211-1/+3
| | | | | | when calling DiagnoseEmptyLookup. llvm-svn: 222551
* Wire up delayed typo correction to DiagnoseEmptyLookup and set upKaelyn Takata2014-11-201-1/+4
| | | | | | | | | Sema::ActOnIdExpression to use the new functionality. Among other things, this allows recovery in several cases where it wasn't possible before (e.g. correcting a mistyped static_cast<>). llvm-svn: 222464
* Remove the last couple uses of the ExprArg(just Expr*) typedef in Parser.Craig Topper2014-10-301-1/+1
| | | | llvm-svn: 220897
* Parse: Replace polymorphic functor objects with lambdas and llvm::function_ref.Benjamin Kramer2014-09-031-95/+48
| | | | | | No change in functionality. llvm-svn: 217025
* Objective-C. When we use @selector(save:), etc. there may be more Fariborz Jahanian2014-06-241-3/+10
| | | | | | | | | | | | | than one method with mismatched type of same selector name. clang issues a warning to point this out since it may cause undefined behavior. There are cases though that some APIs don't care about user methods and such warnings are perceived as noise. This patch allows users to add paren delimiters around selector name to turn off such warnings. So, @selector((save:)) will turn off the warning. It also provides 'fixit' so user knows what to do. // rdar://16458579 llvm-svn: 211611
* Refactoring. Remove release and take methods from ActionResult. Rename ↵Nikola Smiljanic2014-05-291-24/+24
| | | | | | takeAs to getAs. llvm-svn: 209800
* [C++11] Use 'nullptr'. Parser edition.Craig Topper2014-05-211-67/+69
| | | | llvm-svn: 209275
* Objective-C. Improve diagnostic error for '@import' Fariborz Jahanian2014-03-261-3/+3
| | | | | | when modules are disabled. // rdar://15505492 llvm-svn: 204862
* Cleanup dead assignments reported by scan-buildArnaud A. de Grandmaison2014-03-231-2/+2
| | | | llvm-svn: 204569
* [C++11] Add 'override' keyword to virtual methods that override their base ↵Craig Topper2014-03-121-2/+2
| | | | | | class. llvm-svn: 203641
* ExpectAndConsume: Diagnose errors automaticallyAlp Toker2014-01-011-44/+28
| | | | | | | | | | | | | | 1) Teach ExpectAndConsume() to emit expected and expected-after diagnostics using the generic diagnostic descriptions added in r197972, eliminating another set of trivial err_expected_* variations while maintaining existing behaviour. 2) Lift SkipUntil() recovery out of ExpectAndConsume(). The Expect/Consume family of functions are primitive parser operations that now have the well-defined property of operating on single tokens. Factoring out recovery exposes opportunities for more consistent and tailored error recover at the call sites instead of just relying on a bottled SkipUntil formula. llvm-svn: 198270
* Switch over more of the parser to err_expectedAlp Toker2013-12-301-7/+5
| | | | | | | Includes a fix for a missing highlight range caused by a ',' typo in the PP diagnostics. llvm-svn: 198252
* Support and use token kinds as diagnostic argumentsAlp Toker2013-12-241-34/+41
| | | | | | | | | | | | | | | | | | | Introduce proper facilities to render token spellings using the diagnostic formatter. Replaces most of the hard-coded diagnostic messages related to expected tokens, which all shared the same semantics but had to be multiply defined due to variations in token order or quote marks. The associated parser changes are largely mechanical but they expose commonality in whole chunks of the parser that can now be factored away. This commit uses C++11 typed enums along with a speculative legacy fallback until the transition is complete. Requires corresponding changes in LLVM r197895. llvm-svn: 197972
* Fix a tranche of comment, test and doc typosAlp Toker2013-12-051-1/+1
| | | | llvm-svn: 196510
* Generate a marker token when entering or leaving a submodule when building aRichard Smith2013-11-231-4/+4
| | | | | | | | | module. Use the marker to diagnose cases where we try to transition between submodules when not at the top level (most likely because a closing brace was missing at the end of a header file, but is also possible if submodule headers attempt to do something fundamentally non-modular, like our .def files). llvm-svn: 195543
* Replaced bool parameters in SkipUntil function with single bit-based parameter.Alexey Bataev2013-11-181-25/+25
| | | | llvm-svn: 194994
* ObjectiveC: Handle the case of qualifying protocolsFariborz Jahanian2013-09-251-0/+3
| | | | | | | | | declared in a typedef declaraton used as super class of an ObjC class. Curretnly, these protocols are dropped from the class hierarchy. Test shows that it is now included. // rdar://15051465 llvm-svn: 191395
* This patch removes unused parameter allProperties and converts remainingFariborz Jahanian2013-07-161-4/+1
| | | | | | | parameters in ArrayRef'ize Sema::ActOnAtEnd to ArrayRef. Patch by Robert Wilhelm. llvm-svn: 186421
* ArrayRef'ize Sema::CodeComplete*Dmitri Gribenko2013-06-161-25/+13
| | | | | | Patch by Robert Wilhelm. llvm-svn: 184052
* address some comments on r183474:Adrian Prantl2013-06-071-3/+4
| | | | | | | | | | - factor the name construction part out from constructSetterName - rename constructSetterName to the more appropriate constructSetterSelector no functionality change intended. rdar://problem/14035789 llvm-svn: 183582
* Objective-C parsing. Error recovery when category implementationFariborz Jahanian2013-05-171-0/+6
| | | | | | declaration is illegally protocol qualified. // rdar://13920026 llvm-svn: 182136
* Fix a typo in a parse assert.Fariborz Jahanian2013-04-291-1/+1
| | | | | | Patch by Alex Denisov. llvm-svn: 180712
* Objective-C parsing [qoi]: Recover gracefully with good diagnosticFariborz Jahanian2013-04-241-0/+7
| | | | | | | when class implementation declaration adds protocol qualifier list. // rdar://12233858 llvm-svn: 180228
* Objective-C++: Enable passing of modern C++11 style Fariborz Jahanian2013-04-181-1/+8
| | | | | | | initialized temporaries to objc++ methods. // rdar://12788429 llvm-svn: 179818
* Objective-C parsing [qoi]: Provide good recovery whenFariborz Jahanian2013-04-181-1/+3
| | | | | | | Objective-C dictionary literals has bad syntax for the separator. // rdar://10679157 llvm-svn: 179784
* Make the ObjC attributes diagnostics a bit more informative.Nico Weber2013-04-041-6/+10
| | | | llvm-svn: 178720
* Emit a nicer diagnostic for misplaced attributes on ObjC directives.Nico Weber2013-04-031-0/+15
| | | | llvm-svn: 178670
* [Parser] Don't code-complete twice.Argyrios Kyrtzidis2013-03-271-1/+1
| | | | | | | | | | | | | | | When we are consuming the current token just to enter a new token stream, we push the current token in the back of the stream so that we get it again. Unfortunately this had the effect where if the current token is a code-completion one, we would code-complete once during consuming it and another time after the stream ended. Fix this by making sure that, in this case, ConsumeAnyToken() will consume a code-completion token without invoking code-completion. rdar://12842503 llvm-svn: 178199
* Do the error recovery for @end only.Fariborz Jahanian2013-03-201-4/+7
| | | | | | | | I am not sure how much we can improve for when a randon ObjC keyword is thrown into the ivar decl. block. // rdar://6854840 llvm-svn: 177553
* Objective-C [qoi] more gracefull recovery when Fariborz Jahanian2013-03-201-17/+28
| | | | | | | '}' is missing for the ivar declarations. // rdar://6854840 llvm-svn: 177549
* Objective-C [qoi]: Provide improved parse diagnostics whenFariborz Jahanian2013-03-191-0/+4
| | | | | | | | | closing rbrace is missing in an ObjC class declaration. Can do beter than this, but it involves addition of overhead which will be present in correct code. // rdar://6854840 llvm-svn: 177435
* Use None rather than Optional<T>() where possible.David Blaikie2013-02-211-1/+1
| | | | llvm-svn: 175705
* Include llvm::Optional in clang/Basic/LLVM.hDavid Blaikie2013-02-201-1/+1
| | | | | | Post-commit CR feedback from Jordan Rose regarding r175594. llvm-svn: 175679
* Excise <cctype> from Clang (except clang-tblgen) in favor of CharInfo.h.Jordan Rose2013-02-081-1/+2
| | | | | | | Nearly all of these changes are one-to-one replacements; the few that aren't have to do with custom identifier validation. llvm-svn: 174768
* Finish semantic analysis for [[carries_dependency]] attribute.Richard Smith2013-01-281-2/+2
| | | | | | | | | | This required plumbing through a new flag to determine whether a ParmVarDecl is actually a parameter of a function declaration (as opposed to a function typedef etc, where the attribute is prohibited). Weirdly, this attribute (just like [[noreturn]]) cannot be applied to a function type, just to a function declaration (and its parameters). llvm-svn: 173726
* objectiveC (take two): don't warn when in -Wselector mode andFariborz Jahanian2013-01-221-24/+5
| | | | | | | an unimplemented selector is consumed by "respondsToSelector:". // rdar://12938616 llvm-svn: 173179
* objectiveC: don't warn when in -Wselector mode andFariborz Jahanian2013-01-211-3/+22
| | | | | | | an unimplemented selector is consumed by "respondsToSelector:". // rdar://12938616 llvm-svn: 173097
* Refactor to call ActOnFinishFullExpr on every full expression. TeachRichard Smith2013-01-141-1/+1
| | | | | | | | ActOnFinishFullExpr that some of its checks only apply to discarded-value expressions. This adds missing checks for unexpanded variadic template parameter packs to a handful of constructs. llvm-svn: 172485
* s/CXX0X/CXX11/g, except for __GNU_EXPERIMENTAL_CXX0X__, and update a few ↵Richard Smith2013-01-021-1/+1
| | | | | | nearby 'C++0x' comments. llvm-svn: 171372
* Remove some remnants of OwningExprResult / OwningStmtResult.Nico Weber2012-12-311-20/+17
| | | | | | | These got deleted late 2010 during the Actions/Sema unification. No functionality change. llvm-svn: 171269
* Don't require a space between the two ">" in "vector<id<protocol>>" in objc++11.Nico Weber2012-12-141-5/+1
| | | | | | | | C++11 allowed writing "vector<vector<int>>" without a space between the two ">". This change allows this for protocols in template lists too in -std=c++11 mode, and improves the diagnostic in c++98 mode. llvm-svn: 170223
* Use @import rather than @__experimental_modules_import, since theDouglas Gregor2012-12-111-1/+1
| | | | | | latter is rather a mess to type. llvm-svn: 169919
* Sort all of Clang's files under 'lib', and fix up the broken headersChandler Carruth2012-12-041-1/+1
| | | | | | | | | | | | | uncovered. This required manually correcting all of the incorrect main-module headers I could find, and running the new llvm/utils/sort_includes.py script over the files. I also manually added quite a few missing headers that were uncovered by shuffling the order or moving headers up to be main-module-headers. llvm-svn: 169237
* objective-C: improve on warnings about misplacement of methodFariborz Jahanian2012-09-171-20/+4
| | | | | | argument names. // rdar://12263549 llvm-svn: 164077
* objective-C: issue warning when there is no whitespaceFariborz Jahanian2012-09-171-1/+25
| | | | | | | between objc method parameter name and colon. // rdar://12263549 llvm-svn: 164047
* Fix a couple of Doxygen issues pointed out by -Wdocumentation.Dmitri Gribenko2012-09-121-2/+2
| | | | llvm-svn: 163722
* Revert "objective-C: warn under a flag if missing argument"Ted Kremenek2012-09-121-14/+3
| | | | | | | We plan on discussing this more, but we shouldn't have it in the compiler in an incomplete state. llvm-svn: 163720
* Revert "objective-C: warn if selector has nothing but bare"Ted Kremenek2012-09-121-7/+2
| | | | | | We plan on discussing this more. llvm-svn: 163719
* objective-C: warn if selector has nothing but bareFariborz Jahanian2012-09-111-2/+7
| | | | | | ':' in its name. // rdar://8366823 llvm-svn: 163650
OpenPOWER on IntegriCloud