1 //===- llvm/TableGen/TableGenAction.h - defines TableGenAction --*- C++ -*-===// 2 // 3 // The LLVM Compiler Infrastructure 4 // 5 // This file is distributed under the University of Illinois Open Source 6 // License. See LICENSE.TXT for details. 7 // 8 //===----------------------------------------------------------------------===// 9 // 10 // This file defines the TableGenAction base class to be derived from by 11 // tblgen tools. 12 // 13 //===----------------------------------------------------------------------===// 14 15 #ifndef LLVM_TABLEGEN_TABLEGENACTION_H 16 #define LLVM_TABLEGEN_TABLEGENACTION_H 17 18 namespace llvm { 19 20 class raw_ostream; 21 class RecordKeeper; 22 23 class TableGenAction { 24 virtual void anchor(); 25 public: 26 virtual ~TableGenAction() {} 27 28 /// Perform the action using Records, and write output to OS. 29 /// @returns true on error, false otherwise 30 virtual bool operator()(raw_ostream &OS, RecordKeeper &Records) = 0; 31 }; 32 33 } 34 35 #endif 36