X-Git-Url: http://demsky.eecs.uci.edu/git/?a=blobdiff_plain;f=utils%2FTableGen%2FOptParserEmitter.cpp;h=6892912eee13f0c4a98ac0d60ea814d9e47795a9;hb=505f3cd2965e65b6b7ad023eaba0e3dc89b67409;hp=ce1aef5e4daddb9703aa7f498a8bfbb1e5b16c05;hpb=a627ef57ec0a0652bd5922fb86568b43f94d9361;p=oota-llvm.git diff --git a/utils/TableGen/OptParserEmitter.cpp b/utils/TableGen/OptParserEmitter.cpp index ce1aef5e4da..6892912eee1 100644 --- a/utils/TableGen/OptParserEmitter.cpp +++ b/utils/TableGen/OptParserEmitter.cpp @@ -75,26 +75,10 @@ void OptParserEmitter::run(raw_ostream &OS) { Records.getAllDerivedDefinitions("OptionGroup"); std::vector Opts = Records.getAllDerivedDefinitions("Option"); - if (GenDefs) { - OS << "\ -//=== TableGen'erated File - Option Parsing Definitions ---------*- C++ -*-===//\n \ -//\n\ -// Option Parsing Definitions\n\ -//\n\ -// Automatically generated file, do not edit!\n\ -//\n\ -//===----------------------------------------------------------------------===//\n"; - } else { - OS << "\ -//=== TableGen'erated File - Option Parsing Table ---------------*- C++ -*-===//\n \ -//\n\ -// Option Parsing Definitions\n\ -//\n\ -// Automatically generated file, do not edit!\n\ -//\n\ -//===----------------------------------------------------------------------===//\n"; - } - OS << "\n"; + if (GenDefs) + EmitSourceFileHeader("Option Parsing Definitions", OS); + else + EmitSourceFileHeader("Option Parsing Table", OS); array_pod_sort(Opts.begin(), Opts.end(), CompareOptionRecords); if (GenDefs) { @@ -127,7 +111,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(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";