[PATCH] D12607: [ExecutionEngine] Add to the C API possibility to create custom SectionMemoryManager

Jauhien Piatlicki via llvm-commits llvm-commits at lists.llvm.org
Thu Sep 3 13:41:54 PDT 2015


jauhien created this revision.
jauhien added a subscriber: llvm-commits.

New set of functions in ExecutionEngine C API allows to create custom memory manager
based on the SectionMemoryManager with some of methods overridden by user.
Supprot for LLVM RTTI was added to memory managers hierarchy as this is necessary for
easy implementation of functions that call parent methods.

This change is useful e.g. for implementing custom JIT with the need of symbol resolution
similar to the one from MCJIT variant of the Kaleidoscope tutorial. SectionMemoryManager
can be reused in this case with only getSymbolAddress overriden with the appropriate callback.

This patch is taken with minor changes from my Rust LLVM bindings (https://github.com/jauhien/iron-llvm) used at the moment in the Rust LLVM Kaleidoscope tutorial (https://github.com/jauhien/iron-kaleidoscope). There a relevant example of real use can be found (https://github.com/jauhien/iron-llvm/blob/master/src/execution_engine/{memory_manager.rs,wrappers.rs} and https://github.com/jauhien/iron-kaleidoscope/blob/master/src/jitter.rs).

http://reviews.llvm.org/D12607

Files:
  include/llvm-c/ExecutionEngine.h
  include/llvm/ExecutionEngine/RTDyldMemoryManager.h
  include/llvm/ExecutionEngine/SectionMemoryManager.h
  lib/ExecutionEngine/ExecutionEngineBindings.cpp
  tools/lli/RemoteMemoryManager.h
  tools/llvm-rtdyld/llvm-rtdyld.cpp

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D12607.33965.patch
Type: text/x-patch
Size: 16456 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20150903/72b1e053/attachment-0001.bin>


More information about the llvm-commits mailing list