[llvm] [mlir] [DebugInfo] Add symbolic branches to DIExpression (PR #210850)

Aman LaChapelle via llvm-commits llvm-commits at lists.llvm.org
Mon Jul 20 22:03:13 PDT 2026


================
@@ -530,8 +533,31 @@ bool DwarfExpression::addExpression(
   // and not any other parts of the following DWARF expression.
   assert(!IsEmittingEntryValue && "Can't emit entry value around expression");
 
-  std::optional<DIExpression::ExprOperand> PrevConvertOp;
+  struct LabelOffset {
+    uint64_t ID;
+    uint64_t Offset;
+  };
+  struct BranchFixup {
+    uint64_t LabelID;
+    uint64_t PlaceholderOffset;
+  };
+  constexpr unsigned BranchOffsetByteSize = 2;
+
+  // Iterating over ExprCursor doesn't consume it.
+  bool HasSymbolicBranches =
+      llvm::any_of(ExprCursor, [](DIExpression::ExprOperand Op) {
+        return Op.getOp() == dwarf::DW_OP_LLVM_bra ||
----------------
bzcheeseman wrote:

we don't have `isa` for these?

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


More information about the llvm-commits mailing list