| 498 | } |
| 499 | |
| 500 | Variable * |
| 501 | VariableSelector::create_and_initialize(Effect::Access access, const CGContext &cg_context, const Type* t, |
| 502 | const CVQualifiers* qfer, Block *blk, std::string name) |
| 503 | { |
| 504 | const Expression* init = NULL; |
| 505 | Variable* var = NULL; |
| 506 | |
| 507 | if (rnd_flipcoin(NewArrayVariableProb)) { |
| 508 | if (CGOptions::strict_const_arrays()) { |
| 509 | init = Constant::make_random(t); |
| 510 | } else { |
| 511 | init = make_init_value(access, cg_context, t, qfer, blk); |
| 512 | } |
| 513 | var = create_array_and_itemize(blk, name, cg_context, t, init, qfer); |
| 514 | } |
| 515 | else { |
| 516 | init = make_init_value(access, cg_context, t, qfer, blk); |
| 517 | var = new_variable(name, t, init, qfer); |
| 518 | } |
| 519 | assert(var); |
| 520 | return var; |
| 521 | } |
| 522 | |
| 523 | static int tmp_count = 0; |
| 524 | // -------------------------------------------------------------- |
nothing calls this directly
no test coverage detected