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

Function GenerateParameterListFromString

src/Function.cpp:341–360  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

339}
340
341static void
342GenerateParameterListFromString(Function &currFunc, const string &params_string)
343{
344 vector<string> vs;
345 StringUtils::split_string(params_string, vs, ",");
346 int params_cnt = vs.size();
347 assert((params_cnt > 0) && "Invalid params_string!");
348 if ((params_cnt == 1) && (vs[0] == "Void")) {
349 return;
350 }
351 for (int i = 0; i < params_cnt; i++) {
352 assert((vs[i] != "Void") && "Invalid parameter type!");
353 CVQualifiers qfer;
354 qfer.add_qualifiers(false, false);
355 const Type *ty = Type::get_type_from_string(vs[i]);
356 Variable *v = VariableSelector::GenerateParameterVariable(ty, &qfer);
357 assert(v);
358 currFunc.param.push_back(v);
359 }
360}
361
362/*
363 *

Callers 1

make_builtin_functionMethod · 0.85

Calls 2

sizeMethod · 0.80
add_qualifiersMethod · 0.80

Tested by

no test coverage detected