[llvm-dev] llvm::PointerIntPair -- is this by design or a bug?

Riyaz Puthiyapurayil via llvm-dev llvm-dev at lists.llvm.org
Tue Apr 3 21:34:39 PDT 2018


llvm::PointerIntPair<double*, 3, signed> P;

P.setInt(-4);



Ideally, the value range for a 3-bit signed integer should be [-4,3]. But the above call to setInt will fail. Essentially, the signed int field in PointerIntPair is behaving the same as an 3-bit unsigned field which has the legal value range of [0,7]. Is this by design? Are negative values not allowed in PointerIntPair?



/Riyaz
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20180404/85ccf480/attachment.html>


More information about the llvm-dev mailing list