diff options
Diffstat (limited to 'llvm/docs')
-rw-r--r-- | llvm/docs/LangRef.rst | 31 |
1 files changed, 19 insertions, 12 deletions
diff --git a/llvm/docs/LangRef.rst b/llvm/docs/LangRef.rst index e797b1f9a15..5a2f98c493a 100644 --- a/llvm/docs/LangRef.rst +++ b/llvm/docs/LangRef.rst @@ -4793,17 +4793,24 @@ The current supported opcode vocabulary is limited: of the stack is treated as an address. The second stack entry is treated as an address space identifier. - ``DW_OP_stack_value`` marks a constant value. -- If an expression is marked with ``DW_OP_entry_value`` all register and - memory read operations refer to the respective value at the function entry. - The first operand of ``DW_OP_entry_value`` is the size of following - DWARF expression. - ``DW_OP_entry_value`` may appear after the ``LiveDebugValues`` pass. - LLVM only supports entry values for function parameters - that are unmodified throughout a function and that are described as - simple register location descriptions. - ``DW_OP_entry_value`` may also appear after the ``AsmPrinter`` pass when - a call site parameter value (``DW_AT_call_site_parameter_value``) - is represented as entry value of the parameter. +- ``DW_OP_LLVM_entry_value, N`` can only appear at the beginning of a + ``DIExpression``, and it specifies that all register and memory read + operations for the debug value instruction's value/address operand and for + the ``(N - 1)`` operations immediately following the + ``DW_OP_LLVM_entry_value`` refer to their respective values at function + entry. For example, ``!DIExpression(DW_OP_LLVM_entry_value, 1, + DW_OP_plus_uconst, 123, DW_OP_stack_value)`` specifies an expression where + the entry value of the debug value instruction's value/address operand is + pushed to the stack, and is added with 123. Due to framework limitations + ``N`` can currently only be 1. + + ``DW_OP_LLVM_entry_value`` is only legal in MIR. The operation is introduced + by the ``LiveDebugValues`` pass; currently only for function parameters that + are unmodified throughout a function and that are described as simple + register location descriptions. The operation is also introduced by the + ``AsmPrinter`` pass when a call site parameter value + (``DW_AT_call_site_parameter_value``) is represented as entry value of the + parameter. - ``DW_OP_breg`` (or ``DW_OP_bregx``) represents a content on the provided signed offset of the specified register. The opcode is only generated by the ``AsmPrinter`` pass to describe call site parameter value which requires an @@ -4852,7 +4859,7 @@ These flags encode various properties of DINodes. The `ArgumentNotModified` flag marks a function argument whose value is not modified throughout of a function. This flag is used to decide -whether a DW_OP_entry_value can be used in a location description +whether a DW_OP_LLVM_entry_value can be used in a location description after the function prologue. The language frontend is expected to compute this property for each DILocalVariable. The flag should be used only in optimized code. |