mirror of
https://github.com/RPCS3/llvm-mirror.git
synced 2025-04-07 02:01:43 +00:00
Consider ConstantAggregateZero as well as ConstantArray/Struct.
llvm-svn: 129338
This commit is contained in:
parent
72a09952de
commit
a3308fd26f
@ -151,10 +151,12 @@ void llvm::InsertProfilingShutdownCall(Function *Callee, Module *Mod) {
|
||||
// delete it, to replace it with one that has a larger array type.
|
||||
std::vector<Constant *> dtors;
|
||||
if (GlobalVariable *GlobalDtors = Mod->getNamedGlobal("llvm.global_dtors")) {
|
||||
ConstantArray *InitList =
|
||||
cast<ConstantArray>(GlobalDtors->getInitializer());
|
||||
for (unsigned i = 0, e = InitList->getType()->getNumElements(); i != e; ++i)
|
||||
if (ConstantArray *InitList =
|
||||
dyn_cast<ConstantArray>(GlobalDtors->getInitializer())) {
|
||||
for (unsigned i = 0, e = InitList->getType()->getNumElements();
|
||||
i != e; ++i)
|
||||
dtors.push_back(cast<Constant>(InitList->getOperand(i)));
|
||||
}
|
||||
GlobalDtors->eraseFromParent();
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user