<< "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 += ", ";
}
}