llvm-c166/lldb/source/Expression
MrEven132 74253d0e4f
[lldb] Support DW_ATE_float in DW_OP_convert (#219131)
## Problem

DWARF permits the operand of `DW_OP_convert` to reference a
floating-point base type. LLDB instead stops while resolving such a DIE
and reports `unsupported encoding`. This also breaks expressions that
only use the float as an intermediate value, such as converting zero to
float32 and then back to the generic type.

## Change

Carry the base type's DWARF encoding into the expression evaluator so it
can distinguish integer and floating-point destinations. Float32,
float64, and x87 float80 are mapped to their corresponding `APFloat`
semantics.

The conversion rules are now:

- integer to float and float precision changes use nearest-ties-to-even;
- float to integer uses toward-zero;
- NaN, integer overflow, unsupported float widths, and impractical
integer widths produce evaluation errors.

The existing integer truncation and extension behavior, including
conversion to the generic address-sized unsigned type, is unchanged.

## Tests

Extend `DWARFExpression.DW_OP_convert` with the reported expression and
cover 32-, 64-, and 80-bit float targets, precision narrowing, positive
and negative toward-zero conversion, NaN and range errors, excessive
integer widths, and
the existing malformed-DIE paths.

Fixes #202605
2026-08-27 21:42:16 +08:00
..
CMakeLists.txt
DiagnosticManager.cpp
DWARFExpression.cpp [lldb] Support DW_ATE_float in DW_OP_convert (#219131) 2026-08-27 21:42:16 +08:00
DWARFExpressionList.cpp
Expression.cpp
ExpressionParser.cpp
ExpressionTypeSystemHelper.cpp
ExpressionVariable.cpp
FunctionCaller.cpp
IRExecutionUnit.cpp [lldb] std::move unique_ptrs, rather than calling .release. (#213525) 2026-08-02 21:04:18 +10:00
IRInterpreter.cpp
IRMemoryMap.cpp
LLVMUserExpression.cpp
Materializer.cpp [lldb] Fix incorrect formatv format strings in logging (#215024) 2026-08-10 10:36:36 -07:00
ObjectFileJIT.cpp [LLDB] Add a GetTargetSP() accessor to ObjectFileJITDelegate. (NFC) (#215893) 2026-08-13 10:57:37 -07:00
REPL.cpp [lldb][NFC] Remove various Stream::Printf calls with constants (#210294) 2026-07-20 10:16:42 +01:00
UserExpression.cpp
UtilityFunction.cpp