summaryrefslogtreecommitdiffstats
path: root/clang/tools/CIndex/CIndexDiagnostic.cpp
Commit message (Collapse)AuthorAgeFilesLines
* Rename 'CIndex' to 'libclang', since it has basically become our stable publicDaniel Dunbar2010-04-301-285/+0
| | | | | | (C) API, and will likely grow further in this direction in the future. llvm-svn: 102779
* Prune includes.Benjamin Kramer2010-04-121-0/+1
| | | | llvm-svn: 101059
* Minor ASTUnit cleanups:Douglas Gregor2010-04-051-3/+3
| | | | | | | | - Rename "Diagnostics" and related to "StoredDiagnostics", to better capture what we're actually storing. - Move SourceManager and FileManager to the heap. llvm-svn: 100441
* Reinstate my CodeModificationHint -> FixItHint renaming patch, withoutDouglas Gregor2010-03-311-1/+1
| | | | | | the C-only "optimization". llvm-svn: 100022
* Revert r100008, which inexplicably breaks the clang-i686-darwin10 builderDouglas Gregor2010-03-311-1/+1
| | | | llvm-svn: 100018
* Rename CodeModificationHint to FixItHint, since we've been using theDouglas Gregor2010-03-311-1/+1
| | | | | | | term "fix-it" everywhere and even *I* get tired of long names sometimes. No functionality change. llvm-svn: 100008
* Make sure that we have File IDs for all of the unsaved files before weDouglas Gregor2010-03-241-0/+1
| | | | | | deserialize diagnostics. llvm-svn: 99426
* Rework the CIndex API for displaying diagnostics. Instead of printingDouglas Gregor2010-02-221-24/+22
| | | | | | | 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-191-61/+29
| | | | llvm-svn: 96685
* Re-apply my diagnostics-capture patch for CIndex, with some tweaks toDouglas Gregor2010-02-181-3/+82
| | | | | | try to address the msvc failures. llvm-svn: 96624
* Revert my CIndex diagnostic changes (r96603, 96606, 96607), which wereDouglas Gregor2010-02-181-75/+0
| | | | | | breaking the msvc9 builder for unknown reasons. llvm-svn: 96618
* Introduce CIndex API functions for displaying a diagnostic, with someDouglas Gregor2010-02-181-0/+75
| | | | | | | | | | | 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
* Rework how CIndex handles diagnostics. Rather than using a callback,Douglas Gregor2010-02-181-94/+64
| | | | | | | | | | | | | | | | | | 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
* Move createCXString() functions out of CIndexer and into the clang::cxstring ↵Ted Kremenek2010-02-171-35/+36
| | | | | | | | | | | | 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
* Clean up the CIndex interface to diagnostic ranges. Thanks, Daniel!Douglas Gregor2010-02-081-23/+13
| | | | llvm-svn: 95602
* CIndex: Fix diagnostic callback to not return SourceLocations with a ↵Daniel Dunbar2010-01-301-9/+17
| | | | | | reference to a temporary LangOptions object. llvm-svn: 94928
* CIndex: Fix ReportSerializedDiagnostics to honor the DiagnosticClient contractDaniel Dunbar2010-01-301-1/+6
| | | | | | | | | | that diagnostics with a source location should occur inside {Begin,End}SourceFile. Note that code completion is currently passing in an invalid LangOptions object due to its implementation, I need to sort this out with Doug. llvm-svn: 94927
* When printing diagnostics in c-index-test, also print source rangesDouglas Gregor2010-01-291-0/+12
| | | | | | | | and fix-it information, so we can see everything in one place. Along the way, fix a few bugs with deserialization and query of diagnostics in CIndex. llvm-svn: 94768
* Introduce serialization and deserialization of diagnostic informationDouglas Gregor2010-01-281-0/+47
| | | | | | | | | | | | | | | | | so that CIndex can report diagnostics through the normal mechanisms even when executing Clang in a separate process. This applies both when performing code completion and when using ASTs as an intermediary for clang_createTranslationUnitFromSourceFile(). The serialized format is not perfect at the moment, because it does not encapsulate macro-instantiation information. Instead, it maps all source locations back to the instantiation location. However, it does maintain source-range and fix-it information. To get perfect fidelity from the serialized format would require serializing a large chunk of the source manager; at present, it isn't clear if this code will live long enough for that to matter. llvm-svn: 94740
* Implement a diagnostics callback for the C interface to Clang, so thatDouglas Gregor2010-01-281-0/+198
clients can format diagnostics as they wish rather than having to parse standard error. All of the important parts of the front end's diagnostics are exposed: text, severity, location, source ranges, and fix-its. The diagnostics callback is now available with clang_createTranslationUnitFromSource() and clang_createTranslationUnit(). As part of this change, CXSourceLocation and CXSourceRange got one pointer larger, since we need to hold on to the SourceManager and LangOptions structures in the source location. This is the minimum amount of information needed for the functions that operate on source locations and ranges (as implemented now). Previously we held on to the ASTContext, but the diagnostics callback can end up with source locations when there is no ASTContext (or preprocessor). Still to do: - Code completion needs to support the diagnostics callback, once we have the ability to (de-)serialize diagnostics. - Eliminate the "displayDiagnostics" argument to createIndex; we'll always pass diagnostics to the callback and let it deal with display. llvm-svn: 94709
OpenPOWER on IntegriCloud