ASDenysPetrov added a comment.

@vsavchenko
Thank you for a proposed solution. It looks much easier to understand and 
maintain. Great! I will take it into account.

> Well, that is a nice exercise for "two pointer" problems, but can we please 
> talk about the actual use case for it?

I'm currently working on **integral cast between ranges**. Consider the range 
of `int` which is casted to `char`. You've got some ranges of `int` which 
obviously should be corespondently represented as some other ranges of `char`.
Some examples:

  int [257, 259]  -> char [1, 3]
  int [510, 513]  -> char [-2, 1]
  int [42, 1000]  -> char [-128, 127]
  int [257, 259] U [2049, 2051]  -> char [1,3] // Here we need `unite` logic to 
get a casted range because both original ranges lay on the same area after 
trancation.


CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D99797/new/

https://reviews.llvm.org/D99797

_______________________________________________
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to