LLVM 19.0.0git
Public Member Functions | List of all members
llvm::AArch64Disassembler Class Reference

#include "Target/AArch64/Disassembler/AArch64Disassembler.h"

Inheritance diagram for llvm::AArch64Disassembler:
Inheritance graph
[legend]

Public Member Functions

 AArch64Disassembler (const MCSubtargetInfo &STI, MCContext &Ctx, MCInstrInfo const *MCII)
 
 ~AArch64Disassembler () override=default
 
MCDisassembler::DecodeStatus getInstruction (MCInst &Instr, uint64_t &Size, ArrayRef< uint8_t > Bytes, uint64_t Address, raw_ostream &CStream) const override
 Returns the disassembly of a single instruction.
 
uint64_t suggestBytesToSkip (ArrayRef< uint8_t > Bytes, uint64_t Address) const override
 Suggest a distance to skip in a buffer of data to find the next place to look for the start of an instruction.
 
- Public Member Functions inherited from llvm::MCDisassembler
 MCDisassembler (const MCSubtargetInfo &STI, MCContext &Ctx)
 
virtual ~MCDisassembler ()
 
virtual DecodeStatus getInstruction (MCInst &Instr, uint64_t &Size, ArrayRef< uint8_t > Bytes, uint64_t Address, raw_ostream &CStream) const =0
 Returns the disassembly of a single instruction.
 
virtual std::optional< DecodeStatusonSymbolStart (SymbolInfoTy &Symbol, uint64_t &Size, ArrayRef< uint8_t > Bytes, uint64_t Address, raw_ostream &CStream) const
 Used to perform separate target specific disassembly for a particular symbol.
 
virtual uint64_t suggestBytesToSkip (ArrayRef< uint8_t > Bytes, uint64_t Address) const
 Suggest a distance to skip in a buffer of data to find the next place to look for the start of an instruction.
 
bool tryAddingSymbolicOperand (MCInst &Inst, int64_t Value, uint64_t Address, bool IsBranch, uint64_t Offset, uint64_t OpSize, uint64_t InstSize) const
 
void tryAddingPcLoadReferenceComment (int64_t Value, uint64_t Address) const
 
void setSymbolizer (std::unique_ptr< MCSymbolizer > Symzer)
 Set Symzer as the current symbolizer.
 
MCContextgetContext () const
 
const MCSubtargetInfogetSubtargetInfo () const
 
virtual void setABIVersion (unsigned Version)
 ELF-specific, set the ABI version from the object header.
 

Additional Inherited Members

- Public Types inherited from llvm::MCDisassembler
enum  DecodeStatus { Fail = 0 , SoftFail = 1 , Success = 3 }
 Ternary decode status. More...
 
- Public Attributes inherited from llvm::MCDisassembler
raw_ostreamCommentStream = nullptr
 
- Protected Attributes inherited from llvm::MCDisassembler
const MCSubtargetInfoSTI
 
std::unique_ptr< MCSymbolizerSymbolizer
 

Detailed Description

Definition at line 20 of file AArch64Disassembler.h.

Constructor & Destructor Documentation

◆ AArch64Disassembler()

llvm::AArch64Disassembler::AArch64Disassembler ( const MCSubtargetInfo STI,
MCContext Ctx,
MCInstrInfo const MCII 
)
inline

Definition at line 24 of file AArch64Disassembler.h.

◆ ~AArch64Disassembler()

llvm::AArch64Disassembler::~AArch64Disassembler ( )
overridedefault

Member Function Documentation

◆ getInstruction()

DecodeStatus AArch64Disassembler::getInstruction ( MCInst Instr,
uint64_t Size,
ArrayRef< uint8_t >  Bytes,
uint64_t  Address,
raw_ostream CStream 
) const
overridevirtual

Returns the disassembly of a single instruction.

Parameters
Instr- An MCInst to populate with the contents of the instruction.
Size- A value to populate with the size of the instruction, or the number of bytes consumed while attempting to decode an invalid instruction.
Address- The address, in the memory space of region, of the first byte of the instruction.
Bytes- A reference to the actual bytes of the instruction.
CStream- The stream to print comments and annotations on.
Returns
- MCDisassembler::Success if the instruction is valid, MCDisassembler::SoftFail if the instruction was disassemblable but invalid, MCDisassembler::Fail if the instruction was invalid.

Implements llvm::MCDisassembler.

Definition at line 323 of file AArch64Disassembler.cpp.

References llvm::Address, assert(), llvm::MCDisassembler::CommentStream, llvm::MCOperand::createImm(), llvm::MCOperand::createReg(), llvm::MCDisassembler::Fail, Insn, llvm::MCOperand::isImm(), MI, llvm::AArch64::OPERAND_IMPLICIT_IMM_0, llvm::MCOI::OPERAND_REGISTER, llvm::ArrayRef< T >::size(), Size, and llvm::MCDisassembler::STI.

◆ suggestBytesToSkip()

uint64_t AArch64Disassembler::suggestBytesToSkip ( ArrayRef< uint8_t >  Bytes,
uint64_t  Address 
) const
overridevirtual

Suggest a distance to skip in a buffer of data to find the next place to look for the start of an instruction.

For example, if all instructions have a fixed alignment, this might advance to the next multiple of that alignment.

If not overridden, the default is 1.

Parameters
Address- The address, in the memory space of region, of the starting point (typically the first byte of something that did not decode as a valid instruction at all).
Bytes- A reference to the actual bytes at Address. May be needed in order to determine the width of an unrecognized instruction (e.g. in Thumb this is a simple consistent criterion that doesn't require knowing the specific instruction). The caller can pass as much data as they have available, and the function is required to make a reasonable default choice if not enough data is available to make a better one.
Returns
- A number of bytes to skip. Must always be greater than zero. May be greater than the size of Bytes.

Reimplemented from llvm::MCDisassembler.

Definition at line 388 of file AArch64Disassembler.cpp.


The documentation for this class was generated from the following files: