diff options
Diffstat (limited to 'llvm/lib/CodeGen')
-rw-r--r-- | llvm/lib/CodeGen/LiveDebugValues.cpp | 6 | ||||
-rw-r--r-- | llvm/lib/CodeGen/LiveDebugVariables.cpp | 6 | ||||
-rw-r--r-- | llvm/lib/CodeGen/MachineInstr.cpp | 2 | ||||
-rw-r--r-- | llvm/lib/CodeGen/PrologEpilogInserter.cpp | 6 | ||||
-rw-r--r-- | llvm/lib/CodeGen/SafeStack.cpp | 9 | ||||
-rw-r--r-- | llvm/lib/CodeGen/SelectionDAG/SelectionDAG.cpp | 5 | ||||
-rw-r--r-- | llvm/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp | 2 |
7 files changed, 19 insertions, 17 deletions
diff --git a/llvm/lib/CodeGen/LiveDebugValues.cpp b/llvm/lib/CodeGen/LiveDebugValues.cpp index 449f10c7ef7..c062542e9c8 100644 --- a/llvm/lib/CodeGen/LiveDebugValues.cpp +++ b/llvm/lib/CodeGen/LiveDebugValues.cpp @@ -462,9 +462,9 @@ void LiveDebugValues::insertTransferDebugPair( // Create a DBG_VALUE instruction to describe the Var in its spilled // location. VarLoc::SpillLoc SpillLocation = extractSpillBaseRegAndOffset(MI); - auto *SpillExpr = - DIExpression::prepend(DMI->getDebugExpression(), DIExpression::NoDeref, - SpillLocation.SpillOffset); + auto *SpillExpr = DIExpression::prepend(DMI->getDebugExpression(), + DIExpression::ApplyOffset, + SpillLocation.SpillOffset); NewDMI = BuildMI(*MF, DMI->getDebugLoc(), DMI->getDesc(), true, SpillLocation.SpillBase, DMI->getDebugVariable(), SpillExpr); diff --git a/llvm/lib/CodeGen/LiveDebugVariables.cpp b/llvm/lib/CodeGen/LiveDebugVariables.cpp index 648d3eefc2a..c3503bd9980 100644 --- a/llvm/lib/CodeGen/LiveDebugVariables.cpp +++ b/llvm/lib/CodeGen/LiveDebugVariables.cpp @@ -1316,11 +1316,13 @@ void UserValue::insertDebugValue(MachineBasicBlock *MBB, SlotIndex StartIdx, // that the original virtual register was a pointer. Also, add the stack slot // offset for the spilled register to the expression. const DIExpression *Expr = Expression; + uint8_t DIExprFlags = DIExpression::ApplyOffset; bool IsIndirect = Loc.wasIndirect(); if (Spilled) { - auto Deref = IsIndirect ? DIExpression::WithDeref : DIExpression::NoDeref; + if (IsIndirect) + DIExprFlags |= DIExpression::DerefAfter; Expr = - DIExpression::prepend(Expr, DIExpression::NoDeref, SpillOffset, Deref); + DIExpression::prepend(Expr, DIExprFlags, SpillOffset); IsIndirect = true; } diff --git a/llvm/lib/CodeGen/MachineInstr.cpp b/llvm/lib/CodeGen/MachineInstr.cpp index 12091577521..be39a726140 100644 --- a/llvm/lib/CodeGen/MachineInstr.cpp +++ b/llvm/lib/CodeGen/MachineInstr.cpp @@ -2075,7 +2075,7 @@ static const DIExpression *computeExprForSpill(const MachineInstr &MI) { const DIExpression *Expr = MI.getDebugExpression(); if (MI.isIndirectDebugValue()) { assert(MI.getOperand(1).getImm() == 0 && "DBG_VALUE with nonzero offset"); - Expr = DIExpression::prepend(Expr, DIExpression::WithDeref); + Expr = DIExpression::prepend(Expr, DIExpression::DerefBefore); } return Expr; } diff --git a/llvm/lib/CodeGen/PrologEpilogInserter.cpp b/llvm/lib/CodeGen/PrologEpilogInserter.cpp index 55925c8cf45..ab6814be694 100644 --- a/llvm/lib/CodeGen/PrologEpilogInserter.cpp +++ b/llvm/lib/CodeGen/PrologEpilogInserter.cpp @@ -1187,11 +1187,13 @@ void PEI::replaceFrameIndices(MachineBasicBlock *BB, MachineFunction &MF, // to be direct. if (MI.isIndirectDebugValue() && DIExpr->isImplicit()) { SmallVector<uint64_t, 2> Ops = {dwarf::DW_OP_deref_size, Size}; - DIExpr = DIExpression::prependOpcodes(DIExpr, Ops, DIExpression::WithStackValue); + bool WithStackValue = true; + DIExpr = DIExpression::prependOpcodes(DIExpr, Ops, WithStackValue); // Make the DBG_VALUE direct. MI.getOperand(1).ChangeToRegister(0, false); } - DIExpr = DIExpression::prepend(DIExpr, DIExpression::NoDeref, Offset); + DIExpr = + DIExpression::prepend(DIExpr, DIExpression::ApplyOffset, Offset); MI.getOperand(3).setMetadata(DIExpr); continue; } diff --git a/llvm/lib/CodeGen/SafeStack.cpp b/llvm/lib/CodeGen/SafeStack.cpp index 6de72bbcb7b..b73a22133a7 100644 --- a/llvm/lib/CodeGen/SafeStack.cpp +++ b/llvm/lib/CodeGen/SafeStack.cpp @@ -576,7 +576,7 @@ Value *SafeStack::moveStaticAllocasToUnsafeStack( // Replace alloc with the new location. replaceDbgDeclare(Arg, BasePointer, BasePointer->getNextNode(), DIB, - DIExpression::NoDeref, -Offset, DIExpression::NoDeref); + DIExpression::ApplyOffset, -Offset); Arg->replaceAllUsesWith(NewArg); IRB.SetInsertPoint(cast<Instruction>(NewArg)->getNextNode()); IRB.CreateMemCpy(Off, Align, Arg, Arg->getParamAlignment(), Size); @@ -591,8 +591,8 @@ Value *SafeStack::moveStaticAllocasToUnsafeStack( if (Size == 0) Size = 1; // Don't create zero-sized stack objects. - replaceDbgDeclareForAlloca(AI, BasePointer, DIB, DIExpression::NoDeref, - -Offset, DIExpression::NoDeref); + replaceDbgDeclareForAlloca(AI, BasePointer, DIB, DIExpression::ApplyOffset, + -Offset); replaceDbgValueForAlloca(AI, BasePointer, DIB, -Offset); // Replace uses of the alloca with the new location. @@ -683,8 +683,7 @@ void SafeStack::moveDynamicAllocasToUnsafeStack( if (AI->hasName() && isa<Instruction>(NewAI)) NewAI->takeName(AI); - replaceDbgDeclareForAlloca(AI, NewAI, DIB, DIExpression::NoDeref, 0, - DIExpression::NoDeref); + replaceDbgDeclareForAlloca(AI, NewAI, DIB, DIExpression::ApplyOffset, 0); AI->replaceAllUsesWith(NewAI); AI->eraseFromParent(); } diff --git a/llvm/lib/CodeGen/SelectionDAG/SelectionDAG.cpp b/llvm/lib/CodeGen/SelectionDAG/SelectionDAG.cpp index b4530f9bc30..0758a31ec99 100644 --- a/llvm/lib/CodeGen/SelectionDAG/SelectionDAG.cpp +++ b/llvm/lib/CodeGen/SelectionDAG/SelectionDAG.cpp @@ -7946,9 +7946,8 @@ void SelectionDAG::salvageDebugInfo(SDNode &N) { // DIExpression, we need to mark the expression with a // DW_OP_stack_value. auto *DIExpr = DV->getExpression(); - DIExpr = DIExpression::prepend(DIExpr, DIExpression::NoDeref, Offset, - DIExpression::NoDeref, - DIExpression::WithStackValue); + DIExpr = + DIExpression::prepend(DIExpr, DIExpression::StackValue, Offset); SDDbgValue *Clone = getDbgValue(DV->getVariable(), DIExpr, N0.getNode(), N0.getResNo(), DV->isIndirect(), DV->getDebugLoc(), DV->getOrder()); diff --git a/llvm/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp b/llvm/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp index e76628435f7..e1c6b18a1bd 100644 --- a/llvm/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp +++ b/llvm/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp @@ -1363,7 +1363,7 @@ static void processDbgDeclares(FunctionLoweringInfo *FuncInfo) { DIExpression *Expr = DI->getExpression(); if (Offset.getBoolValue()) - Expr = DIExpression::prepend(Expr, DIExpression::NoDeref, + Expr = DIExpression::prepend(Expr, DIExpression::ApplyOffset, Offset.getZExtValue()); MF->setVariableDbgInfo(DI->getVariable(), Expr, FI, DI->getDebugLoc()); } |