This is an archive of the discontinued LLVM Phabricator instance.

[PassManager] Make PassManagerBuilder::addExtension take an std::function, rather than a function pointer.
ClosedPublic

Authored by jlebar on Mar 30 2016, 11:51 AM.

Details

Summary

This gives callers flexibility to pass lambdas with captures, which lets
callers avoid the C-style void*-ptr closure style. (Currently, callers
in clang store state in the PassManagerBuilderBase arg.)

No functional change, and the new API is backwards-compatible.

Diff Detail

Repository
rL LLVM

Event Timeline

jlebar updated this revision to Diff 52096.Mar 30 2016, 11:51 AM
jlebar retitled this revision from to [PassManager] Make PassManagerBuilder::addExtension take an std::function, rather than a function pointer..
jlebar updated this object.
jlebar added a reviewer: chandlerc.
jlebar added a subscriber: cfe-commits.
jlebar edited subscribers, added: llvm-commits; removed: cfe-commits.Mar 30 2016, 11:53 AM
mehdi_amini accepted this revision.Mar 30 2016, 11:54 AM
mehdi_amini added a reviewer: mehdi_amini.

LGTM.
Adding stuff in PassManagerBuilderBase for the purpose of extension was... unfortunate.

This revision is now accepted and ready to land.Mar 30 2016, 11:54 AM
This revision was automatically updated to reflect the committed changes.