15 #ifndef LLVM_C_DISASSEMBLER_H
16 #define LLVM_C_DISASSEMBLER_H
18 #include "llvm/Support/DataTypes.h"
51 uint64_t Offset, uint64_t Size,
52 int TagType,
void *TagBuf);
90 #define LLVMDisassembler_VariantKind_None 0
95 #define LLVMDisassembler_VariantKind_ARM_HI16 1
96 #define LLVMDisassembler_VariantKind_ARM_LO16 2
101 #define LLVMDisassembler_VariantKind_ARM64_PAGE 1
102 #define LLVMDisassembler_VariantKind_ARM64_PAGEOFF 2
103 #define LLVMDisassembler_VariantKind_ARM64_GOTPAGE 3
104 #define LLVMDisassembler_VariantKind_ARM64_GOTPAGEOFF 4
105 #define LLVMDisassembler_VariantKind_ARM64_TLVP 5
106 #define LLVMDisassembler_VariantKind_ARM64_TLVOFF 6
120 typedef const char *(*LLVMSymbolLookupCallback)(
void *DisInfo,
121 uint64_t ReferenceValue,
122 uint64_t *ReferenceType,
123 uint64_t ReferencePC,
124 const char **ReferenceName);
129 #define LLVMDisassembler_ReferenceType_InOut_None 0
132 #define LLVMDisassembler_ReferenceType_In_Branch 1
134 #define LLVMDisassembler_ReferenceType_In_PCrel_Load 2
137 #define LLVMDisassembler_ReferenceType_In_ARM64_ADRP 0x100000001
139 #define LLVMDisassembler_ReferenceType_In_ARM64_ADDXri 0x100000002
141 #define LLVMDisassembler_ReferenceType_In_ARM64_LDRXui 0x100000003
143 #define LLVMDisassembler_ReferenceType_In_ARM64_LDRXl 0x100000004
145 #define LLVMDisassembler_ReferenceType_In_ARM64_ADR 0x100000005
148 #define LLVMDisassembler_ReferenceType_Out_SymbolStub 1
150 #define LLVMDisassembler_ReferenceType_Out_LitPool_SymAddr 2
152 #define LLVMDisassembler_ReferenceType_Out_LitPool_CstrAddr 3
155 #define LLVMDisassembler_ReferenceType_Out_Objc_CFString_Ref 4
157 #define LLVMDisassembler_ReferenceType_Out_Objc_Message 5
159 #define LLVMDisassembler_ReferenceType_Out_Objc_Message_Ref 6
161 #define LLVMDisassembler_ReferenceType_Out_Objc_Selector_Ref 7
163 #define LLVMDisassembler_ReferenceType_Out_Objc_Class_Ref 8
166 #define LLVMDisassembler_ReferenceType_DeMangled_Name 9
193 void *DisInfo,
int TagType,
206 const char *
Features,
void *DisInfo,
int TagType,
217 #define LLVMDisassembler_Option_UseMarkup 1
219 #define LLVMDisassembler_Option_PrintImmHex 2
221 #define LLVMDisassembler_Option_AsmPrinterVariant 4
223 #define LLVMDisassembler_Option_SetInstrComments 8
225 #define LLVMDisassembler_Option_PrintLatency 16
243 uint64_t BytesSize, uint64_t PC,
244 char *OutString,
size_t OutStringSize);
LLVMDisasmContextRef LLVMCreateDisasm(const char *TripleName, void *DisInfo, int TagType, LLVMOpInfoCallback GetOpInfo, LLVMSymbolLookupCallback SymbolLookUp)
Create a disassembler for the TripleName.
const char *(* LLVMSymbolLookupCallback)(void *DisInfo, uint64_t ReferenceValue, uint64_t *ReferenceType, uint64_t ReferencePC, const char **ReferenceName)
The type for the symbol lookup function.
const FeatureBitset Features
LLVMDisasmContextRef LLVMCreateDisasmCPU(const char *Triple, const char *CPU, void *DisInfo, int TagType, LLVMOpInfoCallback GetOpInfo, LLVMSymbolLookupCallback SymbolLookUp)
Create a disassembler for the TripleName and a specific CPU.
void * LLVMDisasmContextRef
An opaque reference to a disassembler context.
struct LLVMOpInfoSymbol1 AddSymbol
struct LLVMOpInfoSymbol1 SubtractSymbol
The initial support in LLVM MC for the most general form of a relocatable expression is "AddSymbol - ...
LLVMDisasmContextRef LLVMCreateDisasmCPUFeatures(const char *Triple, const char *CPU, const char *Features, void *DisInfo, int TagType, LLVMOpInfoCallback GetOpInfo, LLVMSymbolLookupCallback SymbolLookUp)
Create a disassembler for the TripleName, a specific CPU and specific feature string.
size_t LLVMDisasmInstruction(LLVMDisasmContextRef DC, uint8_t *Bytes, uint64_t BytesSize, uint64_t PC, char *OutString, size_t OutStringSize)
Disassemble a single instruction using the disassembler context specified in the parameter DC...
int LLVMSetDisasmOptions(LLVMDisasmContextRef DC, uint64_t Options)
Set the disassembler's options.
void LLVMDisasmDispose(LLVMDisasmContextRef DC)
Dispose of a disassembler context.
int(* LLVMOpInfoCallback)(void *DisInfo, uint64_t PC, uint64_t Offset, uint64_t Size, int TagType, void *TagBuf)
The type for the operand information call back function.