1
0
Fork 0
mirror of https://github.com/beefytech/Beef.git synced 2025-06-09 20:12:21 +02:00

Reduced _imp symbols for methods that may become unreified

This commit is contained in:
Brian Fiete 2021-12-14 09:54:22 -05:00
parent e871bd6ace
commit f92c3d1424

View file

@ -16212,6 +16212,8 @@ void BfModule::EmitDtorBody()
BfIRValue BfModule::CreateDllImportGlobalVar(BfMethodInstance* methodInstance, bool define) BfIRValue BfModule::CreateDllImportGlobalVar(BfMethodInstance* methodInstance, bool define)
{ {
BF_ASSERT(methodInstance->mIsReified);
auto typeInstance = methodInstance->GetOwner(); auto typeInstance = methodInstance->GetOwner();
bool foundDllImportAttr = false; bool foundDllImportAttr = false;
@ -22791,18 +22793,6 @@ void BfModule::DoMethodDeclaration(BfMethodDeclaration* methodDeclaration, bool
//BF_ASSERT(mCompiler->IsAutocomplete()); //BF_ASSERT(mCompiler->IsAutocomplete());
BfLogSysM("DoMethodDeclaration isTemporaryFunc bailout\n"); BfLogSysM("DoMethodDeclaration isTemporaryFunc bailout\n");
return; // Bail out early for autocomplete pass return; // Bail out early for autocomplete pass
}
if ((methodInstance->GetImportCallKind() != BfImportCallKind_None) && (!mBfIRBuilder->mIgnoreWrites) && (!methodInstance->mIRFunction))
{
BfLogSysM("DllImportGlobalVar DoMethodDeclaration processing %p\n", methodInstance);
// If this is in an extension then we did create the global variable already in the original obj
bool doDefine = mExtensionCount == 0;
BfIRValue dllImportGlobalVar = CreateDllImportGlobalVar(methodInstance, doDefine);
func = mBfIRBuilder->GetFakeVal();
methodInstance->mIRFunction = func;
BF_ASSERT(dllImportGlobalVar);
mFuncReferences[mCurMethodInstance] = dllImportGlobalVar;
} }
//TODO: We used to have this (this != mContext->mExternalFuncModule) check, but it caused us to keep around //TODO: We used to have this (this != mContext->mExternalFuncModule) check, but it caused us to keep around