From 628a420ef16a94e75b5f5e507e8dfd5f8e6c05cb Mon Sep 17 00:00:00 2001 From: Krzysztof Parzyszek Date: Mon, 6 Mar 2017 20:24:21 +0000 Subject: [PATCH] Revert r297039, it's causing some mysterious buildbot failures git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@297062 91177308-0d34-0410-b5e6-96231b3b80d8 --- .../tablegen-order-subtargetfeaturenames.mir | 27 ---------------------- utils/TableGen/SubtargetFeatureInfo.cpp | 21 ++++------------- 2 files changed, 4 insertions(+), 44 deletions(-) delete mode 100644 test/CodeGen/Hexagon/tablegen-order-subtargetfeaturenames.mir diff --git a/test/CodeGen/Hexagon/tablegen-order-subtargetfeaturenames.mir b/test/CodeGen/Hexagon/tablegen-order-subtargetfeaturenames.mir deleted file mode 100644 index 688f36664bc..00000000000 --- a/test/CodeGen/Hexagon/tablegen-order-subtargetfeaturenames.mir +++ /dev/null @@ -1,27 +0,0 @@ -# RUN: not llc -march=hexagon -start-after=patchable-function %s -mcpu=hexagonv55 -filetype=obj -o /dev/null 2>&1 | FileCheck %s - -# This is checking for the ordering of feature names in SubtargetFeatureNames, -# generated by TableGen. An incorrect order could cause a wrong name to be -# printed. - -# CHECK: Attempting to emit J2_jumptpt instruction but the Feature_HasV60T predicate(s) are not met - ---- | - define void @fred() { - ret void - } -... - ---- -name: fred -registers: -body: | - bb.0: - liveins: %p0 - ; Instruction not available on Hexagon V55. - J2_jumptpt %p0, %bb.1, implicit-def %pc - - bb.1: - J2_jumpr %r31, implicit-def %pc -... - diff --git a/utils/TableGen/SubtargetFeatureInfo.cpp b/utils/TableGen/SubtargetFeatureInfo.cpp index 72a556182b1..6c2e8b53c48 100644 --- a/utils/TableGen/SubtargetFeatureInfo.cpp +++ b/utils/TableGen/SubtargetFeatureInfo.cpp @@ -62,24 +62,11 @@ void SubtargetFeatureInfo::emitSubtargetFeatureFlagEnumeration( void SubtargetFeatureInfo::emitNameTable( std::map &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< 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" -- 2.11.0