teach various passes about blockaddress. We no longer

crash on any clang tests.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@85465 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Chris Lattner
2009-10-29 01:21:20 +00:00
parent 78c5cdaf2a
commit 4c0236fd8b
3 changed files with 58 additions and 34 deletions
+7 -7
View File
@@ -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