summaryrefslogtreecommitdiffstats
path: root/clang/test/Index/c-index-getCursor-test.m
Commit message (Collapse)AuthorAgeFilesLines
* Change test to dump Filecheck output to an intermediate file. This makes it ↵Ted Kremenek2012-12-191-1/+1
| | | | | | easier to update this test. llvm-svn: 170570
* [libclang] For a ↵Argyrios Kyrtzidis2012-03-231-16/+16
| | | | | | | | | | CXCursor_ObjCInstanceMethodDecl/CXCursor_ObjCClassMethodDecl cursor, return from clang_getCursorLocation the start location of the method name. rdar://11105223 llvm-svn: 153303
* Expose more statement, expression, and declaration kinds in libclang,Douglas Gregor2011-10-051-15/+15
| | | | | | from Manuel Holtgrewe! llvm-svn: 141200
* Improve location fidelity of objc decls.Argyrios Kyrtzidis2011-10-041-5/+5
| | | | | | | | -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
* Make -fobjc-nonfragile-abi the -cc1 default, since it's theJohn McCall2011-10-021-1/+1
| | | | | | | | | | | | | | | | | | | increasingly prevailing case to the point that new features like ARC don't even support the fragile ABI anymore. This required a little bit of reshuffling with exceptions because a check was assuming that ObjCNonFragileABI was only being set in ObjC mode, and that's actually a bit obnoxious to do. Most, though, it involved a perl script to translate a ton of test cases. Mostly no functionality change for driver users, although there are corner cases with disabling language-specific exceptions that we should handle more correctly now. llvm-svn: 140957
* [libclang] For getDeclFromExpr in CIndex.cpp, associate the decl ofArgyrios Kyrtzidis2011-09-121-1/+1
| | | | | | | 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
* For the MacroExpands preprocessor callback, also pass the SourceRangeArgyrios Kyrtzidis2011-08-181-1/+1
| | | | | | of expansion (for function macros it includes the right paren). llvm-svn: 137909
* Update all of the libclang code corresponding to the preprocessorChandler Carruth2011-07-141-1/+1
| | | | | | | | | | | | | | 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
* Fixed source range for StaticAssertDecl and LinkageSpecDecl. Fixed source ↵Abramo Bagnara2011-03-081-2/+2
| | | | | | range for declarations using postfix types. llvm-svn: 127251
* Fixed source range for all DeclaratorDecl's.Abramo Bagnara2011-03-081-2/+2
| | | | llvm-svn: 127225
* When comparing the source range of a declaration against the region ofDouglas Gregor2010-11-171-5/+5
| | | | | | | | | interest (e.g., as used by clang_getCursor()), count the decl-specifier-seq as part of the source range, as we do for clang_annotateTokens(). Makes clang_getCursor() work properly for the result types of functions, for example. llvm-svn: 119514
* Robustify PreprocessingRecord slightly, by only creating macroDouglas Gregor2010-03-191-0/+1
| | | | | | | | instantiations when we have the corresponding macro definition and by removing macro definition information from our table when the macro is undefined. llvm-svn: 99004
* Implement serialization and lazy deserialization of the preprocessingDouglas Gregor2010-03-191-1/+5
| | | | | | | | | | | | | | | | | | | | | | | | record (which includes all macro instantiations and definitions). As with all lay deserialization, this introduces a new external source (here, an external preprocessing record source) that loads all of the preprocessed entities prior to iterating over the entities. The preprocessing record is an optional part of the precompiled header that is disabled by default (enabled with -detailed-preprocessing-record). When the preprocessor given to the PCH writer has a preprocessing record, that record is written into the PCH file. When the PCH reader is given a PCH file that contains a preprocessing record, it will be lazily loaded (which, effectively, implicitly adds -detailed-preprocessing-record). This is the first case where we have sections of the precompiled header that are added/removed based on a compilation flag, which is unfortunate. However, this data consumes ~550k in the PCH file for Cocoa.h (out of ~9.9MB), and there is a non-trivial cost to gathering this detailed preprocessing information, so it's too expensive to turn on by default. In the future, we should investigate a better encoding of this information. llvm-svn: 99002
* Fix a longstanding (but previously unknown) bug in the lazyDouglas Gregor2010-03-191-0/+6
| | | | | | | | | | | | | deserialization of precompiled headers, where the deserialization of the source location entry for a buffer (e.g., macro instantiation scratch space) would overwrite a one-element FileID cache in the source manager. When tickled at the wrong time, we would return the wrong decomposed source location and eventually cause c-index-test to crash. Found by dumb luck. It's amazing this hasn't shown up before. llvm-svn: 98940
* Extend ObjCMessageExpr for class method sends with the source locationDouglas Gregor2010-03-081-1/+3
| | | | | | of the class name. llvm-svn: 97943
* Keep track of type source information in the return type of anDouglas Gregor2010-03-081-1/+3
| | | | | | | | | | Objective-C method declaration, e.g., for - (Foo *)myMethod; we now have TypeSourceInfo for the Foo*. llvm-svn: 97942
* c-index-test: Unify and always print half-open extents.Daniel Dunbar2010-02-141-99/+99
| | | | llvm-svn: 96160
* c-index-test: Unify syntax for printing extents. Yes, there were 4.Daniel Dunbar2010-02-141-99/+99
| | | | llvm-svn: 96158
* Loosen preconditions for clang_getCursorSpelling(), returning an emptyDouglas Gregor2010-01-251-13/+13
| | | | | | | string when given a cursor that does not have a name. Also, don't give silly names for statements and non-reference expressions. llvm-svn: 94426
* Teach CIndex's cursor visitor to restrict its traversal to a specificDouglas Gregor2010-01-221-41/+28
| | | | | | | | | | | | | | region of interest (if provided). Implement clang_getCursor() in terms of this traversal rather than using the Index library; the unified cursor visitor is more complete, and will be The Way Forward. Minor other tweaks needed to make this work: - Extend Preprocessor::getLocForEndOfToken() to accept an offset from the end, making it easy to move to the last character in the token (rather than just past the end of the token). - In Lexer::MeasureTokenLength(), the length of whitespace is zero. llvm-svn: 94200
* Extend the CIndex API with direct support for expressions andDouglas Gregor2010-01-191-79/+85
| | | | | | | | | | statements, moving some of the more unnatural kinds of references (VarRef, EnumConstantRef, etc.) over to the expressions. We can now poke at arbitrary expressions and statements with, e.g., clang_getCursor() and get back useful information (e.g., source ranges). llvm-svn: 93946
* Eliminate cursor kinds used to express definitions. Instead, provideDouglas Gregor2010-01-191-25/+25
| | | | | | | | | | | | CIndex functions that (1) map from a reference or declaration to the corresponding definition, if available, and (2) determine whether a given declaration cursor is also a definition. This eliminates a lot of duplication in the cursor kinds, and maps more closely to the Clang ASTs. This is another API + ABI breaker with no deprecation. Yay, progress. llvm-svn: 93893
* Give ObjCClassRef cursors a sane representation, which is encapsulatedDouglas Gregor2010-01-161-1/+1
| | | | | | | | | in CXCursor.cpp. With this sane representation, fix the class reference that is part of Objective-C category declarations so that the cursor's location matches up with the reference, not the class being referred to. llvm-svn: 93640
* Use a sane encoding for CXCursor_ObjCProtocolRef, using the actualDouglas Gregor2010-01-161-2/+2
| | | | | | | source locations where the protocols were referenced rather than the location of some random enclosing declaration. llvm-svn: 93637
* Remove TranslateKind and centralize Decl -> CXCursorKind in GetCursorKind(). ↵Ted Kremenek2010-01-161-27/+27
| | | | | | This revealed a bunch of inconsistencies in how CXCursorKinds were being computed. llvm-svn: 93618
* Change ObjCContainerDecl to contain the entire range for the '@end'Ted Kremenek2010-01-071-12/+12
| | | | | | | | | | | piece of the declaration. The '@' and the 'end' are separate tokens, and require two SourceLocations to accurately track. This change was motivated because ObjCContainerDecl::getSourceRange() would previously not return the entire range of the declaration (the 'end' would be left off). llvm-svn: 92891
* Update tests to use %clang_cc1 instead of 'clang-cc' or 'clang -cc1'.Daniel Dunbar2009-12-151-1/+1
| | | | | | | | | - This is designed to make it obvious that %clang_cc1 is a "test variable" which is substituted. It is '%clang_cc1' instead of '%clang -cc1' because it can be useful to redefine what gets run as 'clang -cc1' (for example, to set a default target). llvm-svn: 91446
* Make tests use the new clang -cc1 flag.Fariborz Jahanian2009-12-141-1/+1
| | | | llvm-svn: 91303
* Add c-index-test mode "-test-file-scan", which scans a source file and calls ↵Ted Kremenek2009-11-171-0/+160
clang_getCursor() on every character. llvm-svn: 89136
OpenPOWER on IntegriCloud