History log of /external/clang/lib/Frontend/TextDiagnostic.cpp
Revision Date Author Comments (<<< Hide modified files) (Show modified files >>>)
0fda0f75f053ad9afdb2bb8d4ea72c5e6a49d657 01-Aug-2013 Rafael Espindola <rafael.espindola@gmail.com> Use llvm::sys::fs::UniqueID for windows and unix.

This unifies the unix and windows versions of FileManager::UniqueDirContainer
and FileManager::UniqueFileContainer by using UniqueID.

We cannot just replace "struct stat" with llvm::sys::fs::file_status, since we
want to be able to construct fake ones, and file_status has different members
on unix and windows.

What the patch does is:

* Record only the information that clang is actually using.
* Use llvm::sys::fs::status instead of stat and fstat.
* Use llvm::sys::fs::UniqueID
* Delete the old windows versions of UniqueDirContainer and
UniqueFileContainer since the "unix" one now works on windows too.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@187619 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Frontend/TextDiagnostic.cpp
1f13fbd0c5bac045aa7d6ae3e998758e9dfa3ce4 07-Jun-2013 Jordan Rose <jordan_rose@apple.com> Handle Unicode characters in fix-it replacement strings.

Patch by Sukolsak Sakshuwong!

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@183535 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Frontend/TextDiagnostic.cpp
dd3e2d90418de46b77a9dde3bb992390610e343a 23-Apr-2013 Benjamin Kramer <benny.kra@googlemail.com> Make compares unsigned. The expression can't become negative anyways.

Silences a sign compare warning on 32 bit archs.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@180110 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Frontend/TextDiagnostic.cpp
316dd5467bed9242088149fe92f3316ef4f235e9 16-Mar-2013 Ted Kremenek <kremenek@apple.com> Fix buffer underrun (invalid read) triggered during diagnostic rendering. The test would overflow when computing '0 - 1'.

I don't have a good testcase for this that does not depend on system headers.
It did not trigger with preprocessed output, and I had trouble reducing the example.

Fixes <rdar://problem/13324594>.

Thanks to Michael Greiner for reporting this issue.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@177201 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Frontend/TextDiagnostic.cpp
3f6f51e28231f65de9c2dd150a2d757b2162cfa3 08-Feb-2013 Jordan Rose <jordan_rose@apple.com> Excise <cctype> from Clang (except clang-tblgen) in favor of CharInfo.h.

Nearly all of these changes are one-to-one replacements; the few that
aren't have to do with custom identifier validation.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@174768 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Frontend/TextDiagnostic.cpp
77163bc392be75795d58b1f6177a0a4626a57dcb 05-Feb-2013 NAKAMURA Takumi <geek4civic@gmail.com> TextDiagnostic.cpp: Suppress a warning to use ptrdiff_t on i686-clang. [-Wsign-compare]

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@174353 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Frontend/TextDiagnostic.cpp
91165e74c8b480c1da3a719d764f4fa0e7b1b921 30-Jan-2013 Jordan Rose <jordan_rose@apple.com> Diagnostics: Clarify name of line-length-limiting constant in r173976.

Thanks, Sean.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@173981 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Frontend/TextDiagnostic.cpp
f6e74a35e0c0e53b2e65fc9fe86f8e4cadcca473 30-Jan-2013 Jordan Rose <jordan_rose@apple.com> Diagnostics: if a line is longer than 4096 characters, don't print it.

Specifically, don't print snippets, caret diagnostics, or ranges for
lines over 4096 characters. We copy the line around a few times in our
diagnostics machinery, and we have to print a caret line that's just as
long. This uses a lot of memory just to create a poor user experience as
we print out a line much too long for anyone to read...or spend extra
energy trying to fit it to -fmessage-length.

<rdar://problem/13106850>

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@173976 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Frontend/TextDiagnostic.cpp
cb5620c9b213f4bd323912159fdddda35e258a14 30-Jan-2013 Dmitri Gribenko <gribozavr@gmail.com> Move UTF conversion routines from clang/lib/Basic to llvm/lib/Support

