[PassManager] Make PassManagerBuilder::addExtension take an std::function, rather...
authorJustin Lebar <jlebar@google.com>
Wed, 30 Mar 2016 20:39:29 +0000 (20:39 +0000)
committerJustin Lebar <jlebar@google.com>
Wed, 30 Mar 2016 20:39:29 +0000 (20:39 +0000)
commit2fe132311205aa143f976c4922891a40d87583c3
treeb0cfaf65d3a92770fe4f00f790e44cf6d05b07dd
parentc73c9d273dfe5b12ae50cc5f1a6c7b763ee1a746
[PassManager] Make PassManagerBuilder::addExtension take an std::function, rather than a function pointer.

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.

Reviewers: chandlerc

Subscribers: joker.eph, cfe-commits

Differential Revision: http://reviews.llvm.org/D18613

llvm-svn: 264918
llvm/include/llvm/Transforms/IPO/PassManagerBuilder.h
llvm/lib/Transforms/IPO/PassManagerBuilder.cpp