checkedint call removal

Walter Bright via Digitalmars-d digitalmars-d at puremagic.com
Tue Jul 29 18:38:47 PDT 2014


On 7/29/2014 4:03 PM, bearophile wrote:
> How do you do this with no additional language features?

Data flow analysis can figure that example out. If it can't for a more complex 
one, you can do:

   assert(x >= 0 && x <= 255);
   assert(y >= 0 && y <= 255);

The optimizer can certainly use asserts to provide semantic information (even 
though the dmd one doesn't at the moment).


Again, I know you like reading about new languages and language features. I 
think you'd enjoy that even more supplemented with a book on how compilers work 
internally, in particular, how data flow analysis works and what it can do.



More information about the Digitalmars-d mailing list