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

Method to_string

src/SafeOpFlags.cpp:324–347  ·  view source on GitHub ↗

find the safe math function/macro name */

Source from the content-addressed store, hash-verified

322
323/* find the safe math function/macro name */
324std::string
325SafeOpFlags::to_string(enum eBinaryOps op) const
326{
327 if (op_size_ == sFloat)
328 return safe_float_func_string(op);
329 string s;
330 switch (op) {
331 case eAdd: s = "safe_add_"; break;
332 case eSub: s = "safe_sub_"; break;
333 case eMul: s = "safe_mul_"; break;
334 case eMod: s = "safe_mod_"; break;
335 case eDiv: s = "safe_div_"; break;
336 case eLShift: s = "safe_lshift_"; break;
337 case eRShift: s = "safe_rshift_"; break;
338 default: break;
339 }
340 ostringstream oss;
341 OutputFuncOrMacro(oss);
342 OutputSize(oss);
343 OutputOp1(oss);
344 (op == eLShift || op == eRShift) ? OutputOp2(oss) : OutputOp1(oss);
345 s += oss.str();
346 return s;
347}
348
349/* find the safe math function/macro name */
350std::string

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected