diff options
author | Dimitry Andric <dim@FreeBSD.org> | 2020-07-26 19:36:28 +0000 |
---|---|---|
committer | Dimitry Andric <dim@FreeBSD.org> | 2020-07-26 19:36:28 +0000 |
commit | cfca06d7963fa0909f90483b42a6d7d194d01e08 (patch) | |
tree | 209fb2a2d68f8f277793fc8df46c753d31bc853b /llvm/lib/CodeGen/GCRootLowering.cpp | |
parent | 706b4fc47bbc608932d3b491ae19a3b9cde9497b (diff) |
Notes
Diffstat (limited to 'llvm/lib/CodeGen/GCRootLowering.cpp')
-rw-r--r-- | llvm/lib/CodeGen/GCRootLowering.cpp | 14 |
1 files changed, 5 insertions, 9 deletions
diff --git a/llvm/lib/CodeGen/GCRootLowering.cpp b/llvm/lib/CodeGen/GCRootLowering.cpp index 90e5f32f53b3a..c6730aa6b00d8 100644 --- a/llvm/lib/CodeGen/GCRootLowering.cpp +++ b/llvm/lib/CodeGen/GCRootLowering.cpp @@ -57,7 +57,6 @@ public: /// GCMetadata record for each function. class GCMachineCodeAnalysis : public MachineFunctionPass { GCFunctionInfo *FI; - MachineModuleInfo *MMI; const TargetInstrInfo *TII; void FindSafePoints(MachineFunction &MF); @@ -160,10 +159,9 @@ static bool InsertRootInitializers(Function &F, ArrayRef<AllocaInst *> Roots) { for (AllocaInst *Root : Roots) if (!InitedRoots.count(Root)) { - StoreInst *SI = new StoreInst( + new StoreInst( ConstantPointerNull::get(cast<PointerType>(Root->getAllocatedType())), - Root); - SI->insertAfter(Root); + Root, Root->getNextNode()); MadeChange = true; } @@ -189,12 +187,12 @@ bool LowerIntrinsics::runOnFunction(Function &F) { /// need to be able to ensure each root has been initialized by the point the /// first safepoint is reached. This really should have been done by the /// frontend, but the old API made this non-obvious, so we do a potentially -/// redundant store just in case. +/// redundant store just in case. bool LowerIntrinsics::DoLowering(Function &F, GCStrategy &S) { SmallVector<AllocaInst *, 32> Roots; bool MadeChange = false; - for (BasicBlock &BB : F) + for (BasicBlock &BB : F) for (BasicBlock::iterator II = BB.begin(), E = BB.end(); II != E;) { IntrinsicInst *CI = dyn_cast<IntrinsicInst>(II++); if (!CI) @@ -250,7 +248,6 @@ GCMachineCodeAnalysis::GCMachineCodeAnalysis() : MachineFunctionPass(ID) {} void GCMachineCodeAnalysis::getAnalysisUsage(AnalysisUsage &AU) const { MachineFunctionPass::getAnalysisUsage(AU); AU.setPreservesAll(); - AU.addRequired<MachineModuleInfoWrapperPass>(); AU.addRequired<GCModuleInfo>(); } @@ -297,7 +294,7 @@ void GCMachineCodeAnalysis::FindStackOffsets(MachineFunction &MF) { if (MF.getFrameInfo().isDeadObjectIndex(RI->Num)) { RI = FI->removeStackRoot(RI); } else { - unsigned FrameReg; // FIXME: surely GCRoot ought to store the + Register FrameReg; // FIXME: surely GCRoot ought to store the // register that the offset is from? RI->StackOffset = TFI->getFrameIndexReference(MF, RI->Num, FrameReg); ++RI; @@ -311,7 +308,6 @@ bool GCMachineCodeAnalysis::runOnMachineFunction(MachineFunction &MF) { return false; FI = &getAnalysis<GCModuleInfo>().getFunctionInfo(MF.getFunction()); - MMI = &getAnalysis<MachineModuleInfoWrapperPass>().getMMI(); TII = MF.getSubtarget().getInstrInfo(); // Find the size of the stack frame. There may be no correct static frame |