aboutsummaryrefslogtreecommitdiff
path: root/contrib/llvm-project/llvm/lib/Transforms/Utils/ValueMapper.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'contrib/llvm-project/llvm/lib/Transforms/Utils/ValueMapper.cpp')
-rw-r--r--contrib/llvm-project/llvm/lib/Transforms/Utils/ValueMapper.cpp12
1 files changed, 10 insertions, 2 deletions
diff --git a/contrib/llvm-project/llvm/lib/Transforms/Utils/ValueMapper.cpp b/contrib/llvm-project/llvm/lib/Transforms/Utils/ValueMapper.cpp
index 71d0f09e4771..380541ffdd49 100644
--- a/contrib/llvm-project/llvm/lib/Transforms/Utils/ValueMapper.cpp
+++ b/contrib/llvm-project/llvm/lib/Transforms/Utils/ValueMapper.cpp
@@ -544,6 +544,16 @@ void Mapper::remapDPValue(DPValue &V) {
V.setVariable(cast<DILocalVariable>(MappedVar));
V.setDebugLoc(DebugLoc(cast<DILocation>(MappedDILoc)));
+ bool IgnoreMissingLocals = Flags & RF_IgnoreMissingLocals;
+
+ if (V.isDbgAssign()) {
+ auto *NewAddr = mapValue(V.getAddress());
+ if (!IgnoreMissingLocals && !NewAddr)
+ V.setKillAddress();
+ else if (NewAddr)
+ V.setAddress(NewAddr);
+ }
+
// Find Value operands and remap those.
SmallVector<Value *, 4> Vals, NewVals;
for (Value *Val : V.location_ops())
@@ -555,8 +565,6 @@ void Mapper::remapDPValue(DPValue &V) {
if (Vals == NewVals)
return;
- bool IgnoreMissingLocals = Flags & RF_IgnoreMissingLocals;
-
// Otherwise, do some replacement.
if (!IgnoreMissingLocals &&
llvm::any_of(NewVals, [&](Value *V) { return V == nullptr; })) {