Misha Brukman | 9fff7e1 | 2003-05-24 00:15:53 +0000 | [diff] [blame] | 1 | //===- CodeEmitterGen.h - Code Emitter Generator ----------------*- C++ -*-===// |
John Criswell | 01d4582 | 2003-10-20 20:20:30 +0000 | [diff] [blame] | 2 | // |
| 3 | // The LLVM Compiler Infrastructure |
| 4 | // |
| 5 | // This file was developed by the LLVM research group and is distributed under |
| 6 | // the University of Illinois Open Source License. See LICENSE.TXT for details. |
| 7 | // |
| 8 | //===----------------------------------------------------------------------===// |
Misha Brukman | 9fff7e1 | 2003-05-24 00:15:53 +0000 | [diff] [blame] | 9 | // |
Chris Lattner | aaa3939 | 2003-07-31 04:32:37 +0000 | [diff] [blame] | 10 | // FIXME: document |
Misha Brukman | 9fff7e1 | 2003-05-24 00:15:53 +0000 | [diff] [blame] | 11 | // |
| 12 | //===----------------------------------------------------------------------===// |
| 13 | |
| 14 | #ifndef CODEMITTERGEN_H |
| 15 | #define CODEMITTERGEN_H |
| 16 | |
Chris Lattner | 0e5e49e | 2003-08-06 04:36:35 +0000 | [diff] [blame] | 17 | #include "TableGenBackend.h" |
Misha Brukman | 28eefa5 | 2004-10-14 05:53:01 +0000 | [diff] [blame^] | 18 | #include <map> |
| 19 | #include <vector> |
Misha Brukman | 9fff7e1 | 2003-05-24 00:15:53 +0000 | [diff] [blame] | 20 | |
Brian Gaeke | d0fde30 | 2003-11-11 22:41:34 +0000 | [diff] [blame] | 21 | namespace llvm { |
| 22 | |
Misha Brukman | 28eefa5 | 2004-10-14 05:53:01 +0000 | [diff] [blame^] | 23 | class RecordVal; |
| 24 | |
Chris Lattner | 0e5e49e | 2003-08-06 04:36:35 +0000 | [diff] [blame] | 25 | class CodeEmitterGen : public TableGenBackend { |
Misha Brukman | 9fff7e1 | 2003-05-24 00:15:53 +0000 | [diff] [blame] | 26 | RecordKeeper &Records; |
Misha Brukman | 9fff7e1 | 2003-05-24 00:15:53 +0000 | [diff] [blame] | 27 | public: |
| 28 | CodeEmitterGen(RecordKeeper &R) : Records(R) {} |
| 29 | |
Chris Lattner | 048c00d | 2003-08-01 04:38:18 +0000 | [diff] [blame] | 30 | // run - Output the code emitter |
| 31 | void run(std::ostream &o); |
Chris Lattner | aaa3939 | 2003-07-31 04:32:37 +0000 | [diff] [blame] | 32 | private: |
Misha Brukman | 9fff7e1 | 2003-05-24 00:15:53 +0000 | [diff] [blame] | 33 | void emitMachineOpEmitter(std::ostream &o, const std::string &Namespace); |
| 34 | void emitGetValueBit(std::ostream &o, const std::string &Namespace); |
Misha Brukman | 28eefa5 | 2004-10-14 05:53:01 +0000 | [diff] [blame^] | 35 | void emitInstrOpBits(std::ostream &o, |
| 36 | const std::vector<RecordVal> &Vals, |
| 37 | std::map<std::string, unsigned> &OpOrder, |
| 38 | std::map<std::string, bool> &OpContinuous); |
Misha Brukman | 9fff7e1 | 2003-05-24 00:15:53 +0000 | [diff] [blame] | 39 | }; |
| 40 | |
Brian Gaeke | d0fde30 | 2003-11-11 22:41:34 +0000 | [diff] [blame] | 41 | } // End llvm namespace |
| 42 | |
Misha Brukman | 9fff7e1 | 2003-05-24 00:15:53 +0000 | [diff] [blame] | 43 | #endif |