-
Notifications
You must be signed in to change notification settings - Fork 11.9k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
APInt API is atrocious #5579
Comments
Sorry, I got that completely backward. This is what we'd have (foo_eq corresponds to things like +=):
or, better yet in this case:
|
+1 |
The public non-const non-static non-operator methods in question are:
|
Sounds great! |
Done:
Changed them to return a new value:
Made them return void: ... and renamed them:
Done: Is there anything else wrong with the APInt API, or can we close the bug? |
It's looking great to me new Jay, please do close this. Thanks again for tackling this! |
Fixed, then! |
…tch-nested-generics Add nested generic LLDB metadata tests
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.
The text was updated successfully, but these errors were encountered: