1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2024-10-19 02:52:53 +02:00

[TableGen] Simplify some code slightly. No need to check if the arrays are empty before printing. The loop can be made to print the same thing if the loop is empty. NFC

llvm-svn: 256703
This commit is contained in:
Craig Topper 2016-01-03 08:57:41 +00:00
parent 99a9982841
commit 3edc30259c

View File

@ -185,16 +185,12 @@ unsigned SubtargetEmitter::FeatureKeyValues(raw_ostream &OS) {
const std::vector<Record*> &ImpliesList =
Feature->getValueAsListOfDefs("Implies");
if (ImpliesList.empty()) {
OS << "{ }";
} else {
OS << "{ ";
for (unsigned j = 0, M = ImpliesList.size(); j < M;) {
OS << Target << "::" << ImpliesList[j]->getName();
if (++j < M) OS << ", ";
}
OS << " }";
OS << "{";
for (unsigned j = 0, M = ImpliesList.size(); j < M;) {
OS << " " << Target << "::" << ImpliesList[j]->getName();
if (++j < M) OS << ",";
}
OS << " }";
OS << " }";
++NumFeatures;
@ -240,16 +236,12 @@ unsigned SubtargetEmitter::CPUKeyValues(raw_ostream &OS) {
<< "\"" << Name << "\", "
<< "\"Select the " << Name << " processor\", ";
if (FeatureList.empty()) {
OS << "{ }";
} else {
OS << "{ ";
for (unsigned j = 0, M = FeatureList.size(); j < M;) {
OS << Target << "::" << FeatureList[j]->getName();
if (++j < M) OS << ", ";
}
OS << " }";
OS << "{";
for (unsigned j = 0, M = FeatureList.size(); j < M;) {
OS << " " << Target << "::" << FeatureList[j]->getName();
if (++j < M) OS << ",";
}
OS << " }";
// The { } is for the "implies" section of this data structure.
OS << ", { } }";