[PATCH] D147271: [DebugInfo] Add DW_OP_LLVM_user extension point

David Blaikie via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Apr 3 12:33:09 PDT 2023


dblaikie added a comment.

Would it make sense to remap the the sub-kinds into a bigger contiguous kind in the LLVM implementation? (I'm not sure, but curious - but probably not?)



================
Comment at: llvm/include/llvm/BinaryFormat/Dwarf.def:893
+// registered here it cannot be removed nor have its encoding changed. The
+// encoding space must skip zero (which is reserved) and have no gaps.
+//
----------------
Why is zero reserved? (other than to add a the nop op, so there's something to test before we have any USEROPs implemented?)


================
Comment at: llvm/lib/BinaryFormat/Dwarf.cpp:175-208
+static StringRef LlvmUserOperationEncodingString(unsigned Encoding) {
+  switch (Encoding) {
+  default:
+    llvm_unreachable("unhandled DWARF operation with LLVM user op");
+#define HANDLE_DW_OP_LLVM_USEROP(ID, NAME)                                     \
+  case DW_OP_LLVM_##NAME:                                                      \
+    return "DW_OP_LLVM_" #NAME;
----------------
Hmm, any chance we could condense these into a bigger macro (maybe another .def file) that stamps out all these operations, since we have to stamp these out for each kind of enum?)


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D147271/new/

https://reviews.llvm.org/D147271



More information about the llvm-commits mailing list