summaryrefslogtreecommitdiffstats
path: root/llvm/utils/TableGen
diff options
context:
space:
mode:
authorKrzysztof Parzyszek <kparzysz@codeaurora.org>2017-03-06 20:24:21 +0000
committerKrzysztof Parzyszek <kparzysz@codeaurora.org>2017-03-06 20:24:21 +0000
commit9e60e51a713f59ae7ebe4989398817c09e39011e (patch)
treec8b81fe2eed9ad5dbe5a4613537e5d110af09f13 /llvm/utils/TableGen
parent6119b865ec56ce0a75c683e7643078a99c2b3a6a (diff)
downloadbcm5719-llvm-9e60e51a713f59ae7ebe4989398817c09e39011e.tar.gz
bcm5719-llvm-9e60e51a713f59ae7ebe4989398817c09e39011e.zip
Revert r297039, it's causing some mysterious buildbot failures
llvm-svn: 297062
Diffstat (limited to 'llvm/utils/TableGen')
-rw-r--r--llvm/utils/TableGen/SubtargetFeatureInfo.cpp21
1 files changed, 4 insertions, 17 deletions
diff --git a/llvm/utils/TableGen/SubtargetFeatureInfo.cpp b/llvm/utils/TableGen/SubtargetFeatureInfo.cpp
index 72a556182b1..6c2e8b53c48 100644
--- a/llvm/utils/TableGen/SubtargetFeatureInfo.cpp
+++ b/llvm/utils/TableGen/SubtargetFeatureInfo.cpp
@@ -62,24 +62,11 @@ void SubtargetFeatureInfo::emitSubtargetFeatureFlagEnumeration(
void SubtargetFeatureInfo::emitNameTable(
std::map<Record *, SubtargetFeatureInfo, LessRecordByID> &SubtargetFeatures,
raw_ostream &OS) {
- // Need to sort the name table so that lookup by the log of the enum value
- // gives the proper name. More specifically, for a feature of value 1<<n,
- // SubtargetFeatureNames[n] should be the name of the feature.
- uint64_t IndexUB = 0;
- for (const auto &SF : SubtargetFeatures)
- if (IndexUB <= SF.second.Index)
- IndexUB = SF.second.Index+1;
-
- std::vector<std::string> Names;
- if (IndexUB > 0)
- Names.resize(IndexUB);
- for (const auto &SF : SubtargetFeatures)
- Names[SF.second.Index] = SF.second.getEnumName();
-
OS << "static const char *SubtargetFeatureNames[] = {\n";
- for (uint64_t I = 0; I < IndexUB; ++I)
- OS << " \"" << Names[I] << "\",\n";
-
+ for (const auto &SF : SubtargetFeatures) {
+ const SubtargetFeatureInfo &SFI = SF.second;
+ OS << " \"" << SFI.getEnumName() << "\",\n";
+ }
// A small number of targets have no predicates. Null terminate the array to
// avoid a zero-length array.
OS << " nullptr\n"
OpenPOWER on IntegriCloud