| 899 | } |
| 900 | |
| 901 | std::unordered_map<instruction_ref, instruction_ref> |
| 902 | module::get_ins_param_map(const std::vector<instruction_ref>& inputs, bool reverse) const |
| 903 | { |
| 904 | std::unordered_map<instruction_ref, instruction_ref> result; |
| 905 | auto params = this->get_parameters(); |
| 906 | assert(params.size() == inputs.size()); |
| 907 | sort_params(params); |
| 908 | if(reverse) |
| 909 | { |
| 910 | std::transform( |
| 911 | params.begin(), |
| 912 | params.end(), |
| 913 | inputs.begin(), |
| 914 | std::inserter(result, result.end()), |
| 915 | [&](instruction_ref param, auto input) { return std::make_pair(param, input); }); |
| 916 | } |
| 917 | else |
| 918 | { |
| 919 | std::transform( |
| 920 | params.begin(), |
| 921 | params.end(), |
| 922 | inputs.begin(), |
| 923 | std::inserter(result, result.end()), |
| 924 | [&](instruction_ref param, auto input) { return std::make_pair(input, param); }); |
| 925 | } |
| 926 | return result; |
| 927 | } |
| 928 | |
| 929 | std::vector<instruction_ref> |
| 930 | module::get_inputs(const std::unordered_map<instruction_ref, instruction_ref>& map_ins) const |
no test coverage detected