LLVM  6.0.0svn
Macros | Typedefs | Functions | Variables
BPFDisassembler.cpp File Reference
#include "BPF.h"
#include "BPFSubtarget.h"
#include "MCTargetDesc/BPFMCTargetDesc.h"
#include "llvm/ADT/ArrayRef.h"
#include "llvm/MC/MCAsmInfo.h"
#include "llvm/MC/MCContext.h"
#include "llvm/MC/MCDisassembler/MCDisassembler.h"
#include "llvm/MC/MCFixedLenDisassembler.h"
#include "llvm/MC/MCInst.h"
#include "llvm/Support/MathExtras.h"
#include "llvm/Support/TargetRegistry.h"
#include <cstdint>
#include "BPFGenDisassemblerTables.inc"
Include dependency graph for BPFDisassembler.cpp:

Go to the source code of this file.


#define DEBUG_TYPE   "bpf-disassembler"


typedef MCDisassembler::DecodeStatus DecodeStatus
typedef DecodeStatus(* DecodeFunc) (MCInst &MI, unsigned insn, uint64_t Address, const void *Decoder)


static MCDisassemblercreateBPFDisassembler (const Target &T, const MCSubtargetInfo &STI, MCContext &Ctx)
void LLVMInitializeBPFDisassembler ()
static DecodeStatus DecodeGPRRegisterClass (MCInst &Inst, unsigned RegNo, uint64_t, const void *)
static DecodeStatus DecodeGPR32RegisterClass (MCInst &Inst, unsigned RegNo, uint64_t, const void *)
static DecodeStatus decodeMemoryOpValue (MCInst &Inst, unsigned Insn, uint64_t Address, const void *Decoder)
static DecodeStatus readInstruction64 (ArrayRef< uint8_t > Bytes, uint64_t Address, uint64_t &Size, uint64_t &Insn, bool IsLittleEndian)


static const unsigned GPRDecoderTable []
static const unsigned GPR32DecoderTable []

Macro Definition Documentation


#define DEBUG_TYPE   "bpf-disassembler"

Definition at line 29 of file BPFDisassembler.cpp.

Typedef Documentation

◆ DecodeFunc

typedef DecodeStatus(* DecodeFunc) (MCInst &MI, unsigned insn, uint64_t Address, const void *Decoder)

Definition at line 181 of file BPFDisassembler.cpp.

◆ DecodeStatus

Definition at line 31 of file BPFDisassembler.cpp.

Function Documentation

◆ createBPFDisassembler()

static MCDisassembler* createBPFDisassembler ( const Target T,
const MCSubtargetInfo STI,
MCContext Ctx 

Definition at line 50 of file BPFDisassembler.cpp.

Referenced by LLVMInitializeBPFDisassembler().

◆ DecodeGPR32RegisterClass()

static DecodeStatus DecodeGPR32RegisterClass ( MCInst Inst,
unsigned  RegNo,
uint64_t  ,
const void *   

◆ DecodeGPRRegisterClass()

static DecodeStatus DecodeGPRRegisterClass ( MCInst Inst,
unsigned  RegNo,
uint64_t  ,
const void *   

◆ decodeMemoryOpValue()

static DecodeStatus decodeMemoryOpValue ( MCInst Inst,
unsigned  Insn,
uint64_t  Address,
const void *  Decoder 

◆ LLVMInitializeBPFDisassembler()

void LLVMInitializeBPFDisassembler ( )

◆ readInstruction64()

static DecodeStatus readInstruction64 ( ArrayRef< uint8_t >  Bytes,
uint64_t  Address,
uint64_t &  Size,
uint64_t &  Insn,
bool  IsLittleEndian 

Variable Documentation

◆ GPR32DecoderTable

const unsigned GPR32DecoderTable[]
Initial value:
= {
BPF::W0, BPF::W1, BPF::W2, BPF::W3, BPF::W4, BPF::W5,
BPF::W6, BPF::W7, BPF::W8, BPF::W9, BPF::W10, BPF::W11}

Definition at line 82 of file BPFDisassembler.cpp.

◆ GPRDecoderTable

const unsigned GPRDecoderTable[]
Initial value:
= {
BPF::R0, BPF::R1, BPF::R2, BPF::R3, BPF::R4, BPF::R5,
BPF::R6, BPF::R7, BPF::R8, BPF::R9, BPF::R10, BPF::R11}
#define R4(n)
#define R2(n)
#define R6(n)

Definition at line 67 of file BPFDisassembler.cpp.