[clang] [llvm] [Dwarf] Support heterogeneous DW_{OP,AT}s needed for AMDGPU CFI (PR #153883)

Orlando Cazalet-Hyams via llvm-commits llvm-commits at lists.llvm.org
Wed Sep 17 01:50:35 PDT 2025


================
@@ -262,8 +285,10 @@ static bool printCompactDWARFExpr(
       break;
     }
     case dwarf::DW_OP_LLVM_user: {
-      assert(Op.getSubCode() == dwarf::DW_OP_LLVM_nop);
-      break;
+      std::optional<unsigned> SubOpcode = Op.getSubCode();
+      if (SubOpcode == dwarf::DW_OP_LLVM_nop)
+        break;
----------------
OCHyams wrote:

And in any other subop we fall through to `UnknownOpcode` rather than print anything. I am not very familiar with the compact printer usage so maybe this is ok. Ah, I see. Looking at the one caller `printDwarfExpressionCompact` comment, it looks like it's expected that not every operation is handled, which is what I was missing.

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


More information about the llvm-commits mailing list