[LLVMdev] APInt::getBitsSet

Dan Gohman gohman at apple.com
Mon Feb 11 15:47:24 PST 2008


APInt::getBitsSet's loBit and hiBit arguments describe a range that's  
inclusive
on both ends. Would anyone mind if we change it to be a "half-open"  
range,
meaning exclusive on the high end?

Currently every caller (including several new ones in some code I'm  
writing right
now) does a subtract by one to adjust for the current behavior. And the
implementation does an add by one for its part. It would be simpler on  
both
sides to just define the hiBit as being one past the last bit set.

Dan




More information about the llvm-dev mailing list