diff --git a/IDEHelper/Compiler/BfExprEvaluator.cpp b/IDEHelper/Compiler/BfExprEvaluator.cpp index b00fdf65..109f8789 100644 --- a/IDEHelper/Compiler/BfExprEvaluator.cpp +++ b/IDEHelper/Compiler/BfExprEvaluator.cpp @@ -14747,6 +14747,7 @@ BfModuleMethodInstance BfExprEvaluator::GetSelectedMethod(BfAstNode* targetSrc, if ((mModule->mAttributeState != NULL) && (mModule->mAttributeState->mCustomAttributes != NULL) && (mModule->mAttributeState->mCustomAttributes->Contains(mModule->mCompiler->mInlineAttributeTypeDef))) { flags = (BfGetMethodInstanceFlags)(flags | BfGetMethodInstanceFlag_ForceInline); + mModule->mAttributeState->mUsed = true; } if ((!mModule->mCurTypeInstance->IsInterface()) && (methodDef->mBody != NULL)) diff --git a/IDEHelper/Compiler/BfModule.cpp b/IDEHelper/Compiler/BfModule.cpp index 725e68f4..c652d5ba 100644 --- a/IDEHelper/Compiler/BfModule.cpp +++ b/IDEHelper/Compiler/BfModule.cpp @@ -12538,6 +12538,9 @@ BfModuleMethodInstance BfModule::ReferenceExternalMethodInstance(BfMethodInstanc } bool isInlined = (methodInstance->mAlwaysInline) || ((flags & BfGetMethodInstanceFlag_ForceInline) != 0); + if ((methodInstance->mIsIntrinsic) || (methodInstance->mMethodDef->mIsExtern)) + isInlined = false; + BfMethodRef methodRef = methodInstance; if (isInlined) methodRef.mMethodRefFlags = (BfMethodRefFlags)(methodRef.mMethodRefFlags | BfMethodRefFlag_AlwaysInclude); @@ -12712,6 +12715,9 @@ BfModuleMethodInstance BfModule::GetMethodInstance(BfTypeInstance* typeInst, BfM flags = (BfGetMethodInstanceFlags)(flags & ~BfGetMethodInstanceFlag_ForceInline); } + if (methodDef->mIsExtern) + flags = (BfGetMethodInstanceFlags)(flags & ~BfGetMethodInstanceFlag_ForceInline); + bool processNow = false; bool keepInCurrentModule = false; @@ -13256,6 +13262,8 @@ BfModuleMethodInstance BfModule::GetMethodInstance(BfTypeInstance* typeInst, BfM // We need to refer to a function that was defined in a prior module bool isInlined = (methodInstance->mAlwaysInline) || ((flags & BfGetMethodInstanceFlag_ForceInline) != 0); + if (methodInstance->mIsIntrinsic) + isInlined = false; methodInstance->mIRFunction = CreateFunctionFrom(methodInstance, false, isInlined); BF_ASSERT((methodInstance->mDeclModule == this) || (methodInstance->mDeclModule == mContext->mUnreifiedModule) || (methodInstance->mDeclModule == NULL)); methodInstance->mDeclModule = this;