* return 1 if changed, 0 otherwise */
| 575 | * return 1 if changed, 0 otherwise |
| 576 | */ |
| 577 | int |
| 578 | FactPointTo::join(const Fact& f) |
| 579 | { |
| 580 | // right now, only consider facts of same category |
| 581 | // intersect diff. categories of facts later? |
| 582 | int changed = 0; |
| 583 | if (is_related(f)) { |
| 584 | const FactPointTo& fact = (const FactPointTo&)f; |
| 585 | const vector<const Variable*>& vars = fact.get_point_to_vars(); |
| 586 | for (size_t i=0; i<vars.size(); i++) { |
| 587 | const Variable* v = vars[i]; |
| 588 | if (!is_variable_in_set(point_to_vars, v)) { |
| 589 | point_to_vars.push_back(v); |
| 590 | changed = 1; |
| 591 | } |
| 592 | } |
| 593 | } |
| 594 | return changed; |
| 595 | } |
| 596 | |
| 597 | /* |
| 598 | * join two facts from two visits to the same function |
nothing calls this directly
no test coverage detected