From 7fa27ce4a07f19b07799a767fc29416f3b625afb Mon Sep 17 00:00:00 2001 From: Dimitry Andric Date: Wed, 26 Jul 2023 21:03:47 +0200 Subject: Vendor import of llvm-project main llvmorg-17-init-19304-gd0b54bb50e51, the last commit before the upstream release/17.x branch was created. --- llvm/lib/Transforms/Utils/MemoryOpRemark.cpp | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'llvm/lib/Transforms/Utils/MemoryOpRemark.cpp') diff --git a/llvm/lib/Transforms/Utils/MemoryOpRemark.cpp b/llvm/lib/Transforms/Utils/MemoryOpRemark.cpp index 899928c085c6..531b0a624daf 100644 --- a/llvm/lib/Transforms/Utils/MemoryOpRemark.cpp +++ b/llvm/lib/Transforms/Utils/MemoryOpRemark.cpp @@ -11,6 +11,7 @@ //===----------------------------------------------------------------------===// #include "llvm/Transforms/Utils/MemoryOpRemark.h" +#include "llvm/ADT/SmallString.h" #include "llvm/Analysis/OptimizationRemarkEmitter.h" #include "llvm/Analysis/ValueTracking.h" #include "llvm/IR/DebugInfo.h" @@ -321,7 +322,7 @@ 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. for (const DbgVariableIntrinsic *DVI : - FindDbgAddrUses(const_cast(V))) { + FindDbgDeclareUses(const_cast(V))) { if (DILocalVariable *DILV = DVI->getVariable()) { std::optional DISize = getSizeInBytes(DILV->getSizeInBits()); VariableInfo Var{DILV->getName(), DISize}; @@ -387,7 +388,8 @@ bool AutoInitRemark::canHandle(const Instruction *I) { return false; return any_of(I->getMetadata(LLVMContext::MD_annotation)->operands(), [](const MDOperand &Op) { - return cast(Op.get())->getString() == "auto-init"; + return isa(Op.get()) && + cast(Op.get())->getString() == "auto-init"; }); } -- cgit v1.2.3