[llvm-dev] Creating a LLVM Execution Engine for Interpreter

Manoj via llvm-dev llvm-dev at lists.llvm.org
Tue Aug 27 23:08:02 PDT 2019


Hello All,

I am using LLVM-8.0 and creating an Execution Engine as below of kind
Interpreter. Am I doing it right Please let me know.

int loadIRFile__name(const char *filename) {

LLVMContext *contextHandle = new LLVMContext();

SMDiagnostic error;

// Load the bitcode from the .bc file
Module *moduleHandle = parseIRFile(filename, error, *me).release();

return (intptr_t) moduleHandle;

}

int EngineBuilder__create(moduleHandle) {

std::unique_ptr<Module> parModule((Module*) moduleHandle);

EngineBuilder *engineBuilder = new EngineBuilder(std::move(parModule));

return (intptr_t) engineBuilder;

}

void EngineBuilder__setInterpreter(ebHandle) {

EngineBuilder *eb = (EngineBuilder*)_me;

eb->setEngineKind(EngineKind::Interpreter);

}

int ExecutionEngine__build(ebHandle) {

EngineBuilder *me = (EngineBuilder*)ebHandle;

ExecutionEngine *executionEngine = me->create();

return (intptr_t) executionEngine;

}

I need to return the pointer as int


Best regards

Manoj
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20190828/5f776e4c/attachment.html>


More information about the llvm-dev mailing list