MCPcopy Create free account
hub / github.com/csmith-project/csmith / itemize

Method itemize

src/ArrayVariable.cpp:261–278  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

259}
260
261ArrayVariable*
262ArrayVariable::itemize(void) const
263{
264 size_t i;
265 assert(collective == 0);
266 ArrayVariable* av = new ArrayVariable(*this);
267 VariableSelector::AllVars.push_back(av);
268 for (i=0; i<sizes.size(); i++) {
269 int index = rnd_upto(sizes[i]);
270 av->add_index(new Constant(get_int_type(), StringUtils::int2str(index)));
271 }
272 av->collective = this;
273 // only expand struct/union for itemized array variable
274 if (type->is_aggregate()) {
275 av->create_field_vars(type);
276 }
277 return av;
278}
279
280ArrayVariable*
281ArrayVariable::itemize(const vector<int>& const_indices) const

Callers 8

configureMethod · 0.80
to_stringMethod · 0.80
Variable.cppFile · 0.80
output_value_dumpMethod · 0.80
choose_ok_varMethod · 0.80
itemize_arrayMethod · 0.80

Calls 6

rnd_uptoFunction · 0.85
get_int_typeFunction · 0.85
sizeMethod · 0.80
add_indexMethod · 0.80
create_field_varsMethod · 0.80
is_aggregateMethod · 0.45

Tested by

no test coverage detected