mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-02-08 21:32:39 +00:00
Consider ConstantAggregateZero as well as ConstantArray/Struct.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@129338 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
bbfc3b3098
commit
ceb465a8a4
@ -151,10 +151,12 @@ void llvm::InsertProfilingShutdownCall(Function *Callee, Module *Mod) {
|
|||||||
// delete it, to replace it with one that has a larger array type.
|
// delete it, to replace it with one that has a larger array type.
|
||||||
std::vector<Constant *> dtors;
|
std::vector<Constant *> dtors;
|
||||||
if (GlobalVariable *GlobalDtors = Mod->getNamedGlobal("llvm.global_dtors")) {
|
if (GlobalVariable *GlobalDtors = Mod->getNamedGlobal("llvm.global_dtors")) {
|
||||||
ConstantArray *InitList =
|
if (ConstantArray *InitList =
|
||||||
cast<ConstantArray>(GlobalDtors->getInitializer());
|
dyn_cast<ConstantArray>(GlobalDtors->getInitializer())) {
|
||||||
for (unsigned i = 0, e = InitList->getType()->getNumElements(); i != e; ++i)
|
for (unsigned i = 0, e = InitList->getType()->getNumElements();
|
||||||
|
i != e; ++i)
|
||||||
dtors.push_back(cast<Constant>(InitList->getOperand(i)));
|
dtors.push_back(cast<Constant>(InitList->getOperand(i)));
|
||||||
|
}
|
||||||
GlobalDtors->eraseFromParent();
|
GlobalDtors->eraseFromParent();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user