1 //===-- llvm/MC/MCDisassembler.h - Disassembler interface -------*- 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 //===----------------------------------------------------------------------===//
9 #ifndef MCDISASSEMBLER_H
10 #define MCDISASSEMBLER_H
12 #include "llvm/System/DataTypes.h"
22 /// MCDisassembler - Superclass for all disassemblers. Consumes a memory region
23 /// and provides an array of assembly instructions.
24 class MCDisassembler {
26 /// Constructor - Performs initial setup for the disassembler.
29 virtual ~MCDisassembler();
31 /// getInstruction - Returns the disassembly of a single instruction.
33 /// @param instr - An MCInst to populate with the contents of the
35 /// @param size - A value to populate with the size of the instruction, or
36 /// the number of bytes consumed while attempting to decode
37 /// an invalid instruction.
38 /// @param region - The memory object to use as a source for machine code.
39 /// @param address - The address, in the memory space of region, of the first
40 /// byte of the instruction.
41 /// @param vStream - The stream to print warnings and diagnostic messages on.
42 /// @return - True if the instruction is valid; false otherwise.
43 virtual bool getInstruction(MCInst& instr,
45 const MemoryObject ®ion,
47 raw_ostream &vStream) const = 0;
49 /// getEDInfo - Returns the enhanced insturction information corresponding to
52 /// @return - An array of instruction information, with one entry for
53 /// each MCInst opcode this disassembler returns.
54 /// NULL if there is no info for this target.
55 virtual EDInstInfo *getEDInfo() const { return NULL; }