| 86 | } |
| 87 | |
| 88 | eAssignOps |
| 89 | StatementAssign::AssignOpsProbability(const Type* type) |
| 90 | { |
| 91 | if (!CGOptions::compound_assignment()) { |
| 92 | return eSimpleAssign; |
| 93 | } |
| 94 | // First, floating point values do not apply to |=, &= and ^=. |
| 95 | // Second, similar to signed integers, we don't generate pre- or post- |
| 96 | // operators for floating point values. Instead, we will wrap all |
| 97 | // of these operations into safe_float_math later. |
| 98 | if (type && (type->eType != eSimple || type->get_base_type()->is_float())) { |
| 99 | return eSimpleAssign; |
| 100 | } |
| 101 | |
| 102 | VectorFilter filter(&assignOpsTable_); |
| 103 | if (type && type->is_signed()) { |
| 104 | filter.add(ePreIncr).add(ePreDecr).add(ePostIncr).add(ePostDecr); |
| 105 | } |
| 106 | |
| 107 | int value = rnd_upto(filter.get_max_prob(), &filter); |
| 108 | return (eAssignOps)(filter.lookup(value)); |
| 109 | } |
| 110 | |
| 111 | /* |
| 112 | * |
nothing calls this directly
no test coverage detected