llvm.c.disassembler

Undocumented in source.

Members

Aliases

LLVMDisasmContextRef
alias LLVMDisasmContextRef = void*

An opaque reference to a disassembler context.

LLVMOpInfoCallback
alias LLVMOpInfoCallback = int function(void* DisInfo, uint64_t PC, uint64_t Offset, uint64_t Size, int TagType, void* TagBuf)

The type for the operand information call back function. This is called to get the symbolic information for an operand of an instruction. Typically this is from the relocation information, symbol table, etc. That block of information is saved when the disassembler context is created and passed to the call back in the DisInfo parameter. The instruction containing operand is at the PC parameter. For some instruction sets, there can be more than one operand with symbolic information. To determine the symbolic operand information for each operand, the bytes for the specific operand in the instruction are specified by the Offset parameter and its byte widith is the size parameter. For instructions sets with fixed widths and one symbolic operand per instruction, the Offset parameter will be zero and Size parameter will be the instruction width. The information is returned in TagBuf and is Triple specific with its specific information defined by the value of TagType for that Triple. If symbolic information is returned the function returns 1, otherwise it returns 0.

LLVMSymbolLookupCallback
alias LLVMSymbolLookupCallback = const(char)* function(void* DisInfo, uint64_t ReferenceValue, uint64_t* ReferenceType, uint64_t ReferencePC, const(char)** ReferenceName)

The type for the symbol lookup function. This may be called by the disassembler for things like adding a comment for a PC plus a constant offset load instruction to use a symbol name instead of a load address value. It is passed the block information is saved when the disassembler context is created and the ReferenceValue to look up as a symbol. If no symbol is found for the ReferenceValue NULL is returned. The ReferenceType of the instruction is passed indirectly as is the PC of the instruction in ReferencePC. If the output reference can be determined its type is returned indirectly in ReferenceType along with ReferenceName if any, or that is set to NULL.

Functions

LLVMCreateDisasm
LLVMDisasmContextRef LLVMCreateDisasm(const(char)* TripleName, void* DisInfo, int TagType, LLVMOpInfoCallback GetOpInfo, LLVMSymbolLookupCallback SymbolLookUp)

Create a disassembler for the TripleName. Symbolic disassembly is supported by passing a block of information in the DisInfo parameter and specifying the TagType and callback functions as described above. These can all be passed as NULL. If successful, this returns a disassembler context. If not, it returns NULL. This function is equivalent to calling LLVMCreateDisasmCPUFeatures() with an empty CPU name and feature set.

LLVMCreateDisasmCPU
LLVMDisasmContextRef LLVMCreateDisasmCPU(char* Triple, char* CPU, void* DisInfo, int TagType, LLVMOpInfoCallback GetOpInfo, LLVMSymbolLookupCallback SymbolLookUp)

Create a disassembler for the TripleName and a specific CPU. Symbolic disassembly is supported by passing a block of information in the DisInfo parameter and specifying the TagType and callback functions as described above. These can all be passed * as NULL. If successful, this returns a disassembler context. If not, it returns NULL. This function is equivalent to calling LLVMCreateDisasmCPUFeatures() with an empty feature set.

LLVMCreateDisasmCPUFeatures
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. Symbolic disassembly is supported by passing a block of information in the DisInfo parameter and specifying the TagType and callback functions as described above. These can all be passed * as NULL. If successful, this returns a disassembler context. If not, it returns NULL.

LLVMDisasmDispose
void LLVMDisasmDispose(LLVMDisasmContextRef DC)

Dispose of a disassembler context.

LLVMDisasmInstruction
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. The bytes of the instruction are specified in the parameter Bytes, and contains at least BytesSize number of bytes. The instruction is at the address specified by the PC parameter. If a valid instruction can be disassembled, its string is returned indirectly in OutString whose size is specified in the parameter OutStringSize. This function returns the number of bytes in the instruction or zero if there was no valid instruction.

LLVMSetDisasmOptions
int LLVMSetDisasmOptions(LLVMDisasmContextRef DC, uint64_t Options)

Set the disassembler's options. Returns 1 if it can set the Options and 0 otherwise.

Manifest constants

LLVMDisassembler_Option_AsmPrinterVariant
enum LLVMDisassembler_Option_AsmPrinterVariant;
Undocumented in source but is binding to C. You might be able to learn more by searching the web for its name.
LLVMDisassembler_Option_PrintImmHex
enum LLVMDisassembler_Option_PrintImmHex;
Undocumented in source but is binding to C. You might be able to learn more by searching the web for its name.
LLVMDisassembler_Option_PrintLatency
enum LLVMDisassembler_Option_PrintLatency;
Undocumented in source but is binding to C. You might be able to learn more by searching the web for its name.
LLVMDisassembler_Option_SetInstrComments
enum LLVMDisassembler_Option_SetInstrComments;
Undocumented in source but is binding to C. You might be able to learn more by searching the web for its name.
LLVMDisassembler_Option_UseMarkup
enum LLVMDisassembler_Option_UseMarkup;
Undocumented in source but is binding to C. You might be able to learn more by searching the web for its name.
LLVMDisassembler_ReferenceType_DeMangled_Name
enum LLVMDisassembler_ReferenceType_DeMangled_Name;
Undocumented in source but is binding to C. You might be able to learn more by searching the web for its name.
LLVMDisassembler_ReferenceType_InOut_None
enum LLVMDisassembler_ReferenceType_InOut_None;

The reference types on input and output.

