ExecutionEngine::InstallLazyFunctionCreator takes a function pointer, which prevents passing lambdas that capture state or member functions. With this commit, InstallLazyFunctionCreator takes a std::function parameter which allows lambdas and member functions to be used.
The original patch failed on ARM due to an unexpected additional unresolved function ('__aeabi_unwind_cpp_pr0'):
- http://lab.llvm.org:8011/builders/clang-cmake-armv7-a15-selfhost/builds/4137/steps/ninja%20check%202/logs/FAIL%3A%20LLVM-Unit%3A%3AMCJITTest.lazy_function_creator_pointer
- http://lab.llvm.org:8011/builders/clang-cmake-armv7-a15-selfhost/builds/4137/steps/ninja%20check%202/logs/FAIL%3A%20LLVM-Unit%3A%3AMCJITTest.lazy_function_creator_lambda
This patch has been updated to resolve this issue. It also includes Lang's follow-up commits (r241962, r241974).