[cfe-dev] [analyzer] What is RangeSet::Negate idea

Artem Dergachev via cfe-dev cfe-dev at lists.llvm.org
Tue Apr 7 06:04:58 PDT 2020


*re-adds cfe-dev*

Mmm, dunno what you mean. Like, it's the range for the negated symbol. 
It should be applied by the constraint manager (our wannabe SAT solver) 
when it wants to obtain the range for the negated symbol when it already 
has the range for the original symbol.

Would it help you if you see how it's used on tests? Eg., you can inject 
a crash in this function and see which tests fail; this will help you 
gather some examples of how the function is used. Then you can look 
under the debugger to see how exactly does it get used.

On 4/7/20 2:08 AM, Denis Petrov wrote:
> OK, thanks, I think I got it.
>
> Digging a bit more I came up with a special case of -MIN and handling of unsigned ranges. For me it's just a simple classic C unary minus operation. (And actually there is no special case for-MIN, it's just how native unary minus works)
>
> But what is a physical sense of Negate? When it should be applied and what for?
>
> ________________________________
> Denys Petrov
> Senior ะก++ Developer | Kharkiv, Ukraine



More information about the cfe-dev mailing list