|
|
| Bugzilla Link |
5207 |
| Resolution |
FIXED |
| Resolved on |
Dec 09, 2010 02:35 |
| Version |
1.0 |
| OS |
All |
| CC |
@asl,@jayfoad |
Extended Description
The APInt API is extremely inconsistent. Among other things, some methods update the APInt in place, and some return a new APInt. This leads to awful stuff like:
V = V.lshr(ByteStart*8);
V.trunc(ByteSize*8);
I think that we should fix this by changing operations that update in place to have an _eq suffix, this would give us:
V = V.lshr_eq(ByteStart*8);
V = V.trunc_eq(ByteSize*8);
or, better yet in this case:
V.lshr(ByteStart*8);
V.trunc(ByteSize*8);
The ones that update in place should return void to make it really clear that they do not return a new APInt.
Extended Description
The APInt API is extremely inconsistent. Among other things, some methods update the APInt in place, and some return a new APInt. This leads to awful stuff like:
I think that we should fix this by changing operations that update in place to have an _eq suffix, this would give us:
or, better yet in this case:
The ones that update in place should return void to make it really clear that they do not return a new APInt.