[TextDiagnosticBuffer] Fix diagnostic note emission order
authorHal Finkel <hfinkel@anl.gov>
Sat, 16 Dec 2017 01:40:19 +0000 (01:40 +0000)
committerHal Finkel <hfinkel@anl.gov>
Sat, 16 Dec 2017 01:40:19 +0000 (01:40 +0000)
commitcc15219fb1eb7d536fb40ffed7e4a6a779eb23ff
treeceaae3537df3a2fe808dcb4722a42363f8cc702e
parent160f4bb80393ba5c77dae1ccfcea105fd030a3ad
[TextDiagnosticBuffer] Fix diagnostic note emission order

The frontend currently groups diagnostics from the command line according to
diagnostic level, but that places all notes last. Fix that by emitting such
diagnostics in the order they were generated.

Patch by Joel E. Denny, thanks!

Differential Revision: https://reviews.llvm.org/D40995

llvm-svn: 320904
clang/include/clang/Frontend/TextDiagnosticBuffer.h
clang/lib/Frontend/TextDiagnosticBuffer.cpp
clang/test/Frontend/diagnostics-order.c [new file with mode: 0644]