summaryrefslogtreecommitdiff
path: root/llvm/lib/Transforms/Utils/MemoryOpRemark.cpp
diff options
context:
space:
mode:
authorVitaly Buka <vitalybuka@google.com>2023-12-13 11:24:19 -0800
committerVitaly Buka <vitalybuka@google.com>2023-12-13 11:24:19 -0800
commitbb8c48999b0361efd053f842566c727b5fbfe96d (patch)
tree909da3ecfa7ef50a847f35b817b7fece7d9e1a6f /llvm/lib/Transforms/Utils/MemoryOpRemark.cpp
parent2d98fe9115e37c60fd568008c27038015f28c7e3 (diff)
parent64fa90bf8966cb886463840e5c85b9602cbbdc52 (diff)
[𝘀𝗽𝗿] changes introduced through rebaseusers/vitalybuka/spr/main.asan-install-pthread_atfork
Created using spr 1.3.4 [skip ci]
Diffstat (limited to 'llvm/lib/Transforms/Utils/MemoryOpRemark.cpp')
-rw-r--r--llvm/lib/Transforms/Utils/MemoryOpRemark.cpp10
1 files changed, 7 insertions, 3 deletions
diff --git a/llvm/lib/Transforms/Utils/MemoryOpRemark.cpp b/llvm/lib/Transforms/Utils/MemoryOpRemark.cpp
index 5c3776683d5d..47c6bcbaf26e 100644
--- a/llvm/lib/Transforms/Utils/MemoryOpRemark.cpp
+++ b/llvm/lib/Transforms/Utils/MemoryOpRemark.cpp
@@ -322,8 +322,9 @@ void MemoryOpRemark::visitVariable(const Value *V,
// Try to get an llvm.dbg.declare, which has a DILocalVariable giving us the
// real debug info name and size of the variable.
SmallVector<DbgDeclareInst *, 1> DbgDeclares;
- findDbgDeclares(DbgDeclares, const_cast<Value *>(V));
- for (const DbgVariableIntrinsic *DVI : DbgDeclares) {
+ SmallVector<DPValue *, 1> DPValues;
+ findDbgDeclares(DbgDeclares, const_cast<Value *>(V), &DPValues);
+ auto FindDI = [&](const auto *DVI) {
if (DILocalVariable *DILV = DVI->getVariable()) {
std::optional<uint64_t> DISize = getSizeInBytes(DILV->getSizeInBits());
VariableInfo Var{DILV->getName(), DISize};
@@ -332,7 +333,10 @@ void MemoryOpRemark::visitVariable(const Value *V,
FoundDI = true;
}
}
- }
+ };
+ for_each(DbgDeclares, FindDI);
+ for_each(DPValues, FindDI);
+
if (FoundDI) {
assert(!Result.empty());
return;