diff options
author | Richard Smith <richard-llvm@metafoo.co.uk> | 2014-05-06 01:44:26 +0000 |
---|---|---|
committer | Richard Smith <richard-llvm@metafoo.co.uk> | 2014-05-06 01:44:26 +0000 |
commit | c167d656e76c6641efbbafd68a488187739dc21f (patch) | |
tree | 250256984d75ff99274fda3370843da0045a51bc /llvm/lib/Transforms/Utils/CtorUtils.cpp | |
parent | 09bf11693964ed6ea6b010c4843b577dd4fbb96b (diff) | |
download | bcm5719-llvm-c167d656e76c6641efbbafd68a488187739dc21f.tar.gz bcm5719-llvm-c167d656e76c6641efbbafd68a488187739dc21f.zip |
Re-commit r208025, reverted in r208030, with a fix for a conformance issue
which GCC detects and Clang does not!
llvm-svn: 208033
Diffstat (limited to 'llvm/lib/Transforms/Utils/CtorUtils.cpp')
-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; |