[TableGen] Stabilize sort in GET_SUBTARGETINFO_MACRO block
authorKevin P. Neal <kevin.neal@sas.com>
Wed, 28 Jun 2023 12:26:12 +0000 (08:26 -0400)
committerKevin P. Neal <kevin.neal@sas.com>
Wed, 28 Jun 2023 12:28:47 +0000 (08:28 -0400)
commit6afdf4052551bb3eea013c8ffeeb30112ccd69a3
tree0a84d27b4832283f8805935907b5b662fd385fa9
parent1718e640dbda341f5583159348ad380637ba6de5
[TableGen] Stabilize sort in GET_SUBTARGETINFO_MACRO block

The sort of the elements in the GET_SUBTARGETINFO_MACRO block is done on
the "Name" field of each record. This field is not guaranteed to be unique,
is not guaranteed to even have a value at all, and is not used in the
output anyway. Change to sort on the "FieldName" field which should be
unique.

Problem spotted when lib/Target/PowerPC/PPCGenSubtargetInfo.inc changed
unexpectedly.

Differential Revision: https://reviews.llvm.org/D153371
llvm/include/llvm/TableGen/Record.h
llvm/utils/TableGen/SubtargetEmitter.cpp