[llvm] [DWARF] Emit 0/1 for constant boolean values (PR #151225)

Michael Buch via llvm-commits llvm-commits at lists.llvm.org
Thu Aug 7 00:54:21 PDT 2025


================
@@ -194,6 +194,15 @@ void DwarfExpression::addStackValue() {
     emitOp(dwarf::DW_OP_stack_value);
 }
 
+void DwarfExpression::addBooleanConstant(int64_t Value) {
+  assert(isImplicitLocation() || isUnknownLocation());
+  LocationKind = Implicit;
----------------
Michael137 wrote:

Particularly LLDB does some mapping from location description kinds to "is this value a memory location/load address/scalar":
https://github.com/llvm/llvm-project/blob/0b3ee2093954dd3c5a201eba4b7641adadd9b2c6/lldb/source/Expression/DWARFExpression.cpp#L795-L826

And it follows the standard pretty closely w.r.t which ops fall into which category. So would be interesting to see how LLDB handles these new boolean constant DWARF expressions.

Was just wondering if the spec needs some updating.

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


More information about the llvm-commits mailing list