diff options
author | dim <dim@FreeBSD.org> | 2012-08-15 20:02:54 +0000 |
---|---|---|
committer | dim <dim@FreeBSD.org> | 2012-08-15 20:02:54 +0000 |
commit | 554bcb69c2d785a011a30e7db87a36a87fe7db10 (patch) | |
tree | 9abb1a658a297776086f4e0dfa6ca533de02104e /utils/TableGen/OptParserEmitter.cpp | |
parent | bb67ca86b31f67faee50bd10c3b036d65751745a (diff) | |
download | FreeBSD-src-554bcb69c2d785a011a30e7db87a36a87fe7db10.zip FreeBSD-src-554bcb69c2d785a011a30e7db87a36a87fe7db10.tar.gz |
Vendor import of clang trunk r161861:
http://llvm.org/svn/llvm-project/cfe/trunk@161861
Diffstat (limited to 'utils/TableGen/OptParserEmitter.cpp')
-rw-r--r-- | utils/TableGen/OptParserEmitter.cpp | 13 |
1 files changed, 9 insertions, 4 deletions
diff --git a/utils/TableGen/OptParserEmitter.cpp b/utils/TableGen/OptParserEmitter.cpp index dea22d3..b0431a9 100644 --- a/utils/TableGen/OptParserEmitter.cpp +++ b/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 |