On 07/23/2009 05:39 PM, Gavin Lambert wrote: > At 09:22 24/07/2009, Kevin J. Cummings wrote: > > The only usage of "s" after the "_s = s" assignment, are > >assignments to "s" itself, which reflect a value depending > >on the if statements inside the switch. If you assigned a > >positive value to s, return it. > >Otherwise (I assume s is still -1) you break out of the switch > >statement. In which case (pun intended), since you are about to > >throw an exception, it contains the saved input value _s. So, > >the code looks good to me..... > > Although it would have made more sense to alter the local variable and > leave the parameter alone. So, correct, yes, but "good" might be a bit > of a stretch... :)
Maybe, but leaving the parameter in a register ties up that register (and it might still be spilled anyways), depends on the complexity of the code and the intelligence of the optimizers and code generators. B^) From the viewpoint of readability, Gavin is probably right. -- Kevin J. Cummings [email protected] [email protected] [email protected] Registered Linux User #1232 (http://counter.li.org) List: http://www.antlr.org/mailman/listinfo/antlr-interest Unsubscribe: http://www.antlr.org/mailman/options/antlr-interest/your-email-address --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "il-antlr-interest" group. To post to this group, send email to [email protected] To unsubscribe from this group, send email to [email protected] For more options, visit this group at http://groups.google.com/group/il-antlr-interest?hl=en -~----------~----~----~----~------~----~------~--~---
