summaryrefslogtreecommitdiffstats
path: root/clang/lib/Frontend/SerializedDiagnosticPrinter.cpp
Commit message (Collapse)AuthorAgeFilesLines
* Driver: Include driver diagnostics when we --serialize-diagnosticsJustin Bogner2014-10-231-14/+228
| | | | | | | | | | | | | | | Currently, when --serialize-diagnostics is passed this only includes the diagnostics from clang -cc1, and driver diagnostics are dropped. This causes issues for tools that use the serialized diagnostics, since stderr is lost and these diagnostics aren't seen at all. We handle this by merging the diagnostics from the CC1 process and the driver diagnostics into a single file when the driver invokes CC1. Fixes rdar://problem/10585062 llvm-svn: 220525
* Re-apply "Frontend: Extract SerializedDiagnosticReader out of ↵Justin Bogner2014-10-141-4/+2
| | | | | | | | | | | | CXLoadedDiagnostic (NFC)" I'd mispelled "Bitcode/BitCodes.h" before, and tested on a case insensitive filesystem. This reverts commit r219649, effectively re-applying r219647 and r219648. llvm-svn: 219664
* Revert "Frontend: Extract SerializedDiagnosticReader out of ↵Justin Bogner2014-10-141-2/+4
| | | | | | | | | | | CXLoadedDiagnostic (NFC)" The bots can't seem to find an include file. Reverting for now and I'll look into it in a bit. This reverts commits r219647 and r219648. llvm-svn: 219649
* Frontend: Extract SerializedDiagnosticReader out of CXLoadedDiagnostic (NFC)Justin Bogner2014-10-141-4/+2
| | | | | | | | | We currently read serialized diagnostics directly in the C API, which makes it difficult to reuse this logic elsewhere. This extracts the core of the serialized diagnostic parsing logic into a base class that can be subclassed using a visitor pattern. llvm-svn: 219647
* Reduce double set lookups. NFC.Benjamin Kramer2014-10-101-4/+2
| | | | llvm-svn: 219504
* unique_ptrify ChainedDiagnosticConsumer's ctor parametersDavid Blaikie2014-09-151-3/+3
| | | | llvm-svn: 217793
* unique_ptrify the raw_ostream argument to clang::serialized_diags::createDavid Blaikie2014-08-291-8/+9
| | | | llvm-svn: 216767
* Remove uses of the redundant ".reset(nullptr)" of unique_ptr, in favor of ↵David Blaikie2014-07-191-1/+1
| | | | | | | | | | | ".reset()" It's also possible to just write "= nullptr", but there's some question of whether that's as readable, so I leave it up to authors to pick which they prefer for now. If we want to discuss standardizing on one or the other, we can do that at some point in the future. llvm-svn: 213439
* Remove limits on the number of fix-it hints and ranges in the DiagnosticsEngine.Alexander Kornienko2014-05-221-2/+1
| | | | | | | | | | | | | | | | | | | Summary: The limits on the number of fix-it hints and ranges attached to a diagnostic are arbitrary and don't apply universally to all users of the DiagnosticsEngine. The way the limits are enforced may lead to diagnostics generating invalid sets of fixes. I suggest removing the limits, which will also simplify the implementation. Reviewers: rsmith Reviewed By: rsmith Subscribers: klimek, cfe-commits Differential Revision: http://reviews.llvm.org/D3879 llvm-svn: 209468
* [C++11] Use 'nullptr'. Frontend edition.Craig Topper2014-05-221-5/+6
| | | | llvm-svn: 209389
* [C++11] Add 'override' keyword to virtual methods that override their base ↵Craig Topper2014-03-131-32/+31
| | | | | | class. llvm-svn: 203758
* Replace OwningPtr with std::unique_ptr.Ahmed Charles2014-03-071-1/+1
| | | | | | This compiles cleanly with lldb/lld/clang-tools-extra/llvm. llvm-svn: 203279
* Serialized diagnostic severity levels should be stable.Jordan Rose2014-03-031-2/+17
| | | | | | | | | Serialized diagnostics were accidentally using the AST diagnostic level values rather than a dedicated stable enum, so the addition of "remark" broke the reading of existing serialized diagnostics files. I've added a .dia file generated from Xcode 5's Clang to make sure we don't break this in the future. llvm-svn: 202733
* Remove DiagnosticConsumer::clone(), a bad idea that is now unused.Douglas Gregor2013-05-031-4/+0
| | | | llvm-svn: 181070
* Teach serialized diagnostics about notes without locations.Ted Kremenek2013-02-211-0/+10
| | | | | | | | Along the way, improve a diagnostic for "previous declaration here" for implicit parameters. Fixes <rdar://problem/13211384>. llvm-svn: 175802
* Remove useless 'llvm::' qualifier from names like StringRef and others that areDmitri Gribenko2013-01-121-12/+11
| | | | | | brought into 'clang' namespace by clang/Basic/LLVM.h llvm-svn: 172323
* Sort all of Clang's files under 'lib', and fix up the broken headersChandler Carruth2012-12-041-9/+9
| | | | | | | | | | | | | uncovered. This required manually correcting all of the incorrect main-module headers I could find, and running the new llvm/utils/sort_includes.py script over the files. I also manually added quite a few missing headers that were uncovered by shuffling the order or moving headers up to be main-module-headers. llvm-svn: 169237
* Teach the serialized diagnostic writer to clone() itself, sharingDouglas Gregor2012-11-301-67/+112
| | | | | | | | | | state so that all of the various clones end up rendering their diagnostics into the same serialized-diagnostics file. This is important when we actually want failures during module build to be reported back to the translation unit that tried to import the not-yet-built or out-of-date module. <rdar://problem/12565727> llvm-svn: 169057
* Make DiagnosticOptions intrusively reference-counted, and make sureDouglas Gregor2012-10-231-5/+6
| | | | | | | the various stakeholders bump up the reference count. In particular, the diagnostics engine now keeps the DiagnosticOptions object alive. llvm-svn: 166508
* Avoid binding a reference to a dereferenced pointer in diagnostic serializationRichard Smith2012-08-211-92/+133
| | | | | | | | | | | if a diagnostic is emitted outside of any source file. The fix mirrors the corresponding code in TextDiagnosticPrinter. This required moving the functional parts of SDiagRenderer into SDiagWriter so they can be reused in the non-rendering codepath. No functionality change. llvm-svn: 162253
* Fix an assertion hit when the serialized diagnostics writer receive a diagnosticArgyrios Kyrtzidis2012-05-101-16/+24
| | | | | | | | | | | | | | from the frontend when the location is invalid and the SourceManager null. Instead of keeping the SourceManager object in DiagnosticRenderer, propagate it to the calls accordingly (as reference when it is expected to not be null, or pointer when it may be null). This effectively makes DiagnosticRenderer not tied to a specific SourceManager, removing a hack from TextDiagnosticPrinter. rdar://11386874 llvm-svn: 156536
* Serialization: Switch over to using the native SmallVector based BitstreamWriterDaniel Dunbar2012-02-291-1/+1
| | | | | | ctor. llvm-svn: 151752
* Refactor DiagnosticRenderer and SDiagsRenderer to have some functionalityTed Kremenek2012-02-141-29/+10
| | | | | | | | | pulled into DiagnosticNoteRenderer, and common DiagnosticRenderer that assumes that all custom diagnostic messages are notes. Also extend DiagnosticRenderer to work with StoredDiagnostics in preparation for subsequent changes. llvm-svn: 150455
* Basic: import SmallString<> into clang namespaceDylan Noblesmith2012-02-051-2/+2
| | | | | | | (I was going to fix the TODO about DenseMap too, but that would break self-host right now. See PR11922.) llvm-svn: 149799
* Basic: import OwningPtr<> into clang namespaceDylan Noblesmith2012-02-051-1/+1
| | | | llvm-svn: 149798
* Refactor SerializeDiagnosticsPrinter to using DiagnosticRenderer. This ↵Ted Kremenek2011-12-171-71/+186
| | | | | | | | | | gives us comparative diagnostics to TextDiagnosticPrinter. This certainly can be cleaned up a bit. llvm-svn: 146820
* Make changes to SDiagsWriter to make it work in combination with the ARC ↵Argyrios Kyrtzidis2011-12-071-29/+29
| | | | | | | | | | | | | migrator: -Allow it to be used with multiple BeginSourceFile/EndSourceFile calls; for this introduce a "finish" callback method in the DiagnosticConsumer. SDiagsWriter finishes up the serialization file inside this method. -Make it independent of any particular DiagnosticsEngine; make it use the SourceManager of the Diagnostic object. -Ignore null source ranges. llvm-svn: 146020
* Remove extra ';'.Devang Patel2011-11-151-1/+1
| | | | llvm-svn: 144604
* serialized diagnostics: simplify code.Benjamin Kramer2011-11-101-5/+1
| | | | llvm-svn: 144277
* serialized diagnostics: implement full deserialization of clang diagnostics ↵Ted Kremenek2011-11-101-9/+26
| | | | | | | | via the libclang API. I've tested it on simple cases and it works. Test cases to follow as well as a few tweaks. llvm-svn: 144269
* serialized diagnostics: serialize the version info in a separate meta block.Ted Kremenek2011-11-081-20/+31
| | | | llvm-svn: 144115
* serialized diagnostics: include FixIt information in serialized diagnostics.Ted Kremenek2011-11-051-6/+41
| | | | llvm-svn: 143776
* serialized diagnostics: pull emission of filenames into diagnostic block.Ted Kremenek2011-11-051-81/+56
| | | | llvm-svn: 143765
* serialized diagnostics: pull emission of diagnostic flag string into ↵Ted Kremenek2011-11-051-65/+62
| | | | | | diagnostics block. llvm-svn: 143764
* Serialized diagnostics: pull category name serialization into diagnostic ↵Ted Kremenek2011-11-051-24/+33
| | | | | | blocks. The goal is to remove BLOCK_STRINGS so that the bitcode file can potentially be streamed. llvm-svn: 143763
* serialized diagnostics: emit source ranges.Ted Kremenek2011-11-051-2/+55
| | | | llvm-svn: 143762
* Move definition of record/block IDs for serialized diagnostics to public header.Ted Kremenek2011-11-051-16/+1
| | | | llvm-svn: 143761
* Serialized diagnostics: encode a 24 bit version number as part of the "magic ↵Ted Kremenek2011-11-051-4/+2
| | | | | | number" of serialized diagnostics. llvm-svn: 143760
* serialized diagnostics: unique warning strings when emitting serialized ↵Ted Kremenek2011-11-051-25/+61
| | | | | | diagnostics. llvm-svn: 143759
* Serialized diagnostics: serialize "notes" as sub diagnostics of warnings and ↵Ted Kremenek2011-11-051-4/+27
| | | | | | errors. llvm-svn: 143758
* Also include file modification time and size in output of ↵Ted Kremenek2011-11-051-1/+5
| | | | | | SerializedDiagnosticPrinter. llvm-svn: 143757
* Start work on SerializedDiagnosticPrinter, a new DiagnosticConsumer that ↵Ted Kremenek2011-10-291-0/+357
serializes out the diagnostics for a given translation unit to a bit code file. This is a WIP. The motivation for this new DiagnosticConsumer is to provide a way for tools invoking the compiler to get its diagnostics via a libclang interface, rather than textually parsing the compiler output. This gives us flexibility to change the compiler's textual output, but have a structured data format for clients to use to get the diagnostics via a stable API. I have no tests for this, but llvm-bcanalyzer so far shows that the emitted file is well-formed. More work to follow. llvm-svn: 143259
OpenPOWER on IntegriCloud