This is required to use them in TableGen.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@173924 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Frontend/TextDiagnostic.cpp
813bc7faa74bda8162db3dede57e07bfe764e86e 19-Dec-2012 Douglas Gregor <dgregor@apple.com> Be defensive when printing module import locations; the diagnostic printer needs to be robust

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@170466 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Frontend/TextDiagnostic.cpp
55fc873017f10f6f566b182b70f6fc22aefa3464 04-Dec-2012 Chandler Carruth <chandlerc@gmail.com> Sort all of Clang's files under 'lib', and fix up the broken headers
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.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@169237 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Frontend/TextDiagnostic.cpp
c2b914fb6fed213a7e7d9847e543f1e7f94d852d 01-Dec-2012 Benjamin Kramer <benny.kra@googlemail.com> Make helper classes anonymous. Make helper functions static instead of private members so the anonymous class doesn't leak out.

No functionality change.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@169099 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Frontend/TextDiagnostic.cpp
6c3254316de2d0d554b19702f4b10117ae46b77b 30-Nov-2012 Douglas Gregor <dgregor@apple.com> When we're emitting a diagnostic with a source location in an imported
module, provide a module import stack similar to what we would get for
an include stack, e.g.,

In module 'DependsOnModule' imported from build-fail-notes.m:4:
In module 'Module' imported from DependsOnModule.framework/Headers/DependsOnModule.h:1:
Inputs/Module.framework/Headers/Module.h:15:12: note: previous definition is here
@interface Module

<rdar://problem/12696425>


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@169042 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Frontend/TextDiagnostic.cpp
830ea5b7c75413526c19531f0180fa6e45b98919 30-Nov-2012 Douglas Gregor <dgregor@apple.com> When an error occurs while building a module on demand, provide "While
building module 'Foo' imported from..." notes (the same we we provide
"In file included from..." notes) in the diagnostic, so that we know
how this module got included in the first place. This is part of
<rdar://problem/12696425>.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@169021 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Frontend/TextDiagnostic.cpp
191db6dc0d6290b5f2993691e409ff2dc8b4345e 04-Nov-2012 Seth Cantrell <seth.cantrell@gmail.com> only truncate source lines in text diagnostics when
the ellipsis is shorter than the text it replaces

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@167364 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Frontend/TextDiagnostic.cpp
9cffb4a9ae548245ede15850cb96dfedf56255fe 03-Nov-2012 Seth Cantrell <seth.cantrell@gmail.com> don't step into the middle of multibyte sequences

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@167361 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Frontend/TextDiagnostic.cpp
eaa5a2b5e099bf29856bc88b03cd7c9d473f671d 03-Nov-2012 Seth Cantrell <seth.cantrell@gmail.com> fix bug in SourceColumnMap::startOfPreviousColumn

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@167360 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Frontend/TextDiagnostic.cpp
9cb1c3de9df7d944f0c5cccaf03fa414036487eb 03-Nov-2012 Eli Friedman <eli.friedman@gmail.com> Add a proper algorithm to compute accurate source ranges for diagnostics with
caret locations and source ranges in macros. Makes ranges more accurate
in some cases, and fixes an assertion failure.

Fixes <rdar://problem/12472249>.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@167353 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Frontend/TextDiagnostic.cpp
0d1e645bbfd3727b0dd758bdb685c6e5c7592fec 30-Oct-2012 Seth Cantrell <seth.cantrell@gmail.com> remove duplicate data array

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@167007 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Frontend/TextDiagnostic.cpp
c6a2f6e2dd16368f4a60178b5e20b63fcafb5481 30-Oct-2012 Seth Cantrell <seth.cantrell@gmail.com> fix calculation of end pointer

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@167006 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Frontend/TextDiagnostic.cpp
dc7b641574a733624489bd87fc7061771edf2113 24-Oct-2012 Douglas Gregor <dgregor@apple.com> Use a .def file for most of the diagnostic options.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@166520 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Frontend/TextDiagnostic.cpp
02c23ebf41ae2f70da0ba7337e05c51fbfe35f7f 24-Oct-2012 Douglas Gregor <dgregor@apple.com> Make DiagnosticOptions intrusively reference-counted, and make sure
the various stakeholders bump up the reference count. In particular,
the diagnostics engine now keeps the DiagnosticOptions object alive.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@166508 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Frontend/TextDiagnostic.cpp
4ca3abd3680afec6207d25d0bb80838bf59ecbfe 18-Oct-2012 Benjamin Kramer <benny.kra@googlemail.com> Emit diagnostics in chunks even when we're trying to print colored template diffs.

