aboutsummaryrefslogtreecommitdiff
path: root/clang/lib/Frontend/InitPreprocessor.cpp
diff options
context:
space:
mode:
authorAaron Ballman <aaron@aaronballman.com>2022-03-22 10:00:05 -0400
committerAaron Ballman <aaron@aaronballman.com>2022-03-22 10:00:05 -0400
commit9cf8f81ca45de198013f29442a7de6600b226d70 (patch)
tree1269a8414b6ecdfb6f5ab9ea358ff79b4f5d817c /clang/lib/Frontend/InitPreprocessor.cpp
parent5856f30b5ae06153ff4a7d3db73ff8d9a05b4144 (diff)
downloadllvm-9cf8f81ca45de198013f29442a7de6600b226d70.zip
llvm-9cf8f81ca45de198013f29442a7de6600b226d70.tar.gz
llvm-9cf8f81ca45de198013f29442a7de6600b226d70.tar.bz2
Fix _BitInt suffix width calculation
@mgehre-amd pointed out the following post-commit review feedback on the changes in 8cba72177dcd8de5d37177dbaf2347e5c1f0f1e8: As an example, the paper says 3wb /* Yields an _BitInt(3); two value bits, one sign bit */. So I would expect that 0xFwb gives _BitInt(5); four value bits, one sign bit, but with this implementation I get _BitInt(2). This is because ResultVal as 4 bits, and getMinSignedBits() inteprets it as negative and thus says that 1 bit is enough to represent -1. This corrects the behavior for calculating the bit-width and adds some test coverage.
Diffstat (limited to 'clang/lib/Frontend/InitPreprocessor.cpp')
0 files changed, 0 insertions, 0 deletions