[all-commits] [llvm/llvm-project] 262691: [clangd] Allow hover over 128-bit variable without...
Björn Pettersson via All-commits
all-commits at lists.llvm.org
Wed Nov 8 02:30:18 PST 2023
Branch: refs/heads/main
Home: https://github.com/llvm/llvm-project
Commit: 2626916c45f428226052f5e431e510743aba9e75
https://github.com/llvm/llvm-project/commit/2626916c45f428226052f5e431e510743aba9e75
Author: Björn Pettersson <bjorn.a.pettersson at ericsson.com>
Date: 2023-11-08 (Wed, 08 Nov 2023)
Changed paths:
M clang-tools-extra/clangd/Hover.cpp
M clang-tools-extra/clangd/unittests/HoverTests.cpp
Log Message:
-----------
[clangd] Allow hover over 128-bit variable without crashing (#71415)
When hovering over variables larger than 64 bits, with more than 64
active bits, there were assertion failures since Hover is trying to
print the value as a 64-bit hex value.
There is already protection avoiding to call printHex if there is more
than 64 significant bits. And we already truncate and print negative
values using only 32 bits, when possible. So we can simply truncate
values with more than 64 bits to avoid the assert when using
getZExtValue. The result will be that for example a negative 128 bit
variable is printed using 64 bits, when possible.
There is still no support for printing more than 64 bits. That would
involve more changes since for example llvm::FormatterNumber is limited
to 64 bits.
More information about the All-commits
mailing list