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

Fixed issues with global var addresses in const arrays

This commit is contained in:
Brian Fiete 2020-07-13 08:51:02 -07:00
parent 52af512b4f
commit b30a72719c
13 changed files with 376 additions and 36 deletions

View file

@ -680,7 +680,8 @@ void BeIRCodeGen::Read(BeValue*& beValue)
globalVariable->mIsTLS = isTLS;
globalVariable->mAlign = varType->mAlign;
globalVariable->mUnnamedAddr = false;
BF_ASSERT(varType->mAlign > 0);
if (initializer != NULL)
BF_ASSERT(varType->mAlign > 0);
SetResult(streamId, globalVariable);
beValue = globalVariable;
@ -721,6 +722,19 @@ void BeIRCodeGen::Read(BeValue*& beValue)
BE_MEM_END("ParamType_Const_GEP32_2");
return;
}
else if (constType == BfConstType_ExtractValue)
{
CMD_PARAM(BeConstant*, target);
CMD_PARAM(int, idx0);
auto gepConstant = mBeModule->mAlloc.Alloc<BeExtractValueConstant>();
gepConstant->mTarget = target;
gepConstant->mIdx0 = idx0;
beValue = gepConstant;
BE_MEM_END("ParamType_Const_ExtractValue");
return;
}
else if (constType == BfConstType_PtrToInt)
{
CMD_PARAM(BeConstant*, target);