Displaying 2 results from an estimated 2 matches for "amgrp54923b9793dae891d9489c".
2011 Jul 13
2
[LLVMdev] overflow check
Hi,
I have three constants (B, C and V) and V = B + C. I want to find out if B +
C wraps around. The way I'll do it is, assuming B and C are both positive,
to check if V < B or C.
For this I need the values of B, C and V. I tried using APInt as below.
***
If (isa<Constant> (B) && isa<Constant> (C) && isa<Constant>(V)) {
ConstantInt *CV =
2011 Jul 13
0
[LLVMdev] overflow check
...tValue();
> const APInt &CVal = CC->getValue();
> ******
>
> But isn't APInt considered to represent unsigned integers ? Is there another
> way of doing this ?
APInt's aren't inherently signed or unsigned; see
http://llvm.org/doxygen/classllvm_1_1APInt.html#amgrp54923b9793dae891d9489cc5947f263a
.
-Eli