From 91b5ab36cac98e16171055db07b0590ddcc764b5 Mon Sep 17 00:00:00 2001 From: Brian Fiete Date: Tue, 28 Apr 2020 07:30:45 -0700 Subject: [PATCH] Fixed void skipcall boxed methods --- IDEHelper/Compiler/BfModule.cpp | 16 ++++++++++++++-- IDEHelper/Compiler/BfModule.h | 1 + 2 files changed, 15 insertions(+), 2 deletions(-) diff --git a/IDEHelper/Compiler/BfModule.cpp b/IDEHelper/Compiler/BfModule.cpp index bfca112e..3d4c9ce1 100644 --- a/IDEHelper/Compiler/BfModule.cpp +++ b/IDEHelper/Compiler/BfModule.cpp @@ -12225,8 +12225,18 @@ bool BfModule::IsInGeneric() return (mCurMethodInstance->GetNumGenericArguments() != 0) || (mCurTypeInstance->IsGenericTypeInstance()); } -bool BfModule::IsInSpecializedGeneric() +bool BfModule::InDefinitionSection() { + if (mCurTypeInstance != NULL) + { + if (mCurTypeInstance->IsUnspecializedTypeVariation()) + return false; + } + return !IsInSpecializedSection(); +} + +bool BfModule::IsInSpecializedGeneric() +{ if ((mCurMethodInstance == NULL) || (mCurMethodInstance->mIsUnspecialized)) return false; return (mCurMethodInstance->GetNumGenericArguments() != 0) || (mCurTypeInstance->IsGenericTypeInstance()); @@ -16991,7 +17001,7 @@ void BfModule::ProcessMethod(BfMethodInstance* methodInstance, bool isInlineDup) skipEndChecks = true; if (HasCompiledOutput()) - { + { // Clear out DebugLoc - to mark the ".addr" code as part of prologue mBfIRBuilder->ClearDebugLocation(); @@ -17016,6 +17026,8 @@ void BfModule::ProcessMethod(BfMethodInstance* methodInstance, bool isInlineDup) auto retVal = GetDefaultValue(methodInstance->mReturnType); CreateReturn(retVal); } + else + mBfIRBuilder->CreateRetVoid(); } else { diff --git a/IDEHelper/Compiler/BfModule.h b/IDEHelper/Compiler/BfModule.h index d6571f2d..300d0d6d 100644 --- a/IDEHelper/Compiler/BfModule.h +++ b/IDEHelper/Compiler/BfModule.h @@ -1537,6 +1537,7 @@ public: BfTypedValue GetThis(); BfLocalVariable* GetThisVariable(); bool IsInGeneric(); + bool InDefinitionSection(); bool IsInSpecializedGeneric(); bool IsInSpecializedSection(); // Either a specialized generic or an injected mixin bool IsInUnspecializedGeneric();