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

Fixed temp var deferred lifetime end issue in LLVM backend

This commit is contained in:
Brian Fiete 2022-07-26 16:07:14 -04:00
parent 1a85562d54
commit a1c7e6e02b

View file

@ -3582,7 +3582,7 @@ void BfModule::VisitCodeBlock(BfBlock* block)
auto lifetimeStart = mBfIRBuilder->CreateLifetimeStart(tempVar);
mBfIRBuilder->ClearDebugLocation(lifetimeStart);
if (!mBfIRBuilder->mIgnoreWrites)
if ((!mBfIRBuilder->mIgnoreWrites) && (IsTargetingBeefBackend()))
mCurMethodState->mCurScope->mPrevScope->mDeferredLifetimeEnds.push_back(tempVar);
mBfIRBuilder->SetInsertPoint(prevInsertBlock);
if (exprEvaluator->mResult.IsSplat())
@ -4314,6 +4314,11 @@ void BfModule::Visit(BfDeleteStatement* deleteStmt)
void BfModule::Visit(BfSwitchStatement* switchStmt)
{
if (mModuleName == "BeefTest_TestProgram")
{
NOP;
}
BfScopeData outerScope;
outerScope.mInnerIsConditional = false;
outerScope.mCloseNode = switchStmt;