[PATCH] D83560: [DebugInfo] Emit DW_OP_implicit_value for Floating point constants
Bjorn Pettersson via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Fri Jul 24 09:47:40 PDT 2020
bjope added inline comments.
================
Comment at: llvm/lib/CodeGen/AsmPrinter/DwarfExpression.cpp:233
+ for (int i = 0; i < NumBytes; ++i)
+ emitData1(Data[i]);
+ return;
----------------
bjope wrote:
> I'm working on a big-endian target (together with a debugger based on gdb 8.1.0).
> I needed to reverse the order here (and in the loop at line 243), to get same result as before.
>
> Does that make sense? Should we care about endianess in DwarfExpression.cpp?
>
One thing I noticed is that APFloat::bitcastToAPInt, according to comments in APFloat.cpp, is creating an APInt that is a bit map of the value as it would appear in memory. However, that would only be true if the APInt was stored as one value taking endianess into consideration. When looking at the rawBytes of the resulting APInt after bitcastToAPInt the bytes are in litte-endian order. So a byteSwap is generally needed for big-endian.
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D83560/new/
https://reviews.llvm.org/D83560
More information about the llvm-commits
mailing list