mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-06-17 20:23:59 +00:00
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
This commit is contained in:
@ -1,4 +1,4 @@
|
|||||||
//===- llvm/TableGen/TableGenBackend.h - Backend base class -----*- C++ -*-===//
|
//===- llvm/TableGen/TableGenBackend.h - Backend utilities ------*- C++ -*-===//
|
||||||
//
|
//
|
||||||
// The LLVM Compiler Infrastructure
|
// The LLVM Compiler Infrastructure
|
||||||
//
|
//
|
||||||
@ -7,39 +7,21 @@
|
|||||||
//
|
//
|
||||||
//===----------------------------------------------------------------------===//
|
//===----------------------------------------------------------------------===//
|
||||||
//
|
//
|
||||||
// The TableGenBackend class is provided as a common interface for all TableGen
|
// Useful utilities for TableGen backends.
|
||||||
// backends. It provides useful services and an standardized interface.
|
|
||||||
//
|
//
|
||||||
//===----------------------------------------------------------------------===//
|
//===----------------------------------------------------------------------===//
|
||||||
|
|
||||||
#ifndef LLVM_TABLEGEN_TABLEGENBACKEND_H
|
#ifndef LLVM_TABLEGEN_TABLEGENBACKEND_H
|
||||||
#define LLVM_TABLEGEN_TABLEGENBACKEND_H
|
#define LLVM_TABLEGEN_TABLEGENBACKEND_H
|
||||||
|
|
||||||
#include "llvm/Support/raw_ostream.h"
|
#include "llvm/ADT/StringRef.h"
|
||||||
|
|
||||||
namespace llvm {
|
namespace llvm {
|
||||||
|
|
||||||
class Record;
|
class raw_ostream;
|
||||||
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;
|
|
||||||
|
|
||||||
};
|
|
||||||
|
|
||||||
/// emitSourceFileHeader - Output a LLVM style file header to the specified
|
/// emitSourceFileHeader - Output a LLVM style file header to the specified
|
||||||
/// ostream.
|
/// raw_ostream.
|
||||||
void emitSourceFileHeader(StringRef Desc, raw_ostream &OS);
|
void emitSourceFileHeader(StringRef Desc, raw_ostream &OS);
|
||||||
|
|
||||||
} // End llvm namespace
|
} // End llvm namespace
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
//===- TableGenBackend.cpp - Base class for TableGen Backends ---*- C++ -*-===//
|
//===- TableGenBackend.cpp - Utilities for TableGen Backends ----*- C++ -*-===//
|
||||||
//
|
//
|
||||||
// The LLVM Compiler Infrastructure
|
// The LLVM Compiler Infrastructure
|
||||||
//
|
//
|
||||||
@ -11,17 +11,10 @@
|
|||||||
//
|
//
|
||||||
//===----------------------------------------------------------------------===//
|
//===----------------------------------------------------------------------===//
|
||||||
|
|
||||||
|
#include "llvm/Support/raw_ostream.h"
|
||||||
#include "llvm/TableGen/TableGenBackend.h"
|
#include "llvm/TableGen/TableGenBackend.h"
|
||||||
#include "llvm/TableGen/Record.h"
|
|
||||||
using namespace llvm;
|
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) {
|
void llvm::emitSourceFileHeader(StringRef Desc, raw_ostream &OS) {
|
||||||
OS << "//===- TableGen'erated file -------------------------------------*-"
|
OS << "//===- TableGen'erated file -------------------------------------*-"
|
||||||
" C++ -*-===//\n//\n// " << Desc << "\n//\n// Automatically generate"
|
" C++ -*-===//\n//\n// " << Desc << "\n//\n// Automatically generate"
|
||||||
|
Reference in New Issue
Block a user