| 3401 | } |
| 3402 | |
| 3403 | BeBinaryOpInst* BeModule::CreateBinaryOp(BeBinaryOpKind opKind, BeValue* lhs, BeValue* rhs, BfOverflowCheckKind overflowCheckKind) |
| 3404 | { |
| 3405 | #ifdef _DEBUG |
| 3406 | auto leftType = lhs->GetType(); |
| 3407 | auto rightType = rhs->GetType(); |
| 3408 | BF_ASSERT(leftType == rightType); |
| 3409 | #endif |
| 3410 | auto inst = mAlloc.Alloc<BeBinaryOpInst>(); |
| 3411 | inst->mOpKind = opKind; |
| 3412 | inst->mLHS = lhs; |
| 3413 | inst->mRHS = rhs; |
| 3414 | inst->mOverflowCheckKind = overflowCheckKind; |
| 3415 | AddInst(inst); |
| 3416 | return inst; |
| 3417 | } |
| 3418 | |
| 3419 | BeAllocaInst* BeModule::CreateAlloca(BeType* type) |
| 3420 | { |