1 //===- TableGenBackend.h - Base class for TableGen Backends -----*- C++ -*-===//
3 // The TableGenBackend class is provided as a common interface for all TableGen
4 // backends. It provides useful services and an standardized interface.
6 //===----------------------------------------------------------------------===//
8 #ifndef TABLEGENBACKEND_H
9 #define TABLEGENBACKEND_H
16 struct TableGenBackend {
17 virtual ~TableGenBackend() {}
19 // run - All TableGen backends should implement the run method, which should
20 // be the main entry point.
21 virtual void run(std::ostream &OS) = 0;
24 public: // Useful helper routines...
25 /// EmitSourceFileHeader - Output a LLVM style file header to the specified
27 void EmitSourceFileHeader(const std::string &Desc, std::ostream &OS) const;
29 /// getQualifiedName - Return the name of the specified record, with a
30 /// namespace qualifier if the record contains one.
31 std::string getQualifiedName(Record *R) const;