mirror of
https://github.com/beefytech/Beef.git
synced 2025-07-05 15:56: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 tryExtendValue = false;
|
||||||
bool addDebugInfo = true;
|
bool addDebugInfo = true;
|
||||||
if ((wantsDebugInfo) && (!switchValue.mType->IsValuelessType()))
|
if ((wantsDebugInfo) && (!switchValue.mType->IsValuelessType()) && (!switchValue.mType->IsVar()))
|
||||||
{
|
{
|
||||||
if (IsTargetingBeefBackend())
|
if (IsTargetingBeefBackend())
|
||||||
{
|
{
|
||||||
|
@ -4000,6 +4000,7 @@ void BfModule::Visit(BfSwitchStatement* switchStmt)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (!localDef->mResolvedType->IsVar())
|
||||||
AddLocalVariableDef(localDef, addDebugInfo, true);
|
AddLocalVariableDef(localDef, addDebugInfo, true);
|
||||||
|
|
||||||
BfDeferredLocalAssignData deferredLocalAssignData(mCurMethodState->mCurScope);
|
BfDeferredLocalAssignData deferredLocalAssignData(mCurMethodState->mCurScope);
|
||||||
|
@ -4062,7 +4063,7 @@ void BfModule::Visit(BfSwitchStatement* switchStmt)
|
||||||
enumTagVal = LoadValue(enumTagVal);
|
enumTagVal = LoadValue(enumTagVal);
|
||||||
switchStatement = mBfIRBuilder->CreateSwitch(enumTagVal.mValue, noSwitchBlock, numExpressions);
|
switchStatement = mBfIRBuilder->CreateSwitch(enumTagVal.mValue, noSwitchBlock, numExpressions);
|
||||||
}
|
}
|
||||||
else if (!isConstSwitch)
|
else if ((!isConstSwitch) && (!switchValue.mType->IsVar()))
|
||||||
switchStatement = mBfIRBuilder->CreateSwitch(switchValue.mValue, noSwitchBlock, numExpressions);
|
switchStatement = mBfIRBuilder->CreateSwitch(switchValue.mValue, noSwitchBlock, numExpressions);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue