[PATCH] D133576: [Assignment Tracing][5.1/*] Add deleteAssignmentMarkers function
Orlando Cazalet-Hyams via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Fri Sep 9 06:35:39 PDT 2022
Orlando created this revision.
Orlando added a reviewer: jmorse.
Orlando added a project: debug-info.
Herald added a subscriber: hiraditya.
Herald added a project: All.
Orlando requested review of this revision.
Herald added a project: LLVM.
Herald added a subscriber: llvm-commits.
`deleteAssignmentMarkers(const Instruction *Inst)` does exactly as you'd expect - it deletes any dbg.assign intrinsics linked to `Inst`.
I'll fold this into the previous patch (D132224 <https://reviews.llvm.org/D132224>) when landing them, but I wanted to keep the review separate as that one has already been accepted.
https://reviews.llvm.org/D133576
Files:
llvm/include/llvm/IR/DebugInfo.h
llvm/lib/IR/DebugInfo.cpp
Index: llvm/lib/IR/DebugInfo.cpp
===================================================================
--- llvm/lib/IR/DebugInfo.cpp
+++ llvm/lib/IR/DebugInfo.cpp
@@ -1696,6 +1696,15 @@
return make_range(IDAsValue->user_begin(), IDAsValue->user_end());
}
+void at::deleteAssignmentMarkers(const Instruction *Inst) {
+ auto Range = getAssignmentMarkers(Inst);
+ if (Range.empty())
+ return;
+ SmallVector<DbgAssignIntrinsic *> ToDelete(Range.begin(), Range.end());
+ for (auto *DAI : ToDelete)
+ DAI->eraseFromParent();
+}
+
void at::RAUW(DIAssignID *Old, DIAssignID *New) {
// Replace MetadataAsValue uses.
if (auto *OldIDAsValue =
Index: llvm/include/llvm/IR/DebugInfo.h
===================================================================
--- llvm/include/llvm/IR/DebugInfo.h
+++ llvm/include/llvm/IR/DebugInfo.h
@@ -219,6 +219,9 @@
return make_range(Value::user_iterator(), Value::user_iterator());
}
+/// Delete the llvm.dbg.assgin intrinsics linked to \p Inst.
+void deleteAssignmentMarkers(const Instruction *Inst);
+
/// Replace all uses (and attachments) of \p Old with \p New.
void RAUW(DIAssignID *Old, DIAssignID *New);
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D133576.459040.patch
Type: text/x-patch
Size: 1163 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20220909/8d9720d0/attachment.bin>
More information about the llvm-commits
mailing list