[llvm-commits] [PATCH] Bug 5207: sanitise APInt doubleToBits() and floatToBits()

Chris Lattner clattner at apple.com
Sun Nov 28 11:13:33 PST 2010


On Nov 26, 2010, at 2:44 AM, Jay Foad wrote:

> http://llvm.org/bugs/show_bug.cgi?id=5207
> 
> This bug says, among other things, that the APInt methods "that update
> in place should return void to make it really clear that they do not
> return a new APInt".
> 
> The methods doubleToBits() and floatToBits() update the APInt in
> place, and are defined to truncate or zero-extend the double/float
> bits if the APInt isn't already 64/32 bits wide respectively. These
> semantics don't seem very useful, and indeed no-one seems to use them,
> so how about changing these methods to be static and return a new
> APInt?
> 
> Patch attached. grep tells me that these methods aren't used in cfe or
> llvm-gcc. "make check" shows no new failures beyond what I reported
> here:
> 
> http://lists.cs.uiuc.edu/pipermail/cfe-dev/2010-November/012292.html
> 
> OK to commit?

Looks great, please commit!

-Chris



More information about the llvm-commits mailing list