From 4e7c05e39964e003f5ee0de06f812eefaffabb44 Mon Sep 17 00:00:00 2001 From: Brian Fiete Date: Thu, 28 May 2020 07:37:55 -0700 Subject: [PATCH] Support for __MALFORMED test method --- IDEHelper/Compiler/BfModule.cpp | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/IDEHelper/Compiler/BfModule.cpp b/IDEHelper/Compiler/BfModule.cpp index b1aeb743..1e176104 100644 --- a/IDEHelper/Compiler/BfModule.cpp +++ b/IDEHelper/Compiler/BfModule.cpp @@ -6020,7 +6020,7 @@ BfIRValue BfModule::CreateTypeData(BfType* type, Dictionary& usedStrin if (vDataVal == -1) vDataVal = vDataIdx * mSystem->mPtrSize; } - + SizedArray methodDataVals = { emptyValueType, @@ -6031,7 +6031,7 @@ BfIRValue BfModule::CreateTypeData(BfType* type, Dictionary& usedStrin GetConstValue((int)paramVals.size(), shortType), GetConstValue(methodFlags, shortType), GetConstValue(vDataVal, intType), - GetConstValue(-1, intType), + GetConstValue(customAttrIdx, intType), }; auto methodData = mBfIRBuilder->CreateConstStruct(mBfIRBuilder->MapTypeInst(reflectMethodDataType->ToTypeInstance(), BfIRPopulateType_Full), methodDataVals); methodTypes.push_back(methodData); @@ -16693,6 +16693,12 @@ void BfModule::ProcessMethod(BfMethodInstance* methodInstance, bool isInlineDup) mBfIRBuilder->SetInsertPoint(llvmEntryBlock); + if (methodDef->mName == "__MALFORMED") + { + auto newBlock = mBfIRBuilder->CreateBlock("malformed", true); + mBfIRBuilder->SetInsertPoint(newBlock); + } + if (methodDef->mBody != NULL) { UpdateSrcPos(methodDef->mBody, BfSrcPosFlag_NoSetDebugLoc); @@ -18460,7 +18466,7 @@ BfModuleMethodInstance BfModule::GetLocalMethodInstance(BfLocalMethod* localMeth //methodState.mCurLocalVarId = declMethodState->mCurLocalVarId; methodState.mIRFunction = declMethodState->mIRFunction; methodState.mDeferredLocalAssignData = &deferredLocalAssignData; - + if (auto blockBody = BfNodeDynCast(body)) { methodState.mCurScope->mAstBlock = blockBody;