mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2024-07-24 08:29:39 +00:00
Make sure the initialization of a GC root is after its definition.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@101388 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
764f62ba60
commit
8538f0496a
@ -181,9 +181,10 @@ bool LowerIntrinsics::InsertRootInitializers(Function &F, AllocaInst **Roots,
|
|||||||
|
|
||||||
for (AllocaInst **I = Roots, **E = Roots + Count; I != E; ++I)
|
for (AllocaInst **I = Roots, **E = Roots + Count; I != E; ++I)
|
||||||
if (!InitedRoots.count(*I)) {
|
if (!InitedRoots.count(*I)) {
|
||||||
new StoreInst(ConstantPointerNull::get(cast<PointerType>(
|
StoreInst* SI = new StoreInst(ConstantPointerNull::get(cast<PointerType>(
|
||||||
cast<PointerType>((*I)->getType())->getElementType())),
|
cast<PointerType>((*I)->getType())->getElementType())),
|
||||||
*I, IP);
|
*I);
|
||||||
|
SI->insertAfter(*I);
|
||||||
MadeChange = true;
|
MadeChange = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user