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

Function ExpressionTypeProbability

src/Expression.cpp:111–122  ·  view source on GitHub ↗

* */

Source from the content-addressed store, hash-verified

109 *
110 */
111static eTermType
112ExpressionTypeProbability(const VectorFilter *filter)
113{
114 if (PartialExpander::direct_expand_check(eInvoke))
115 return eFunction;
116
117 assert(filter);
118
119 int i = rnd_upto(filter->get_max_prob(), filter);
120 ERROR_GUARD(MAX_TERM_TYPES);
121 return (eTermType)(filter->lookup(i));
122}
123
124unsigned int
125Expression::func_count(void) const

Callers 2

make_randomMethod · 0.85
make_random_paramMethod · 0.85

Calls 3

rnd_uptoFunction · 0.85
get_max_probMethod · 0.80
lookupMethod · 0.80

Tested by

no test coverage detected