Branch: Tag:

2014-12-04

2014-12-04 19:26:10 by Arne Goedeke <el@laramies.com>

overflow checks: generate overflow checks for 8 and 16 bit integer types

even though llvm internally has apis for checking overflow of 8 and 16 bit
integer arithmetic, those are not available through clang intrinsics. we
therefore use the same checks as for other compilers

126:   # define INT16 short   #endif    + #ifndef MAX_INT16 + # define MAX_UINT16 65535 + # define MAX_INT16 32767 + # define MIN_INT16 (-32768) + #endif +    /* and INT8 */   #ifndef INT8   # define INT8 char   #endif    -  + #ifndef MAX_INT8 + # define MAX_UINT8 255 + # define MAX_INT8 127 + # define MIN_INT8 (-128) + #endif +    #ifdef INT64   # define LONGEST INT64   # define PRINTLONGEST PRINTINT64