[LLVMdev] error api for APInt / APFloat

Erick Tryzelaar idadesub at users.sourceforge.net
Wed Aug 19 21:36:07 PDT 2009


I'm breaking this out from LLVM asserts thread. Here are all the
assertions in APInt I consider should be recoverable:

APInt::APInt:
bitwidth too small
Null pointer detected!

APInt::getBitsNeeded:
Invalid string length
string is only a minus!
Invalid radix

APInt::fromString:
Radix should be 2, 8, 10, or 16!
Invalid string length
string is only a minus
Insufficient bit width
Invalid digit in string for given radix

APInt::toString:
"Radix should be 2, 8, 10, or 16!


For the recoverable APFloat assertions:

assertArithmeticOK:
Compile-time arithmetic does not support these semantics

readExponent:
Exponent has no digits
Invalid character in exponent

totalExponent:
Invalid character in exponent

skipLeadingZeroesAndAnyDot:
String cannot be just a dot

interpretDecimal:
Multiple dots in float
Invalid character in digit string

trailingHexadecimalFraction:
Invalid trailing hexadecimal fraction!


I'd expect we'd want to keep the assertions that check to make sure
we're comparing APInts and APFloats of the right semantics.

I'm not sure if it makes sense trying to change this right before the
code freeze, especially since I can't find any other classes that have
similar semantics that we could copy. So, what should we do?



More information about the llvm-dev mailing list