forked from OSchip/llvm-project
tblgen: Remove last traces of old TableGenMain API.
llvm-svn: 165168
This commit is contained in:
parent
f85f39df47
commit
b336c96f1d
|
@ -16,11 +16,6 @@
|
||||||
|
|
||||||
namespace llvm {
|
namespace llvm {
|
||||||
|
|
||||||
class TableGenAction;
|
|
||||||
|
|
||||||
/// Run the table generator, performing the specified Action on parsed records.
|
|
||||||
int TableGenMain(char *argv0, TableGenAction &Action);
|
|
||||||
|
|
||||||
class RecordKeeper;
|
class RecordKeeper;
|
||||||
class raw_ostream;
|
class raw_ostream;
|
||||||
typedef bool TableGenMainFn(raw_ostream &OS, RecordKeeper &Records);
|
typedef bool TableGenMainFn(raw_ostream &OS, RecordKeeper &Records);
|
||||||
|
|
|
@ -1,35 +0,0 @@
|
||||||
//===- llvm/TableGen/TableGenAction.h - defines TableGenAction --*- C++ -*-===//
|
|
||||||
//
|
|
||||||
// The LLVM Compiler Infrastructure
|
|
||||||
//
|
|
||||||
// This file is distributed under the University of Illinois Open Source
|
|
||||||
// License. See LICENSE.TXT for details.
|
|
||||||
//
|
|
||||||
//===----------------------------------------------------------------------===//
|
|
||||||
//
|
|
||||||
// This file defines the TableGenAction base class to be derived from by
|
|
||||||
// tblgen tools.
|
|
||||||
//
|
|
||||||
//===----------------------------------------------------------------------===//
|
|
||||||
|
|
||||||
#ifndef LLVM_TABLEGEN_TABLEGENACTION_H
|
|
||||||
#define LLVM_TABLEGEN_TABLEGENACTION_H
|
|
||||||
|
|
||||||
namespace llvm {
|
|
||||||
|
|
||||||
class raw_ostream;
|
|
||||||
class RecordKeeper;
|
|
||||||
|
|
||||||
class TableGenAction {
|
|
||||||
virtual void anchor();
|
|
||||||
public:
|
|
||||||
virtual ~TableGenAction() {}
|
|
||||||
|
|
||||||
/// Perform the action using Records, and write output to OS.
|
|
||||||
/// @returns true on error, false otherwise
|
|
||||||
virtual bool operator()(raw_ostream &OS, RecordKeeper &Records) = 0;
|
|
||||||
};
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
#endif
|
|
|
@ -7,7 +7,6 @@ add_llvm_library(LLVMTableGen
|
||||||
Main.cpp
|
Main.cpp
|
||||||
Record.cpp
|
Record.cpp
|
||||||
StringMatcher.cpp
|
StringMatcher.cpp
|
||||||
TableGenAction.cpp
|
|
||||||
TableGenBackend.cpp
|
TableGenBackend.cpp
|
||||||
TGLexer.cpp
|
TGLexer.cpp
|
||||||
TGParser.cpp
|
TGParser.cpp
|
||||||
|
|
|
@ -24,7 +24,6 @@
|
||||||
#include "llvm/TableGen/Error.h"
|
#include "llvm/TableGen/Error.h"
|
||||||
#include "llvm/TableGen/Main.h"
|
#include "llvm/TableGen/Main.h"
|
||||||
#include "llvm/TableGen/Record.h"
|
#include "llvm/TableGen/Record.h"
|
||||||
#include "llvm/TableGen/TableGenAction.h"
|
|
||||||
#include <algorithm>
|
#include <algorithm>
|
||||||
#include <cstdio>
|
#include <cstdio>
|
||||||
using namespace llvm;
|
using namespace llvm;
|
||||||
|
@ -48,27 +47,9 @@ namespace {
|
||||||
cl::value_desc("directory"), cl::Prefix);
|
cl::value_desc("directory"), cl::Prefix);
|
||||||
}
|
}
|
||||||
|
|
||||||
namespace {
|
|
||||||
// XXX: this is a crutch for transitioning to the new TableGenMain API
|
|
||||||
// (with a TableGenMainFn* instead of a pointless class).
|
|
||||||
class StubTransitionalTableGenAction : public TableGenAction {
|
|
||||||
TableGenMainFn *MainFn;
|
|
||||||
public:
|
|
||||||
StubTransitionalTableGenAction(TableGenMainFn *M) : MainFn(M) {}
|
|
||||||
bool operator()(raw_ostream &OS, RecordKeeper &Records) {
|
|
||||||
return MainFn(OS, Records);
|
|
||||||
}
|
|
||||||
};
|
|
||||||
}
|
|
||||||
|
|
||||||
namespace llvm {
|
namespace llvm {
|
||||||
|
|
||||||
int TableGenMain(char *argv0, TableGenMainFn *MainFn) {
|
int TableGenMain(char *argv0, TableGenMainFn *MainFn) {
|
||||||
StubTransitionalTableGenAction Action(MainFn);
|
|
||||||
return TableGenMain(argv0, Action);
|
|
||||||
}
|
|
||||||
|
|
||||||
int TableGenMain(char *argv0, TableGenAction &Action) {
|
|
||||||
RecordKeeper Records;
|
RecordKeeper Records;
|
||||||
|
|
||||||
try {
|
try {
|
||||||
|
@ -123,7 +104,7 @@ int TableGenMain(char *argv0, TableGenAction &Action) {
|
||||||
DepOut.keep();
|
DepOut.keep();
|
||||||
}
|
}
|
||||||
|
|
||||||
if (Action(Out.os(), Records))
|
if (MainFn(Out.os(), Records))
|
||||||
return 1;
|
return 1;
|
||||||
|
|
||||||
// Declare success.
|
// Declare success.
|
||||||
|
|
|
@ -1,15 +0,0 @@
|
||||||
//===- TableGenAction.cpp - defines TableGenAction --------------*- C++ -*-===//
|
|
||||||
//
|
|
||||||
// The LLVM Compiler Infrastructure
|
|
||||||
//
|
|
||||||
// This file is distributed under the University of Illinois Open Source
|
|
||||||
// License. See LICENSE.TXT for details.
|
|
||||||
//
|
|
||||||
//===----------------------------------------------------------------------===//
|
|
||||||
|
|
||||||
#include "llvm/TableGen/TableGenAction.h"
|
|
||||||
|
|
||||||
using namespace llvm;
|
|
||||||
|
|
||||||
void TableGenAction::anchor() { }
|
|
||||||
|
|
Loading…
Reference in New Issue