diff options
| author | Chris Lattner <sabre@nondot.org> | 2009-10-29 01:21:20 +0000 |
|---|---|---|
| committer | Chris Lattner <sabre@nondot.org> | 2009-10-29 01:21:20 +0000 |
| commit | ee8b951e73a9580ada11725ccd2e4f49e758b34f (patch) | |
| tree | 09cde592fd25f78f27a784961ca8038ed2aeb2f8 /llvm/lib/Transforms/IPO | |
| parent | 29fb551a36dda8f60293908a63f100dd2561f126 (diff) | |
| download | bcm5719-llvm-ee8b951e73a9580ada11725ccd2e4f49e758b34f.tar.gz bcm5719-llvm-ee8b951e73a9580ada11725ccd2e4f49e758b34f.zip | |
teach various passes about blockaddress. We no longer
crash on any clang tests.
llvm-svn: 85465
Diffstat (limited to 'llvm/lib/Transforms/IPO')
| -rw-r--r-- | llvm/lib/Transforms/IPO/GlobalDCE.cpp | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/llvm/lib/Transforms/IPO/GlobalDCE.cpp b/llvm/lib/Transforms/IPO/GlobalDCE.cpp index af4711e0928..cfab6b27d15 100644 --- a/llvm/lib/Transforms/IPO/GlobalDCE.cpp +++ b/llvm/lib/Transforms/IPO/GlobalDCE.cpp @@ -191,13 +191,13 @@ void GlobalDCE::GlobalIsNeeded(GlobalValue *G) { void GlobalDCE::MarkUsedGlobalsAsNeeded(Constant *C) { if (GlobalValue *GV = dyn_cast<GlobalValue>(C)) - GlobalIsNeeded(GV); - else { - // Loop over all of the operands of the constant, adding any globals they - // use to the list of needed globals. - for (User::op_iterator I = C->op_begin(), E = C->op_end(); I != E; ++I) - MarkUsedGlobalsAsNeeded(cast<Constant>(*I)); - } + return GlobalIsNeeded(GV); + + // Loop over all of the operands of the constant, adding any globals they + // use to the list of needed globals. + for (User::op_iterator I = C->op_begin(), E = C->op_end(); I != E; ++I) + if (Constant *OpC = dyn_cast<Constant>(*I)) + MarkUsedGlobalsAsNeeded(OpC); } // RemoveUnusedGlobalValue - Loop over all of the uses of the specified |

