[PATCH] D95990: Remove overzealous verifier check on DW_OP_LLVM_entry_value and improve the documentation

Djordje Todorovic via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Feb 3 23:57:37 PST 2021


djtodoro added inline comments.


================
Comment at: llvm/docs/LangRef.rst:5262-5283
+- ``DW_OP_LLVM_entry_value, N`` may only appear in MIR and at the
+  beginning of a ``DIExpression``. In DWARF a ``DBG_VALUE``
+  instruction binding a ``DIExpression(DW_OP_LLVM_entry_value`` to a
+  register is lowered to a ``DW_OP_entry_value [reg]``, pushing the
+  value the register had upon function entry onto the stack.  The next
+  ``(N - 1)`` operations will be part of the ``DW_OP_entry_value``
+  block argument. For example, ``!DIExpression(DW_OP_LLVM_entry_value,
----------------
cool!


================
Comment at: llvm/lib/IR/DebugInfoMetadata.cpp:1114
       // other expressions.
-      return I->get() == expr_op_begin()->get() && I->getArg(0) == 1 &&
-             getNumElements() == 2;
+      return I->get() == expr_op_begin()->get() && I->getArg(0) == 1;
     }
----------------
The same I added in: https://reviews.llvm.org/D87233#change-euq8o0qWqm4k

Maybe we can add a `constexpr` variable, for example:

`constexpr unsigned entry_val_size = 1;`

and use it here as well as in `DIExpression::prependOpcodes()` from the D87233. WDYT?




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

https://reviews.llvm.org/D95990



More information about the llvm-commits mailing list