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

Improved null conditional lhs cast location

This commit is contained in:
Brian Fiete 2021-06-29 11:58:33 -07:00
parent 4ef6723ac2
commit 096dc0aaa3
4 changed files with 40 additions and 16 deletions

View file

@ -83,11 +83,15 @@ bool BfModule::AddDeferredCallEntry(BfDeferredCallEntry* deferredCallEntry, BfSc
auto prevInsertBlock = mBfIRBuilder->GetInsertBlock();
mBfIRBuilder->SetInsertPoint(mCurMethodState->mIRHeadBlock);
auto allocaInst = mBfIRBuilder->CreateAlloca(origParamTypes[paramIdx]);
mBfIRBuilder->ClearDebugLocation(allocaInst);
mBfIRBuilder->ClearDebugLocation_Last();
mBfIRBuilder->SetInsertPoint(prevInsertBlock);
if (WantsLifetimes())
{
mBfIRBuilder->CreateLifetimeStart(allocaInst);
mBfIRBuilder->ClearDebugLocation_Last();
}
mBfIRBuilder->CreateStore(scopeArg, allocaInst);
mBfIRBuilder->ClearDebugLocation_Last();
deferredCallEntry->mScopeArgs[paramIdx] = allocaInst;
if (WantsLifetimes())
scopeData->mDeferredLifetimeEnds.push_back(allocaInst);