llvm-project
3aae4bd1 - Emit DW_OP_lit0/1 for constant boolean values (#155539)

Commit
35 days ago
Emit DW_OP_lit0/1 for constant boolean values (#155539) 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_lot0; DW_OP_not`.
Author
Parents
Loading