//
//===----------------------------------------------------------------------===//
//
-// This tablegen backend emits subtarget enumerations. The format is in a state
-// flux and will be tightened up when integration to scheduling is complete.
+// This tablegen backend emits subtarget enumerations.
//
//===----------------------------------------------------------------------===//
<< "static llvm::SubtargetFeatureKV FeatureKV[] = {\n";
// For each feature
- for (unsigned i = 0, N = FeatureList.size(); i < N;) {
+ for (unsigned i = 0, N = FeatureList.size(); i < N; ++i) {
// Next feature
Record *Feature = FeatureList[i];
std::string CommandLineName = Feature->getValueAsString("Name");
std::string Desc = Feature->getValueAsString("Desc");
+ if (CommandLineName.empty()) continue;
+
// Emit as { "feature", "decription", feactureEnum }
OS << " { "
<< "\"" << CommandLineName << "\", "
<< " }";
// Depending on 'if more in the list' emit comma
- if (++i < N) OS << ",";
+ if ((i + 1) < N) OS << ",";
OS << "\n";
}
// For each stage
unsigned N = NStages = StageList.size();
- for (unsigned i = 0; i < N; i++) {
+ for (unsigned i = 0; i < N;) {
// Next stage
Record *Stage = StageList[i];
// Close off stage
ItinString += " }";
+ if (++i < N) ItinString += ", ";
}
}
// For each itinerary class
std::vector<InstrItinerary> &ItinList = *ProcListIter++;
- unsigned ItinIndex = 0;
for (unsigned j = 0, M = ItinList.size(); j < M;) {
InstrItinerary &Intinerary = ItinList[j];
// End processor itinerary table
OS << "};\n";
}
-
- OS << "\n";
- OS << "static llvm::InstrItinerary NoItineraries[] = {};\n";
}
//