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

Method CreateFunctionInvocationUnary

src/FunctionInvocationUnary.cpp:50–71  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

48///////////////////////////////////////////////////////////////////////////////
49
50FunctionInvocationUnary *
51FunctionInvocationUnary::CreateFunctionInvocationUnary(
52 CGContext &cg_context, eUnaryOps op, SafeOpFlags *flags)
53{
54 FunctionInvocationUnary *fi = NULL;
55 if (flags) {
56 bool op1 = flags->get_op1_sign();
57 enum SafeOpSize size = flags->get_op_size();
58
59 eSimpleType type = SafeOpFlags::flags_to_type(op1, size);
60 const Block *blk = cg_context.get_current_block();
61 assert(blk);
62
63 std::string tmp_var = blk->create_new_tmp_var(type);
64 fi = new FunctionInvocationUnary(op, flags, tmp_var);
65 }
66 else {
67 fi = new FunctionInvocationUnary(op, flags);
68 }
69 assert(fi);
70 return fi;
71}
72
73FunctionInvocationUnary::FunctionInvocationUnary(eUnaryOps op, SafeOpFlags *flags)
74 : FunctionInvocation(eUnaryPrim, flags),

Callers

nothing calls this directly

Calls 4

get_op1_signMethod · 0.80
get_op_sizeMethod · 0.80
get_current_blockMethod · 0.80
create_new_tmp_varMethod · 0.80

Tested by

no test coverage detected