do some constant folding */
| 157 | |
| 158 | /* do some constant folding */ |
| 159 | bool |
| 160 | FunctionInvocationUnary::equals(int num) const |
| 161 | { |
| 162 | assert(!param_value.empty()); |
| 163 | if (num == 0 && eFunc == eNot && param_value[0]->not_equals(0)) { |
| 164 | return true; |
| 165 | } |
| 166 | if (num == 1 && eFunc == eNot && param_value[0]->equals(0)) { |
| 167 | return true; |
| 168 | } |
| 169 | if (eFunc == eMinus && param_value[0]->equals(num * -1)) { |
| 170 | return true; |
| 171 | } |
| 172 | return false; |
| 173 | } |
| 174 | |
| 175 | /////////////////////////////////////////////////////////////////////////////// |
| 176 |
nothing calls this directly
no test coverage detected