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

Method is_variant

src/ArrayVariable.cpp:403–424  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

401}
402
403bool
404ArrayVariable::is_variant(const Variable* v) const
405{
406 if (v->isArray) {
407 const ArrayVariable* av = dynamic_cast<const ArrayVariable*>(v);
408 assert(av);
409 if (av->collective != 0 && collective == av->collective && av->indices.size() == this->indices.size() ) {
410 size_t i;
411 for (i=0; i<indices.size(); i++) {
412 const Expression* e = indices[i];
413 const Expression* other_e = av->indices[i];
414 if (count_expr_key_var(e) != 1 ||
415 count_expr_key_var(other_e) != 1 ||
416 find_expr_key_var(e) != find_expr_key_var(other_e)) {
417 return false;
418 }
419 }
420 return true;
421 }
422 }
423 return false;
424}
425
426// --------------------------------------------------------------
427bool

Callers

nothing calls this directly

Calls 3

count_expr_key_varFunction · 0.85
find_expr_key_varFunction · 0.85
sizeMethod · 0.80

Tested by

no test coverage detected