LLVM
8.0.1
|
Macros | |
#define | LLVMDisassembler_Option_UseMarkup 1 |
#define | LLVMDisassembler_Option_PrintImmHex 2 |
#define | LLVMDisassembler_Option_AsmPrinterVariant 4 |
#define | LLVMDisassembler_Option_SetInstrComments 8 |
#define | LLVMDisassembler_Option_PrintLatency 16 |
Functions | |
LLVMDisasmContextRef | LLVMCreateDisasm (const char *TripleName, void *DisInfo, int TagType, LLVMOpInfoCallback GetOpInfo, LLVMSymbolLookupCallback SymbolLookUp) |
Create a disassembler for the TripleName. More... | |
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. More... | |
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. More... | |
int | LLVMSetDisasmOptions (LLVMDisasmContextRef DC, uint64_t Options) |
Set the disassembler's options. More... | |
void | LLVMDisasmDispose (LLVMDisasmContextRef DC) |
Dispose of a disassembler context. More... | |
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. More... | |
#define LLVMDisassembler_Option_AsmPrinterVariant 4 |
Definition at line 80 of file Disassembler.h.
Referenced by LLVMSetDisasmOptions().
#define LLVMDisassembler_Option_PrintImmHex 2 |
Definition at line 78 of file Disassembler.h.
Referenced by LLVMSetDisasmOptions().
#define LLVMDisassembler_Option_PrintLatency 16 |
Definition at line 84 of file Disassembler.h.
Referenced by LLVMDisasmInstruction(), and LLVMSetDisasmOptions().
#define LLVMDisassembler_Option_SetInstrComments 8 |
Definition at line 82 of file Disassembler.h.
Referenced by LLVMSetDisasmOptions().
#define LLVMDisassembler_Option_UseMarkup 1 |
Definition at line 76 of file Disassembler.h.
Referenced by LLVMSetDisasmOptions().
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.
Definition at line 118 of file Disassembler.cpp.
References LLVMCreateDisasmCPUFeatures().
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.
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.
Definition at line 111 of file Disassembler.cpp.
References 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.
Definition at line 46 of file Disassembler.cpp.
References llvm::Target::createMCAsmInfo(), llvm::Target::createMCDisassembler(), llvm::Target::createMCInstPrinter(), llvm::Target::createMCInstrInfo(), llvm::Target::createMCRegInfo(), llvm::Target::createMCRelocationInfo(), llvm::Target::createMCSubtargetInfo(), llvm::Target::createMCSymbolizer(), DC, llvm::MCAsmInfo::getAssemblerDialect(), llvm::TargetRegistry::lookupTarget(), MRI, llvm::LLVMDisasmContext::setCPU(), and llvm::MCDisassembler::setSymbolizer().
Referenced by LLVMCreateDisasm(), and LLVMCreateDisasmCPU().
void LLVMDisasmDispose | ( | LLVMDisasmContextRef | DC | ) |
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.
Definition at line 248 of file Disassembler.cpp.
References assert(), llvm::Data, llvm::SmallVectorTemplateCommon< T >::data(), DC, emitComments(), emitLatency(), llvm::MCDisassembler::Fail, llvm::LLVMDisasmContext::getDisAsm(), llvm::MCDisassembler::getInstruction(), llvm::LLVMDisasmContext::getIP(), llvm::LLVMDisasmContext::getOptions(), llvm::LLVMDisasmContext::getSubtargetInfo(), llvm_unreachable, LLVMDisassembler_Option_PrintLatency, llvm::Intrinsic::memcpy, llvm::nulls(), llvm::MCInstPrinter::printInst(), Size, llvm::SmallVectorBase::size(), llvm::MCDisassembler::SoftFail, llvm::raw_svector_ostream::str(), and llvm::MCDisassembler::Success.
int LLVMSetDisasmOptions | ( | LLVMDisasmContextRef | DC, |
uint64_t | Options | ||
) |
Set the disassembler's options.
Returns 1 if it can set the Options and 0 otherwise.
Definition at line 298 of file Disassembler.cpp.
References llvm::LLVMDisasmContext::addOptions(), llvm::LLVMDisasmContext::CommentStream, llvm::Target::createMCInstPrinter(), DC, llvm::LLVMDisasmContext::getAsmInfo(), llvm::MCAsmInfo::getAssemblerDialect(), llvm::LLVMDisasmContext::getInstrInfo(), llvm::LLVMDisasmContext::getIP(), llvm::LLVMDisasmContext::getRegisterInfo(), llvm::LLVMDisasmContext::getTarget(), llvm::LLVMDisasmContext::getTripleName(), LLVMDisassembler_Option_AsmPrinterVariant, LLVMDisassembler_Option_PrintImmHex, LLVMDisassembler_Option_PrintLatency, LLVMDisassembler_Option_SetInstrComments, LLVMDisassembler_Option_UseMarkup, MRI, llvm::MCInstPrinter::setCommentStream(), llvm::LLVMDisasmContext::setIP(), llvm::MCInstPrinter::setPrintImmHex(), and llvm::MCInstPrinter::setUseMarkup().