[ORC][C-bindings] Add access to LLJIT IRTransformLayer, ThreadSafeModule utils.
authorLang Hames <lhames@gmail.com>
Sat, 19 Jun 2021 01:41:42 +0000 (11:41 +1000)
committerLang Hames <lhames@gmail.com>
Sat, 19 Jun 2021 01:50:27 +0000 (11:50 +1000)
commit80f30a6b855b7aa96b99205c986972483d75822e
tree8e071e8cfb2276c41ef9431a6ef90395f75fdcdd
parent9b699450dd66df258cb424470fcb1ea737a99341
[ORC][C-bindings] Add access to LLJIT IRTransformLayer, ThreadSafeModule utils.

This patch was derived from Valentin Churavy's work in
https://reviews.llvm.org/D104480. It adds support for setting the transform on
an IRTransformLayer, and for accessing the IRTransformLayer in LLJIT. It also
adds access to the ThreadSafeModule::withModuleDo method for thread-safe
access to modules.

A new example has been added to show how to use these APIs to optimize a module
during materialization.

Thanks Valentin!

Reviewed By: lhames

Differential Revision: https://reviews.llvm.org/D103855
llvm/examples/OrcV2Examples/CMakeLists.txt
llvm/examples/OrcV2Examples/OrcV2CBindingsIRTransforms/CMakeLists.txt [new file with mode: 0644]
llvm/examples/OrcV2Examples/OrcV2CBindingsIRTransforms/OrcV2CBindingsIRTransforms.c [new file with mode: 0644]
llvm/include/llvm-c/LLJIT.h
llvm/include/llvm-c/Orc.h
llvm/lib/ExecutionEngine/Orc/OrcV2CBindings.cpp