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

Method aggregateVals

ir/type.cpp:809–835  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

807}
808
809StateValue AggregateType::aggregateVals(const vector<StateValue> &vals) const {
810 assert(vals.size() + numPaddingsConst() == elements);
811 // structs can be empty
812 if (elements == 0)
813 return { expr::mkUInt(0, 1), expr::mkUInt(0, 1) };
814
815 StateValue v;
816 bool first = true;
817 unsigned val_idx = 0;
818 for (unsigned idx = 0; idx < elements; ++idx) {
819 if (children[idx]->bits() == 0) {
820 assert(!isPadding(idx));
821 val_idx++;
822 continue;
823 }
824
825 StateValue vv;
826 if (isPadding(idx))
827 vv = children[idx]->getDummyValue(false);
828 else
829 vv = vals[val_idx++];
830 vv = children[idx]->toBV(std::move(vv));
831 v = first ? std::move(vv) : v.concat(vv);
832 first = false;
833 }
834 return v;
835}
836
837StateValue AggregateType::extract(const StateValue &val, unsigned index,
838 bool fromInt) const {

Callers 11

fromIntMethod · 0.95
freezeMethod · 0.80
addFnCallMethod · 0.80
toSMTMethod · 0.80
mkInputMethod · 0.80
loadMethod · 0.80
toSMTMethod · 0.80
update_repackFunction · 0.80
pack_returnFunction · 0.80
check_ret_attributesFunction · 0.80
toSMTMethod · 0.80

Calls 5

getDummyValueMethod · 0.80
toBVMethod · 0.80
sizeMethod · 0.45
bitsMethod · 0.45
concatMethod · 0.45

Tested by

no test coverage detected