Sirish Pande | 26f61a1 | 2012-05-03 21:52:53 +0000 | [diff] [blame] | 1 | //===- HexagonMCInst.h - Hexagon sub-class of MCInst ----------------------===// |
| 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 class extends MCInst to allow some VLIW annotation. |
| 11 | // |
| 12 | //===----------------------------------------------------------------------===// |
| 13 | |
| 14 | #ifndef HEXAGONMCINST_H |
| 15 | #define HEXAGONMCINST_H |
| 16 | |
| 17 | #include "llvm/MC/MCInst.h" |
| 18 | #include "llvm/CodeGen/MachineInstr.h" |
| 19 | |
| 20 | namespace llvm { |
| 21 | class HexagonMCInst: public MCInst { |
| 22 | // Packet start and end markers |
| 23 | unsigned startPacket: 1, endPacket: 1; |
| 24 | const MachineInstr *MachineI; |
| 25 | public: |
| 26 | explicit HexagonMCInst(): MCInst(), |
| 27 | startPacket(0), endPacket(0) {} |
| 28 | |
Eric Christopher | 22b291a | 2012-05-08 20:45:04 +0000 | [diff] [blame] | 29 | const MachineInstr* getMI() const { return MachineI; } |
Sirish Pande | 26f61a1 | 2012-05-03 21:52:53 +0000 | [diff] [blame] | 30 | |
Eric Christopher | 22b291a | 2012-05-08 20:45:04 +0000 | [diff] [blame] | 31 | void setMI(const MachineInstr *MI) { MachineI = MI; } |
Sirish Pande | 26f61a1 | 2012-05-03 21:52:53 +0000 | [diff] [blame] | 32 | |
Eric Christopher | 22b291a | 2012-05-08 20:45:04 +0000 | [diff] [blame] | 33 | bool isStartPacket() const { return (startPacket); } |
| 34 | bool isEndPacket() const { return (endPacket); } |
Sirish Pande | 26f61a1 | 2012-05-03 21:52:53 +0000 | [diff] [blame] | 35 | |
Eric Christopher | 22b291a | 2012-05-08 20:45:04 +0000 | [diff] [blame] | 36 | void setStartPacket(bool yes) { startPacket = yes; } |
| 37 | void setEndPacket(bool yes) { endPacket = yes; } |
Sirish Pande | 26f61a1 | 2012-05-03 21:52:53 +0000 | [diff] [blame] | 38 | }; |
| 39 | } |
| 40 | |
| 41 | #endif |