summaryrefslogtreecommitdiffstats
path: root/clang/test/Index/annotate-tokens.m
Commit message (Collapse)AuthorAgeFilesLines
* C++ support for Objective-C lightweight generics.Douglas Gregor2015-07-071-0/+7
| | | | | | | | | | | | | | | | | | | Teach C++'s tentative parsing to handle specializations of Objective-C class types (e.g., NSArray<NSString *>) as well as Objective-C protocol qualifiers (id<NSCopying>) by extending type-annotation tokens to handle this case. As part of this, remove Objective-C protocol qualifiers from the declaration specifiers, which never really made sense: instead, provide Sema entry points to make them part of the type annotation token. Among other things, this properly diagnoses bogus types such as "<NSCopying> id" which should have been written as "id <NSCopying>". Implements template instantiation support for, e.g., NSArray<T>* in C++. Note that parameterized classes are not templates in the C++ sense, so that cannot (for example) be used as a template argument for a template template parameter. Part of rdar://problem/6294649. llvm-svn: 241545
* [libclang] When annotating tokens, don't override a property annotation with ↵Argyrios Kyrtzidis2013-06-041-0/+22
| | | | | | | | a getter/setter method annotation. rdar://13764549 llvm-svn: 183242
* [libclang] Introduce a CXCursor_ObjCSelfExpr cursor, which is the equivalent ↵Argyrios Kyrtzidis2013-04-231-5/+5
| | | | | | | | of CXCursor_CXXThisExpr for C++ code. rdar://13717006 llvm-svn: 180127
* [libclang] Make token annotation of type/storage qualifiers accurate.Argyrios Kyrtzidis2013-01-071-1/+1
| | | | | | | | Previously type/storage qualifiers would not be annotated as the declaration they belonged to. Just use the resulting source range of getRawCursorExtent() which is more correct than what AnnotateTokensWorker::Visit() was adjusting it to. llvm-svn: 171774
* [libclang] For a ↵Argyrios Kyrtzidis2012-03-231-97/+97
| | | | | | | | | | CXCursor_ObjCInstanceMethodDecl/CXCursor_ObjCClassMethodDecl cursor, return from clang_getCursorLocation the start location of the method name. rdar://11105223 llvm-svn: 153303
* [libclang] Enhance clang_getOverriddenCursors.Argyrios Kyrtzidis2012-03-081-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | Basically the current design is: -for an implementation method, show as overridden the interface method. This is not useful, and is inconsistent with the C++ side -for an interface method, show as overridden the protocols methods (this is desirable) and the methods from the categories; methods from categories are not useful since they are considered the same method (same USR). -If there is a protocol method or category method reported, it does not check the super class for overridden methods. This is really problematic since overridden methods from super class is what we want to give back. Change clang_getOverriddenCursors to show as overridden any method in the class's base class, its protocols, or its categories' protocols, that has the same selector and is of the same kind (class or instance). If no such method exists, the search continues to the class's superclass, its protocols, and its categories, and so on. A method from an Objective-C implementation is considered to override the same methods as its corresponding method in the interface. rdar://10967206 llvm-svn: 152270
* [libclang] In clang::getCursorKindForDecl() don't return "UnexposedDecl"Argyrios Kyrtzidis2012-01-241-2/+2
| | | | | | | | for forward references of classes and protocols, this breaks libclang API usage. rdar://10747438. llvm-svn: 148861
* rename -ccc-host-triple into -targetSebastian Pop2012-01-201-1/+1
| | | | llvm-svn: 148582
* Revert r148138; it's causing test failures.Eli Friedman2012-01-131-1/+1
| | | | llvm-svn: 148141
* rename -ccc-host-triple into -targetSebastian Pop2012-01-131-1/+1
| | | | llvm-svn: 148138
* Eliminate ObjCClassDecl, which is redundant now that ObjCInterfaceDeclDouglas Gregor2011-12-271-2/+2
| | | | | | | covers both declarations (@class) and definitions (@interface) of an Objective-C class. llvm-svn: 147299
* Expose more statement, expression, and declaration kinds in libclang,Douglas Gregor2011-10-051-62/+62
| | | | | | from Manuel Holtgrewe! llvm-svn: 141200
* Improve location fidelity of objc decls.Argyrios Kyrtzidis2011-10-041-28/+28
| | | | | | | | -Add the location of the class name to all objc container decls, not just ObjCInterfaceDecl. -Make objc decls consistent with the rest of the NamedDecls and have getLocation() point to the class name, not the location of '@'. llvm-svn: 141061
* [libclang] For getDeclFromExpr in CIndex.cpp, associate the decl ofArgyrios Kyrtzidis2011-09-121-6/+6
| | | | | | | a DeclRefExpr, MemberExpr, etc. with a CastExpr if it is ImplicitCast, since the implicit cast is the one that is invisible in source code. llvm-svn: 139547
* Fix tests for non-darwin hosts.Argyrios Kyrtzidis2011-08-151-1/+1
| | | | llvm-svn: 137688
* Fix the buildbot test.Argyrios Kyrtzidis2011-08-151-1/+1
| | | | llvm-svn: 137660
* [libclang] Handle AttributedTypeLoc for cursor visitation. Fixes rdar://9535717.Argyrios Kyrtzidis2011-08-151-0/+13
| | | | llvm-svn: 137634
* Update all of the libclang code corresponding to the preprocessorChandler Carruth2011-07-141-6/+6
| | | | | | | | | | | | | | MacroInstantiation -> MacroExpansion rename. Internally, everything is switched. Introduce a new cursor kind enum with the new name, but retain the old name as an alias so that we don't break backwards compatibility. Also update the debug printing routine to use 'macro expansions' as its explicitly not guaranteed to be stable, and mechanically switch the test cases over to that. llvm-svn: 135140
* Update Indexer test for new 'atomic' keyword.Fariborz Jahanian2011-06-131-2/+14
| | | | llvm-svn: 132918
* Expose @synthesize and @dynamic via their own cursor kinds inDouglas Gregor2011-06-031-4/+4
| | | | | | libclang. Fixes <rdar://problem/9537904>. llvm-svn: 132603
* Teach libclang's token-annotation logic about context-sensitiveDouglas Gregor2011-03-081-15/+16
| | | | | | keywords for Objective-C+ and C++0x. llvm-svn: 127253
* Fix test to be platform-agnosticDouglas Gregor2010-12-211-1/+1
| | | | llvm-svn: 122348
* Fix a major inconsistency in the representation of Objective-CDouglas Gregor2010-12-211-11/+40
| | | | | | | | | | | | | | | | | | | | 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
* Implement BlockDecl::getSourceRange(). The bogus source-rangeDouglas Gregor2010-12-211-0/+34
| | | | | | | information caused token-annotation to fail in funny ways. Fixes <rdar://problem/8595386>. llvm-svn: 122338
* For an Objective-C @synthesize statement, e.g.,Douglas Gregor2010-11-171-1/+6
| | | | | | | | | @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
* Fix source-range information for Objective-C properties. Previously,Douglas Gregor2010-11-171-5/+38
| | | | | | | | | | | | we were just getting a range covering only the property name, which is certainly not correct (and broke token annotation, among other things). Also, teach libclang about the relationship between @synthesize/@dynamic and @property, so we get property name and cursor-reference information for @synthesize and @dynamic. llvm-svn: 119409
* Hack to workaround deficiency in ObjC ASTs. Functions and variables may be ↵Ted Kremenek2010-11-021-1/+51
| | | | | | | | | | | declared within an @implementation, but we have no way to record that information in the AST. This may cause CursorVisitor to miss these Decls when doing a AST walk. Fixes <rdar://problem/8595462>. llvm-svn: 118109
* Improve the implementation of libclang's token-annotation logic forDouglas Gregor2010-10-211-1/+1
| | | | | | | | | | | | | | | | | entities in the preprocessing record. Previously, we would only end up getting the first token of a preprocessing record annotated correctly. For example, given #include "foo.h" we would only get the '#' annotated as an inclusion directive; the 'include' and '"foo.h"' tokens would be given the general 'processing directive' annotation. Now, we get proper annotations for entities in the preprocessing record. llvm-svn: 117001
* Teach clang_getCursorReferenced() about Objective-C property referenceDouglas Gregor2010-10-011-3/+51
| | | | | | and protocol expressions. Fixes <rdar://problem/7833565>. llvm-svn: 115346
* Fix RUN line in test.Ted Kremenek2010-08-251-1/+1
| | | | llvm-svn: 112097
* When annotating tokens, don't fallback to annotating with a null cursor for ↵Ted Kremenek2010-08-251-4/+102
| | | | | | cursors that come before a macro instantiation. Fixes <rdar://problem/7974151>. llvm-svn: 112096
* Revert "Move macro definitions for IBOutlet and IBAction into the sourceDaniel Dunbar2010-05-121-113/+110
| | | | | | code. ...", this was a lit bug which should be fixed in r103652. llvm-svn: 103654
* Move macro definitions for IBOutlet and IBAction into the source code. This ↵Ted Kremenek2010-05-121-110/+113
| | | | | | | | hopefully unbreaks the test with lit+Windows. llvm-svn: 103650
* Yes another annotate-tokens tweak.Daniel Dunbar2010-05-121-1/+1
| | | | llvm-svn: 103615
* Increase test portability.Daniel Dunbar2010-05-121-1/+1
| | | | llvm-svn: 103614
* Make test case invariant to macro definition location.Ted Kremenek2010-05-121-3/+3
| | | | llvm-svn: 103587
* Re-apply r103581 with updated tests. It turns out we were computing bogus ↵Ted Kremenek2010-05-121-1/+141
| | | | | | | | locations for many things. llvm-svn: 103583
* Temporarily revert r103581 so I can fix the failing tests.Ted Kremenek2010-05-121-141/+1
| | | | llvm-svn: 103582
* Correctly check if a cursor is a declaration before returning its ↵Ted Kremenek2010-05-121-1/+141
| | | | | | | | | | location/range in clang_getCursorLocation()/clang_getCursorExtent(). This fixes a horrible bug reported in <rdar://problem/7961995> and <rdar://problem/7967123> where declarations with attributes would get grossly annotated with the wrong tokens because the attribute would be interpreted as if it was a Decl*. llvm-svn: 103581
* Adjust clang_annotateTokens() to correctly account for the TypeSourceInfo ↵Ted Kremenek2010-05-121-1/+55
| | | | | | | | for DeclaratorDecls when annotating tokens. Fixes <rdar://problem/7971430>. llvm-svn: 103577
* Rework clang_annotateTokens() to annotate tokens with information that more ↵Ted Kremenek2010-05-051-38/+38
| | | | | | | | | closely matches clang_getCursor(). Tokens are now annotated with the cursor (for the matching AST element) that most closely encompasses that token. llvm-svn: 103064
* Keep proper source location information for the type in an Objective-CDouglas Gregor2010-04-201-4/+14
| | | | | | @encode expression. llvm-svn: 101907
* Improve Objective-C token-annotation testDouglas Gregor2010-03-091-1/+28
| | | | llvm-svn: 98078
* Add an Objective-C test for token annotationDouglas Gregor2010-03-091-0/+22
llvm-svn: 98056
OpenPOWER on IntegriCloud