mirror of
https://github.com/RPCS3/llvm-mirror.git
synced 2024-11-24 19:52:54 +01:00
Make sure the initialization of a GC root is after its definition.
llvm-svn: 101388
This commit is contained in:
parent
a1cca8a579
commit
2a7f992240
@ -181,9 +181,10 @@ bool LowerIntrinsics::InsertRootInitializers(Function &F, AllocaInst **Roots,
|
||||
|
||||
for (AllocaInst **I = Roots, **E = Roots + Count; I != E; ++I)
|
||||
if (!InitedRoots.count(*I)) {
|
||||
new StoreInst(ConstantPointerNull::get(cast<PointerType>(
|
||||
cast<PointerType>((*I)->getType())->getElementType())),
|
||||
*I, IP);
|
||||
StoreInst* SI = new StoreInst(ConstantPointerNull::get(cast<PointerType>(
|
||||
cast<PointerType>((*I)->getType())->getElementType())),
|
||||
*I);
|
||||
SI->insertAfter(*I);
|
||||
MadeChange = true;
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user