Changes in directory llvm/lib/Target:
SubtargetFeature.cpp updated: 1.5 -> 1.6 --- Log message: Improve help output. --- Diffs of the changes: (+16 -12) SubtargetFeature.cpp | 28 ++++++++++++++++------------ 1 files changed, 16 insertions(+), 12 deletions(-) Index: llvm/lib/Target/SubtargetFeature.cpp diff -u llvm/lib/Target/SubtargetFeature.cpp:1.5 llvm/lib/Target/SubtargetFeature.cpp:1.6 --- llvm/lib/Target/SubtargetFeature.cpp:1.5 Sun Oct 23 00:26:26 2005 +++ llvm/lib/Target/SubtargetFeature.cpp Sun Oct 23 00:33:39 2005 @@ -125,25 +125,29 @@ /// Display help for feature choices. /// -static void Help(const char *Heading, const SubtargetFeatureKV *Table, +static void Help(bool isFeature, const SubtargetFeatureKV *Table, size_t TableSize) { - // Determine the length of the longest key + // Determine the length of the longest key. size_t MaxLen = 0; for (size_t i = 0; i < TableSize; i++) MaxLen = std::max(MaxLen, std::strlen(Table[i].Key)); - // Print heading - std::cerr << "Help for " << Heading << " choices:\n\n"; - // For each feature + + std::cerr << "Available " << (isFeature ? "features" : "CPUs") + << " for this target:\n\n"; + for (size_t i = 0; i < TableSize; i++) { // Compute required padding size_t Pad = MaxLen - std::strlen(Table[i].Key); - // Print details std::cerr << Table[i].Key << std::string(Pad, ' ') << " - " - << Table[i].Desc << "\n"; + << Table[i].Desc << ".\n"; + } + + std::cerr << "\n"; + if (isFeature) { + std::cerr + << "Use +feature to enable a feature, or -feature to disable it.\n" + << "For example, llc -mcpu=mycpu -mattr=+feature1,-feature2\n"; } - // Wrap it up - std::cerr << "\n\n"; - // Leave tool exit(1); } @@ -202,7 +206,7 @@ // Check if default is needed if (Features[0].empty()) Features[0] = DefaultCPU; // Check for help - if (Features[0] == "help") Help("CPU", CPUTable, CPUTableSize); + if (Features[0] == "help") Help(false, CPUTable, CPUTableSize); // Find CPU entry const SubtargetFeatureKV *CPUEntry = Find(Features[0], CPUTable, CPUTableSize); @@ -221,7 +225,7 @@ // Get next feature const std::string &Feature = Features[i]; // Check for help - if (Feature == "+help") Help("feature", FeatureTable, FeatureTableSize); + if (Feature == "+help") Help(true, FeatureTable, FeatureTableSize); // Find feature in table. const SubtargetFeatureKV *FeatureEntry = Find(StripFlag(Feature), FeatureTable, FeatureTableSize); _______________________________________________ llvm-commits mailing list [EMAIL PROTECTED] http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits