diff --git a/llvm/lib/Target/AArch64/AArch64StackTagging.cpp b/llvm/lib/Target/AArch64/AArch64StackTagging.cpp index 072b29fb3dfa34..42193c584346f7 100644 --- a/llvm/lib/Target/AArch64/AArch64StackTagging.cpp +++ b/llvm/lib/Target/AArch64/AArch64StackTagging.cpp @@ -586,14 +586,14 @@ bool AArch64StackTagging::runOnFunction(Function &Fn) { uint64_t Size = *Info.AI->getAllocationSizeInBits(*DL) / 8; Value *Ptr = IRB.CreatePointerCast(TagPCall, IRB.getInt8PtrTy()); tagAlloca(AI, &*IRB.GetInsertPoint(), Ptr, Size); - for (auto &RI : SInfo.RetVec) { + for (auto *RI : SInfo.RetVec) { untagAlloca(AI, RI, Size); } // We may have inserted tag/untag outside of any lifetime interval. // Remove all lifetime intrinsics for this alloca. - for (auto &II : Info.LifetimeStart) + for (auto *II : Info.LifetimeStart) II->eraseFromParent(); - for (auto &II : Info.LifetimeEnd) + for (auto *II : Info.LifetimeEnd) II->eraseFromParent(); } @@ -604,7 +604,7 @@ bool AArch64StackTagging::runOnFunction(Function &Fn) { // If we have instrumented at least one alloca, all unrecognized lifetime // intrinsics have to go. - for (auto &I : SInfo.UnrecognizedLifetimes) + for (auto *I : SInfo.UnrecognizedLifetimes) I->eraseFromParent(); return true;