mirror of
https://github.com/beefytech/Beef.git
synced 2025-07-04 23:36:00 +02:00
'var' fixes
This commit is contained in:
parent
37e5576973
commit
75e0cb9907
1 changed files with 4 additions and 3 deletions
|
@ -3924,7 +3924,7 @@ void BfModule::Visit(BfSwitchStatement* switchStmt)
|
|||
|
||||
bool tryExtendValue = false;
|
||||
bool addDebugInfo = true;
|
||||
if ((wantsDebugInfo) && (!switchValue.mType->IsValuelessType()))
|
||||
if ((wantsDebugInfo) && (!switchValue.mType->IsValuelessType()) && (!switchValue.mType->IsVar()))
|
||||
{
|
||||
if (IsTargetingBeefBackend())
|
||||
{
|
||||
|
@ -4000,7 +4000,8 @@ void BfModule::Visit(BfSwitchStatement* switchStmt)
|
|||
}
|
||||
}
|
||||
|
||||
AddLocalVariableDef(localDef, addDebugInfo, true);
|
||||
if (!localDef->mResolvedType->IsVar())
|
||||
AddLocalVariableDef(localDef, addDebugInfo, true);
|
||||
|
||||
BfDeferredLocalAssignData deferredLocalAssignData(mCurMethodState->mCurScope);
|
||||
deferredLocalAssignData.mVarIdBarrier = mCurMethodState->GetRootMethodState()->mCurLocalVarId;
|
||||
|
@ -4062,7 +4063,7 @@ void BfModule::Visit(BfSwitchStatement* switchStmt)
|
|||
enumTagVal = LoadValue(enumTagVal);
|
||||
switchStatement = mBfIRBuilder->CreateSwitch(enumTagVal.mValue, noSwitchBlock, numExpressions);
|
||||
}
|
||||
else if (!isConstSwitch)
|
||||
else if ((!isConstSwitch) && (!switchValue.mType->IsVar()))
|
||||
switchStatement = mBfIRBuilder->CreateSwitch(switchValue.mValue, noSwitchBlock, numExpressions);
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue