Dan Gohman | f17a25c | 2007-07-18 16:29:46 +0000 | [diff] [blame] | 1 | //===- CodeEmitterGen.h - Code Emitter Generator ----------------*- C++ -*-===// |
| 2 | // |
| 3 | // The LLVM Compiler Infrastructure |
| 4 | // |
Chris Lattner | fd6c2f0 | 2007-12-29 20:37:13 +0000 | [diff] [blame] | 5 | // This file is distributed under the University of Illinois Open Source |
| 6 | // License. See LICENSE.TXT for details. |
Dan Gohman | f17a25c | 2007-07-18 16:29:46 +0000 | [diff] [blame] | 7 | // |
| 8 | //===----------------------------------------------------------------------===// |
| 9 | // |
| 10 | // FIXME: document |
| 11 | // |
| 12 | //===----------------------------------------------------------------------===// |
| 13 | |
| 14 | #ifndef CODEMITTERGEN_H |
| 15 | #define CODEMITTERGEN_H |
| 16 | |
| 17 | #include "TableGenBackend.h" |
| 18 | #include <map> |
| 19 | #include <vector> |
| 20 | #include <string> |
| 21 | |
| 22 | namespace llvm { |
| 23 | |
| 24 | class RecordVal; |
| 25 | class BitsInit; |
Daniel Dunbar | fd96f34 | 2009-12-09 02:58:09 +0000 | [diff] [blame] | 26 | struct Init; |
Dan Gohman | f17a25c | 2007-07-18 16:29:46 +0000 | [diff] [blame] | 27 | |
| 28 | class CodeEmitterGen : public TableGenBackend { |
| 29 | RecordKeeper &Records; |
| 30 | public: |
| 31 | CodeEmitterGen(RecordKeeper &R) : Records(R) {} |
| 32 | |
| 33 | // run - Output the code emitter |
Daniel Dunbar | d428706 | 2009-07-03 00:10:29 +0000 | [diff] [blame] | 34 | void run(raw_ostream &o); |
Dan Gohman | f17a25c | 2007-07-18 16:29:46 +0000 | [diff] [blame] | 35 | private: |
Daniel Dunbar | d428706 | 2009-07-03 00:10:29 +0000 | [diff] [blame] | 36 | void emitMachineOpEmitter(raw_ostream &o, const std::string &Namespace); |
| 37 | void emitGetValueBit(raw_ostream &o, const std::string &Namespace); |
Dan Gohman | f17a25c | 2007-07-18 16:29:46 +0000 | [diff] [blame] | 38 | void reverseBits(std::vector<Record*> &Insts); |
Dan Gohman | a45e492 | 2009-12-05 00:05:43 +0000 | [diff] [blame] | 39 | int getVariableBit(const Init *VarVal, BitsInit *BI, int bit); |
Dan Gohman | f17a25c | 2007-07-18 16:29:46 +0000 | [diff] [blame] | 40 | }; |
| 41 | |
| 42 | } // End llvm namespace |
| 43 | |
| 44 | #endif |