Use BranchProbability instead of floating points in IfConverter.
[llvm/stm8.git] / lib / Target / ARM / Disassembler / ARMDisassembler.h
blob0a74a3866eedc660c32070e26db55686b9876d6c
1 //===- ARMDisassembler.h - Disassembler for ARM/Thumb ISA -------*- 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 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"
21 namespace llvm {
23 class MCInst;
24 class MemoryObject;
25 class raw_ostream;
27 struct EDInstInfo;
29 /// ARMDisassembler - ARM disassembler for all ARM platforms.
30 class ARMDisassembler : public MCDisassembler {
31 public:
32 /// Constructor - Initializes the disassembler.
33 ///
34 ARMDisassembler() :
35 MCDisassembler() {
38 ~ARMDisassembler() {
41 /// getInstruction - See MCDisassembler.
42 bool getInstruction(MCInst &instr,
43 uint64_t &size,
44 const MemoryObject &region,
45 uint64_t address,
46 raw_ostream &vStream) const;
48 /// getEDInfo - See MCDisassembler.
49 EDInstInfo *getEDInfo() const;
50 private:
53 // Forward declaration.
54 class ARMBasicMCBuilder;
56 /// Session - Keep track of the IT Block progression.
57 class Session {
58 friend class ARMBasicMCBuilder;
59 public:
60 Session() : ITCounter(0), ITState(0) {}
61 ~Session() {}
62 /// InitIT - Initializes ITCounter/ITState.
63 bool InitIT(unsigned short bits7_0);
64 /// UpdateIT - Updates ITCounter/ITState as IT Block progresses.
65 void UpdateIT();
67 private:
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 {
74 public:
75 /// Constructor - Initializes the disassembler.
76 ///
77 ThumbDisassembler() :
78 MCDisassembler(), SO() {
81 ~ThumbDisassembler() {
84 /// getInstruction - See MCDisassembler.
85 bool getInstruction(MCInst &instr,
86 uint64_t &size,
87 const MemoryObject &region,
88 uint64_t address,
89 raw_ostream &vStream) const;
91 /// getEDInfo - See MCDisassembler.
92 EDInstInfo *getEDInfo() const;
93 private:
94 Session SO;
97 } // namespace llvm
99 #endif