diff --git a/IDEHelper/Compiler/BfContext.cpp b/IDEHelper/Compiler/BfContext.cpp index f4ba7e96..76af668a 100644 --- a/IDEHelper/Compiler/BfContext.cpp +++ b/IDEHelper/Compiler/BfContext.cpp @@ -2238,7 +2238,8 @@ void BfContext::UpdateRevisedTypes() if (changed) { - RebuildType(typeInst); + TypeDataChanged(typeInst, true); + TypeMethodSignaturesChanged(typeInst); } } @@ -2312,7 +2313,7 @@ void BfContext::UpdateRevisedTypes() if (isSignatureChange) { TypeDataChanged(typeInst, true); - TypeMethodSignaturesChanged(typeInst); + TypeMethodSignaturesChanged(typeInst); } /*if (!mCompiler->mIsResolveOnly) diff --git a/IDEHelper/Compiler/BfIRBuilder.cpp b/IDEHelper/Compiler/BfIRBuilder.cpp index fdb63f56..4c59099e 100644 --- a/IDEHelper/Compiler/BfIRBuilder.cpp +++ b/IDEHelper/Compiler/BfIRBuilder.cpp @@ -2712,6 +2712,11 @@ public: void BfIRBuilder::CreateTypeDeclaration(BfType* type, bool forceDbgDefine) { + auto populateModule = mModule->mContext->mUnreifiedModule; + auto typeInstance = type->ToTypeInstance(); + if (typeInstance != NULL) + populateModule = typeInstance->mModule; + bool wantDIData = DbgHasInfo() && (!type->IsUnspecializedType()); // Types that don't have a proper 'defining module' need to be defined in every module they are used @@ -2736,7 +2741,7 @@ void BfIRBuilder::CreateTypeDeclaration(BfType* type, bool forceDbgDefine) bool isPrimEnum = (type->IsEnum()) && (type->IsTypedPrimitive()); if (!type->IsDeclared()) - mModule->PopulateType(type, BfPopulateType_Declaration); + populateModule->PopulateType(type, BfPopulateType_Declaration); BF_ASSERT(type->IsDeclared()); @@ -2747,8 +2752,7 @@ void BfIRBuilder::CreateTypeDeclaration(BfType* type, bool forceDbgDefine) BfIRType irType; BfIRMDNode diType; bool trackDIType = false; - - BfTypeInstance* typeInstance = type->ToTypeInstance(); + BfType* underlyingArrayType = NULL; int underlyingArraySize = -1; bool underlyingArrayIsVector = false; @@ -2758,7 +2762,7 @@ void BfIRBuilder::CreateTypeDeclaration(BfType* type, bool forceDbgDefine) if (type->IsPointer()) { BfPointerType* pointerType = (BfPointerType*)type; - mModule->PopulateType(pointerType->mElementType, BfPopulateType_Data); + populateModule->PopulateType(pointerType->mElementType, BfPopulateType_Data); if (pointerType->mElementType->IsValuelessType()) { irType = GetPrimitiveType(BfTypeCode_NullPtr); @@ -3069,7 +3073,7 @@ void BfIRBuilder::CreateTypeDeclaration(BfType* type, bool forceDbgDefine) } else if (type->IsTypedPrimitive()) { - mModule->PopulateType(type); + populateModule->PopulateType(type); auto underlyingType = type->GetUnderlyingType(); irType = MapType(underlyingType); SetType(type, irType); diff --git a/IDEHelper/Compiler/CeMachine.cpp b/IDEHelper/Compiler/CeMachine.cpp index ba92df8c..c6a05806 100644 --- a/IDEHelper/Compiler/CeMachine.cpp +++ b/IDEHelper/Compiler/CeMachine.cpp @@ -3553,13 +3553,13 @@ bool CeContext::AddRebuild(const CeRebuildKey& key, const CeRebuildValue& value) { if (mCurModule == NULL) return false; - if (mCurModule->mCurTypeInstance == NULL) + if (mCallerTypeInstance == NULL) return false; if ((mCurEvalFlags & CeEvalFlags_NoRebuild) != 0) return false; - if (mCurModule->mCurTypeInstance->mCeTypeInfo == NULL) - mCurModule->mCurTypeInstance->mCeTypeInfo = new BfCeTypeInfo(); - mCurModule->mCurTypeInstance->mCeTypeInfo->mRebuildMap[key] = value; + if (mCallerTypeInstance->mCeTypeInfo == NULL) + mCallerTypeInstance->mCeTypeInfo = new BfCeTypeInfo(); + mCallerTypeInstance->mCeTypeInfo->mRebuildMap[key] = value; mCurModule->mCompiler->mHasComptimeRebuilds = true; return true; }