summaryrefslogtreecommitdiffstats
path: root/clang/tools
Commit message (Collapse)AuthorAgeFilesLines
* Add 'clang_getClangVersion()' function to CIndex. This exposes the full ↵Ted Kremenek2010-01-222-0/+16
| | | | | | Clang version string through the CIndex API. llvm-svn: 94242
* Yet more CIndex API cleanup:Douglas Gregor2010-01-223-16/+77
| | | | | | | | - Added more routines to manipulate/compare source locations and ranges - Switched clang_getCursor() over to take a CXSourceLocation rather than file/line/column. llvm-svn: 94226
* Eliminate index-test; all of its tested functionality is now in c-index-test.Douglas Gregor2010-01-225-384/+1
| | | | llvm-svn: 94211
* Eliminate CIndex's dependency on the Clang Index library, since weDouglas Gregor2010-01-225-20/+7
| | | | | | weren't actually using any of its facilities. llvm-svn: 94210
* Teach CIndex's cursor visitor to restrict its traversal to a specificDouglas Gregor2010-01-221-35/+146
| | | | | | | | | | | | | | 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
* Visit if, switch statements properlyDouglas Gregor2010-01-221-0/+32
| | | | llvm-svn: 94126
* Teach the cursor visitor to walk all of the C and Objective-CDouglas Gregor2010-01-221-28/+118
| | | | | | | | declarations that have enough source information to make such a walk useful. This includes walking into variable initializers and enum constants, the types behind typedefs, etc. llvm-svn: 94124
* Teach the cursor visitor to walk statements and expressions, includingDouglas Gregor2010-01-211-23/+62
| | | | | | a few important subkinds. Now we're cookin' with gas! llvm-svn: 94116
* Teach the cursor visitor to walk into typeof types (both kinds). ThisDouglas Gregor2010-01-211-0/+16
| | | | | | | is hard to test now; tests will come when we can walk stataements and expressions properly. llvm-svn: 94099
* Teach the cursor visitor to walk into a variety of different TypeLocDouglas Gregor2010-01-211-7/+170
| | | | | | kinds, so that we see referenced types, protocols, classes, etc. llvm-svn: 94085
* Introduce type references into the C API, capturing references toDouglas Gregor2010-01-213-2/+68
| | | | | | typedefs only (for now). llvm-svn: 94078
* Stash a CXXUnit pointer into each cursor. This allows us to simplifyDouglas Gregor2010-01-204-105/+85
| | | | | | | the interface to clang_visitChildren() by eliminating the CXTranslationUnit pointer. llvm-svn: 94051
* Eliminate the MakeCXCursor routines that require their callers to know too ↵Douglas Gregor2010-01-203-16/+9
| | | | | | much about the cursor's storage llvm-svn: 94049
* Kill CXEntity and CXDecl. The first has never been used, while theDouglas Gregor2010-01-202-57/+0
| | | | | | second has been wholly replaced by cursors. llvm-svn: 94039
* Kill some CXDecl-related APIs that have been superceded byDouglas Gregor2010-01-202-57/+23
| | | | | | CXCursor-based APIs. llvm-svn: 94037
* Kill clang_loadDeclaration() and clang_loadTranslationUnit().Douglas Gregor2010-01-202-63/+0
| | | | llvm-svn: 94034
* Switch c-index-test from clang_loadDeclaration() andDouglas Gregor2010-01-201-55/+44
| | | | | | clang_loadTranslationUnit() over to clang_visitChildren(). llvm-svn: 94031
* Switch the internals of clang_loadTranslationUnit() over to the newDouglas Gregor2010-01-201-69/+33
| | | | | | | cursor-based traversal, and eliminate TUVisitor. We're now down to one visitor for traversing the AST. Yay! llvm-svn: 94025
* Introduce a new, cursor-based traversal function that visits theDouglas Gregor2010-01-202-100/+187
| | | | | | | | | | | | children of a given cursor, regardless of what kind of cursor it is. This is a generalization of clang_loadDeclaration and clang_loadTranslationUnit that will also extent to statements, expressions, etc. As proof-of-concept, switched clang_loadDeclaration() from its own visitor over to an instance of this traversal function internally. llvm-svn: 94022
* Remove some #if 0'd code that's never going to get used.Douglas Gregor2010-01-201-61/+0
| | | | llvm-svn: 93957
* Kill off clang_getDeclColumn, clang_getDeclExtent, clang_getDeclLine,Douglas Gregor2010-01-202-48/+0
| | | | | | | clang_getDeclSource, and clang_getDeclSourceFile; the cursor equivalents are the way of the future. llvm-svn: 93955
* Introduce a special cursor kind for the translation unit, to serve asDouglas Gregor2010-01-203-0/+20
| | | | | | | | | the root of the conceptual cursor hierarchy (just like we do with declarations). This will be used when we get to unify clang_loadTranslationUnit() and clang_loadDeclaration() into something more generally useful. llvm-svn: 93954
* Kill CXCursor_ObjCSelectorRef, CXCursor_VarRef, CXCursor_FunctionRef,Douglas Gregor2010-01-192-48/+0
| | | | | | | and CXCursor_EnumConstantRef; they've been subsumed by expression references, which do a much nicer job. llvm-svn: 93947
* Extend the CIndex API with direct support for expressions andDouglas Gregor2010-01-194-39/+209
| | | | | | | | | | 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
* Kill the unused and unnecessary CXCursor_MemberRef, twin to theDouglas Gregor2010-01-192-7/+2
| | | | | | now-dead CXCursor_ObjCIvarRef. llvm-svn: 93928
* Kill CXCursor_ObjCIvarRef. Such cursors could never be created, andDouglas Gregor2010-01-192-5/+0
| | | | | | have been marked for death for a while. llvm-svn: 93927
* Introduce the notion of an "unexposed" declaration into the CIndexDouglas Gregor2010-01-192-4/+11
| | | | | | | | API. This is a catch-all for any declaration known to Clang but not specifically part of the CIndex API. We'll use the same approach with expressions, statements, references, etc., as needed. llvm-svn: 93924
* Rework the CXSourceLocation and CXSourceRange APIs. They are nowDouglas Gregor2010-01-193-30/+139
| | | | | | | | | | opaque data structures accessed through the new functions clang_getInstantiationLocation(), clang_getRangeStart(), and clang_getRangeEnd(). The new API permits later extensions to introduce new functions to allow CIndex clients to walk macro instantiations, if we ever care. llvm-svn: 93915
* Eliminate cursor kinds used to express definitions. Instead, provideDouglas Gregor2010-01-194-28/+252
| | | | | | | | | | | | 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
* Introduce clang_getCursorReferenced, to get a cursor pointing at theDouglas Gregor2010-01-193-5/+47
| | | | | | entity that a particular cursor references. llvm-svn: 93830
* Implement clang_getCursorExtent, which provides a source range for theDouglas Gregor2010-01-193-59/+105
| | | | | | | | | | | | | cursor itself. In particular, for references this returns the source range of the reference rather than the source range of the thing it refers to. Switch c-index-test from clang_getDeclExtent (which will eventually be deprecated and removed) over to clang_getCursorExtent. The source ranges we print for references now make sense; fix up the tests appropriately. llvm-svn: 93823
* Teach clang_getCursorLocation() to return the locations of referencesDouglas Gregor2010-01-183-69/+111
| | | | | | rather than the locations that refer to. llvm-svn: 93812
* Tweak USR output for ObjC categories.Ted Kremenek2010-01-181-4/+3
| | | | llvm-svn: 93805
* Now that a reasonable deprecation cycle has passed, killDouglas Gregor2010-01-182-20/+0
| | | | | | | clang_getCursorLine(), clang_getCursorColumn(), clang_getCursorSource(), and clang_getCursorSourceFile() outright. llvm-svn: 93801
* Introduce clang_getCursorLocation(), which supercedesDouglas Gregor2010-01-183-59/+72
| | | | | | | | clang_getCursorLine(), clang_getCursorColumn(), clang_getCursorSource(), and clang_getCursorSourceFile(). Mark those 4 functions as deprecated and stop using them ourselves. llvm-svn: 93800
* Refactor USR generation for TagDecls into a common method.Ted Kremenek2010-01-181-16/+10
| | | | llvm-svn: 93799
* Clean up the CIndex API slightly.Douglas Gregor2010-01-182-5/+6
| | | | | | | | | | | Renamed CXSourceFileLine to CXSourceLocation and added a CXFile, to better match Clang's SourceLocation. Teach clang_getDeclExtent to fill in the CXFile properly. Renamed CXSourceExtent to CXSourceRange, to better match Clang's SourceLocation. llvm-svn: 93783
* Explicitly not handle ObjCForwardProtocolDecl in GetCursorKind().Ted Kremenek2010-01-181-0/+3
| | | | llvm-svn: 93779
* Tweak USR generation to handle anonymous bitfields.Ted Kremenek2010-01-181-1/+18
| | | | llvm-svn: 93778
* Replace clang_getDeclUSR() with clang_getCursorUSR(). Also remove printing ↵Ted Kremenek2010-01-183-36/+31
| | | | | | 'contexts' from c-index-test output; it wasn't helpful and was extremely brittle. llvm-svn: 93760
* Make CMake's clang++ installation respect DESTDIR, based on a patch byDouglas Gregor2010-01-181-1/+1
| | | | | | Ingmar Vanhassel. Fixes PR6046. llvm-svn: 93741
* Don't build/install clang++ in CLANG_IS_PRODUCTION build mode yet.Daniel Dunbar2010-01-181-0/+2
| | | | llvm-svn: 93732
* Fix -Asserts warning.Daniel Dunbar2010-01-181-2/+1
| | | | llvm-svn: 93731
* Give ObjCClassRef cursors a sane representation, which is encapsulatedDouglas Gregor2010-01-163-37/+38
| | | | | | | | | 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-163-21/+44
| | | | | | | source locations where the protocols were referenced rather than the location of some random enclosing declaration. llvm-svn: 93637
* Give CXCursor_ObjCSuperClassRef a sane encoding, which is only knownDouglas Gregor2010-01-163-12/+44
| | | | | | to CXCursor.cpp. llvm-svn: 93634
* Add mapping from ObjCPropertDecl to CXCursorKind.Ted Kremenek2010-01-161-0/+1
| | | | llvm-svn: 93623
* Remove 'default' case in switch statement in clang_getCursorKindSpelling(). ↵Ted Kremenek2010-01-161-5/+7
| | | | | | This identified a missing case (warned by the compiler) and identified that CXCursor_FirstDecl didn't actually correspond to the first decl. llvm-svn: 93622
* Remove TranslateKind and centralize Decl -> CXCursorKind in GetCursorKind(). ↵Ted Kremenek2010-01-163-38/+34
| | | | | | This revealed a bunch of inconsistencies in how CXCursorKinds were being computed. llvm-svn: 93618
* Migrate Decl* -> cursorkind logic into CXCursor.cpp, and drastically tighten ↵Ted Kremenek2010-01-163-69/+53
| | | | | | TUVisitor. llvm-svn: 93599
OpenPOWER on IntegriCloud