diff options
Diffstat (limited to 'contrib/llvm/tools/clang/utils/TableGen/OptParserEmitter.cpp')
-rw-r--r-- | contrib/llvm/tools/clang/utils/TableGen/OptParserEmitter.cpp | 13 |
1 files changed, 9 insertions, 4 deletions
diff --git a/contrib/llvm/tools/clang/utils/TableGen/OptParserEmitter.cpp b/contrib/llvm/tools/clang/utils/TableGen/OptParserEmitter.cpp index dea22d3..b0431a9 100644 --- a/contrib/llvm/tools/clang/utils/TableGen/OptParserEmitter.cpp +++ b/contrib/llvm/tools/clang/utils/TableGen/OptParserEmitter.cpp @@ -7,8 +7,8 @@ // //===----------------------------------------------------------------------===// -#include "OptParserEmitter.h" #include "llvm/TableGen/Record.h" +#include "llvm/TableGen/TableGenBackend.h" #include "llvm/ADT/STLExtras.h" using namespace llvm; @@ -69,16 +69,20 @@ static raw_ostream &write_cstring(raw_ostream &OS, llvm::StringRef Str) { return OS; } -void OptParserEmitter::run(raw_ostream &OS) { +/// OptParserEmitter - This tablegen backend takes an input .td file +/// describing a list of options and emits a data structure for parsing and +/// working with those options when given an input command line. +namespace clang { +void EmitOptParser(RecordKeeper &Records, raw_ostream &OS, bool GenDefs) { // Get the option groups and options. const std::vector<Record*> &Groups = Records.getAllDerivedDefinitions("OptionGroup"); std::vector<Record*> Opts = Records.getAllDerivedDefinitions("Option"); if (GenDefs) - EmitSourceFileHeader("Option Parsing Definitions", OS); + emitSourceFileHeader("Option Parsing Definitions", OS); else - EmitSourceFileHeader("Option Parsing Table", OS); + emitSourceFileHeader("Option Parsing Table", OS); array_pod_sort(Opts.begin(), Opts.end(), CompareOptionRecords); if (GenDefs) { @@ -192,3 +196,4 @@ void OptParserEmitter::run(raw_ostream &OS) { } } } +} // end namespace clang |