stage3/constant_folding.cc
changeset 603 a45a62dd6df9
parent 602 456add88d64c
child 604 2989051a0a64
equal deleted inserted replaced
602:456add88d64c 603:a45a62dd6df9
   199 #define NEW_CVALUE(dtype, symbol) \
   199 #define NEW_CVALUE(dtype, symbol) \
   200  (symbol->const_value_##dtype) = new(symbol_c::const_value_##dtype##_t); \
   200  (symbol->const_value_##dtype) = new(symbol_c::const_value_##dtype##_t); \
   201  if ((symbol->const_value_##dtype) == NULL) ERROR; \
   201  if ((symbol->const_value_##dtype) == NULL) ERROR; \
   202  (symbol->const_value_##dtype)->status = symbol_c::cs_undefined;
   202  (symbol->const_value_##dtype)->status = symbol_c::cs_undefined;
   203 
   203 
   204 #define SET_CVALUE(dtype, symbol, new_value)  ((symbol)->const_value_##dtype->value) = new_value; ((symbol)->const_value_##dtype->status) = symbol_c::cs_const_value;  
   204 #define SET_CVALUE(dtype, symbol, new_value)  ((symbol)->const_value_##dtype->value) = new_value; ((symbol)->const_value_##dtype->status) = symbol_c::cs_const_value;
   205 #define GET_CVALUE(dtype, symbol)             ((symbol)->const_value_##dtype->value) 
   205 #define GET_CVALUE(dtype, symbol)             ((symbol)->const_value_##dtype->value)
   206 #define SET_OVFLOW(dtype, symbol)             ((symbol)->const_value_##dtype->status) = symbol_c::cs_overflow
   206 #define SET_OVFLOW(dtype, symbol)             ((symbol)->const_value_##dtype->status) = symbol_c::cs_overflow
   207     /* The following test is correct in the presence of a NULL pointer, as the logical evaluation will be suspended as soon as the first condition is false! */
   207     /* The following test is correct in the presence of a NULL pointer, as the logical evaluation will be suspended as soon as the first condition is false! */
   208 #define VALID_CVALUE(dtype, symbol)           ((NULL != (symbol)->const_value_##dtype) && (symbol_c::cs_const_value == (symbol)->const_value_##dtype->status))
   208 #define VALID_CVALUE(dtype, symbol)           ((NULL != (symbol)->const_value_##dtype) && (symbol_c::cs_const_value == (symbol)->const_value_##dtype->status))
   209 #define ISZERO_CVALUE(dtype, symbol)          ((VALID_CVALUE(dtype, symbol)) && (GET_CVALUE(dtype, symbol) == 0))
   209 #define ISZERO_CVALUE(dtype, symbol)          ((VALID_CVALUE(dtype, symbol)) && (GET_CVALUE(dtype, symbol) == 0))
   210 
   210