| 486 | } |
| 487 | |
| 488 | bool FwdAnalysis::hasOperand(const Token *tok, const Token *lhs) const |
| 489 | { |
| 490 | if (!tok) |
| 491 | return false; |
| 492 | std::deque<const Token*> nodes{ tok }; |
| 493 | while (!nodes.empty()) { |
| 494 | const Token* node = nodes.front(); |
| 495 | if (isSameExpression(false, node, lhs, mSettings, false, false, nullptr)) |
| 496 | return true; |
| 497 | if (node->astOperand1()) |
| 498 | nodes.emplace_back(node->astOperand1()); |
| 499 | if (node->astOperand2()) |
| 500 | nodes.emplace_back(node->astOperand2()); |
| 501 | nodes.pop_front(); |
| 502 | } |
| 503 | return false; |
| 504 | } |
| 505 | |
| 506 | const Token *FwdAnalysis::reassign(const Token *expr, const Token *startToken, const Token *endToken) |
| 507 | { |
no test coverage detected