mirror of
https://github.com/beefytech/Beef.git
synced 2025-06-09 03:52:19 +02:00
Fixed win x64 lowering issue
This commit is contained in:
parent
ced4321239
commit
5c3d0021b1
4 changed files with 12 additions and 2 deletions
|
@ -4859,7 +4859,7 @@ BfTypedValue BfExprEvaluator::CreateCall(BfMethodInstance* methodInstance, BfIRV
|
||||||
mModule->mBfIRBuilder->Call_AddAttribute(callInst, argIdx + 1, BfIRAttribute_NoCapture);
|
mModule->mBfIRBuilder->Call_AddAttribute(callInst, argIdx + 1, BfIRAttribute_NoCapture);
|
||||||
addDeref = paramType->mSize;
|
addDeref = paramType->mSize;
|
||||||
}
|
}
|
||||||
else
|
else if (methodInstance->WantsIRStructsByVal())
|
||||||
{
|
{
|
||||||
mModule->mBfIRBuilder->Call_AddAttribute(callInst, argIdx + 1, BfIRAttribute_ByVal, mModule->mSystem->mPtrSize);
|
mModule->mBfIRBuilder->Call_AddAttribute(callInst, argIdx + 1, BfIRAttribute_ByVal, mModule->mSystem->mPtrSize);
|
||||||
}
|
}
|
||||||
|
|
|
@ -14469,7 +14469,7 @@ void BfModule::SetupIRMethod(BfMethodInstance* methodInstance, BfIRFunction func
|
||||||
PopulateType(resolvedTypeRef, BfPopulateType_Data);
|
PopulateType(resolvedTypeRef, BfPopulateType_Data);
|
||||||
addDeref = resolvedTypeRef->mSize;
|
addDeref = resolvedTypeRef->mSize;
|
||||||
}
|
}
|
||||||
else
|
else if (methodInstance->WantsIRStructsByVal())
|
||||||
{
|
{
|
||||||
mBfIRBuilder->PopulateType(resolvedTypeRef);
|
mBfIRBuilder->PopulateType(resolvedTypeRef);
|
||||||
mBfIRBuilder->Func_AddAttribute(func, argIdx + 1, BfIRAttribute_ByVal, mSystem->mPtrSize);
|
mBfIRBuilder->Func_AddAttribute(func, argIdx + 1, BfIRAttribute_ByVal, mSystem->mPtrSize);
|
||||||
|
|
|
@ -646,6 +646,15 @@ bool BfMethodInstance::GetLoweredReturnType(BfTypeCode* loweredTypeCode, BfTypeC
|
||||||
return mReturnType->GetLoweredType(mMethodDef->mIsStatic ? BfTypeUsage_Return_Static : BfTypeUsage_Return_NonStatic, loweredTypeCode, loweredTypeCode2);
|
return mReturnType->GetLoweredType(mMethodDef->mIsStatic ? BfTypeUsage_Return_Static : BfTypeUsage_Return_NonStatic, loweredTypeCode, loweredTypeCode2);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
bool BfMethodInstance::WantsIRStructsByVal()
|
||||||
|
{
|
||||||
|
auto owner = GetOwner();
|
||||||
|
if ((owner->mModule->mCompiler->mOptions.mPlatformType == BfPlatformType_Windows) &&
|
||||||
|
(owner->mModule->mCompiler->mOptions.mMachineType == BfMachineType_x64))
|
||||||
|
return false;
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
bool BfMethodInstance::IsSkipCall(bool bypassVirtual)
|
bool BfMethodInstance::IsSkipCall(bool bypassVirtual)
|
||||||
{
|
{
|
||||||
if ((mMethodDef->mIsSkipCall) &&
|
if ((mMethodDef->mIsSkipCall) &&
|
||||||
|
|
|
@ -863,6 +863,7 @@ public:
|
||||||
int GetStructRetIdx();
|
int GetStructRetIdx();
|
||||||
bool HasSelf();
|
bool HasSelf();
|
||||||
bool GetLoweredReturnType(BfTypeCode* loweredTypeCode = NULL, BfTypeCode* loweredTypeCode2 = NULL);
|
bool GetLoweredReturnType(BfTypeCode* loweredTypeCode = NULL, BfTypeCode* loweredTypeCode2 = NULL);
|
||||||
|
bool WantsIRStructsByVal();
|
||||||
bool IsAutocompleteMethod() { /*return mIdHash == -1;*/ return mIsAutocompleteMethod; }
|
bool IsAutocompleteMethod() { /*return mIdHash == -1;*/ return mIsAutocompleteMethod; }
|
||||||
bool IsSkipCall(bool bypassVirtual = false);
|
bool IsSkipCall(bool bypassVirtual = false);
|
||||||
bool IsVarArgs();
|
bool IsVarArgs();
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue