Laxman Sole c1734763ce
[llvm][DebugInfo] Emit DW_OP_lit0/1 for constant boolean values (#157167)
Backends like NVPTX use -1 to indicate `true` and 0 to indicate `false`
for boolean values. Machine instruction `#DBG_VALUE` also uses -1 to
indicate a `true` boolean constant.

However, during the DWARF generation, booleans are treated as unsigned
variables, and the debug_loc expression, like `DW_OP_lit0; DW_OP_not` is
emitted for the `true` value.

This leads to the debugger printing `255` instead of `true` for constant
boolean variables.

This change emits `DW_OP_lit1` instead of `DW_OP_lit0; DW_OP_not`.
2025-09-08 10:28:21 +01:00
..
2023-07-12 12:03:44 +02:00
2023-03-27 10:20:08 +01:00