This revision was automatically updated to reflect the committed changes.
Closed by commit rL317820: [analyzer] assume bitwise arithmetic axioms
(authored by george.karpenkov).
Changed prior to commit:
https://reviews.llvm.org/D39707?vs=122170&id=122278#toc
Repository:
rL LLVM
https://revie
dcoughlin added a comment.
This looks good to me. It is very clean! But please add a comment in the places
where you are assuming a two's complement value representation for signed
integers.
https://reviews.llvm.org/D39707
___
cfe-commits mailing
george.karpenkov updated this revision to Diff 122170.
george.karpenkov added a comment.
Handle non-zero case, more tests cases, cleaner code.
https://reviews.llvm.org/D39707
Files:
lib/StaticAnalyzer/Core/RangeConstraintManager.cpp
test/Analysis/constant-folding.c
Index: test/Analysis/con
dcoughlin added a comment.
I believe your motivating examples used errno_t, which is a signed type.
I'm fine with assuming a two's complement value representation for signed
integers, which would make Artem's suggestion work. That assumption definitely
deserves a comment, though.
https://revi
NoQ accepted this revision.
NoQ added a comment.
Yep, nice and clean~
Comment at: lib/StaticAnalyzer/Core/RangeConstraintManager.cpp:520
+ Result = applyBitwiseConstraints(BV, F, T, Result, Sym);
return Result;
That's more and more "special case"s, i gues
xazax.hun accepted this revision.
xazax.hun added a comment.
This revision is now accepted and ready to land.
This looks like a great addition! Apart from some nits, LGTM.
Comment at: lib/StaticAnalyzer/Core/RangeConstraintManager.cpp:487
+
+// result >= constant
+
george.karpenkov updated this revision to Diff 121825.
https://reviews.llvm.org/D39707
Files:
lib/StaticAnalyzer/Core/RangeConstraintManager.cpp
test/Analysis/constant-folding.c
Index: test/Analysis/constant-folding.c
===
--- t
george.karpenkov created this revision.
Herald added subscribers: szepet, xazax.hun.
Patches the solver to assume that bitwise OR of an unsigned value with a
constant always produces a value larger-or-equal than the constant, and bitwise
AND with a constant always produces a value less-or-equal