Johnny Chen | b68a3ee | 2010-04-02 22:27:38 +0000 | [diff] [blame] | 1 | //===------------ ARMDecoderEmitter.h - Decoder Generator -------*- 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 is part of the ARM Disassembler. |
| 11 | // It contains the tablegen backend declaration ARMDecoderEmitter. |
| 12 | // |
| 13 | //===----------------------------------------------------------------------===// |
| 14 | |
| 15 | #ifndef ARMDECODEREMITTER_H |
| 16 | #define ARMDECODEREMITTER_H |
| 17 | |
| 18 | #include "TableGenBackend.h" |
| 19 | |
Johnny Chen | 9981814 | 2010-04-02 22:41:06 +0000 | [diff] [blame] | 20 | #include "llvm/System/DataTypes.h" |
Johnny Chen | b68a3ee | 2010-04-02 22:27:38 +0000 | [diff] [blame] | 21 | |
| 22 | namespace llvm { |
| 23 | |
| 24 | class ARMDecoderEmitter : public TableGenBackend { |
| 25 | RecordKeeper &Records; |
| 26 | public: |
| 27 | ARMDecoderEmitter(RecordKeeper &R) : Records(R) { |
| 28 | initBackend(); |
| 29 | } |
| 30 | |
| 31 | ~ARMDecoderEmitter() { |
| 32 | shutdownBackend(); |
| 33 | } |
Duncan Sands | 3472766 | 2010-07-12 08:16:59 +0000 | [diff] [blame] | 34 | |
Johnny Chen | b68a3ee | 2010-04-02 22:27:38 +0000 | [diff] [blame] | 35 | // run - Output the code emitter |
| 36 | void run(raw_ostream &o); |
| 37 | |
| 38 | private: |
| 39 | // Helper class for ARMDecoderEmitter. |
| 40 | class ARMDEBackend; |
| 41 | |
| 42 | ARMDEBackend *Backend; |
| 43 | |
| 44 | void initBackend(); |
| 45 | void shutdownBackend(); |
| 46 | }; |
| 47 | |
| 48 | } // end llvm namespace |
| 49 | |
| 50 | #endif |