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

Method print_model_val

tools/transform.cpp:93–110  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

91}
92
93void tools::print_model_val(ostream &os, State &st, const Model &m,
94 const Value *var, const Type &type,
95 const StateValue &val, unsigned child) {
96 if (!type.isAggregateType()) {
97 print_single_varval(os, st, m, var, type, val, child);
98 return;
99 }
100
101 os << (type.isStructType() ? "{ " : "< ");
102 auto agg = type.getAsAggregateType();
103 for (unsigned i = 0, e = agg->numElementsConst(); i < e; ++i) {
104 if (i != 0)
105 os << ", ";
106 tools::print_model_val(os, st, m, var, agg->getChild(i),
107 agg->extract(val, i), child + i);
108 }
109 os << (type.isStructType() ? " }" : " >");
110}
111
112
113using print_var_val_ty = function<void(ostream&, const Model&)>;

Callers

nothing calls this directly

Calls 6

print_single_varvalFunction · 0.85
isAggregateTypeMethod · 0.80
getAsAggregateTypeMethod · 0.80
numElementsConstMethod · 0.80
isStructTypeMethod · 0.45
extractMethod · 0.45

Tested by

no test coverage detected