mirror of
https://github.com/beefytech/Beef.git
synced 2025-06-10 12:32:20 +02:00
Enum fixes, small reflection fixes
This commit is contained in:
parent
973b5e73cf
commit
dffde00a6a
11 changed files with 100 additions and 35 deletions
|
@ -994,6 +994,7 @@ void COFF::CvParseMembers(DbgType* parentType, int tagIdx, bool ipi)
|
|||
parentType->mTypeParam = CvGetType(fieldTypeId);
|
||||
if ((parentType->mBaseTypes.mHead != NULL) && (strcmp(parentType->mBaseTypes.mHead->mBaseType->mName, "System.Enum") == 0))
|
||||
parentType->mTypeCode = DbgType_Enum;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -437,6 +437,7 @@ bool BfContext::ProcessWorkList(bool onlyReifiedTypes, bool onlyReifiedMethods)
|
|||
continue;
|
||||
|
||||
auto methodSpecializationRequest = *workItemRef;
|
||||
|
||||
auto module = workItemRef->mFromModule;
|
||||
workIdx = mMethodSpecializationWorkList.RemoveAt(workIdx);
|
||||
|
||||
|
@ -2339,11 +2340,6 @@ void BfContext::QueueMethodSpecializations(BfTypeInstance* typeInst, bool checkS
|
|||
return;
|
||||
}
|
||||
|
||||
if ((module->mModuleName == "System_Array") && (!mCompiler->mIsResolveOnly))
|
||||
{
|
||||
NOP;
|
||||
}
|
||||
|
||||
// Find any method specialization requests for types that are rebuilding, but from
|
||||
// modules that are NOT rebuilding to be sure we generate those. Failure to do this
|
||||
// will cause a link error from an old module
|
||||
|
|
|
@ -16163,6 +16163,7 @@ void BfExprEvaluator::PerformUnaryOperation_OnResult(BfExpression* unaryOpExpr,
|
|||
MarkResultUsed();
|
||||
|
||||
mModule->FixIntUnknown(mResult);
|
||||
mModule->PopulateType(mResult.mType);
|
||||
auto ptrType = mModule->CreatePointerType(mResult.mType);
|
||||
if ((!CheckModifyResult(mResult, unaryOpExpr, "take address of")) || (mResult.mType->IsValuelessType()))
|
||||
{
|
||||
|
@ -16194,6 +16195,7 @@ void BfExprEvaluator::PerformUnaryOperation_OnResult(BfExpression* unaryOpExpr,
|
|||
return;
|
||||
}
|
||||
|
||||
mModule->PopulateType(resolvedType);
|
||||
if (resolvedType->IsValuelessType())
|
||||
mResult = BfTypedValue(mModule->mBfIRBuilder->GetFakeVal(), resolvedType, true);
|
||||
else
|
||||
|
|
|
@ -1097,7 +1097,7 @@ void BfModule::EnsureIRBuilder(bool dbgVerifyCodeGen)
|
|||
// code as we walk the AST
|
||||
//mBfIRBuilder->mDbgVerifyCodeGen = true;
|
||||
if (
|
||||
(mModuleName == "IDE_ui_LaunchDialog")
|
||||
(mModuleName == "Blurg")
|
||||
//|| (mModuleName == "System_Internal")
|
||||
//|| (mModuleName == "vdata")
|
||||
//|| (mModuleName == "Hey_Dude_Bro_TestClass")
|
||||
|
@ -11036,7 +11036,7 @@ BfModuleMethodInstance BfModule::GetMethodInstance(BfTypeInstance* typeInst, BfM
|
|||
BF_ASSERT(instModule == mParentModule);
|
||||
}
|
||||
else if (instModule != this)
|
||||
{
|
||||
{
|
||||
if ((!mIsReified) && (instModule->mIsReified))
|
||||
{
|
||||
BF_ASSERT(!mCompiler->mIsResolveOnly);
|
||||
|
@ -11064,10 +11064,11 @@ BfModuleMethodInstance BfModule::GetMethodInstance(BfTypeInstance* typeInst, BfM
|
|||
specializationRequest->mMethodDef = methodDef;
|
||||
specializationRequest->mMethodGenericArguments = methodGenericArguments;
|
||||
specializationRequest->mType = typeInst;
|
||||
specializationRequest->mFlags = flags;
|
||||
}
|
||||
|
||||
auto defFlags = (BfGetMethodInstanceFlags)(flags & ~BfGetMethodInstanceFlag_ForceInline);
|
||||
|
||||
|
||||
// Not extern
|
||||
// Create the instance in the proper module and then create a reference in this one
|
||||
moduleMethodInst = instModule->GetMethodInstance(typeInst, methodDef, methodGenericArguments, defFlags, foreignType);
|
||||
|
@ -11769,12 +11770,7 @@ void BfModule::HadSlotCountDependency()
|
|||
}
|
||||
|
||||
BfTypedValue BfModule::ReferenceStaticField(BfFieldInstance* fieldInstance)
|
||||
{
|
||||
if (fieldInstance->mResolvedType->IsVar())
|
||||
{
|
||||
NOP;
|
||||
}
|
||||
|
||||
{
|
||||
if (mIsScratchModule)
|
||||
{
|
||||
// Just fake it for the extern and unspecialized modules
|
||||
|
@ -19490,7 +19486,7 @@ void BfModule::DoMethodDeclaration(BfMethodDeclaration* methodDeclaration, bool
|
|||
// CheckHotMethod(methodInstance, mangledName);
|
||||
|
||||
BfLogSysM("DoMethodDeclaration %s Module: %p Type: %p MethodInst: %p Reified: %d Unspecialized: %d IRFunction: %d MethodId:%llx\n", mangledName.c_str(), this, mCurTypeInstance, methodInstance, methodInstance->mIsReified, mCurTypeInstance->IsUnspecializedType(), methodInstance->mIRFunction.mId, methodInstance->mIdHash);
|
||||
|
||||
|
||||
SizedArray<BfIRMDNode, 8> diParams;
|
||||
diParams.push_back(mBfIRBuilder->DbgGetType(resolvedReturnType));
|
||||
|
||||
|
|
|
@ -1867,9 +1867,14 @@ void BfTupleType::Finish()
|
|||
//////////////////////////////////////////////////////////////////////////
|
||||
|
||||
BfType* BfBoxedType::GetModifiedElementType()
|
||||
{
|
||||
{
|
||||
if ((mBoxedFlags & BoxedFlags_StructPtr) != 0)
|
||||
return mModule->CreatePointerType(mElementType);
|
||||
{
|
||||
auto module = mModule;
|
||||
if (module == NULL)
|
||||
module = mContext->mUnreifiedModule;
|
||||
return module->CreatePointerType(mElementType);
|
||||
}
|
||||
return mElementType;
|
||||
}
|
||||
|
||||
|
|
|
@ -1410,9 +1410,11 @@ DbgType* DbgType::GetPrimaryType()
|
|||
{
|
||||
if ((mCompileUnit != NULL) &&
|
||||
((mCompileUnit->mLanguage == DbgLanguage_Beef) || (mTypeCode == DbgType_Namespace) || (mIsDeclaration)))
|
||||
{
|
||||
mPrimaryType = mCompileUnit->mDbgModule->GetPrimaryType(this);
|
||||
{
|
||||
mPrimaryType = mCompileUnit->mDbgModule->GetPrimaryType(this);
|
||||
mPrimaryType->PopulateType();
|
||||
mTypeCode = mPrimaryType->mTypeCode;
|
||||
mTypeParam = mPrimaryType->mTypeParam;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue