Skip to content

Commit d3be9f6

Browse files
committed
[RemoveDIs] Support DPValue dbg.declares in MemoryOpRemark
Depends on #74099, #73500.
1 parent c209d56 commit d3be9f6

File tree

1 file changed

+7
-3
lines changed

1 file changed

+7
-3
lines changed

llvm/lib/Transforms/Utils/MemoryOpRemark.cpp

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -322,8 +322,9 @@ void MemoryOpRemark::visitVariable(const Value *V,
322322
// Try to get an llvm.dbg.declare, which has a DILocalVariable giving us the
323323
// real debug info name and size of the variable.
324324
SmallVector<DbgDeclareInst *, 1> DbgDeclares;
325-
findDbgDeclares(DbgDeclares, const_cast<Value *>(V));
326-
for (const DbgVariableIntrinsic *DVI : DbgDeclares) {
325+
SmallVector<DPValue *, 1> DPValues;
326+
findDbgDeclares(DbgDeclares, const_cast<Value *>(V), &DPValues);
327+
auto FindDI = [&](const auto *DVI) {
327328
if (DILocalVariable *DILV = DVI->getVariable()) {
328329
std::optional<uint64_t> DISize = getSizeInBytes(DILV->getSizeInBits());
329330
VariableInfo Var{DILV->getName(), DISize};
@@ -332,7 +333,10 @@ void MemoryOpRemark::visitVariable(const Value *V,
332333
FoundDI = true;
333334
}
334335
}
335-
}
336+
};
337+
for_each(DbgDeclares, FindDI);
338+
for_each(DPValues, FindDI);
339+
336340
if (FoundDI) {
337341
assert(!Result.empty());
338342
return;

0 commit comments

Comments
 (0)