forked from OSchip/llvm-project
Make sure the initialization of a GC root is after its definition.
llvm-svn: 101388
This commit is contained in:
parent
839cdaa70a
commit
19cd1d84ad
|
@ -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