aboutsummaryrefslogtreecommitdiff
path: root/llvm/lib/IR
diff options
context:
space:
mode:
authorOrlando Cazalet-Hyams <orlando.hyams@sony.com>2023-12-12 09:43:58 +0000
committerGitHub <noreply@github.com>2023-12-12 09:43:58 +0000
commit2d9d9a1a556a5f8845a7a9e19dc52346b825989e (patch)
tree7105430ab21036ec01c93adedf32b78047b72cab /llvm/lib/IR
parent6111f5c5925cb40357e2a972ebae4294731c307f (diff)
downloadllvm-2d9d9a1a556a5f8845a7a9e19dc52346b825989e.zip
llvm-2d9d9a1a556a5f8845a7a9e19dc52346b825989e.tar.gz
llvm-2d9d9a1a556a5f8845a7a9e19dc52346b825989e.tar.bz2
[NFC] Change FindDbgDeclareUsers interface to match findDbgUsers/values (#73498)
This simplifies an upcoming patch to support the RemoveDIs project (tracking variable locations without using intrinsics). Next in this series is #73500.
Diffstat (limited to 'llvm/lib/IR')
-rw-r--r--llvm/lib/IR/DebugInfo.cpp14
1 files changed, 6 insertions, 8 deletions
diff --git a/llvm/lib/IR/DebugInfo.cpp b/llvm/lib/IR/DebugInfo.cpp
index d532aea..b3cc999 100644
--- a/llvm/lib/IR/DebugInfo.cpp
+++ b/llvm/lib/IR/DebugInfo.cpp
@@ -44,25 +44,23 @@ using namespace llvm;
using namespace llvm::at;
using namespace llvm::dwarf;
-TinyPtrVector<DbgDeclareInst *> llvm::FindDbgDeclareUses(Value *V) {
+void llvm::findDbgDeclares(SmallVectorImpl<DbgDeclareInst *> &DbgUsers,
+ Value *V) {
// This function is hot. Check whether the value has any metadata to avoid a
// DenseMap lookup.
if (!V->isUsedByMetadata())
- return {};
+ return;
auto *L = LocalAsMetadata::getIfExists(V);
if (!L)
- return {};
+ return;
auto *MDV = MetadataAsValue::getIfExists(V->getContext(), L);
if (!MDV)
- return {};
+ return;
- TinyPtrVector<DbgDeclareInst *> Declares;
for (User *U : MDV->users()) {
if (auto *DDI = dyn_cast<DbgDeclareInst>(U))
- Declares.push_back(DDI);
+ DbgUsers.push_back(DDI);
}
-
- return Declares;
}
template <typename IntrinsicT>