[DebugInfo] Refactor code for emitting DWARF expressions for FP constants
authorPavel Labath <pavel@labath.sk>
Fri, 6 Nov 2020 09:44:14 +0000 (10:44 +0100)
committerPavel Labath <pavel@labath.sk>
Mon, 23 Nov 2020 08:59:07 +0000 (09:59 +0100)
commit6ef7835afca246e623e9990dcd8c71204f5691e5
tree4e5c1e33a4fe8bffce711c03bf621901056af799
parent33b2c88fa8223dbf15846ce18cc957e33e0d67fc
[DebugInfo] Refactor code for emitting DWARF expressions for FP constants

This patch moves the selection of the style used to emit the numbers
(DW_OP_implicit_value vs. DW_OP_const+DW_OP_stack_value) into
DwarfExpression::addUnsignedConstant. This logic is not FP-specific, and
it will be needed for large integers too.

The refactor also makes DW_OP_implicit_value (DW_OP_stack_value worked
already) be used for floating point constants other than float and
double, so I've added a _Float16 test for it.

Split off from D90916.

Differential Revision: https://reviews.llvm.org/D91058
llvm/lib/CodeGen/AsmPrinter/DwarfDebug.cpp
llvm/lib/CodeGen/AsmPrinter/DwarfExpression.cpp
llvm/lib/CodeGen/AsmPrinter/DwarfExpression.h
llvm/test/DebugInfo/ARM/implicit_value-_Float16.ll [new file with mode: 0644]