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

Aman LaChapelle llvmlistbot at llvm.org
Mon Jul 20 22:03:15 PDT 2026


================
@@ -757,6 +807,29 @@ bool DwarfExpression::addExpression(
     // Turn this into an implicit location description.
     addStackValue();
 
+  if (HasSymbolicBranches) {
+    for (const BranchFixup &Fixup : Fixups) {
+      auto Label = llvm::find_if(Labels, [&](const LabelOffset &Candidate) {
+        return Candidate.ID == Fixup.LabelID;
+      });
+      if (Label == Labels.end())
+        report_fatal_error(Twine("DWARF expression branch to label ") +
+                           Twine(Fixup.LabelID) + " has no matching label");
+
+      int64_t Displacement =
----------------
bzcheeseman wrote:

could you add a brief comment explaining why this works? It would help for the future not having to re-derive it

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


More information about the Mlir-commits mailing list