aboutsummaryrefslogtreecommitdiff
path: root/utils/TableGen/OptParserEmitter.cpp
diff options
context:
space:
mode:
authorDaniel Dunbar <daniel@zuster.org>2009-12-04 21:41:24 +0000
committerDaniel Dunbar <daniel@zuster.org>2009-12-04 21:41:24 +0000
commitd90ade54cd910ac7e74ab84d2322dd6ad1214942 (patch)
tree7972fd26178da1af3254b1b0efd9a124ba9a319f /utils/TableGen/OptParserEmitter.cpp
parent1500c4f49a975fd6a800c70d3245f8d6e145c677 (diff)
OptParser: Emit HelpText field for option groups.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@90599 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'utils/TableGen/OptParserEmitter.cpp')
-rw-r--r--utils/TableGen/OptParserEmitter.cpp13
1 files changed, 12 insertions, 1 deletions
diff --git a/utils/TableGen/OptParserEmitter.cpp b/utils/TableGen/OptParserEmitter.cpp
index ce1aef5e4d..3cd5784c54 100644
--- a/utils/TableGen/OptParserEmitter.cpp
+++ b/utils/TableGen/OptParserEmitter.cpp
@@ -127,7 +127,18 @@ void OptParserEmitter::run(raw_ostream &OS) {
OS << "INVALID";
// The other option arguments (unused for groups).
- OS << ", INVALID, 0, 0, 0, 0)\n";
+ OS << ", INVALID, 0, 0";
+
+ // The option help text.
+ if (!dynamic_cast<UnsetInit*>(R.getValueInit("HelpText"))) {
+ OS << ",\n";
+ OS << " ";
+ write_cstring(OS, R.getValueAsString("HelpText"));
+ } else
+ OS << ", 0";
+
+ // The option meta-variable name (unused).
+ OS << ", 0)\n";
}
OS << "\n";