char-by-char is really slow on an unbuffered stream.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@166218 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Frontend/TextDiagnostic.cpp
f3477c13eeaf11b32a41f181398fb5deffd0dd73 27-Sep-2012 Sylvestre Ledru <sylvestre@debian.org> Revert 'Fix a typo 'iff' => 'if''. iff is an abreviation of if and only if. See: http://en.wikipedia.org/wiki/If_and_only_if Commit 164766

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@164769 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Frontend/TextDiagnostic.cpp
94ff8e1f57c6382d91d0de981a4f311509d83e37 27-Sep-2012 Sylvestre Ledru <sylvestre@debian.org> Fix a typo 'iff' => 'if'

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@164766 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Frontend/TextDiagnostic.cpp
c7bb384d608aeae23a6c95114569da0c3eae10fe 13-Sep-2012 Richard Smith <richard-llvm@metafoo.co.uk> Make TextDiagnostic more robust against SourceLocations which point into the
middle of UTF-8 characters, and avoid walking to such positions when adjusting
column ranges for display. Fixes a couple of hangs when rendering diagnostics.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@163820 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Frontend/TextDiagnostic.cpp
7094dee95f8c915d27097ac18b47d1ef31fd72ed 10-Aug-2012 Joerg Sonnenberger <joerg@bec.de> Add missing cctype includes.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@161660 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Frontend/TextDiagnostic.cpp
fbffb5f91e34c4c455cdeb9d4331b128f9511a48 08-Aug-2012 Benjamin Kramer <benny.kra@googlemail.com> Remove unused variables.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@161483 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Frontend/TextDiagnostic.cpp
bed28ac1d1463adca3ecf24fca5c30646fa9dbb2 23-Jul-2012 Sylvestre Ledru <sylvestre@debian.org> Fix a typo (the the => the)

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@160622 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Frontend/TextDiagnostic.cpp
bbe0175255d4da42cd99d93ca1e60c8eabcb4b9a 20-Jul-2012 Jordan Rose <jordan_rose@apple.com> Re-apply r160319 "Don't crash when emitting fixits following Unicode chars"

This time, make sure we don't try to print fixits with newline characters,
since they don't have a valid column width, and they don't look good anyway.

