[PATCH] D35109: [Analyzer] SValBuilder Comparison Rearrangement
Balogh, Ádám via Phabricator via cfe-commits
cfe-commits at lists.llvm.org
Tue Oct 31 02:22:04 PDT 2017
baloghadamsoftware added inline comments.
================
Comment at: lib/StaticAnalyzer/Core/SimpleSValBuilder.cpp:595
+
+ if (origWidth < 128) {
+ auto newWidth = std::max(2 * origWidth, (uint32_t) 8);
----------------
danielmarjamaki wrote:
> I would like that "128" is rewritten somehow. Using expression instead.
Do you have an exact suggestion here? `int128` is the widest integer type which I cannot multiply by `2` because there is not `256` bit wide integer type. Maybe I should take the size of `int128`? Is it any better than just typing `128`?
================
Comment at: lib/StaticAnalyzer/Core/SimpleSValBuilder.cpp:596
+ if (origWidth < 128) {
+ auto newWidth = std::max(2 * origWidth, (uint32_t) 8);
+ auto newAPSIntType = APSIntType(newWidth, false);
----------------
danielmarjamaki wrote:
> Is `origWidth < 4` possible?
>
> I wonder about "8". Is that CHAR_BIT hardcoded?
Width of `bool` is 1. There is no integer type for bit-width of `2` so I had to round it up to 8.
https://reviews.llvm.org/D35109
More information about the cfe-commits
mailing list