aboutsummaryrefslogtreecommitdiff
path: root/llvm/lib/IR/DebugInfo.cpp
diff options
context:
space:
mode:
authorOrlando Cazalet-Hyams <orlando.hyams@sony.com>2025-08-13 10:56:19 +0100
committerGitHub <noreply@github.com>2025-08-13 10:56:19 +0100
commitd13341db26fde0cb9764222f6d36db8b786d6119 (patch)
tree5d0e6b3fd991400aeef530af663abfb9bd62b7f8 /llvm/lib/IR/DebugInfo.cpp
parentd35686b25cc040d79d526008d1ddedfc3e572429 (diff)
downloadllvm-d13341db26fde0cb9764222f6d36db8b786d6119.zip
llvm-d13341db26fde0cb9764222f6d36db8b786d6119.tar.gz
llvm-d13341db26fde0cb9764222f6d36db8b786d6119.tar.bz2
[RemoveDIs][NFC] Remove getAssignmentMarkers (#153214)
getAssignmentMarkers was for debug intrinsics. getDVRAssignmentMarkers is used for DbgRecords.
Diffstat (limited to 'llvm/lib/IR/DebugInfo.cpp')
-rw-r--r--llvm/lib/IR/DebugInfo.cpp23
1 files changed, 1 insertions, 22 deletions
diff --git a/llvm/lib/IR/DebugInfo.cpp b/llvm/lib/IR/DebugInfo.cpp
index ab8ecee..65d4840 100644
--- a/llvm/lib/IR/DebugInfo.cpp
+++ b/llvm/lib/IR/DebugInfo.cpp
@@ -1896,29 +1896,8 @@ AssignmentInstRange at::getAssignmentInsts(DIAssignID *ID) {
return make_range(MapIt->second.begin(), MapIt->second.end());
}
-AssignmentMarkerRange at::getAssignmentMarkers(DIAssignID *ID) {
- assert(ID && "Expected non-null ID");
- LLVMContext &Ctx = ID->getContext();
-
- auto *IDAsValue = MetadataAsValue::getIfExists(Ctx, ID);
-
- // The ID is only used wrapped in MetadataAsValue(ID), so lets check that
- // one of those already exists first.
- if (!IDAsValue)
- return make_range(Value::user_iterator(), Value::user_iterator());
-
- return make_range(IDAsValue->user_begin(), IDAsValue->user_end());
-}
-
void at::deleteAssignmentMarkers(const Instruction *Inst) {
- auto Range = getAssignmentMarkers(Inst);
- SmallVector<DbgVariableRecord *> DVRAssigns = getDVRAssignmentMarkers(Inst);
- if (Range.empty() && DVRAssigns.empty())
- return;
- SmallVector<DbgAssignIntrinsic *> ToDelete(Range.begin(), Range.end());
- for (auto *DAI : ToDelete)
- DAI->eraseFromParent();
- for (auto *DVR : DVRAssigns)
+ for (auto *DVR : getDVRAssignmentMarkers(Inst))
DVR->eraseFromParent();
}