From 6cf1d744d85ad3f341005f2346445d19b1479c66 Mon Sep 17 00:00:00 2001 From: Richard Smith Date: Tue, 6 May 2014 01:01:29 +0000 Subject: Add llvm::function_ref (and a couple of uses of it), representing a type-erased reference to a callable object. llvm-svn: 208025 --- llvm/lib/Transforms/Utils/CtorUtils.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'llvm/lib/Transforms/Utils') 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 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; -- cgit v1.2.3