[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)
commitab88c4b23f7ee1a3e77a801ef059cb29161233da
tree3f9bb1d375faae2d15ef53637fd93d5ec25d8cbc
parent87961dfbc9f2faf85ccc5342a8415500938ed24a
[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

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@320904 91177308-0d34-0410-b5e6-96231b3b80d8
include/clang/Frontend/TextDiagnosticBuffer.h
lib/Frontend/TextDiagnosticBuffer.cpp
test/Frontend/diagnostics-order.c [new file with mode: 0644]