[cfe-commits] PATCH: Switch libclang's formatDiagnostic routine to use the new TextDiagnostic interface

Chandler Carruth chandlerc at google.com
Sun Oct 16 03:29:42 PDT 2011


This patch switches libclang over to share the logic for emitting textual
diagnostics with the Clang driver. There are some "interesting"
ramifications of this switch:

- Complete path names to files instead of just filenames in some cases
- Macro backtrace notes are printed into the same blob of text
- Possibility to extend with color, caret diagnostics, line-wrapping, etc

The only real downside here seems to be that backtrace situation. There is
no really ideal solution to this; the problem is that the macro backtrace
doesn't consist of real notes, they are synthesized during emission. That
means there won't be any representation of them within the diagnostic
objects libclang sees, but when it goes to render some diagnostics
textually, the macro notes will suddenly appear.

I don't really use libclang directly, so I wanted to mail this patch out as
a starting point; I'll let Doug, Argiris, or others who understand its
customers better decide how best to proceed. =]
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20111016/b760d3a2/attachment.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: format-diagnostics.diff
Type: text/x-patch
Size: 8139 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20111016/b760d3a2/attachment.bin>


More information about the cfe-commits mailing list