http://llvm.org/bugs/show_bug.cgi?id=5207
Summary: APInt API is atrocious
Product: libraries
Version: 1.0
Platform: PC
OS/Version: All
Status: NEW
Keywords: code-cleanup
Severity: normal
Priority: P2
Component: Support Libraries
AssignedTo: [email protected]
ReportedBy: [email protected]
CC: [email protected]
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.
--
Configure bugmail: http://llvm.org/bugs/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are on the CC list for the bug.
_______________________________________________
LLVMbugs mailing list
[email protected]
http://lists.cs.uiuc.edu/mailman/listinfo/llvmbugs