summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Transforms/IPO
diff options
context:
space:
mode:
authorChris Lattner <sabre@nondot.org>2009-10-29 01:21:20 +0000
committerChris Lattner <sabre@nondot.org>2009-10-29 01:21:20 +0000
commitee8b951e73a9580ada11725ccd2e4f49e758b34f (patch)
tree09cde592fd25f78f27a784961ca8038ed2aeb2f8 /llvm/lib/Transforms/IPO
parent29fb551a36dda8f60293908a63f100dd2561f126 (diff)
downloadbcm5719-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.cpp14
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
OpenPOWER on IntegriCloud