| 18477 | } |
| 18478 | |
| 18479 | BfIRCallingConv BfModule::GetIRCallingConvention(BfMethodInstance* methodInstance) |
| 18480 | { |
| 18481 | auto methodDef = methodInstance->mMethodDef; |
| 18482 | BfTypeInstance* owner = NULL; |
| 18483 | if (!methodDef->mIsStatic) |
| 18484 | owner = methodInstance->GetThisType()->ToTypeInstance(); |
| 18485 | if (owner == NULL) |
| 18486 | owner = methodInstance->GetOwner(); |
| 18487 | |
| 18488 | if ((mCompiler->mOptions.mMachineType != BfMachineType_x86) || (mCompiler->mOptions.mPlatformType != BfPlatformType_Windows)) |
| 18489 | return BfIRCallingConv_CDecl; |
| 18490 | if (methodInstance->mCallingConvention == BfCallingConvention_Stdcall) |
| 18491 | return BfIRCallingConv_StdCall; |
| 18492 | if (methodInstance->mCallingConvention == BfCallingConvention_Fastcall) |
| 18493 | return BfIRCallingConv_FastCall; |
| 18494 | if (!methodDef->mIsStatic) |
| 18495 | { |
| 18496 | if (owner->mIsCRepr) |
| 18497 | return BfIRCallingConv_ThisCall; |
| 18498 | if ((!owner->IsValuelessType()) && |
| 18499 | ((!owner->IsSplattable()) || (methodDef->HasNoThisSplat()))) |
| 18500 | return BfIRCallingConv_ThisCall; |
| 18501 | } |
| 18502 | return BfIRCallingConv_CDecl; |
| 18503 | |
| 18504 | //return GetIRCallingConvention(owner, methodInstance->mMethodDef); |
| 18505 | } |
| 18506 | |
| 18507 | void BfModule::SetupIRMethod(BfMethodInstance* methodInstance, BfIRFunction func, bool isInlined) |
| 18508 | { |
no test coverage detected