>> Right.  ConstantInt's are immutable, so it doesn't really need to be
>> marked const.  I'm saying that the implementation of these methods
>> shouldn't build a "1" apint, then add it.  Instead, it should just
>> increment an apint with ++.
>
> Yup. I've already changed it to:
>
> static ConstantInt *AddOne(ConstantInt *C) {
>   APInt Val(C->getValue());
>   return ConstantInt::get(++Val);
> }

Beautiful,

-Chris
_______________________________________________
llvm-commits mailing list
llvm-commits@cs.uiuc.edu
http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits

Reply via email to