summaryrefslogtreecommitdiffstats
path: root/clang/tools/CIndex
Commit message (Collapse)AuthorAgeFilesLines
...
* Try to appease MSVCDouglas Gregor2010-03-181-4/+4
| | | | llvm-svn: 98875
* Explicitly link macro instantiations to macro definitions in theDouglas Gregor2010-03-181-0/+8
| | | | | | | | preprocessing record. Use that link with clang_getCursorReferenced() and clang_getCursorDefinition() to match instantiations of a macro to the definition of the macro. llvm-svn: 98842
* Expose macro definitions as CIndex cursors. These can still only beDouglas Gregor2010-03-183-1/+43
| | | | | | generated by clang_annotateTokens(). llvm-svn: 98837
* Introduce the notion of a "preprocessing record", which keeps track ofDouglas Gregor2010-03-183-96/+62
| | | | | | | | | | | | | | | | | | | | | | | | the macro definitions and macro instantiations that are found during preprocessing. Preprocessing records are *not* generated by default; rather, we provide a PPCallbacks subclass that hooks into the existing callback mechanism to record this activity. The only client of preprocessing records is CIndex, which keeps track of macro definitions and instantations so that they can be exposed via cursors. At present, only token annotation uses these facilities, and only for macro instantiations; both will change in the near future. However, with this change, token annotation properly annotates macro instantiations that do not produce any tokens and instantiations of macros that are later undef'd, improving our consistency. Preprocessing directives that are not macro definitions are still handled by clang_annotateTokens() via re-lexing, so that we don't have to track every preprocessing directive in the preprocessing record. Performance impact of preprocessing records is still TBD, although it is limited to CIndex and therefore out of the path of the main compiler. llvm-svn: 98836
* More token-annotation experimentation, preprocessing the annotatedDouglas Gregor2010-03-183-12/+115
| | | | | | | token sequence to detect macro instantiations (that produce at least token). WIP. llvm-svn: 98826
* Experimental stab at using relexing to identify preprocessorDouglas Gregor2010-03-184-8/+141
| | | | | | | | directives while annotating tokens in CIndex. This functionality should probably be factored out of this routine, but we're not there yet. llvm-svn: 98786
* Audit all callers of SourceManager::getBufferData(); fix the one thatDouglas Gregor2010-03-161-0/+2
| | | | | | needs better error recovery. llvm-svn: 98667
* Let SourceManager::getBufferData return StringRef instead of a pair of two ↵Benjamin Kramer2010-03-161-8/+7
| | | | | | const char*. llvm-svn: 98630
* Give SourceManager a Diagnostic object with which to report errors,Douglas Gregor2010-03-162-12/+14
| | | | | | and start simplifying the interfaces in SourceManager that can fail. llvm-svn: 98594
* Introduce a new BufferResult class to act as the return type ofDouglas Gregor2010-03-151-6/+17
| | | | | | | | | | | | | | SourceManager's getBuffer() (and similar) operations. This abstract can be used to force callers to cope with errors in getBuffer(), such as missing files and changed files. Fix a bunch of callers to use the new interface. Add some very basic checks for file consistency (file size, modification time) into ContentCache::getBuffer(), although these checks don't help much until we've updated the main callers (e.g., SourceManager::getSpelling()). llvm-svn: 98585
* Rename clang_constructUSR_ObjCategory to clang_constructUSR_ObjCCategory.Ted Kremenek2010-03-152-2/+2
| | | | | | (there was a missing 'C'). llvm-svn: 98554
* Revert 98439. There is a bad race condition in sys::Path::makeUnique on win32.Benjamin Kramer2010-03-134-12/+18
| | | | llvm-svn: 98452
* Make getTemporaryPath a static member of CIndexer and use it to replace ↵Benjamin Kramer2010-03-134-18/+12
| | | | | | | | tmpnam calls. This fixes linker warnings on linux. llvm-svn: 98439
* Implement several CIndex functions for constructing USRs from C-strings ↵Ted Kremenek2010-03-132-38/+166
| | | | | | instead of AST elements. llvm-svn: 98421
* Allow users to set CPPFLAGS and CXXFLAGS on the make command line.Jeffrey Yasskin2010-03-121-1/+1
| | | | | Tested: make CPPFLAGS=-m64 CXXFLAGS=-m64 -j8 && (cd tools/clang;make test) llvm-svn: 98399
* Implement clang_isUnexposed(), a predicate function to simplify filtering outTed Kremenek2010-03-082-0/+13
| | | | | | unexposed AST elements. llvm-svn: 97985
* Extend ObjCMessageExpr for class method sends with the source locationDouglas Gregor2010-03-081-0/+9
| | | | | | of the class name. llvm-svn: 97943
* Keep track of type source information in the return type of anDouglas Gregor2010-03-081-3/+4
| | | | | | | | | | Objective-C method declaration, e.g., for - (Foo *)myMethod; we now have TypeSourceInfo for the Foo*. llvm-svn: 97942
* Check if 'Unit' is NULL before trying to iterate over the diagnostics.Ted Kremenek2010-03-051-1/+2
| | | | | | | This obviates a null dereference that can occur when 'NumErrors' is not zero. llvm-svn: 97849
* Add clang version to crashtracer string.Ted Kremenek2010-03-051-1/+2
| | | | llvm-svn: 97848
* A little hack to identify unwanted concurrency in CIndexDouglas Gregor2010-03-051-0/+6
| | | | llvm-svn: 97831
* Export clang_getCursorLinkage().Ted Kremenek2010-03-031-0/+1
| | | | llvm-svn: 97647
* Add clang_getCursorLinkage(), which returns theTed Kremenek2010-03-031-0/+19
| | | | | | | underlying linkage for the entity referred to by a CXCursor. llvm-svn: 97646
* When given unsaved files in clang_createTranslationUnitFromSourceFile,Douglas Gregor2010-02-271-1/+1
| | | | | | | | | | copy the source buffers provided rather than referencing them directly, so that the caller can free those buffers immediately after calling clang_createTranslationUnitFromSourceFile(). Otherwise, we risk hitting those buffers later (when building source ranges, forming diagnostics, etc.). llvm-svn: 97296
* Fix bogus diagnostic format string.Daniel Dunbar2010-02-232-2/+2
| | | | llvm-svn: 96978
* Rework the CIndex API for displaying diagnostics. Instead of printingDouglas Gregor2010-02-223-29/+44
| | | | | | | the diagnostics to a FILE*, return a CXString containing the formatted diagnostic. llvm-svn: 96823
* Attempt to fix the MSVC9 failure with c-indext-test, where the CIndex DLLDouglas Gregor2010-02-211-0/+7
| | | | | | | | and the c-index-test executable end up getting different copies of stderr, causing non-deterministic ordering of output. Fixed by flushing the file after printing a diagnostic (only on Windows). llvm-svn: 96754
* Simplify the CIndex fix-it API, now that we have half-open CXSourceRanges.Douglas Gregor2010-02-192-65/+30
| | | | llvm-svn: 96685
* Teach ASTUnit to keep track of temporary files, then delete them whenDouglas Gregor2010-02-182-11/+26
| | | | | | the ASTUnit itself is destroyed. Fixes <rdar://problem/7649385>. llvm-svn: 96628
* Re-apply my diagnostics-capture patch for CIndex, with some tweaks toDouglas Gregor2010-02-185-20/+149
| | | | | | try to address the msvc failures. llvm-svn: 96624
* Revert "Sort visitor methods so we can easily tell what's implemented."Ted Kremenek2010-02-181-14/+14
| | | | | | This reverts commit 4383e04c75731f8695b8355783f9966ac56b0926. llvm-svn: 96622
* Revert "Tidy up order of switch statement. No functionality change."Ted Kremenek2010-02-181-20/+24
| | | | | | This reverts commit 95575005fc6409df98e6e079caf324308f62171b. llvm-svn: 96620
* Revert my CIndex diagnostic changes (r96603, 96606, 96607), which wereDouglas Gregor2010-02-184-129/+8
| | | | | | breaking the msvc9 builder for unknown reasons. llvm-svn: 96618
* Introduce debugging/testing hook clang_enableStackTraces() intoDouglas Gregor2010-02-182-0/+6
| | | | | | | CIndex, so that c-index-test to use it to call lvm::sys::PrintStackTraceOnErrorSignal(). llvm-svn: 96607
* Resurrect the displayDiagnostics parameter to clang_createIndex(), andDouglas Gregor2010-02-182-8/+46
| | | | | | | display captured diagnostics when we can't return an invalid CXTranslationUnit. llvm-svn: 96606
* Introduce CIndex API functions for displaying a diagnostic, with someDouglas Gregor2010-02-182-0/+77
| | | | | | | | | | | knobs to control formatting. Eventually, I'd like to merge the implementation of this code with the TextDiagnosticPrinter, so that it's easy for CIndex clients to produce beautiful diagnostics like the clang compiler does. Use this new function to display diagnostics within c-index-test. llvm-svn: 96603
* Tidy up order of switch statement. No functionality change.Ted Kremenek2010-02-181-24/+20
| | | | llvm-svn: 96602
* Sort visitor methods so we can easily tell what's implemented.Ted Kremenek2010-02-181-14/+14
| | | | llvm-svn: 96600
* Change cursor behavior for attributes to have them visited as part of recursingTed Kremenek2010-02-181-7/+1
| | | | | | to the children of a Decl. llvm-svn: 96599
* Rework how CIndex handles diagnostics. Rather than using a callback,Douglas Gregor2010-02-185-159/+143
| | | | | | | | | | | | | | | | | | we attach diagnostics to translation units and code-completion results, so they can be queried at any time. To facilitate this, the new StoredDiagnostic class stores a diagnostic in a serializable/deserializable form, and ASTUnit knows how to capture diagnostics in this stored form. CIndex's CXDiagnostic is a thin wrapper around StoredDiagnostic, providing a C interface to stored or de-serialized diagnostics. I've XFAIL'd one test case temporarily, because currently we end up storing diagnostics in an ASTUnit that's never returned to the user (because it contains errors). I'll introduce a temporary fix for this soon; the real fix will be to allow us to return and query invalid ASTs. llvm-svn: 96592
* Add basic cursor traversal for attributes. We currently don't have sourceTed Kremenek2010-02-181-0/+16
| | | | | | ranges for Attr objects, so lookup by cursor location currently doesn't work. llvm-svn: 96571
* Teach CMake to put the CIndex header into the Xcode/MSVC projectDouglas Gregor2010-02-181-0/+1
| | | | llvm-svn: 96566
* Start adding cursor kinds for attributes, with first exposingTed Kremenek2010-02-183-2/+27
| | | | | | IBActionAttr and IBOutletAttr respectively. llvm-svn: 96563
* Don't make the inclusion of crashtracer information depend on NDEBUG.Ted Kremenek2010-02-171-3/+1
| | | | llvm-svn: 96515
* Convert clang_getCompletionChunkText() to return a CXString.Ted Kremenek2010-02-171-6/+8
| | | | llvm-svn: 96439
* Remove trailing spaces.Ted Kremenek2010-02-171-212/+212
| | | | llvm-svn: 96427
* Change clang_getCursorKindSpelling() to return a CXStringTed Kremenek2010-02-171-45/+79
| | | | | | instead of a 'const char *'. llvm-svn: 96425
* Change clang_getFileName() to return a 'CXString' instead of 'const char *'.Ted Kremenek2010-02-171-3/+3
| | | | llvm-svn: 96424
* Move createCXString() functions out of CIndexer and into the clang::cxstring ↵Ted Kremenek2010-02-174-98/+101
| | | | | | | | | | | | namespace. We can much more succinctly refer to these functions this way. Also change the default behavior of createCXString(StringRef&) to duplicate the string. This is almost always what we want. The other case is where we pass a constant c-string, which uses the other version of createCXString(). llvm-svn: 96423
* ASTUnit: Constant fold UseBumpAllocator to true, we don't care to support ↵Daniel Dunbar2010-02-161-4/+1
| | | | | | this as an argument. llvm-svn: 96316
OpenPOWER on IntegriCloud