summaryrefslogtreecommitdiffstats
path: root/clang/tools/CIndex/CIndex.cpp
Commit message (Collapse)AuthorAgeFilesLines
...
* For now, add back clang_getDeclSource().Ted Kremenek2010-01-081-0/+7
| | | | llvm-svn: 93003
* More crashtracer enhancements to CIndex. When "popping" a crashtracer stringTed Kremenek2010-01-071-9/+15
| | | | | | restore to the one most recently created. llvm-svn: 92959
* Tidy up crashtracer logic in CIndex.Ted Kremenek2010-01-071-38/+72
| | | | llvm-svn: 92955
* Change clang_getDeclExtent() to have the endpoint point to the last ↵Ted Kremenek2010-01-061-8/+43
| | | | | | character in the last token. llvm-svn: 92869
* Add enhanced crash reporter breadcrumbs for ↵Ted Kremenek2010-01-061-0/+54
| | | | | | clang_createTranslationUnitFromSourceFile(). llvm-svn: 92820
* Remove deprecated function 'clang_getDeclSource()'. Use ↵Ted Kremenek2010-01-051-7/+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/+19
| | | | | | declaration. This implements <rdar://problem/7280072>. llvm-svn: 92802
* Split (mostly nonexistent) USR code out from the main CIndex logic.Ted Kremenek2010-01-051-29/+0
| | | | llvm-svn: 92789
* Add back #include of 'cstdio' to hopefully unbreak the build on Linux.Ted Kremenek2010-01-051-0/+3
| | | | llvm-svn: 92765
* Split code in CIndex.cpp into multiple source files, and remove some ↵Ted Kremenek2010-01-051-472/+6
| | | | | | unnecessary #includes. llvm-svn: 92756
* Turn on code-completion for macros within CIndexDouglas Gregor2010-01-041-1/+3
| | | | llvm-svn: 92500
* Extend code-completion results with the type of each resultDouglas Gregor2009-12-181-0/+4
| | | | llvm-svn: 91702
* Change clang_codeComplete API to return the results in a structure onDouglas Gregor2009-12-181-16/+48
| | | | | | | | 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
* Lift builtin-include-path logic out of ASTUnit::LoadFromCommandLine and fix ↵Daniel Dunbar2009-12-131-10/+29
| | | | | | CIndex to pass in the right directory (previously it was using the path to the main executable, which generally is wrong). llvm-svn: 91238
* clang_getCompletionChunkText() will treat optional strings as empty text blocksDouglas Gregor2009-12-101-1/+1
| | | | llvm-svn: 91072
* Document that CompilerInvocation::createDiagnostics keeps a reference to the ↵Daniel Dunbar2009-12-061-1/+2
| | | | | | DiagnosticOptions, and update callers to make sure they don't pass in a temporary. llvm-svn: 90704
* CIndex: For the time being, don't return translation units if we encounter ↵Daniel Dunbar2009-12-051-4/+14
| | | | | | | | | an error during parsing. - We need to be more careful in the rest of CIndex if we are to handle possibly-invalid ASTs, and don't have much experience with this yet. llvm-svn: 90643
* ASTUnit/CIndex: Explicitly track the top-level decls when using an ASTUnit madeDaniel Dunbar2009-12-041-1/+11
| | | | | | | | from a source file. - This allows CIndex to avoid iterating over all the top-level decls when using a PCH, which means we deserialize far fewer decls. llvm-svn: 90559
* Update test and CIndex to use -FOO BAR form for ↵Daniel Dunbar2009-12-031-3/+5
| | | | | | -{remap-file,code-completion-at}. llvm-svn: 90416
* Switch clang_createTranslationUnitFromSourceFile to use ↵Daniel Dunbar2009-12-031-2/+41
| | | | | | | | | | | | | | | | | | | 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
* Fix ASTUnit to allows require a (persistent) Diagnostic object be provided; ↵Daniel Dunbar2009-12-031-20/+24
| | | | | | propogate and simplify. llvm-svn: 90379
* Extend the CIndex code-completion API to perform code completionDouglas Gregor2009-12-021-1/+42
| | | | | | | involving unsaved files, using the -remap-file= functionality recently added to clang-cc. llvm-svn: 90314
* Switch the clang-to-CIndex interface for code-completion to a binary format, ↵Douglas Gregor2009-12-011-89/+19
| | | | | | for a massive speedup llvm-svn: 90209
* CIndex: Normalize formatting some more.Daniel Dunbar2009-12-011-70/+43
| | | | llvm-svn: 90196
* Reindent buffer, switches in particular were totally out of style.Daniel Dunbar2009-11-301-161/+159
| | | | llvm-svn: 90155
* Strip trailing space.Daniel Dunbar2009-11-301-144/+144
| | | | llvm-svn: 90154
* Change -code-completion-debug-printer to -no-code-completion-debug-printer.Daniel Dunbar2009-11-191-1/+1
| | | | | | Also, tweak a few help strings and update CompilerInvocation serialization for prev change. llvm-svn: 89317
* Add clang_getNullCursor() and clang_equalCursors() (the latter for comparing ↵Ted Kremenek2009-11-171-0/+12
| | | | | | 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
* Sort visitor methods. No functionality change.Ted Kremenek2009-11-171-22/+24
| | | | llvm-svn: 89055
* Have clang_getCursorSource() return NULL when the source location is invalid ↵Ted Kremenek2009-11-171-2/+5
| | | | | | or refers to a built-in buffer. Implements <rdar://problem/7296243>. llvm-svn: 89044
* Move code completion options to clang-ccDaniel Dunbar2009-11-131-1/+1
| | | | llvm-svn: 87050
* Fix clang executable path for WindowsJohn Thompson2009-11-111-1/+6
| | | | llvm-svn: 86896
* CIndex: Only display diagnostics to llvm::errs() when the client has set the ↵Ted Kremenek2009-11-101-3/+3
| | | | | | 'displayDiagnostics' option to 1 in clang_createIndex(). This fixes <rdar://problem/7370691>. llvm-svn: 86700
* Make sure that we look into nested, transparent declaration contextsDouglas Gregor2009-11-091-0/+1
| | | | | | | when looking for a name within a given DeclContext. Now enumerators will show up in code-completion results. llvm-svn: 86591
* Factor CXString creation into a helper method.Benjamin Kramer2009-11-091-39/+36
| | | | llvm-svn: 86577
* Writing to a struct passed by value is pointless. Remove dead code.Benjamin Kramer2009-11-091-7/+2
| | | | | | | | - free(NULL) is a nop anyway. - if someone thinks calling clang_disposeString twice should be legal please change the method to take a pointer. llvm-svn: 86568
* Introduce CXString type and associated functions clang_getCString() and ↵Steve Naroff2009-11-091-24/+55
| | | | | | | | | | 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
* Move a function which returns a class outside of extern C scope.Daniel Dunbar2009-11-081-65/+64
| | | | llvm-svn: 86439
* CIndex: Add temporary hack to leak memory instead of returning invalid pointers.Daniel Dunbar2009-11-081-2/+4
| | | | llvm-svn: 86438
* Various improvements to Clang's code-completion infrastructure:Douglas Gregor2009-11-071-0/+315
| | | | | | | | | | | | | | - 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/tweak some comments.Steve Naroff2009-10-291-1/+4
| | | | | | | | - change ObjCCategoryImplDecl::getCategoryClass() to getCategoryDecl(). No functionality change. llvm-svn: 85528
* clang_getDeclSpelling(): For category implementations, make sure we hand ↵Steve Naroff2009-10-291-1/+4
| | | | | | back the category name (not the class name). This fixes <rdar://problem/7297518>. llvm-svn: 85521
* Remove _clang_initCXLookupHint() and _clang_getCursorWithHint(). Related to ↵Steve Naroff2009-10-281-18/+12
| | | | | | | | | | <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-1/+42
| | | | | | | | | | - 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
* Unify Unix and Windows code paths when executing 'clang'.Ted Kremenek2009-10-261-7/+3
| | | | llvm-svn: 85163
* Remove unnecessary calls to 'flush()'.Ted Kremenek2009-10-261-8/+7
| | | | llvm-svn: 85162
* Always emit error diagnostics when an error occurs within ↵Ted Kremenek2009-10-221-2/+2
| | | | | | clang_createTranslationUnit() and clang_createTranslationUnitFromSource(). These kind of errors are ones that shouldn't be missed. llvm-svn: 84904
* Split clang_getCursor() into clang_getCursor() and clang_getCursorWithHint().Ted Kremenek2009-10-221-2/+15
| | | | llvm-svn: 84873
* Add some explanatory diagnostics when clang_createTranslationUnitFromSource ↵Ted Kremenek2009-10-221-8/+28
| | | | | | fails. llvm-svn: 84825
OpenPOWER on IntegriCloud