diff options
author | Richard Smith <richard-llvm@metafoo.co.uk> | 2014-05-06 01:01:29 +0000 |
---|---|---|
committer | Richard Smith <richard-llvm@metafoo.co.uk> | 2014-05-06 01:01:29 +0000 |
commit | 6cf1d744d85ad3f341005f2346445d19b1479c66 (patch) | |
tree | 6ada479c8ffe4c13a2d27044d76e49ee73e79cea /llvm/lib/Transforms/Utils | |
parent | f129f72e434afa2889af47b552b165137420f664 (diff) | |
download | bcm5719-llvm-6cf1d744d85ad3f341005f2346445d19b1479c66.tar.gz bcm5719-llvm-6cf1d744d85ad3f341005f2346445d19b1479c66.zip |
Add llvm::function_ref (and a couple of uses of it), representing a type-erased reference to a callable object.
llvm-svn: 208025
Diffstat (limited to 'llvm/lib/Transforms/Utils')
-rw-r--r-- | llvm/lib/Transforms/Utils/CtorUtils.cpp | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/llvm/lib/Transforms/Utils/CtorUtils.cpp b/llvm/lib/Transforms/Utils/CtorUtils.cpp index 0082df01214..7cf793f6266 100644 --- a/llvm/lib/Transforms/Utils/CtorUtils.cpp +++ b/llvm/lib/Transforms/Utils/CtorUtils.cpp @@ -132,8 +132,8 @@ GlobalVariable *findGlobalCtors(Module &M) { /// Call "ShouldRemove" for every entry in M's global_ctor list and remove the /// entries for which it returns true. Return true if anything changed. -bool optimizeGlobalCtorsList(Module &M, ShouldRemoveCtor ShouldRemove, - void *Context) { +bool optimizeGlobalCtorsList(Module &M, + function_ref<bool(Function *)> ShouldRemove) { GlobalVariable *GlobalCtors = findGlobalCtors(M); if (!GlobalCtors) return false; @@ -163,7 +163,7 @@ bool optimizeGlobalCtorsList(Module &M, ShouldRemoveCtor ShouldRemove, continue; // If we can evaluate the ctor at compile time, do. - if (ShouldRemove(Context, F)) { + if (ShouldRemove(F)) { Ctors.erase(Ctors.begin() + i); MadeChange = true; --i; |