1
0
Fork 0
mirror of https://github.com/beefytech/Beef.git synced 2025-06-08 11:38:21 +02:00

Comptime updates, start of metaprogramming support

This commit is contained in:
Brian Fiete 2021-01-08 16:21:03 -08:00
parent be1c099f19
commit 3bbf2d8313
43 changed files with 1562 additions and 885 deletions

View file

@ -880,6 +880,21 @@ void BeIRCodeGen::Read(BeValue*& beValue)
beValue = mBeModule->CreateUndefValue(type);
return;
}
else if (constType == BfConstType_TypeOf)
{
CMD_PARAM(BeType*, type);
beValue = mReflectDataMap[type];
BF_ASSERT(beValue != NULL);
return;
}
else if (constType == BfConstType_TypeOf_WithData)
{
CMD_PARAM(BeType*, type);
CMD_PARAM(BeValue*, value);
mReflectDataMap[type] = value;
beValue = value;
return;
}
bool isSigned = false;
BeType* llvmConstType = GetBeType(typeCode, isSigned);
@ -1969,6 +1984,13 @@ void BeIRCodeGen::HandleNextCmd()
//SetResult(curId, globalVariable);
}
break;
case BfIRCmd_SetReflectTypeData:
{
CMD_PARAM(BeType*, type);
CMD_PARAM(BeValue*, value);
mReflectDataMap[type] = value;
}
break;
case BfIRCmd_CreateBlock:
{
CMD_PARAM(String, name);