diff options
author | Jakob Stoklund Olesen <stoklund@2pi.dk> | 2012-06-13 05:15:49 +0000 |
---|---|---|
committer | Jakob Stoklund Olesen <stoklund@2pi.dk> | 2012-06-13 05:15:49 +0000 |
commit | 764dc754fe52c3a61363fad341b68be397103668 (patch) | |
tree | 2c9a43d47cef5a454b9f8bfba300c21712125dfc | |
parent | 36c58aa4d6957a4ca3800c47fa241acc59d676c8 (diff) |
Eliminate struct TableGenBackend.
TableGen backends are simply written as functions now.
Patch by Sean Silva!
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@158389 91177308-0d34-0410-b5e6-96231b3b80d8
-rw-r--r-- | include/llvm/TableGen/TableGenBackend.h | 28 | ||||
-rw-r--r-- | lib/TableGen/TableGenBackend.cpp | 11 |
2 files changed, 7 insertions, 32 deletions
diff --git a/include/llvm/TableGen/TableGenBackend.h b/include/llvm/TableGen/TableGenBackend.h index 751a7cf750..bedf7fb343 100644 --- a/include/llvm/TableGen/TableGenBackend.h +++ b/include/llvm/TableGen/TableGenBackend.h @@ -1,4 +1,4 @@ -//===- llvm/TableGen/TableGenBackend.h - Backend base class -----*- C++ -*-===// +//===- llvm/TableGen/TableGenBackend.h - Backend utilities ------*- C++ -*-===// // // The LLVM Compiler Infrastructure // @@ -7,39 +7,21 @@ // //===----------------------------------------------------------------------===// // -// The TableGenBackend class is provided as a common interface for all TableGen -// backends. It provides useful services and an standardized interface. +// Useful utilities for TableGen backends. // //===----------------------------------------------------------------------===// #ifndef LLVM_TABLEGEN_TABLEGENBACKEND_H #define LLVM_TABLEGEN_TABLEGENBACKEND_H -#include "llvm/Support/raw_ostream.h" +#include "llvm/ADT/StringRef.h" namespace llvm { -class Record; -class RecordKeeper; - -struct TableGenBackend { - virtual void anchor(); - virtual ~TableGenBackend() {} - - // run - All TableGen backends should implement the run method, which should - // be the main entry point. - virtual void run(raw_ostream &OS) = 0; - - -public: // Useful helper routines... - /// EmitSourceFileHeader - Output a LLVM style file header to the specified - /// ostream. - void EmitSourceFileHeader(StringRef Desc, raw_ostream &OS) const; - -}; +class raw_ostream; /// emitSourceFileHeader - Output a LLVM style file header to the specified -/// ostream. +/// raw_ostream. void emitSourceFileHeader(StringRef Desc, raw_ostream &OS); } // End llvm namespace diff --git a/lib/TableGen/TableGenBackend.cpp b/lib/TableGen/TableGenBackend.cpp index 8117250819..89d3f5e81e 100644 --- a/lib/TableGen/TableGenBackend.cpp +++ b/lib/TableGen/TableGenBackend.cpp @@ -1,4 +1,4 @@ -//===- TableGenBackend.cpp - Base class for TableGen Backends ---*- C++ -*-===// +//===- TableGenBackend.cpp - Utilities for TableGen Backends ----*- C++ -*-===// // // The LLVM Compiler Infrastructure // @@ -11,17 +11,10 @@ // //===----------------------------------------------------------------------===// +#include "llvm/Support/raw_ostream.h" #include "llvm/TableGen/TableGenBackend.h" -#include "llvm/TableGen/Record.h" using namespace llvm; -void TableGenBackend::anchor() { } - -void TableGenBackend::EmitSourceFileHeader(StringRef Desc, - raw_ostream &OS) const { - emitSourceFileHeader(Desc, OS); -} - void llvm::emitSourceFileHeader(StringRef Desc, raw_ostream &OS) { OS << "//===- TableGen'erated file -------------------------------------*-" " C++ -*-===//\n//\n// " << Desc << "\n//\n// Automatically generate" |