| 596 | } |
| 597 | |
| 598 | instruction_ref module::replace_return(std::vector<instruction_ref> args) |
| 599 | { |
| 600 | impl->changed.notify(); |
| 601 | auto last = std::prev(this->end()); |
| 602 | // If there is no return then add a return |
| 603 | if(last->name() != "@return") |
| 604 | { |
| 605 | assert(std::none_of(impl->instructions.begin(), |
| 606 | impl->instructions.end(), |
| 607 | [](const instruction& ins) { return ins.name() == "@return"; })); |
| 608 | return this->add_return(args); |
| 609 | } |
| 610 | |
| 611 | shape r = compute_shape(last->get_operator(), args); |
| 612 | instruction::replace(last, last->get_operator(), r, std::move(args)); |
| 613 | assert(last->valid(begin())); |
| 614 | |
| 615 | return last; |
| 616 | } |
| 617 | |
| 618 | shape module::get_parameter_shape(std::string name) const |
| 619 | { |
no test coverage detected