1
0
Fork 0
mirror of https://github.com/beefytech/Beef.git synced 2025-06-10 04:22:20 +02:00

Support for static field exporting

This commit is contained in:
Brian Fiete 2020-09-21 23:38:50 -07:00
parent 989f9e6019
commit 6878183873
9 changed files with 61 additions and 7 deletions

View file

@ -691,6 +691,7 @@ void BeIRCodeGen::Read(BeValue*& beValue)
globalVariable->mIsTLS = isTLS;
globalVariable->mAlign = varType->mAlign;
globalVariable->mUnnamedAddr = false;
globalVariable->mStorageKind = BfIRStorageKind_Normal;
if (initializer != NULL)
BF_ASSERT(varType->mAlign > 0);
@ -1782,6 +1783,7 @@ void BeIRCodeGen::HandleNextCmd()
globalVariable->mName = name;
globalVariable->mIsTLS = isTLS;
globalVariable->mUnnamedAddr = false;
globalVariable->mStorageKind = BfIRStorageKind_Normal;
if (initializer != NULL)
{
globalVariable->mAlign = varType->mAlign;
@ -1838,6 +1840,17 @@ void BeIRCodeGen::HandleNextCmd()
}
}
break;
case BfIRCmd_GlobalVar_SetStorageKind:
{
CMD_PARAM(BeValue*, val);
CMD_PARAM(int, storageKind);
BF_ASSERT(BeValueDynCast<BeGlobalVariable>(val) != NULL);
auto globalVariable = (BeGlobalVariable*)val;
globalVariable->mStorageKind = (BfIRStorageKind)storageKind;
}
break;
case BfIRCmd_GlobalStringPtr:
{
CMD_PARAM(String, str);