| 52 | /////////////////////////////////////////////////////////////////////////////// |
| 53 | |
| 54 | FunctionInvocationBinary * |
| 55 | FunctionInvocationBinary::CreateFunctionInvocationBinary(CGContext &cg_context, |
| 56 | eBinaryOps op, |
| 57 | SafeOpFlags *flags) |
| 58 | { |
| 59 | FunctionInvocationBinary *fi = NULL; |
| 60 | assert(flags); |
| 61 | |
| 62 | if (flags && FunctionInvocationBinary::safe_ops(op)) { |
| 63 | bool op1 = flags->get_op1_sign(); |
| 64 | bool op2 = flags->get_op2_sign(); |
| 65 | enum SafeOpSize size = flags->get_op_size(); |
| 66 | |
| 67 | eSimpleType type1 = SafeOpFlags::flags_to_type(op1, size); |
| 68 | eSimpleType type2 = SafeOpFlags::flags_to_type(op2, size); |
| 69 | |
| 70 | const Block *blk = cg_context.get_current_block(); |
| 71 | assert(blk); |
| 72 | |
| 73 | std::string tmp_var1 = blk->create_new_tmp_var(type1); |
| 74 | std::string tmp_var2; |
| 75 | if (op == eLShift || op == eRShift) |
| 76 | tmp_var2 = blk->create_new_tmp_var(type2); |
| 77 | else |
| 78 | tmp_var2 = blk->create_new_tmp_var(type1); |
| 79 | |
| 80 | fi = new FunctionInvocationBinary(op, flags, tmp_var1, tmp_var2); |
| 81 | } |
| 82 | else { |
| 83 | fi = new FunctionInvocationBinary(op, flags); |
| 84 | } |
| 85 | return fi; |
| 86 | } |
| 87 | |
| 88 | |
| 89 | /* |
nothing calls this directly
no test coverage detected