[llvm] [RemoveDIs][NFC] Find DPValues using findDbgDeclares (PR #73500)
Jeremy Morse via llvm-commits
llvm-commits at lists.llvm.org
Mon Dec 11 06:18:57 PST 2023
================
@@ -44,29 +44,12 @@ using namespace llvm;
using namespace llvm::at;
using namespace llvm::dwarf;
-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;
- auto *L = LocalAsMetadata::getIfExists(V);
- if (!L)
- return;
- auto *MDV = MetadataAsValue::getIfExists(V->getContext(), L);
- if (!MDV)
- return;
+template <typename IntrinsicT, bool AnyType,
+ DPValue::LocationType Type = DPValue::LocationType(-1)>
----------------
jmorse wrote:
Non-edit: that is, casting -1 to DPValue::LocationType, an enumeration that doesn't have an enumerated element for -1, is likely undefined.
https://github.com/llvm/llvm-project/pull/73500
More information about the llvm-commits
mailing list