[llvm-commits] [llvm] r165168 - in /llvm/trunk: include/llvm/TableGen/Main.h include/llvm/TableGen/TableGenAction.h lib/TableGen/CMakeLists.txt lib/TableGen/Main.cpp lib/TableGen/TableGenAction.cpp

Sean Silva silvas at purdue.edu
Wed Oct 3 14:31:09 PDT 2012


Author: silvas
Date: Wed Oct  3 16:31:08 2012
New Revision: 165168

URL: http://llvm.org/viewvc/llvm-project?rev=165168&view=rev
Log:
tblgen: Remove last traces of old TableGenMain API.

Removed:
    llvm/trunk/include/llvm/TableGen/TableGenAction.h
    llvm/trunk/lib/TableGen/TableGenAction.cpp
Modified:
    llvm/trunk/include/llvm/TableGen/Main.h
    llvm/trunk/lib/TableGen/CMakeLists.txt
    llvm/trunk/lib/TableGen/Main.cpp

Modified: llvm/trunk/include/llvm/TableGen/Main.h
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/TableGen/Main.h?rev=165168&r1=165167&r2=165168&view=diff
==============================================================================
--- llvm/trunk/include/llvm/TableGen/Main.h (original)
+++ llvm/trunk/include/llvm/TableGen/Main.h Wed Oct  3 16:31:08 2012
@@ -16,11 +16,6 @@
 
 namespace llvm {
 
-class TableGenAction;
-
-/// Run the table generator, performing the specified Action on parsed records.
-int TableGenMain(char *argv0, TableGenAction &Action);
-
 class RecordKeeper;
 class raw_ostream;
 typedef bool TableGenMainFn(raw_ostream &OS, RecordKeeper &Records);

Removed: llvm/trunk/include/llvm/TableGen/TableGenAction.h
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/TableGen/TableGenAction.h?rev=165167&view=auto
==============================================================================
--- llvm/trunk/include/llvm/TableGen/TableGenAction.h (original)
+++ llvm/trunk/include/llvm/TableGen/TableGenAction.h (removed)
@@ -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

Modified: llvm/trunk/lib/TableGen/CMakeLists.txt
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/TableGen/CMakeLists.txt?rev=165168&r1=165167&r2=165168&view=diff
==============================================================================
--- llvm/trunk/lib/TableGen/CMakeLists.txt (original)
+++ llvm/trunk/lib/TableGen/CMakeLists.txt Wed Oct  3 16:31:08 2012
@@ -7,7 +7,6 @@
   Main.cpp
   Record.cpp
   StringMatcher.cpp
-  TableGenAction.cpp
   TableGenBackend.cpp
   TGLexer.cpp
   TGParser.cpp

Modified: llvm/trunk/lib/TableGen/Main.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/TableGen/Main.cpp?rev=165168&r1=165167&r2=165168&view=diff
==============================================================================
--- llvm/trunk/lib/TableGen/Main.cpp (original)
+++ llvm/trunk/lib/TableGen/Main.cpp Wed Oct  3 16:31:08 2012
@@ -24,7 +24,6 @@
 #include "llvm/TableGen/Error.h"
 #include "llvm/TableGen/Main.h"
 #include "llvm/TableGen/Record.h"
-#include "llvm/TableGen/TableGenAction.h"
 #include <algorithm>
 #include <cstdio>
 using namespace llvm;
@@ -48,27 +47,9 @@
               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 {
 
 int TableGenMain(char *argv0, TableGenMainFn *MainFn) {
-  StubTransitionalTableGenAction Action(MainFn);
-  return TableGenMain(argv0, Action);
-}
-
-int TableGenMain(char *argv0, TableGenAction &Action) {
   RecordKeeper Records;
 
   try {
@@ -123,7 +104,7 @@
       DepOut.keep();
     }
 
-    if (Action(Out.os(), Records))
+    if (MainFn(Out.os(), Records))
       return 1;
 
     // Declare success.

Removed: llvm/trunk/lib/TableGen/TableGenAction.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/TableGen/TableGenAction.cpp?rev=165167&view=auto
==============================================================================
--- llvm/trunk/lib/TableGen/TableGenAction.cpp (original)
+++ llvm/trunk/lib/TableGen/TableGenAction.cpp (removed)
@@ -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() { }
-





More information about the llvm-commits mailing list