1
0
Fork 0
mirror of https://github.com/beefytech/Beef.git synced 2025-06-08 11:38:21 +02:00

Fixed some 'var' handling cases where module hasn't failed

This commit is contained in:
Brian Fiete 2025-01-23 05:26:05 -08:00
parent 7b29a4facb
commit f830e23c52
3 changed files with 200 additions and 191 deletions

View file

@ -2276,6 +2276,7 @@ BeMCOperand BeMCContext::GetOperand(BeValue* value, bool allowMetaResult, bool a
return mcOperand;
}
break;
case BeGEP1Constant::TypeId:
{
auto gepConstant = (BeGEP1Constant*)value;
@ -2364,6 +2365,15 @@ BeMCOperand BeMCContext::GetOperand(BeValue* value, bool allowMetaResult, bool a
return GetOperand(&beConstant);
}
break;
case BeUndefConstant::TypeId:
{
auto undefConstant = (BeUndefConstant*)value;
BeConstant beConstant;
beConstant.mType = undefConstant->mType;
beConstant.mUInt64 = 0;
return GetOperand(&beConstant);
}
break;
case BeFunction::TypeId:
{
auto sym = mCOFFObject->GetSymbol(value);
@ -2387,6 +2397,7 @@ BeMCOperand BeMCContext::GetOperand(BeValue* value, bool allowMetaResult, bool a
case BeDbgVariable::TypeId:
{
}
break;
}
BeMCOperand* operandPtr = NULL;

View file

@ -2344,6 +2344,7 @@ void BfIRCodeGen::HandleNextCmd()
{
CMD_PARAM_NOTRANS(llvm::Value*, val);
CMD_PARAM(String, name);
if (!val->getType()->isVoidTy())
val->setName(name.c_str());
}
break;

View file

@ -9097,11 +9097,8 @@ BfTypedValue BfModule::FlushNullConditional(BfTypedValue result, bool ignoreNull
{
auto pendingNullCond = mCurMethodState->mPendingNullConditional;
if ((result) && (!ignoreNullable))
if ((result) && (!result.mType->IsVar()) && (!ignoreNullable))
{
if (result.mType->IsVar())
return result;
auto notNullBB = mBfIRBuilder->GetInsertBlock();
//TODO: Make this work, needed for 'void' and such