summaryrefslogtreecommitdiffstats
path: root/clang/include/clang-c
Commit message (Collapse)AuthorAgeFilesLines
...
* Kill the unused and unnecessary CXCursor_MemberRef, twin to theDouglas Gregor2010-01-191-5/+4
| | | | | | now-dead CXCursor_ObjCIvarRef. llvm-svn: 93928
* Kill CXCursor_ObjCIvarRef. Such cursors could never be created, andDouglas Gregor2010-01-191-1/+0
| | | | | | have been marked for death for a while. llvm-svn: 93927
* Introduce the notion of an "unexposed" declaration into the CIndexDouglas Gregor2010-01-191-1/+33
| | | | | | | | 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-191-11/+46
| | | | | | | | | | 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-191-13/+42
| | | | | | | | | | | | 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-191-3/+15
| | | | | | entity that a particular cursor references. llvm-svn: 93830
* Implement clang_getCursorExtent, which provides a source range for theDouglas Gregor2010-01-191-0/+11
| | | | | | | | | | | | | 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
* Now that a reasonable deprecation cycle has passed, killDouglas Gregor2010-01-181-5/+0
| | | | | | | clang_getCursorLine(), clang_getCursorColumn(), clang_getCursorSource(), and clang_getCursorSourceFile() outright. llvm-svn: 93801
* Introduce clang_getCursorLocation(), which supercedesDouglas Gregor2010-01-181-3/+17
| | | | | | | | clang_getCursorLine(), clang_getCursorColumn(), clang_getCursorSource(), and clang_getCursorSourceFile(). Mark those 4 functions as deprecated and stop using them ourselves. llvm-svn: 93800
* Clean up the CIndex API slightly.Douglas Gregor2010-01-181-7/+19
| | | | | | | | | | | 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
* Replace clang_getDeclUSR() with clang_getCursorUSR(). Also remove printing ↵Ted Kremenek2010-01-181-1/+4
| | | | | | 'contexts' from c-index-test output; it wasn't helpful and was extremely brittle. llvm-svn: 93760
* Remove 'default' case in switch statement in clang_getCursorKindSpelling(). ↵Ted Kremenek2010-01-161-18/+18
| | | | | | 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
* Make CXCursor's data opaque.Douglas Gregor2010-01-151-3/+1
| | | | llvm-svn: 93561
* Add 'referringDecl' field to CXCursor to prepare the way to better model ↵Ted Kremenek2010-01-131-0/+1
| | | | | | declaration references from other delcarations. llvm-svn: 93343
* Rename clang_getUSR() -> clang_getDeclUSR(). For now we take a CXDecl ↵Ted Kremenek2010-01-121-1/+1
| | | | | | | | instead of a CXEntity. Enhance USR generation a bit with support for records. llvm-svn: 93267
* Change clang_getUSR() to return a CXString instead of a 'const char *'.Ted Kremenek2010-01-121-1/+1
| | | | llvm-svn: 93213
* CIndex:Ted Kremenek2010-01-111-4/+10
| | | | | | | | | - Remove unused (and unimplemented) clang_getDeclarationName(). - Remove unused (and unimplemented) clang_getEntity(). - Add clang_getEntityFromDecl(): maps from a CXDecl to a CXEntity) - Add clang_getDeclaration(): maps from a (CXEntity, CXTranslationUnit) to a CXDecl). llvm-svn: 93209
* Improve code completion by introducing patterns for the various C andDouglas Gregor2010-01-101-1/+22
| | | | | | | | | | | | | | | | | | | | | | C++ grammatical constructs that show up in top-level (namespace-level) declarations, member declarations, template declarations, statements, expressions, conditions, etc. For example, we now provide a pattern for static_cast<type>(expr) when we can have an expression, or using namespace identifier; when we can have a using directive. Also, improves the results of code completion at the beginning of a top-level declaration. Previously, we would see value names (function names, global variables, etc.); now we see types, namespace names, etc., but no values. llvm-svn: 93134
* For now, add back clang_getDeclSource().Ted Kremenek2010-01-081-0/+1
| | | | llvm-svn: 93003
* Change clang_getDeclExtent() to have the endpoint point to the last ↵Ted Kremenek2010-01-061-2/+2
| | | | | | character in the last token. llvm-svn: 92869
* Add missing CINDEX_LINKAGE.Daniel Dunbar2010-01-061-4/+5
| | | | llvm-svn: 92827
* Remove deprecated function 'clang_getDeclSource()'. Use ↵Ted Kremenek2010-01-051-1/+0
| | | | | | 'clang_getDeclFile()' instead. llvm-svn: 92803
* Add C API hook 'clang_getDeclExtent()', which returns the source extent of a ↵Ted Kremenek2010-01-051-0/+16
| | | | | | declaration. This implements <rdar://problem/7280072>. llvm-svn: 92802
* Split (mostly nonexistent) USR code out from the main CIndex logic.Ted Kremenek2010-01-051-2/+2
| | | | llvm-svn: 92789
* Extend code-completion results with the type of each resultDouglas Gregor2009-12-181-1/+9
| | | | llvm-svn: 91702
* Change clang_codeComplete API to return the results in a structure onDouglas Gregor2009-12-181-34/+42
| | | | | | | | the heap, so that clients are not forced to copy the results during the initial iteration. A separate clang_disposeCodeCompleteResults function frees the returned results. llvm-svn: 91690
* Include <time.h> in order to use 'time_t'.Chandler Carruth2009-12-171-0/+1
| | | | llvm-svn: 91597
* Switch clang_createTranslationUnitFromSourceFile to use ↵Daniel Dunbar2009-12-031-17/+39
| | | | | | | | | | | | | | | | | | | ASTUnit::LoadFromCommandLine. - This is much faster, as it avoids the overhead of dumping an AST file to disk and reloading it. - For debugging purposes, there is a clang_setUseExternalASTGeneration hook which can be used to disable this. On the Sketch Cocoa app, the speedup is pretty nice, especially when using a PCH file while scanning the source: Wall time to c-index-test all files (no PCH): Old: 23.4221 New: 12.3884 Wall time to c-index-test all files (with a PCH, and "local" mode): Old: 10.9233 New: 1.9038 llvm-svn: 90385
* Extend the CIndex code-completion API to perform code completionDouglas Gregor2009-12-021-0/+37
| | | | | | | involving unsaved files, using the -remap-file= functionality recently added to clang-cc. llvm-svn: 90314
* Add clang_getNullCursor() and clang_equalCursors() (the latter for comparing ↵Ted Kremenek2009-11-171-0/+4
| | | | | | cursors). llvm-svn: 89131
* Allow "source_filename" to be an optional argument (the client can provide ↵Ted Kremenek2009-11-171-1/+2
| | | | | | NULL). This allows the client to put the source_filename in the command_line_args without fear of the file being named twice. llvm-svn: 89118
* Introduce CXString type and associated functions clang_getCString() and ↵Steve Naroff2009-11-091-4/+23
| | | | | | | | | | clang_disposeString(). This abstraction will help us manage string memory for complex names that cross the C++/C boundary (e.g. ObjC methods, selectors). This patch also uses it in clang_getTranslationUnitSpelling (which I'm not sure is necessary). Will investigate later...since the extra malloc() can't hurt (for now). Patch by John Thompson. llvm-svn: 86562
* Various improvements to Clang's code-completion infrastructure:Douglas Gregor2009-11-071-0/+321
| | | | | | | | | | | | | | - Introduce more code-completion string "chunk" kinds that describe symbols, the actual text that the user is expected to type, etc. - Make the generation of macro results optional, since it can be slow - Make code-completion accessible through the C API, marshalling the code-completion results through a temporary file (ick) to maintain process separation. The last doesn't have tests yet. llvm-svn: 86306
* Add two missing CINDEX_LINKAGE uses, in libCIndex, from KovarththananDouglas Gregor2009-10-311-2/+2
| | | | | | Rajaratnam! llvm-svn: 85665
* Remove _clang_initCXLookupHint() and _clang_getCursorWithHint(). Related to ↵Steve Naroff2009-10-281-15/+0
| | | | | | | | | | <rdar://problem/7310688>. Localize the optimization to ResolveLocationInAST(). The last valid AST location is now stored with ASTUnit. There still isn't optimal, however it's an improvement (with a much cleaner API). Having the client manage an "hint" is error prone and complex. I wanted to land the major changes before finishing up the optimizations. llvm-svn: 85425
* Add support for 'CXFile' (<rdar://problem/7303360>).Steve Naroff2009-10-271-3/+14
| | | | | | | | | | - 4 new functions (clang_getCursorSourceFile, clang_getDeclSourceFile, clang_getFileName, clang_getFileTime). - Should remove clang_getDeclSource() and clang_getCursorSource(). For now, just put 'deprecate' comment in header. - Also changed CXX style comment to C style (to eliminate warning). llvm-svn: 85238
* Changes for building as a Windows DLLJohn Thompson2009-10-271-32/+43
| | | | llvm-svn: 85234
* Split clang_getCursor() into clang_getCursor() and clang_getCursorWithHint().Ted Kremenek2009-10-221-5/+16
| | | | llvm-svn: 84873
* Enhance 'clang_createTranslationUnitFromSourceFile()' in two ways:Ted Kremenek2009-10-221-3/+11
| | | | | | | | | (1) Allow the source file to be specified in the actual command line arguments by allowing the caller to set 'source_filename' to NULL. (2) Automatically strip off the arguments '-emit-ast', '-fsyntax-only', and '-c'. llvm-svn: 84802
* Extend clang_getCursor() to take a 'relativeDecl' argument (so speed up ↵Steve Naroff2009-10-211-1/+9
| | | | | | | | | | | | | | searching). Without a 'relativeDecl', the algorithm is n-squared. For example, running the following command on 'Large.m' takes hours without a 'relatvieDecl'. snaroff% time ../../Debug/bin/c-index-test Large.ast all > Large.out snaroff% cat Large.m #import <Cocoa/Cocoa.h> #import <QuickTime/QuickTime.h> #import <OpenGL/OpenGL.h> With a 'relativeDecl', it takes <30 seconds:-) llvm-svn: 84760
* Add an example to help claify the process/assumptions...Steve Naroff2009-10-201-0/+24
| | | | llvm-svn: 84642
* - Extend clang_createIndex() to support PCH and diagnostic 'filtering'. This ↵Steve Naroff2009-10-201-20/+26
| | | | | | | | | | | | seems cleaner to me without sacrificing much flexibility. - Remove clang_wantOnlyLocalDeclarations(). - Remove 'displayDiagnostics' arguments to clang_createTranslationUnitFromSourceFile() and clang_createTranslationUnit(). - Have clang_createTranslationUnitFromSourceFile() strip the '-o <outfile>' command line arguments if they exist. Document this semantic in the header. Also verify we have a valid ASTUnit before telling it to 'unlinkTemporaryFile()'. llvm-svn: 84634
* Really fix <rdar://problem/7312058> by adding a 'displayDiagnostics' option toTed Kremenek2009-10-191-3/+14
| | | | | | | | | | | clang_createTranslationUnit() and clang_createTranslationUnitFromSourceFile(). The user can now specify if the diagnostics from Clang are printed to stderr or are silenced completely. We can obviously evolve this API to be more general in the future. Note: Added a FIXME since I wasn't certain what was the best way to redirect to something analogous to '/dev/null' on Windows. llvm-svn: 84548
* Keep track of whether declararions were loaded from a precompiledDouglas Gregor2009-10-161-0/+11
| | | | | | | | | | header or not via a new "PCHLevel" field in Decl. We currently use this information to help CIndex filter out declarations that came from a precompiled header (rather than from an AST file). Further down the road, it can be used to help implement multi-level precompiled headers. llvm-svn: 84267
* Implement <rdar://problem/7303432> [Clang/Index] In-memory-style AST ↵Steve Naroff2009-10-151-0/+6
| | | | | | | | | generation API (initial API implementation). Added clang_createTranslationUnitFromSourceFile(). Changed clang_createIndex() to lookup the location of clang (using dladdr). llvm-svn: 84198
* Add clang_getDeclSource().Steve Naroff2009-09-251-0/+1
| | | | llvm-svn: 82807
* Add clang_getDeclLine and clang_getDeclColumnSteve Naroff2009-09-251-0/+3
| | | | | | | Fix clang_getCursorDecl to do the right thing for expr refs Fixup test file to accommodate new output (which includes the line/column for the referenced decl) llvm-svn: 82798
* More work to enable more exhaustive testing of the indexing API.Steve Naroff2009-09-231-1/+9
| | | | | | Next step: Add actual some test cases:-) llvm-svn: 82636
* - Implement support for various types of "refs" (initially to help test ↵Steve Naroff2009-09-221-7/+15
| | | | | | | | clang_getCursor()). - Add missing prototypes for dispose functions. llvm-svn: 82564
* fit in 80 colsChris Lattner2009-09-161-1/+2
| | | | llvm-svn: 82073
OpenPOWER on IntegriCloud