This is an archive of the discontinued LLVM Phabricator instance.

[JIT] Use std::function with InstallLazyFunctionCreator
ClosedPublic

Authored by pasaulais on Jul 6 2015, 6:44 AM.

Details

Reviewers
lhames
Summary

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.

Diff Detail

Repository
rL LLVM

Event Timeline

pasaulais updated this revision to Diff 29083.Jul 6 2015, 6:44 AM
pasaulais retitled this revision from to [JIT] Use std::function with InstallLazyFunctionCreator.
pasaulais updated this object.
pasaulais added a reviewer: lhames.
pasaulais set the repository for this revision to rL LLVM.
pasaulais added a subscriber: llvm-commits.
lhames edited edge metadata.Jul 6 2015, 11:28 AM

Looks good to me. Thanks Pierre.

Do you have commit access? Otherwise I can commit this for you.

lhames accepted this revision.Jul 6 2015, 11:28 AM
lhames edited edge metadata.
This revision is now accepted and ready to land.Jul 6 2015, 11:28 AM

Thanks for the review Lang. I don't have commit access yet, it would be great if you could commit the changes for me.

lhames added a comment.Jul 9 2015, 2:14 PM

Hi Pierre,

My apologies - I just realized this doesn't have a unit-test. Would you be able to write one up?

If not, I'll try to get to it tomorrow, but I'm a bit swamped at the moment.

Cheers,
Lang.

pasaulais updated this revision to Diff 29438.Jul 10 2015, 4:01 AM
pasaulais edited edge metadata.

Hi Lang,

My bad, here is a couple unit tests (for both the old function pointer use case and the new lambda / std::function one).

Cheers,
Pierre-Andre

lhames closed this revision.Jul 10 2015, 4:03 PM

Thanks Pierre-Andre! Committed in r241962.

Thanks Lang! I have noticed that this commit was reverted due to tests failing on ARM. I'll create another review with an updated patch.