| 2514 | } |
| 2515 | |
| 2516 | static void unpack_inputs(State &s, Value &argv, Type &ty, |
| 2517 | const ParamAttrs &argflag, StateValue value, |
| 2518 | StateValue value2, vector<StateValue> &inputs, |
| 2519 | vector<PtrInput> &ptr_inputs, unsigned idx) { |
| 2520 | if (auto agg = ty.getAsAggregateType()) { |
| 2521 | for (unsigned i = 0, e = agg->numElementsConst(); i != e; ++i) { |
| 2522 | if (agg->isPadding(i)) |
| 2523 | continue; |
| 2524 | unpack_inputs(s, argv, agg->getChild(i), argflag, agg->extract(value, i), |
| 2525 | agg->extract(value2, i), inputs, ptr_inputs, idx); |
| 2526 | } |
| 2527 | return; |
| 2528 | } |
| 2529 | |
| 2530 | auto unpack = [&](StateValue &&value) { |
| 2531 | value = argflag.encode(s, std::move(value), ty); |
| 2532 | |
| 2533 | if (ty.isPtrType()) { |
| 2534 | ptr_inputs.emplace_back(idx, |
| 2535 | std::move(value), |
| 2536 | expr::mkUInt(argflag.blockSize, 64), |
| 2537 | argflag.has(ParamAttrs::NoRead), |
| 2538 | argflag.has(ParamAttrs::NoWrite), |
| 2539 | argflag.has(ParamAttrs::NoCapture)); |
| 2540 | } else { |
| 2541 | inputs.emplace_back(std::move(value)); |
| 2542 | } |
| 2543 | }; |
| 2544 | unpack(std::move(value)); |
| 2545 | unpack(std::move(value2)); |
| 2546 | } |
| 2547 | |
| 2548 | static StateValue |
| 2549 | check_return_value(State &s, StateValue &&val, const Type &ty, |
no test coverage detected