Rework ExecutionEngine::invoke() to make it more friendly to use from C++
authorMehdi Amini <joker.eph@gmail.com>
Sat, 6 Feb 2021 01:32:40 +0000 (01:32 +0000)
committerMehdi Amini <joker.eph@gmail.com>
Sat, 6 Feb 2021 01:32:50 +0000 (01:32 +0000)
commitd6efb6fc86a6ded63fc50e3a31377a1f4aa33c6e
tree4f8190338a61d30246d09c384db5b5889c6e73d9
parent0453d2ddb4742e550b85f204424e04dcd7b9db00
Rework ExecutionEngine::invoke() to make it more friendly to use from C++

This new invoke will pack a list of argument before calling the
`invokePacked` method. It accepts returned value as output argument
wrapped in `ExecutionEngine::Result<T>`, and delegate the packing of
arguments to a trait to allow for customization for some types.

Reviewed By: ftynse

Differential Revision: https://reviews.llvm.org/D95961
mlir/include/mlir/ExecutionEngine/ExecutionEngine.h
mlir/lib/ExecutionEngine/ExecutionEngine.cpp
mlir/unittests/CMakeLists.txt
mlir/unittests/ExecutionEngine/CMakeLists.txt [new file with mode: 0644]
mlir/unittests/ExecutionEngine/Invoke.cpp [new file with mode: 0644]