| 293 | return insert_instruction(this->insert_end(), op, std::move(args)); |
| 294 | } |
| 295 | instruction_ref module::insert_instruction(instruction_ref ins, |
| 296 | const operation& op, |
| 297 | std::vector<instruction_ref> args) |
| 298 | { |
| 299 | assert(has_instruction(ins) or is_end(ins, this->end())); |
| 300 | assert(not starts_with(op.name(), "@")); |
| 301 | shape r = compute_shape(op, args); |
| 302 | auto result = impl->insert(ins, {op, r, std::move(args)}); |
| 303 | instruction::backreference(result); |
| 304 | assert(result->valid(begin())); |
| 305 | return result; |
| 306 | } |
| 307 | |
| 308 | instruction_ref module::add_instruction(const operation& op, |
| 309 | std::vector<instruction_ref> args, |