mirror of
https://github.com/RPCS3/llvm.git
synced 2026-07-21 03:05:26 -04:00
Generalize llvm::replaceDbgDeclare and actually support the use-case that
is mentioned in the documentation (inserting a deref before the plus_uconst). git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@320203 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
@@ -558,7 +558,7 @@ Value *SafeStack::moveStaticAllocasToUnsafeStack(
|
||||
|
||||
// Replace alloc with the new location.
|
||||
replaceDbgDeclare(Arg, BasePointer, BasePointer->getNextNode(), DIB,
|
||||
/*Deref=*/false, -Offset);
|
||||
DIExpression::NoDeref, -Offset, DIExpression::NoDeref);
|
||||
Arg->replaceAllUsesWith(NewArg);
|
||||
IRB.SetInsertPoint(cast<Instruction>(NewArg)->getNextNode());
|
||||
IRB.CreateMemCpy(Off, Arg, Size, Arg->getParamAlignment());
|
||||
@@ -573,7 +573,8 @@ Value *SafeStack::moveStaticAllocasToUnsafeStack(
|
||||
if (Size == 0)
|
||||
Size = 1; // Don't create zero-sized stack objects.
|
||||
|
||||
replaceDbgDeclareForAlloca(AI, BasePointer, DIB, /*Deref=*/false, -Offset);
|
||||
replaceDbgDeclareForAlloca(AI, BasePointer, DIB, DIExpression::NoDeref,
|
||||
-Offset, DIExpression::NoDeref);
|
||||
replaceDbgValueForAlloca(AI, BasePointer, DIB, -Offset);
|
||||
|
||||
// Replace uses of the alloca with the new location.
|
||||
@@ -663,7 +664,8 @@ void SafeStack::moveDynamicAllocasToUnsafeStack(
|
||||
if (AI->hasName() && isa<Instruction>(NewAI))
|
||||
NewAI->takeName(AI);
|
||||
|
||||
replaceDbgDeclareForAlloca(AI, NewAI, DIB, /*Deref=*/false);
|
||||
replaceDbgDeclareForAlloca(AI, NewAI, DIB, DIExpression::NoDeref, 0,
|
||||
DIExpression::NoDeref);
|
||||
AI->replaceAllUsesWith(NewAI);
|
||||
AI->eraseFromParent();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user