It's incompletete -- it wasn't filling ReferenceType so it was causing
garbagge on the disassembly. Furthermore it seems impossible to get the
jump information through this interface.
The solution for function size problem is to effectively book-keep the
machine code start and end address while JIT'ing.
-static const char *
-disassemblerSymbolLookupCB(void *DisInfo,
- uint64_t ReferenceValue,
- uint64_t *ReferenceType,
- uint64_t ReferencePC,
- const char **ReferenceName)
-{
- // TODO: Maybe this can be used to guess jumps
- return NULL;
-}
-
-
/*
* Disassemble a function, using the LLVM MC disassembler.
*
/*
* Disassemble a function, using the LLVM MC disassembler.
*
*/
std::string Triple = llvm::sys::getProcessTriple();
*/
std::string Triple = llvm::sys::getProcessTriple();
- LLVMDisasmContextRef D = LLVMCreateDisasm(Triple.c_str(), NULL, 0, NULL, &disassemblerSymbolLookupCB);
+ LLVMDisasmContextRef D = LLVMCreateDisasm(Triple.c_str(), NULL, 0, NULL, NULL);
char outline[1024];
if (!D) {
char outline[1024];
if (!D) {