LLVMDisassembler_ReferenceType_In_ARM64_ADDXri
enum LLVMDisassembler_ReferenceType_In_ARM64_ADDXri;
Undocumented in source but is binding to C. You might be able to learn more by searching the web for its name.
LLVMDisassembler_ReferenceType_In_ARM64_ADR
enum LLVMDisassembler_ReferenceType_In_ARM64_ADR;
Undocumented in source but is binding to C. You might be able to learn more by searching the web for its name.
LLVMDisassembler_ReferenceType_In_ARM64_ADRP
enum LLVMDisassembler_ReferenceType_In_ARM64_ADRP;
Undocumented in source but is binding to C. You might be able to learn more by searching the web for its name.
LLVMDisassembler_ReferenceType_In_ARM64_LDRXl
enum LLVMDisassembler_ReferenceType_In_ARM64_LDRXl;
Undocumented in source but is binding to C. You might be able to learn more by searching the web for its name.
LLVMDisassembler_ReferenceType_In_ARM64_LDRXui
enum LLVMDisassembler_ReferenceType_In_ARM64_LDRXui;
Undocumented in source but is binding to C. You might be able to learn more by searching the web for its name.
LLVMDisassembler_ReferenceType_In_Branch
enum LLVMDisassembler_ReferenceType_In_Branch;
Undocumented in source but is binding to C. You might be able to learn more by searching the web for its name.
LLVMDisassembler_ReferenceType_In_PCrel_Load
enum LLVMDisassembler_ReferenceType_In_PCrel_Load;
Undocumented in source but is binding to C. You might be able to learn more by searching the web for its name.
LLVMDisassembler_ReferenceType_Out_LitPool_CstrAddr
enum LLVMDisassembler_ReferenceType_Out_LitPool_CstrAddr;
Undocumented in source but is binding to C. You might be able to learn more by searching the web for its name.
LLVMDisassembler_ReferenceType_Out_LitPool_SymAddr
enum LLVMDisassembler_ReferenceType_Out_LitPool_SymAddr;
Undocumented in source but is binding to C. You might be able to learn more by searching the web for its name.
LLVMDisassembler_ReferenceType_Out_Objc_CFString_Ref
enum LLVMDisassembler_ReferenceType_Out_Objc_CFString_Ref;
Undocumented in source but is binding to C. You might be able to learn more by searching the web for its name.
LLVMDisassembler_ReferenceType_Out_Objc_Class_Ref
enum LLVMDisassembler_ReferenceType_Out_Objc_Class_Ref;
Undocumented in source but is binding to C. You might be able to learn more by searching the web for its name.
LLVMDisassembler_ReferenceType_Out_Objc_Message
enum LLVMDisassembler_ReferenceType_Out_Objc_Message;
Undocumented in source but is binding to C. You might be able to learn more by searching the web for its name.
LLVMDisassembler_ReferenceType_Out_Objc_Message_Ref
enum LLVMDisassembler_ReferenceType_Out_Objc_Message_Ref;
Undocumented in source but is binding to C. You might be able to learn more by searching the web for its name.
LLVMDisassembler_ReferenceType_Out_Objc_Selector_Ref
enum LLVMDisassembler_ReferenceType_Out_Objc_Selector_Ref;
Undocumented in source but is binding to C. You might be able to learn more by searching the web for its name.
LLVMDisassembler_ReferenceType_Out_SymbolStub
enum LLVMDisassembler_ReferenceType_Out_SymbolStub;
Undocumented in source but is binding to C. You might be able to learn more by searching the web for its name.
LLVMDisassembler_VariantKind_ARM64_GOTPAGE
enum LLVMDisassembler_VariantKind_ARM64_GOTPAGE;
Undocumented in source but is binding to C. You might be able to learn more by searching the web for its name.
LLVMDisassembler_VariantKind_ARM64_GOTPAGEOFF
enum LLVMDisassembler_VariantKind_ARM64_GOTPAGEOFF;
Undocumented in source but is binding to C. You might be able to learn more by searching the web for its name.
LLVMDisassembler_VariantKind_ARM64_PAGE
enum LLVMDisassembler_VariantKind_ARM64_PAGE;

The ARM64 target VariantKinds.

LLVMDisassembler_VariantKind_ARM64_PAGEOFF
enum LLVMDisassembler_VariantKind_ARM64_PAGEOFF;
Undocumented in source but is binding to C. You might be able to learn more by searching the web for its name.
LLVMDisassembler_VariantKind_ARM64_TLVOFF
enum LLVMDisassembler_VariantKind_ARM64_TLVOFF;
Undocumented in source but is binding to C. You might be able to learn more by searching the web for its name.
LLVMDisassembler_VariantKind_ARM64_TLVP
enum LLVMDisassembler_VariantKind_ARM64_TLVP;
Undocumented in source but is binding to C. You might be able to learn more by searching the web for its name.
LLVMDisassembler_VariantKind_ARM_HI16
enum LLVMDisassembler_VariantKind_ARM_HI16;

The ARM target VariantKinds.

LLVMDisassembler_VariantKind_ARM_LO16
enum LLVMDisassembler_VariantKind_ARM_LO16;
Undocumented in source but is binding to C. You might be able to learn more by searching the web for its name.
LLVMDisassembler_VariantKind_None
enum LLVMDisassembler_VariantKind_None;

The operand VariantKinds for symbolic disassembly.

Structs

LLVMOpInfo1
struct LLVMOpInfo1
Undocumented in source but is binding to C. You might be able to learn more by searching the web for its name.
LLVMOpInfoSymbol1
struct LLVMOpInfoSymbol1

The initial support in LLVM MC for the most general form of a relocatable expression is "AddSymbol - SubtractSymbol + Offset". For some Darwin targets this full form is encoded in the relocation information so that AddSymbol and SubtractSymbol can be link edited independent of each other. Many other platforms only allow a relocatable expression of the form AddSymbol + Offset to be encoded.

Meta