1
0
Fork 0
mirror of https://github.com/beefytech/Beef.git synced 2025-06-08 19:48:20 +02:00

Use lifetime extension for mixin results

This commit is contained in:
Brian Fiete 2022-06-16 07:21:19 -07:00
parent 1639542fed
commit ccb1646990
12 changed files with 105 additions and 44 deletions

View file

@ -34,11 +34,10 @@ static const char* gOpName[] =
"@DefLoad",
"@DefPhi",
"@DbgDecl",
"@DbgRangeStart",
"@DbgRangeEnd",
"@LifetimeExtend",
"@LifetimeStart",
"@LifetimeEnd",
"@LifetimeSoftEnd",
"@ValueScopeSoftEnd",
"@ValueScopeHardEnd",
"@Label",
@ -13234,29 +13233,25 @@ void BeMCContext::DoCodeEmission()
}
}
break;
case BeMCInstKind_DbgRangeStart:
{
}
break;
case BeMCInstKind_DbgRangeEnd:
{
auto vregInfo = GetVRegInfo(inst->mArg0);
if (vregInfo->mDbgVariable != NULL)
{
auto dbgVar = vregInfo->mDbgVariable;
dbgVar->mDeclEnd = funcCodePos;
dbgVar->mDeclLifetimeExtend = false;
BF_ASSERT((uint)dbgVar->mDeclEnd >= (uint)dbgVar->mDeclStart);
}
}
break;
case BeMCInstKind_LifetimeExtend:
break;
case BeMCInstKind_LifetimeStart:
break;
case BeMCInstKind_LifetimeEnd:
break;
case BeMCInstKind_LifetimeSoftEnd:
{
auto vregInfo = GetVRegInfo(inst->mArg0);
if ((vregInfo != NULL) && (vregInfo->mDbgVariable != NULL))
{
auto dbgVar = vregInfo->mDbgVariable;
dbgVar->mDeclEnd = funcCodePos;
dbgVar->mDeclLifetimeExtend = false;
dbgVar->mDbgLifeEnded = true;
BF_ASSERT((uint)dbgVar->mDeclEnd >= (uint)dbgVar->mDeclStart);
}
}
break;
case BeMCInstKind_ValueScopeSoftEnd:
break;
case BeMCInstKind_ValueScopeHardEnd:
@ -16143,7 +16138,7 @@ void BeMCContext::Generate(BeFunction* function)
mDbgPreferredRegs[32] = X64Reg_R8;*/
//mDbgPreferredRegs[8] = X64Reg_RAX;
//mDebugging = (function->mName == "?CreateEntity@ModelLoader@Content@GlitchyEngine@bf@@CA?AU?$__TUPLE_Entity_Transform@VEcsEntity@World@GlitchyEngine@bf@@PEA?AUTransformComponent@123@@4@PEAVEcsWorld@World@34@U?$Nullable@UStringView@System@bf@@@System@4@VEcsEntity@734@@Z");
mDebugging = (function->mName == "?NumberToString@NumberFormatter@System@bf@@SAXUStringView@23@HPEAVIFormatProvider@23@PEAVString@23@@Z");
// || (function->mName == "?MethodA@TestProgram@BeefTest@bf@@CAXXZ");
// || (function->mName == "?Hey@Blurg@bf@@SAXXZ")
// ;
@ -17002,6 +16997,16 @@ void BeMCContext::Generate(BeFunction* function)
}
}
break;
case BeLifetimeSoftEndInst::TypeId:
{
auto castedInst = (BeLifetimeSoftEndInst*)inst;
auto mcPtr = GetOperand(castedInst->mPtr, false, true, true);
if (mcPtr.IsVRegAny())
{
AllocInst(BeMCInstKind_LifetimeSoftEnd, mcPtr);
}
}
break;
case BeValueScopeStartInst::TypeId:
{
result = BeMCOperand::FromImmediate((int)mVRegInfo.size());