1
0
Fork 0
mirror of https://github.com/beefytech/Beef.git synced 2025-06-08 19:48:20 +02:00

Added support for C-style vararg methods

This commit is contained in:
Brian Fiete 2020-02-11 07:34:47 -08:00
parent 89e6b0d577
commit 7741344fd2
16 changed files with 129 additions and 68 deletions

View file

@ -628,6 +628,13 @@ bool BfMethodInstance::IsSkipCall(bool bypassVirtual)
return false;
}
bool BfMethodInstance::IsVarArgs()
{
if (mMethodDef->mParams.IsEmpty())
return false;
return mMethodDef->mParams.back()->mParamKind == BfParamKind_VarArgs;
}
bool BfMethodInstance::AlwaysInline()
{
return mAlwaysInline;
@ -855,12 +862,7 @@ int BfMethodInstance::DbgGetVirtualMethodNum()
}
void BfMethodInstance::GetIRFunctionInfo(BfModule* module, BfIRType& returnType, SizedArrayImpl<BfIRType>& paramTypes, bool forceStatic)
{
if ((mMethodDef->mNoSplat) && (GetOwner()->GetLoweredType() != BfTypeCode_None))
{
NOP;
}
{
module->PopulateType(mReturnType);
if (mReturnType->IsValuelessType())
{
@ -904,7 +906,7 @@ void BfMethodInstance::GetIRFunctionInfo(BfModule* module, BfIRType& returnType,
else
{
checkType = GetParamType(paramIdx);
}
}
if ((paramIdx != -1) || (!mMethodDef->mNoSplat && !mMethodDef->mIsMutating))
{