summaryrefslogtreecommitdiffstats
path: root/clang/lib/Parse/ParseObjc.cpp
Commit message (Collapse)AuthorAgeFilesLines
...
* objective-C: warn under a flag if missing argumentFariborz Jahanian2012-09-111-3/+14
| | | | | | | name results in unintended selector name. // rdar://12263549 llvm-svn: 163634
* Remove ASTOwningVector, it doesn't own anything and provides no value over ↵Benjamin Kramer2012-08-231-18/+9
| | | | | | SmallVector. llvm-svn: 162492
* Rip out remnants of move semantic emulation and smart pointers in Sema.Benjamin Kramer2012-08-231-13/+13
| | | | | | | These were nops for quite a while and only lead to confusion. ASTMultiPtr now behaves like a proper dumb array reference. llvm-svn: 162475
* objective-C++: dalyed parsing of ctors with memberFariborz Jahanian2012-08-101-6/+16
| | | | | | | initializer list defined inside an objc class implementation. wip llvm-svn: 161699
* objective-C++: delay parsing of ctor with try blockFariborz Jahanian2012-08-101-0/+10
| | | | | | | with member initializer list defined inside an objc implementation block. wip. llvm-svn: 161692
* objective-C++: delayed parsing of member function withFariborz Jahanian2012-08-101-4/+15
| | | | | | | function-try-block occuring in objc's implementation block. wip. llvm-svn: 161675
* objective-C: refactoring of objc's delayed parsing.Fariborz Jahanian2012-08-091-22/+3
| | | | llvm-svn: 161620
* objective-C: minor refactoring in methodFariborz Jahanian2012-08-091-9/+4
| | | | | | definition parsing logic. llvm-svn: 161593
* Minor simplification for r161534.Eli Friedman2012-08-081-6/+4
| | | | llvm-svn: 161544
* objective-C: refactor/simplify parsing of delayedFariborz Jahanian2012-08-081-1/+4
| | | | | | | method/c-funcs defined in objc class implementation. No intended functionality change. llvm-svn: 161540
* PR13558: Fix typo 'compatiblity'. Thinking of the children. Apparently.Richard Smith2012-08-081-2/+2
| | | | llvm-svn: 161537
* Handle deprecation diagnostics correctly for C struct fields and Objective-C ↵Eli Friedman2012-08-081-4/+6
| | | | | | properties/ivars. <rdar://problem/6642337>. llvm-svn: 161534
* objective-c parsing. Don't crash when selector nameFariborz Jahanian2012-07-261-5/+5
| | | | | | is missing in method prototype. // rdar://11939584 llvm-svn: 160789
* objective-c: provide fixit hint for @autoreleasepoolFariborz Jahanian2012-07-091-2/+17
| | | | | | and similar other keywords. // rdar://10723084 llvm-svn: 159956
* objective-c: just as we have done for method definitions,Fariborz Jahanian2012-07-021-22/+41
| | | | | | | | c-functions declared in implementation should have their parsing delayed until the end so, they can access forward declared private methods. // rdar://10387088 llvm-svn: 159626
* Clean up a large number of C++11 attribute parse issues, including parsingAlexis Hunt2012-06-231-1/+1
| | | | | | | | | | | | | | | | | | attributes in more places where we didn't and catching a lot more issues. This implements nearly every aspect of C++11 attribute parsing, except for: - Attributes are permitted on explicit instantiations inside the declarator (but not preceding the decl-spec) - Attributes are permitted on friend declarations of functions. - Multiple instances of the same attribute in an attribute-list (e.g. [[noreturn, noreturn]], not [[noreturn]] [[noreturn]] which is conforming) are allowed. The first two are marked as expected-FIXME in the test file and the latter is probably a defect and is currently untested. Thanks to Richard Smith for providing the lion's share of the testcases. llvm-svn: 159072
* objective-c: deprecated C-like parameters in Objective-C Fariborz Jahanian2012-06-211-2/+5
| | | | | | | method declarations. // rdar://11578353. llvm-svn: 158929
* Move isCXXSimpleTypeSpecifier from Parser to Sema and tweak it for wider use.Kaelyn Uhrain2012-06-151-1/+1
| | | | llvm-svn: 158572
* Documentation cleanup, fixing Doxygen markup. Mostly this avoids common termsJames Dennett2012-06-111-5/+5
| | | | | | | | | | | | | | such as "protocol" and "expression" being implicitly turned into links to mistakenly-generated Doxygen pages: - Escaping @ symbols when Doxygen would otherwise incorrectly interpret them; - Escaping # symbols when they're not intended as explicit Doxygen link requests, such as when discussing preprocessor directives; - In one odd case, unescaping @ in @__experimental_modules_import, because Doxygen wrote '\@' to the output in that case, causing the example in the description of ImportDecl to be wrong; and - Fixing a typo: @breif -> @brief. llvm-svn: 158299
* objc: position of 'fixit' was off by one.Fariborz Jahanian2012-05-291-1/+1
| | | | | | This patch fixes it. // rdar://11488351 llvm-svn: 157646
* objective-c: provide a useful 'fixit' suggestion whenFariborz Jahanian2012-05-211-1/+5
| | | | | | | errornously using commas to separate ObjC message arguments. // rdar://11376372 llvm-svn: 157216
* Move the warnings for extra semi-colons under -Wextra-semi. Also, addedRichard Trieu2012-05-161-3/+1
| | | | | | | | a warning for an extra semi-colon after function definitions. Added logic so that a block of semi-colons on a line will only get one warning instead of a warning for each semi-colon. llvm-svn: 156934
* [libclang/AST] Index references of protocols in "@protocol(...)" syntax.Argyrios Kyrtzidis2012-05-161-1/+2
| | | | | | | | | To do that, keep track of the location of the protocol id in the ObjCProtocolExpr AST node. rdar://11190837 llvm-svn: 156890
* Don't crash when using objc boxed expression with parsing error.Argyrios Kyrtzidis2012-05-101-1/+4
| | | | | | rdar://11426994 llvm-svn: 156565
* objective-c. Fixes a 'fixit' where location ofFariborz Jahanian2012-05-091-0/+1
| | | | | | | '*' on objective-c class name was misplaced. // rdar://11311333 llvm-svn: 156517
* Refactor DelayedDiagnostics so that it keeps diagnostics inJohn McCall2012-05-071-1/+1
| | | | | | | separate pools owned by the RAII objects that keep pushing decl state. This gives us quite a bit more flexibility. llvm-svn: 156289
* Implements boxed expressions for Objective-C. <rdar://problem/10194391>Patrick Beard2012-04-191-0/+26
| | | | llvm-svn: 155082
* Added a flag to the parser to skip method bodies.Erik Verbruggen2012-04-121-5/+3
| | | | llvm-svn: 154584
* Added a new attribute, objc_root_class, which informs the compiler when a ↵Patrick Beard2012-04-061-0/+1
| | | | | | | | | root class is intentionally declared. The warning this inhibits, -Wobjc-root-class, is opt-in for now. However, all clang unit tests that would trigger the warning have been updated to use -Wno-objc-root-class. <rdar://problem/7446698> llvm-svn: 154187
* Unify naming of LangOptions variable/get function across the Clang stack ↵David Blaikie2012-03-111-13/+13
| | | | | | | | | | (Lex to AST). The member variable is always "LangOpts" and the member function is always "getLangOpts". Reviewed by Chris Lattner llvm-svn: 152536
* Support for raw and template forms of numeric user-defined literals,Richard Smith2012-03-091-2/+0
| | | | | | and lots of tidying up. llvm-svn: 152392
* Streamline BalancedDelimiterTracker, by eliminating the duplicateDouglas Gregor2012-03-081-1/+1
| | | | | | | | paren/brace/bracket tracking (the Consume* functions already did it), removing the use of ConsumeAnyToken(), and moving the hot paths inline with the error paths out-of-line. llvm-svn: 152274
* Silence unused variable warnings.Benjamin Kramer2012-03-071-3/+3
| | | | llvm-svn: 152170
* Add clang support for new Objective-C literal syntax for NSDictionary, NSArray,Ted Kremenek2012-03-061-0/+181
| | | | | | | | | | | | | NSNumber, and boolean literals. This includes both Sema and Codegen support. Included is also support for new Objective-C container subscripting. My apologies for the large patch. It was very difficult to break apart. The patch introduces changes to the driver as well to cause clang to link in additional runtime support when needed to support the new language features. Docs are forthcoming to document the implementation and behavior of these features. llvm-svn: 152137
* User-defined literals: reject string and character UDLs in all places where theRichard Smith2012-03-061-0/+2
| | | | | | | | | | grammar requires a string-literal and not a user-defined-string-literal. The two constructs are still represented by the same TokenKind, in order to prevent a combinatorial explosion of different kinds of token. A flag on Token tracks whether a ud-suffix is present, in order to prevent clients from needing to look at the token's spelling. llvm-svn: 152098
* Change @import to @__experimental_modules_import. We are not ready to ↵Ted Kremenek2012-03-011-1/+1
| | | | | | | | commit to a particular syntax for modules, and don't have time to push it forward in the near future. llvm-svn: 151841
* objective-c: provide fixit hint when atomic property does notFariborz Jahanian2012-02-291-4/+10
| | | | | | | have matching user defined setter/getter and a warning is issued. In this case, a fixit note is displayed. // rdar://10267155 llvm-svn: 151766
* [libclang] Make sure that all top-level decls in a @implementation areArgyrios Kyrtzidis2012-02-231-3/+1
| | | | | | | | marked as such. Previously we missed tag declarations; fixes rdar://10902015 llvm-svn: 151283
* Generalize -Wempty-body: warn when statement body is empty (closes: PR11329)Dmitri Gribenko2012-02-141-1/+3
| | | | | | | | | | | | | | * if, switch, range-based for: warn if semicolon is on the same line. * for, while: warn if semicolon is on the same line and either next statement is compound statement or next statement has more indentation. Replacing the semicolon with {} or moving the semicolon to the next line will always silence the warning. Tests from SemaCXX/if-empty-body.cpp merged into SemaCXX/warn-empty-body.cpp. llvm-svn: 150515
* Make parsing of objc @implementations more robust.Argyrios Kyrtzidis2012-02-071-82/+105
| | | | | | | | | | | | | | | | | | | 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 llvm-svn: 149987
* Remove unreachable code in Clang. (replace with llvm_unreachable where ↵David Blaikie2012-01-171-2/+0
| | | | | | appropriate or when GCC requires it) llvm-svn: 148292
* Under -fmodules, accept #public <macroname> and #private <macroname>Douglas Gregor2012-01-031-1/+5
| | | | | | | to make a macro public (the default for headers) or private, respectively. llvm-svn: 147455
* Introduce a non-uglified syntax for module imports in Objective-C:Douglas Gregor2012-01-031-0/+2
| | | | | | @import identifier [. identifier]* ; llvm-svn: 147452
* Eliminate ObjCForwardProtocolDecl, which is redundant now thatDouglas Gregor2012-01-011-11/+10
| | | | | | ObjCProtocolDecl modules forward declarations properly. llvm-svn: 147415
* Unweaken vtables as per ↵David Blaikie2011-12-201-0/+6
| | | | | | http://llvm.org/docs/CodingStandards.html#ll_virtual_anch llvm-svn: 146959
* In Parser::SkipUntil do not stop at '@' unconditionally.Argyrios Kyrtzidis2011-12-171-2/+6
| | | | | | | | | | | | | | | Stopping at '@' was originally intended to avoid skipping an '@' at the @interface context when doing parser recovery, but we should not stop at all '@' tokens because they may be part of expressions (e.g. in @"string", @selector(), etc.), so in most cases we will want to skip them. This commit caused 'test/Parser/method-def-in-class.m' to fail for the cases where we tried to recover from unmatched angle bracket but IMO it is not a big deal to not have good recovery from such broken code and the way we did recovery would not always work anyway (e.g. if there was '@' in an expression). The case that rdar://7029784 is about still passes. llvm-svn: 146815
* After late parsing an objc method, make sure there are no leftover cached ↵Argyrios Kyrtzidis2011-12-171-2/+19
| | | | | | | | | | | | | | | tokens, because the memory associated with them is going to get released. We also don't want them to affect later parsing. (We do the same for C++ inline methods.) The underlying cause for the leftover tokens is going to be addressed in the next commit. Couldn't get a test case for the crash though. rdar://10583033. llvm-svn: 146814
* Fix: allow @protocol forward declarations inside @implementation-s.Erik Verbruggen2011-12-081-1/+2
| | | | llvm-svn: 146147
* Extend warnings for missing '@end'.Erik Verbruggen2011-12-061-16/+51
| | | | | | Fixes PR2709. llvm-svn: 145928
* Fix leaking of LexedMethod objects created for caching objc method ↵Argyrios Kyrtzidis2011-11-291-1/+9
| | | | | | | | definitions tokens for late parsing. llvm-svn: 145394
OpenPOWER on IntegriCloud