[PATCH] D153371: [TableGen] Stabilize sort in GET_SUBTARGETINFO_MACRO block
Kevin P. Neal via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Wed Jun 28 05:29:46 PDT 2023
This revision was automatically updated to reflect the committed changes.
Closed by commit rG6afdf4052551: [TableGen] Stabilize sort in GET_SUBTARGETINFO_MACRO block (authored by kpn).
Changed prior to commit:
https://reviews.llvm.org/D153371?vs=532997&id=535341#toc
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D153371/new/
https://reviews.llvm.org/D153371
Files:
llvm/include/llvm/TableGen/Record.h
llvm/utils/TableGen/SubtargetEmitter.cpp
Index: llvm/utils/TableGen/SubtargetEmitter.cpp
===================================================================
--- llvm/utils/TableGen/SubtargetEmitter.cpp
+++ llvm/utils/TableGen/SubtargetEmitter.cpp
@@ -202,7 +202,7 @@
std::vector<Record *> FeatureList =
Records.getAllDerivedDefinitions("SubtargetFeature");
- llvm::sort(FeatureList, LessRecordFieldName());
+ llvm::sort(FeatureList, LessRecordFieldFieldName());
for (const Record *Feature : FeatureList) {
const StringRef FieldName = Feature->getValueAsString("FieldName");
Index: llvm/include/llvm/TableGen/Record.h
===================================================================
--- llvm/include/llvm/TableGen/Record.h
+++ llvm/include/llvm/TableGen/Record.h
@@ -2033,6 +2033,15 @@
}
};
+/// Sorting predicate to sort record pointers by their
+/// FieldName field.
+struct LessRecordFieldFieldName {
+ bool operator()(const Record *Rec1, const Record *Rec2) const {
+ return Rec1->getValueAsString("FieldName") <
+ Rec2->getValueAsString("FieldName");
+ }
+};
+
struct LessRecordRegister {
struct RecordParts {
SmallVector<std::pair< bool, StringRef>, 4> Parts;
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D153371.535341.patch
Type: text/x-patch
Size: 1181 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20230628/6512349b/attachment.bin>
More information about the llvm-commits
mailing list