aboutsummaryrefslogtreecommitdiff
path: root/llvm/lib/IR/Module.cpp
diff options
context:
space:
mode:
authorBjörn Pettersson <bjorn.a.pettersson@ericsson.com>2023-11-08 11:30:03 +0100
committerBjorn Pettersson <bjorn.a.pettersson@ericsson.com>2023-11-08 14:13:11 +0100
commitd5cfdcaacbd36d6c25011f03a4eb51137f7a804a (patch)
tree46d2469252ad991e8fd48cb5c24969d927d31ba1 /llvm/lib/IR/Module.cpp
parentfdf99b21f3dbe1cbf286e2bcc443b59cf7d9b9be (diff)
downloadllvm-d5cfdcaacbd36d6c25011f03a4eb51137f7a804a.zip
llvm-d5cfdcaacbd36d6c25011f03a4eb51137f7a804a.tar.gz
llvm-d5cfdcaacbd36d6c25011f03a4eb51137f7a804a.tar.bz2
[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. This is a second attempt at landing this patch. Now with protection to ensure we use a triple that supports __int128_t.
Diffstat (limited to 'llvm/lib/IR/Module.cpp')
0 files changed, 0 insertions, 0 deletions