MCPcopy Create free account
hub / github.com/beefytech/Beef / CreateNot

Method CreateNot

IDEHelper/Compiler/BfIRBuilder.cpp:4762–4778  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

4760}
4761
4762BfIRValue 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
4780BfIRValue BfIRBuilder::CreateBitCast(BfIRValue val, BfIRType type)
4781{

Callers 4

HandleNextCmdMethod · 0.80
VisitMethod · 0.80

Calls 1

IsConstMethod · 0.45

Tested by

no test coverage detected