summaryrefslogtreecommitdiff
path: root/utils
diff options
context:
space:
mode:
authorJim Grosbach <grosbach@apple.com>2008-09-11 17:05:32 +0000
committerJim Grosbach <grosbach@apple.com>2008-09-11 17:05:32 +0000
commit7c9a7728d9dd248ebee8f2dd969d303711d487a9 (patch)
tree83394f72c8d240d8b24425c29fcb14356deaf56a /utils
parent1abe60b9be1b7b33e1fa422add5296d392831850 (diff)
downloadllvm-7c9a7728d9dd248ebee8f2dd969d303711d487a9.tar.gz
llvm-7c9a7728d9dd248ebee8f2dd969d303711d487a9.tar.bz2
llvm-7c9a7728d9dd248ebee8f2dd969d303711d487a9.tar.xz
lib/Target/SubtargetFeature.cpp asserts that the FeatureKV[] table be sorted
by its first field, but TableGen doesn't actually enforce creating it that way. TableGen sorts the records that will be used to create it by the names of the records, not the Name field of those records. This patch corrects the sort to use the "Name" field of the record as the sort key. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@56106 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'utils')
-rw-r--r--utils/TableGen/Record.h3
-rw-r--r--utils/TableGen/SubtargetEmitter.cpp2
2 files changed, 3 insertions, 2 deletions
diff --git a/utils/TableGen/Record.h b/utils/TableGen/Record.h
index d597715cd1..90e246eb47 100644
--- a/utils/TableGen/Record.h
+++ b/utils/TableGen/Record.h
@@ -1183,7 +1183,8 @@ struct LessRecord {
}
};
-/// LessRecord - Sorting predicate to sort record pointers by their name field.
+/// LessRecordFieldName - Sorting predicate to sort record pointers by their
+/// name field.
///
struct LessRecordFieldName {
bool operator()(const Record *Rec1, const Record *Rec2) const {
diff --git a/utils/TableGen/SubtargetEmitter.cpp b/utils/TableGen/SubtargetEmitter.cpp
index 9b5f6df4d4..b05b9968a2 100644
--- a/utils/TableGen/SubtargetEmitter.cpp
+++ b/utils/TableGen/SubtargetEmitter.cpp
@@ -61,7 +61,7 @@ void SubtargetEmitter::FeatureKeyValues(std::ostream &OS) {
// Gather and sort all the features
std::vector<Record*> FeatureList =
Records.getAllDerivedDefinitions("SubtargetFeature");
- std::sort(FeatureList.begin(), FeatureList.end(), LessRecord());
+ std::sort(FeatureList.begin(), FeatureList.end(), LessRecordFieldName());
// Begin feature table
OS << "// Sorted (by key) array of values for CPU features.\n"