[safestack] Fixup llvm.dbg.value when rewriting unsafe allocas.

When moving unsafe allocas to the unsafe stack, dbg.declare intrinsics are
updated to refer to the new location.

This change does the same to dbg.value intrinsics.

llvm-svn: 272968
This commit is contained in:
Evgeniy Stepanov
2016-06-16 22:34:00 +00:00
parent 205bb618de
commit 72d961a1da
5 changed files with 237 additions and 19 deletions

View File

@@ -614,6 +614,7 @@ Value *SafeStack::moveStaticAllocasToUnsafeStack(
// Replace alloc with the new location.
replaceDbgDeclareForAlloca(AI, BasePointer, DIB, /*Deref=*/true, -StaticOffset);
replaceDbgValueForAlloca(AI, BasePointer, DIB, -StaticOffset);
AI->replaceAllUsesWith(NewAI);
AI->eraseFromParent();
}