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

Method GetMaxArrayDimension

src/Variable.cpp:863–879  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

861}
862
863size_t
864Variable::GetMaxArrayDimension(const vector<Variable*>& vars)
865{
866 // find the largest dimension of arrays, if there is any
867 size_t dimen = 0;
868
869 for (size_t i=0; i<vars.size(); i++) {
870 if (vars[i]->isArray) {
871 ArrayVariable* av = (ArrayVariable*)(vars[i]);
872 // const Array members were initialzed in ArrayVariable::OutputDef
873 if (av->get_dimension() > dimen) {
874 dimen = av->get_dimension();
875 }
876 }
877 }
878 return dimen;
879}
880
881void
882OutputArrayInitializers(const vector<Variable*>& vars, std::ostream &out, int indent)

Callers

nothing calls this directly

Calls 2

sizeMethod · 0.80
get_dimensionMethod · 0.45

Tested by

no test coverage detected