| 1252 | } |
| 1253 | |
| 1254 | void simplecpp::TokenList::constFoldShift(Token *tok) |
| 1255 | { |
| 1256 | for (; tok && tok->op != ')'; tok = tok->next) { |
| 1257 | if (!tok->previous || !tok->previous->number) |
| 1258 | continue; |
| 1259 | if (!tok->next || !tok->next->number) |
| 1260 | continue; |
| 1261 | |
| 1262 | long long result; |
| 1263 | if (tok->str() == "<<") |
| 1264 | result = stringToLL(tok->previous->str()) << stringToLL(tok->next->str()); |
| 1265 | else if (tok->str() == ">>") |
| 1266 | result = stringToLL(tok->previous->str()) >> stringToLL(tok->next->str()); |
| 1267 | else |
| 1268 | continue; |
| 1269 | |
| 1270 | tok = tok->previous; |
| 1271 | tok->setstr(toString(result)); |
| 1272 | deleteToken(tok->next); |
| 1273 | deleteToken(tok->next); |
| 1274 | } |
| 1275 | } |
| 1276 | |
| 1277 | static const std::string NOTEQ("not_eq"); |
| 1278 | void simplecpp::TokenList::constFoldComparison(Token *tok) |
nothing calls this directly
no test coverage detected