mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2026-04-26 12:20:42 +00:00
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:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user