PR13417 (and originally <rdar://problem/11877454>)

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@160561 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Frontend/TextDiagnostic.cpp
43972898614d91c00982f10cdf7f2bfb4a9f6275 20-Jul-2012 Nico Weber <nicolasweber@gmx.de> Revert r160319, it caused PR13417. Add a test for PR13417.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@160542 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Frontend/TextDiagnostic.cpp
6f977c3e7918f9a668164f3ce27f1baa9557eb82 16-Jul-2012 Jordan Rose <jordan_rose@apple.com> Don't crash when emitting fixits following Unicode characters.

This code is very sensitive to the difference between "columns" as printed
and "bytes" (SourceManager columns). All variables are now named explicitly
and our assumptions are (hopefully) documented as both comment and assertion.

Whether parseable fixits should use byte offsets or Unicode character counts
is pending discussion on the mailing list; currently the implementation uses
bytes (and has no problems on lines containing multibyte characters).
This has been added to the user manual.

<rdar://problem/11877454>

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@160319 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Frontend/TextDiagnostic.cpp
af082c3b163397c040c3a98c7a5f09ee2a0badef 12-Jul-2012 Benjamin Kramer <benny.kra@googlemail.com> PR13312: Don't crash when printing a fixit that ends in a unicode character.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@160112 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Frontend/TextDiagnostic.cpp
b956e5a2439bce94ba2e1da264471859632eb11f 29-Jun-2012 Richard Trieu <rtrieu@google.com> When applying a template diff highlighting to a diagnostic message, remember
to reapply the bold formatting when needed.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@159386 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Frontend/TextDiagnostic.cpp
50badd523b9b90c0731423d002b13a00bf754036 28-Jun-2012 David Blaikie <dblaikie@gmail.com> Fix template type diffing coloring (r159216) when forcing color output to a file (not a terminal)

Reviewed (over the shoulder) by Richard Trieu.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@159381 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Frontend/TextDiagnostic.cpp
246b6aa6763de8c617d564ef33123a8f3293a80e 26-Jun-2012 Richard Trieu <rtrieu@google.com> Add template type diffing to Clang. This feature will provide a better
comparison between two templated types when they both appear in a diagnostic.
Type elision will remove indentical template arguments, which can be disabled
with -fno-elide-type. Cyan highlighting is applied to the differing types.

For more formatting, -fdiagnostic-show-template-tree will output the template
type as an indented text tree, with differences appearing inline. Template
tree works with or without type elision.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@159216 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Frontend/TextDiagnostic.cpp
6b4f50662a1857d5203254fb2c52975e6f30fc90 22-Jun-2012 James Dennett <jdennett@google.com> Documentation cleanup: escape \ characters in Doxygen comments as needed.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@158968 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Frontend/TextDiagnostic.cpp
3772c9abf9651da1f77c83ec937c96e10a353c6a 08-Jun-2012 Jordan Rose <jordan_rose@apple.com> If fixits appear to overlap, move the second one over in the output.

This occurs when you have two insertions and the first one is so long that the
second fixit's column is before the first fixit ends. The edits themselves
don't actually overlap, but our command-line preview does.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@158229 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Frontend/TextDiagnostic.cpp
4031a376275ccf9f76eae2efeb26ee64c4c5780a 25-May-2012 Seth Cantrell <seth.cantrell@gmail.com> ensure value passed to is space is representable as unsigned char

if the value isn't an unsigned char or EOF behavior is undefined
(and on Windows there's an assertion)

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@157445 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Frontend/TextDiagnostic.cpp
c5493d7d60005fc8aa9b0e06d326026a9f9a688d 24-May-2012 Seth Cantrell <seth.cantrell@gmail.com> fix Bug 12924

http://llvm.org/bugs/show_bug.cgi?id=12924

This issue was that the source location was pointing to a
non-printable character and so CaretEnd was pointing one
_column_ past the caret but not one _character_ past the
caret. So the conversion between column and byte locations
wasn't working (because the conversion is only valid from
the first column or byte of a character).

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@157372 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Frontend/TextDiagnostic.cpp
16afdf76b6f12e41ff6f6e6828bfb1d4732523ba 10-May-2012 Argyrios Kyrtzidis <akyrtzi@gmail.com> Fix an assertion hit when the serialized diagnostics writer receive a diagnostic
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

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@156536 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Frontend/TextDiagnostic.cpp
d1fda0393b50c9c1ea25925725916da3ce13c1e2 01-May-2012 Benjamin Kramer <benny.kra@googlemail.com> Make some helper functions static.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@155914 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Frontend/TextDiagnostic.cpp
40d8e971a32a23856ce1ab0106ae75cf4b92ca9d 26-Apr-2012 Nico Weber <nicolasweber@gmx.de> Revert r154981, because it caused PR12674.

Add a test for PR12674.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@155666 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Frontend/TextDiagnostic.cpp
0ddb097bb02ddee8f1924ee4fcca384cb18ad8c5 18-Apr-2012 Matt Beaumont-Gay <matthewbg@google.com> Suppress -Wunused-variable warning in -Asserts build

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@155011 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Frontend/TextDiagnostic.cpp
3acf764931e0f3e3ce75db0f4c4d400ee588d6b0 18-Apr-2012 Seth Cantrell <seth.cantrell@gmail.com> fix display of source lines with null characters

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@154981 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Frontend/TextDiagnostic.cpp
6749dd50869281f9b49ad5960e25288c15a71cac 18-Apr-2012 Seth Cantrell <seth.cantrell@gmail.com> Nicer display of unprintable source, and fix caret display for non-ascii text

Unprintable source in diagnostics is transformed to a printable form and then
displayed with reversed colors if possible. Unprintable characters are
displayed as <U+NNNN> while bytes that do not represent valid characters are
shown as <XX>.

Column adjustments to diagnostic carets, highlighted ranges, and fixups are
made both for characters escaped as above and for characters which are
printable but take up more than a single column.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@154980 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Frontend/TextDiagnostic.cpp
9591697707c69af99bb196d70895f4e7e28be333 17-Apr-2012 Seth Cantrell <seth.cantrell@gmail.com> Revert "Nicer display of unprintable source, and fix caret display for non-ascii text"

This reverts commit e9a3b76ba589a8a884e978273beaed0d97cf9861.

Revert "fix display of source lines with null characters"

This reverts commit 70712b276e40bbe11e5063dfc7e82ce3209929cd.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@154950 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Frontend/TextDiagnostic.cpp
70712b276e40bbe11e5063dfc7e82ce3209929cd 17-Apr-2012 Seth Cantrell <seth.cantrell@gmail.com> fix display of source lines with null characters

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@154947 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Frontend/TextDiagnostic.cpp
e9a3b76ba589a8a884e978273beaed0d97cf9861 17-Apr-2012 Seth Cantrell <seth.cantrell@gmail.com> Nicer display of unprintable source, and fix caret display for non-ascii text

Unprintable source in diagnostics is transformed to a printable form and then
displayed with reversed colors if possible. Unprintable characters are
displayed as <U+NNNN> while bytes that do not represent valid characters are
shown as <XX>.

Column adjustments to diagnostic carets, highlighted ranges, and fixups are
made both for characters escaped as above and for characters which are
printable but take up more than a single column.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@154946 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Frontend/TextDiagnostic.cpp
8be51eab5ad34515d2a40dcdc8558128ca1800ad 14-Feb-2012 Ted Kremenek <kremenek@apple.com> Refactor DiagnosticRenderer and SDiagsRenderer to have some functionality
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.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@150455 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Frontend/TextDiagnostic.cpp
f7ccbad5d9949e7ddd1cbef43d482553b811e026 05-Feb-2012 Dylan Noblesmith <nobled@dreamwidth.org> Basic: import SmallString<> into clang namespace

(I was going to fix the TODO about DenseMap too, but
that would break self-host right now. See PR11922.)

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@149799 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Frontend/TextDiagnostic.cpp
2898d4f7648e6ed5e9047068f1e8ee2f3c2bcd75 17-Dec-2011 Ted Kremenek <kremenek@apple.com> Refactor 'TextDiagnostic' to have a parent class 'DiagnosticRenderer' which handles
the policy of how diagnostics are lowered/rendered, while TextDiagnostic handles
the actual pretty-printing.

This is a first part of reworking SerializedDiagnosticPrinter to use the same
inclusion-stack/macro-expansion logic as TextDiagnostic.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@146819 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Frontend/TextDiagnostic.cpp
9875c6020f6f2832e48c0d41910ba9fc99181670 24-Oct-2011 Chandler Carruth <chandlerc@gmail.com> Switch to a more natural formatting of the macro name printing.
Suggested by John McCall.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@142836 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Frontend/TextDiagnostic.cpp
fe627b0e16e9a735891505325b670d0d3c51d2b9 16-Oct-2011 Chandler Carruth <chandlerc@gmail.com> Hoist the logic I added to compute the macro name into a helper
function. No functionality changed.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@142128 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Frontend/TextDiagnostic.cpp
a47129e97be2379961046fac4f94f12ac15cb540 16-Oct-2011 Chandler Carruth <chandlerc@gmail.com> Now that macro expansion notes are real notes and go through the same
formatting as any other diagnostic, they will be properly line wrapped and
otherwise pretty printed. Let's take advantage of that and the new factoring to
add some helpful information to them (much like template backtrace notes and
other notes): the name of the macro whose expansion is being noted. This makes
a world of difference if caret diagnostics are disabled, making the expansion
notes actually useful in this case. It also helps ensure that in edge cases the
information the user needs is present. Consider:

% nl -ba t5.cc
1 #define M(x, y, z) \
2 y
3
4 M(
5 1,
6 2,
7 3);

We now produce:
% ./bin/clang -fsyntax-only t5.cc
t5.cc:6:3: error: expected unqualified-id
2,
^
t5.cc:2:3: note: expanded from macro: M
y
^
1 error generated.

Without the added information in the note, the name of the macro being expanded
would never be shown.

This also deletes a FIXME to use the diagnostic formatting. It's not yet clear
to me that we *can* do this reasonably, and the production of this message was
my primary goal here anyways.

I'd love any comments or suggestions on improving these notes, their wording,
etc. Currently, I need to make them provide more helpful information in the
presence of a token-pasting buffer, and I'm pondering adding something along
the lines of "expanded from argument N of macro: ...".

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@142127 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Frontend/TextDiagnostic.cpp
938ef249e9e5b5e3b7065c7f92b2578aa2dd971b 16-Oct-2011 Chandler Carruth <chandlerc@gmail.com> Fix the original bug in our diagnostic printing that got me started on
this long quest: actually use the note printing machinery for each macro
expansion note rather than a hacky version of it. This will colorize and
format the notes the same as any other. There is still some stuff to fix
here, but it's one step closer.

No test case changes because currently we don't do anything differently
that I can FileCheck for -- I don't really want to try matching the
color escape codes... Suggestions for how to test this are welcome. =]

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@142121 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Frontend/TextDiagnostic.cpp
4ba55659982bf45eedc9d32851815e5c4b6d8460 16-Oct-2011 Chandler Carruth <chandlerc@gmail.com> Now that the structure of this is more reasonably laid out, fix a long
standing deficiency: we were providing no macro backtrace information
whenever caret diagnostics were turned off. This sinks the logic for
suppressing the code snippet and caret to the code that actually prints
tho code snippet and caret. Along the way, clean up the naming of
functions, remove some now fixed FIXMEs, and generally improve the
wording and logic of this process.

