MCPcopy Create free account
hub / github.com/AliveToolkit/alive2 / unpack_inputs

Function unpack_inputs

ir/instr.cpp:2516–2546  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

2514}
2515
2516static 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
2548static StateValue
2549check_return_value(State &s, StateValue &&val, const Type &ty,

Callers 1

toSMTMethod · 0.85

Calls 7

getAsAggregateTypeMethod · 0.80
numElementsConstMethod · 0.80
isPaddingMethod · 0.80
isPtrTypeMethod · 0.80
extractMethod · 0.45
encodeMethod · 0.45
hasMethod · 0.45

Tested by

no test coverage detected