[llvm] [RemoveDIs][NFC] Add DPLabel class [2/3] (PR #82376)

Stephen Tozer via llvm-commits llvm-commits at lists.llvm.org
Thu Feb 22 06:17:59 PST 2024


================
@@ -156,6 +157,31 @@ class DbgRecord : public ilist_node<DbgRecord> {
   ~DbgRecord() = default;
 };
 
+/// Records a position in IR for a source label (DILabel). Corresponds to the
+/// llvm.dbg.label intrinsic.
+/// FIXME: Rename DbgLabelRecord when DPValue is renamed to DbgVariableRecord.
+class DPLabel : public DbgRecord {
+  DILabel *Label;
+
+public:
+  DPLabel(DILabel *Label, DebugLoc DL)
+      : DbgRecord(LabelKind, DL), Label(Label) {
+    assert(Label && "unexpected nullptr");
----------------
SLTozer wrote:

```suggestion
    assert(Label && "Unexpected nullptr");
```

https://github.com/llvm/llvm-project/pull/82376


More information about the llvm-commits mailing list