Chris Lattner | ec35240 | 2004-08-01 05:04:00 +0000 | [diff] [blame] | 1 | //===- CodeGenInstruction.h - Instruction Class Wrapper ---------*- C++ -*-===// |
| 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 | //===----------------------------------------------------------------------===// |
| 9 | // |
| 10 | // This file defines a wrapper class for the 'Instruction' TableGen class. |
| 11 | // |
| 12 | //===----------------------------------------------------------------------===// |
| 13 | |
| 14 | #ifndef CODEGEN_INSTRUCTION_H |
| 15 | #define CODEGEN_INSTRUCTION_H |
| 16 | |
| 17 | #include <string> |
| 18 | #include <vector> |
| 19 | #include <utility> |
| 20 | |
| 21 | namespace llvm { |
| 22 | class Record; |
| 23 | |
| 24 | struct CodeGenInstruction { |
| 25 | Record *TheDef; // The actual record defining this instruction. |
| 26 | std::string Name; // Contents of the 'Name' field. |
| 27 | std::string Namespace; // The namespace the instruction is in. |
| 28 | |
| 29 | /// AsmString - The format string used to emit a .s file for the |
| 30 | /// instruction. |
| 31 | std::string AsmString; |
| 32 | |
| 33 | /// OperandList - The list of declared operands, along with their declared |
| 34 | /// type (which is a record). |
| 35 | std::vector<std::pair<Record*, std::string> > OperandList; |
| 36 | |
| 37 | // Various boolean values we track for the instruction. |
| 38 | bool isReturn; |
| 39 | bool isBranch; |
| 40 | bool isBarrier; |
| 41 | bool isCall; |
| 42 | bool isTwoAddress; |
| 43 | bool isTerminator; |
| 44 | |
| 45 | CodeGenInstruction(Record *R); |
| 46 | }; |
| 47 | } |
| 48 | |
| 49 | #endif |