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/IPO/GlobalDCE.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/IPO/GlobalDCE.cpp')
-rw-r--r-- | llvm/lib/Transforms/IPO/GlobalDCE.cpp | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/llvm/lib/Transforms/IPO/GlobalDCE.cpp b/llvm/lib/Transforms/IPO/GlobalDCE.cpp index 03b17d52386..9decddcff80 100644 --- a/llvm/lib/Transforms/IPO/GlobalDCE.cpp +++ b/llvm/lib/Transforms/IPO/GlobalDCE.cpp @@ -54,16 +54,16 @@ namespace { bool RemoveUnusedGlobalValue(GlobalValue &GV); }; +} /// Returns true if F contains only a single "ret" instruction. -bool isEmptyFunction(void *Context, Function *F) { +static bool isEmptyFunction(Function *F) { BasicBlock &Entry = F->getEntryBlock(); if (Entry.size() != 1 || !isa<ReturnInst>(Entry.front())) return false; ReturnInst &RI = cast<ReturnInst>(Entry.front()); return RI.getReturnValue() == NULL; } -} char GlobalDCE::ID = 0; INITIALIZE_PASS(GlobalDCE, "globaldce", @@ -75,7 +75,7 @@ bool GlobalDCE::runOnModule(Module &M) { bool Changed = false; // Remove empty functions from the global ctors list. - Changed |= optimizeGlobalCtorsList(M, isEmptyFunction, nullptr); + Changed |= optimizeGlobalCtorsList(M, isEmptyFunction); // Loop over the module, adding globals which are obviously necessary. for (Module::iterator I = M.begin(), E = M.end(); I != E; ++I) { |