| 4760 | } |
| 4761 | |
| 4762 | BfIRValue BfIRBuilder::CreateNot(BfIRValue val) |
| 4763 | { |
| 4764 | if (val.IsConst()) |
| 4765 | { |
| 4766 | auto constVal = GetConstantById(val.mId); |
| 4767 | uint64 newVal = 0; |
| 4768 | if (constVal->mTypeCode == BfTypeCode_Boolean) |
| 4769 | newVal = constVal->mBool ? 0 : 1; |
| 4770 | else |
| 4771 | newVal = ~constVal->mUInt64; |
| 4772 | return CreateConst(constVal->mTypeCode, newVal); |
| 4773 | } |
| 4774 | |
| 4775 | auto retVal = WriteCmd(BfIRCmd_Not, val); |
| 4776 | NEW_CMD_INSERTED_IRVALUE; |
| 4777 | return retVal; |
| 4778 | } |
| 4779 | |
| 4780 | BfIRValue BfIRBuilder::CreateBitCast(BfIRValue val, BfIRType type) |
| 4781 | { |
no test coverage detected