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

Method has_eligible_volatile_var

src/VariableSelector.cpp:302–320  ·  view source on GitHub ↗

return true if a variable in the list is volatile */

Source from the content-addressed store, hash-verified

300
301/* return true if a variable in the list is volatile */
302bool
303VariableSelector::has_eligible_volatile_var(const vector<Variable *>& vars, const Type* type, const CVQualifiers* qfer, Effect::Access access, const CGContext& cg_context)
304{
305 for (size_t i=0; i<vars.size(); i++) {
306 Variable* var = vars[i];
307 if (type && !type->match(var->type, eFlexible)) {
308 continue;
309 }
310 if (qfer && !qfer->match_indirect(var->qfer)) {
311 continue;
312 }
313 int deref_level = var->type->get_indirect_level() - type->get_indirect_level();
314 if (is_eligible_var(var, deref_level, access, cg_context) && var->is_volatile()) {
315 Bookkeeper::volatile_avail++;
316 return true;
317 }
318 }
319 return false;
320}
321
322Variable *
323VariableSelector::choose_ok_var(const vector<Variable *> &vars)

Callers

nothing calls this directly

Calls 5

sizeMethod · 0.80
match_indirectMethod · 0.80
matchMethod · 0.45
get_indirect_levelMethod · 0.45
is_volatileMethod · 0.45

Tested by

no test coverage detected