diff options
author | Richard Smith <richard-llvm@metafoo.co.uk> | 2016-09-14 01:51:10 +0000 |
---|---|---|
committer | Richard Smith <richard-llvm@metafoo.co.uk> | 2016-09-14 01:51:10 +0000 |
commit | b7ad5ad5f8efc93d1838f99ae173455857b93225 (patch) | |
tree | 9e0822b0c0c0e555949be4770ca2052c8a1f541e /utils | |
parent | 6c177e51536b577afc163cb0cbbf32e3430ac2dc (diff) |
Update DiagnosticsReference and fix emitter to emit -Wpedantic diagnostics and groups in a deterministic order.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@281433 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'utils')
-rw-r--r-- | utils/TableGen/ClangDiagnosticsEmitter.cpp | 15 |
1 files changed, 12 insertions, 3 deletions
diff --git a/utils/TableGen/ClangDiagnosticsEmitter.cpp b/utils/TableGen/ClangDiagnosticsEmitter.cpp index 036e742311..58a53b6470 100644 --- a/utils/TableGen/ClangDiagnosticsEmitter.cpp +++ b/utils/TableGen/ClangDiagnosticsEmitter.cpp @@ -1248,11 +1248,20 @@ void EmitClangDiagDocs(RecordKeeper &Records, raw_ostream &OS) { // Compute the set of diagnostics that are in -Wpedantic. { - RecordSet DiagsInPedantic; - RecordSet GroupsInPedantic; + RecordSet DiagsInPedanticSet; + RecordSet GroupsInPedanticSet; InferPedantic inferPedantic(DGParentMap, Diags, DiagGroups, DiagsInGroup); - inferPedantic.compute(&DiagsInPedantic, &GroupsInPedantic); + inferPedantic.compute(&DiagsInPedanticSet, &GroupsInPedanticSet); auto &PedDiags = DiagsInGroup["pedantic"]; + // Put the diagnostics into a deterministic order. + RecordVec DiagsInPedantic(DiagsInPedanticSet.begin(), + DiagsInPedanticSet.end()); + RecordVec GroupsInPedantic(GroupsInPedanticSet.begin(), + GroupsInPedanticSet.end()); + std::sort(DiagsInPedantic.begin(), DiagsInPedantic.end(), + beforeThanCompare); + std::sort(GroupsInPedantic.begin(), GroupsInPedantic.end(), + beforeThanCompare); PedDiags.DiagsInGroup.insert(PedDiags.DiagsInGroup.end(), DiagsInPedantic.begin(), DiagsInPedantic.end()); |