1 //===- ARMDisassembler.h - Disassembler for ARM/Thumb ISA -------*- C++ -*-===//
3 // The LLVM Compiler Infrastructure
5 // This file is distributed under the University of Illinois Open Source
6 // License. See LICENSE.TXT for details.
8 //===----------------------------------------------------------------------===//
10 // This file is part of the ARM Disassembler.
11 // It contains the header for ARMDisassembler and ThumbDisassembler, both are
12 // subclasses of MCDisassembler.
14 //===----------------------------------------------------------------------===//
16 #ifndef ARMDISASSEMBLER_H
17 #define ARMDISASSEMBLER_H
19 #include "llvm/MC/MCDisassembler.h"
29 /// ARMDisassembler - ARM disassembler for all ARM platforms.
30 class ARMDisassembler
: public MCDisassembler
{
32 /// Constructor - Initializes the disassembler.
41 /// getInstruction - See MCDisassembler.
42 bool getInstruction(MCInst
&instr
,
44 const MemoryObject
®ion
,
46 raw_ostream
&vStream
) const;
48 /// getEDInfo - See MCDisassembler.
49 EDInstInfo
*getEDInfo() const;
53 // Forward declaration.
54 class ARMBasicMCBuilder
;
56 /// Session - Keep track of the IT Block progression.
58 friend class ARMBasicMCBuilder
;
60 Session() : ITCounter(0), ITState(0) {}
62 /// InitIT - Initializes ITCounter/ITState.
63 bool InitIT(unsigned short bits7_0
);
64 /// UpdateIT - Updates ITCounter/ITState as IT Block progresses.
68 unsigned ITCounter
; // Possible values: 0, 1, 2, 3, 4.
69 unsigned ITState
; // A2.5.2 Consists of IT[7:5] and IT[4:0] initially.
72 /// ThumbDisassembler - Thumb disassembler for all ARM platforms.
73 class ThumbDisassembler
: public MCDisassembler
{
75 /// Constructor - Initializes the disassembler.
78 MCDisassembler(), SO() {
81 ~ThumbDisassembler() {
84 /// getInstruction - See MCDisassembler.
85 bool getInstruction(MCInst
&instr
,
87 const MemoryObject
®ion
,
89 raw_ostream
&vStream
) const;
91 /// getEDInfo - See MCDisassembler.
92 EDInstInfo
*getEDInfo() const;