Add a test case exerecising this functionality. It is notable that the
resulting messages are extremely low quality. I'm working on a follow-up
patch that should address this and have left a FIXME in the test case.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@142120 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Frontend/TextDiagnostic.cpp
2ed3495278c13802a3d85578ab20560dcb0ef270 16-Oct-2011 Chandler Carruth <chandlerc@gmail.com> Add proper doxyments to the entry point routine, and remove a dead parameter.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@142109 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Frontend/TextDiagnostic.cpp
21a869aace45586125238fde88c477b330618a0b 16-Oct-2011 Chandler Carruth <chandlerc@gmail.com> Persist the TextDiagnostic object across multiple diagnostics as long as
the SourceManager doesn't change, and the source files don't change.
This greatly simplifies the interfaces and interactions. The lifetime of
the TextDiagnostic object forms the 'session' over which we attempt to
condense and deduplicate information in diagnostics.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@142104 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Frontend/TextDiagnostic.cpp
7531f571808201d44002fa38b67ee0a81e5ae936 16-Oct-2011 Chandler Carruth <chandlerc@gmail.com> Clean up the names of all the TextDiagnostic methods (and even a static
function) to agree with the coding conventions, and in one case have
a bit more information in it.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@142088 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Frontend/TextDiagnostic.cpp
6ddd8871c07ab161742e8ed37d3ef121ac79fa59 16-Oct-2011 Chandler Carruth <chandlerc@gmail.com> Move two functions out of the public interface that shouldn't have ever
been there. Also delete their redundant doxyments in favor of those in
the source file. I'm putting the doxyments for private and static
helpers into the implementation file, and only the public interface
doxyments into the header. If folks have strong opinions about this type
of split, feel free to chime in, I'm happy to re-organize.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@142087 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Frontend/TextDiagnostic.cpp
db463bb2e4a9751f4cbe53996db751e1985ee966 16-Oct-2011 Chandler Carruth <chandlerc@gmail.com> Graduate the TextDiagnostic interface to its own header and source file,
making it accessible to anyone from the Frontend library. Still a good
bit of cleanup to do here, but its a good milestone. This ensures that
*all* of the functionality needed to implement the DiagnosticConsumer is
exposed via the generic interface in some form. No sneaky re-use of
static functions.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@142086 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Frontend/TextDiagnostic.cpp