diff options
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()); |