diff options
author | Adrian Prantl <aprantl@apple.com> | 2017-12-08 21:58:18 +0000 |
---|---|---|
committer | Adrian Prantl <aprantl@apple.com> | 2017-12-08 21:58:18 +0000 |
commit | d13170174c656a6dbf2f4b30b638645d6e0727fd (patch) | |
tree | 48e17ffc3aa57c3277dd85aa052f4075a22f6cb5 /llvm/lib/CodeGen | |
parent | 195dfd10a679ed4860200e935d1ca292d09bb64b (diff) | |
download | bcm5719-llvm-d13170174c656a6dbf2f4b30b638645d6e0727fd.tar.gz bcm5719-llvm-d13170174c656a6dbf2f4b30b638645d6e0727fd.zip |
Generalize llvm::replaceDbgDeclare and actually support the use-case that
is mentioned in the documentation (inserting a deref before the plus_uconst).
llvm-svn: 320203
Diffstat (limited to 'llvm/lib/CodeGen')
-rw-r--r-- | llvm/lib/CodeGen/SafeStack.cpp | 8 | ||||
-rw-r--r-- | llvm/lib/CodeGen/SelectionDAG/SelectionDAG.cpp | 1 |
2 files changed, 6 insertions, 3 deletions
diff --git a/llvm/lib/CodeGen/SafeStack.cpp b/llvm/lib/CodeGen/SafeStack.cpp index e68f6e10a2a..51233be521b 100644 --- a/llvm/lib/CodeGen/SafeStack.cpp +++ b/llvm/lib/CodeGen/SafeStack.cpp @@ -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(); } diff --git a/llvm/lib/CodeGen/SelectionDAG/SelectionDAG.cpp b/llvm/lib/CodeGen/SelectionDAG/SelectionDAG.cpp index bcc972e0b4f..e45c632c93b 100644 --- a/llvm/lib/CodeGen/SelectionDAG/SelectionDAG.cpp +++ b/llvm/lib/CodeGen/SelectionDAG/SelectionDAG.cpp @@ -7130,6 +7130,7 @@ void SelectionDAG::salvageDebugInfo(SDNode &N) { // DW_OP_stack_value. auto *DIExpr = DV->getExpression(); DIExpr = DIExpression::prepend(DIExpr, DIExpression::NoDeref, Offset, + DIExpression::NoDeref, DIExpression::WithStackValue); SDDbgValue *Clone = getDbgValue(DV->getVariable(), DIExpr, N0.getNode(), N0.getResNo(), |