summaryrefslogtreecommitdiffstats
path: root/clang/tools/CIndex
Commit message (Collapse)AuthorAgeFilesLines
...
* Introduce CXString type and associated functions clang_getCString() and ↵Steve Naroff2009-11-092-24/+57
| | | | | | | | | | 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
* Minor cleanup for CIndex-based code-completion:Douglas Gregor2009-11-091-0/+1
| | | | | | | | - Provide an actual test for code-completion via CIndex. - Actually print optional strings in c-index-test - Export clang_getCompletionChunkCompletionString from CIndex llvm-svn: 86550
* 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
* Add some missing libraries for CMake as well.Daniel Dunbar2009-11-071-1/+1
| | | | llvm-svn: 86390
* Add some missing libraries.Daniel Dunbar2009-11-071-1/+1
| | | | llvm-svn: 86389
* Various improvements to Clang's code-completion infrastructure:Douglas Gregor2009-11-072-0/+319
| | | | | | | | | | | | | | - 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
* Sort export list.Daniel Dunbar2009-11-021-17/+17
| | | | llvm-svn: 85832
* - 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-282-20/+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-272-1/+46
| | | | | | | | | | - 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-0/+1
| | | | llvm-svn: 85234
* 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-222-2/+17
| | | | llvm-svn: 84873
* Add some explanatory diagnostics when clang_createTranslationUnitFromSource ↵Ted Kremenek2009-10-221-8/+28
| | | | | | fails. llvm-svn: 84825
* Enhance 'clang_createTranslationUnitFromSourceFile()' in two ways:Ted Kremenek2009-10-221-11/+32
| | | | | | | | | (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-2/+4
| | | | | | | | | | | | | | 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
* - Extend clang_createIndex() to support PCH and diagnostic 'filtering'. This ↵Steve Naroff2009-10-202-21/+39
| | | | | | | | | | | | 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
* Fix inverted preprocessor guard, and fix the resulting compiler error that ↵Ted Kremenek2009-10-191-5/+5
| | | | | | was unmasked. llvm-svn: 84555
* Really fix <rdar://problem/7312058> by adding a 'displayDiagnostics' option toTed Kremenek2009-10-191-6/+17
| | | | | | | | | | | 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
* The constructor for ASTUnit now takes a DiagnosticClient*, allowing uses of ↵Ted Kremenek2009-10-191-1/+11
| | | | | | | | | | | | | | ASTUnit to specify alternate DiagnosticClients. To match this API, ASTUnit::LoadFromPCHFile() now takes a corresponding DiagnosticClient* argument as well. The DiagnosticClient object is destroyed when the ASTUnit object is destroyed. The CIndex library now uses this API to create a 'IgnoreDiagnosticsClient' that simply silences diagnostics when using the clang_createTranslationUnitFromSourceFile() function. This fixes <rdar://problem/7312058>. This API can change in the future as we add more flexibility for clients. llvm-svn: 84539
* Re-order includes so that the logic involving '#ifdef LLVM_ON_WIN32' appears ↵Ted Kremenek2009-10-191-1/+2
| | | | | | after the main #includes. The ultimate solution is to just use LLVM-portable methods in llvm/System. llvm-svn: 84534
* Move Diagnostic/DiagClient/FileManager from Indexer => ASTUnit.Steve Naroff2009-10-191-2/+1
| | | | | | Removing this shared data should enable clang_createTranslationUnit/clang_createTranslationUnitFromSourceFile to be run from multiple threads (related to <rdar://problem/7303432>). llvm-svn: 84499
* Change indenting for case/compound statements to conform to the rest of clang.Steve Naroff2009-10-191-39/+26
| | | | llvm-svn: 84498
* CIndex: make variable non-static to avoid potential race conditions, perBenjamin Kramer2009-10-191-4/+2
| | | | | | Daniel's comment. llvm-svn: 84484
* Move clients to use IdentifierInfo::getNameStart() instead of getName()Daniel Dunbar2009-10-181-6/+6
| | | | llvm-svn: 84436
* Try to unbreak MSVC build.Benjamin Kramer2009-10-181-0/+7
| | | | llvm-svn: 84433
* CIndex: fix typo.Benjamin Kramer2009-10-181-1/+1
| | | | llvm-svn: 84422
* Missed a paren.Benjamin Kramer2009-10-181-1/+1
| | | | llvm-svn: 84421
* CIndex: add a (untested) WIN32 codepath to get ClangPath.Benjamin Kramer2009-10-181-10/+14
| | | | llvm-svn: 84420
* CIndex: compute ClangPath lazily.Benjamin Kramer2009-10-181-17/+31
| | | | llvm-svn: 84419
* CIndex: replace fork/exec with our portable ExecuteAndWait wrapper.Benjamin Kramer2009-10-181-17/+3
| | | | llvm-svn: 84414
* CIndex: avoid a dangling pointer issue.Benjamin Kramer2009-10-181-8/+7
| | | | llvm-svn: 84413
* Attempt to unbreak the MSVC build.Daniel Dunbar2009-10-171-0/+12
| | | | llvm-svn: 84381
* Resolve FIXME: delete the 'Program' object in the destructor of CIndexer.Ted Kremenek2009-10-171-4/+4
| | | | llvm-svn: 84313
* Add 'UseBumpPtrAllocator' flag to ASTUnit::LoadFromPCHFile() to cause the ↵Ted Kremenek2009-10-171-1/+2
| | | | | | | | | | | created ASTContext to use its own BumpPtrAllocator to allocate ASTs. Change clang_createTranslationUnit (CIndex) to pass 'UseBumpPtrAllocator = true' to ASTUnit::LoadFromPCHFile(). llvm-svn: 84296
* Make CIndex and c-index-test a little bit more robust. The onlyDouglas Gregor2009-10-161-2/+14
| | | | | | | | substantive change is that clang_getCursorSource() now returns the file in which a macro was instantiated when the cursor points into a macro instantiation, rather than crashing. llvm-svn: 84275
* Keep track of whether declararions were loaded from a precompiledDouglas Gregor2009-10-162-10/+53
| | | | | | | | | | 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
* Use an std::vector<> instead of an array of ARG_MAX size, as ARG_MAX may not ↵Ted Kremenek2009-10-151-12/+12
| | | | | | be defined everywhere. llvm-svn: 84220
* Make sure temporary files get unlinked.Steve Naroff2009-10-151-1/+4
| | | | llvm-svn: 84208
* Add missing #include for wait().Ted Kremenek2009-10-151-0/+1
| | | | llvm-svn: 84207
* Minor improvement to format...no functionality change.Steve Naroff2009-10-151-14/+13
| | | | llvm-svn: 84203
* Implement <rdar://problem/7303432> [Clang/Index] In-memory-style AST ↵Steve Naroff2009-10-152-0/+63
| | | | | | | | | generation API (initial API implementation). Added clang_createTranslationUnitFromSourceFile(). Changed clang_createIndex() to lookup the location of clang (using dladdr). llvm-svn: 84198
* Make sure that libCIndex links as a C++ libraryDouglas Gregor2009-10-051-0/+4
| | | | llvm-svn: 83331
* - Fix assert in clang_getCursorDecl (having to do with recently added ↵Steve Naroff2009-10-051-1/+2
| | | | | | | | ObjC_ProtocolRef). - Make sure CHECK: lines in test case match the expected output. llvm-svn: 83316
* Add support for class and protocol references.Steve Naroff2009-10-011-5/+33
| | | | llvm-svn: 83186
* When pointing at a type decl reference, ASTLocation is a NamedDeclRef.Argyrios Kyrtzidis2009-09-291-0/+2
| | | | llvm-svn: 83099
OpenPOWER on IntegriCloud