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

Method Output

src/FunctionInvocationUnary.cpp:205–258  ·  view source on GitHub ↗

* */

Source from the content-addressed store, hash-verified

203 *
204 */
205void
206FunctionInvocationUnary::Output(std::ostream &out) const
207{
208 bool need_cast = false;
209 out << "(";
210 switch (eFunc) {
211 default:
212 assert(!"invalid operator in FunctionInvocationUnary::Output()");
213 break;
214
215 case eMinus:
216 if (CGOptions::avoid_signed_overflow()) {
217 assert(op_flags);
218 if (op_flags->get_op_size() != sFloat) {
219 string fname = op_flags->to_string(eFunc);
220 int id = SafeOpFlags::to_id(fname);
221 // don't use safe math wrapper if this function is specified in "--safe-math-wrapper"
222 if (CGOptions::safe_math_wrapper(id)) {
223 out << fname << "(";
224 if (CGOptions::math_notmp()) {
225 out << tmp_var << ", ";
226 }
227 param_value[0]->Output(out);
228 if (CGOptions::identify_wrappers()) {
229 out << ", " << id;
230 }
231 out << ")";
232 break;
233 }
234 }
235 else {
236 OutputStandardFuncName(eFunc, out);
237 param_value[0]->Output(out);
238 break;
239 }
240 }
241 need_cast = true;
242 // Fallthrough!
243
244 case ePlus:
245 case eNot:
246 case eBitNot:
247 OutputStandardFuncName(eFunc, out);
248 // explicit type casting for op1
249 if (need_cast) {
250 out << "(";
251 op_flags->OutputSize(out);
252 out << ")";
253 }
254 param_value[0]->Output(out);
255 break;
256 }
257 out << ")";
258}
259
260/*
261 *

Callers

nothing calls this directly

Calls 4

get_op_sizeMethod · 0.80
OutputSizeMethod · 0.80
OutputStandardFuncNameFunction · 0.70
to_stringMethod · 0.45

Tested by

no test coverage detected