mirror of
https://github.com/beefytech/Beef.git
synced 2025-06-09 12:02:21 +02:00
Support for __MALFORMED test method
This commit is contained in:
parent
a44f39b3e4
commit
4e7c05e399
1 changed files with 9 additions and 3 deletions
|
@ -6020,7 +6020,7 @@ BfIRValue BfModule::CreateTypeData(BfType* type, Dictionary<int, int>& usedStrin
|
||||||
if (vDataVal == -1)
|
if (vDataVal == -1)
|
||||||
vDataVal = vDataIdx * mSystem->mPtrSize;
|
vDataVal = vDataIdx * mSystem->mPtrSize;
|
||||||
}
|
}
|
||||||
|
|
||||||
SizedArray<BfIRValue, 8> methodDataVals =
|
SizedArray<BfIRValue, 8> methodDataVals =
|
||||||
{
|
{
|
||||||
emptyValueType,
|
emptyValueType,
|
||||||
|
@ -6031,7 +6031,7 @@ BfIRValue BfModule::CreateTypeData(BfType* type, Dictionary<int, int>& usedStrin
|
||||||
GetConstValue((int)paramVals.size(), shortType),
|
GetConstValue((int)paramVals.size(), shortType),
|
||||||
GetConstValue(methodFlags, shortType),
|
GetConstValue(methodFlags, shortType),
|
||||||
GetConstValue(vDataVal, intType),
|
GetConstValue(vDataVal, intType),
|
||||||
GetConstValue(-1, intType),
|
GetConstValue(customAttrIdx, intType),
|
||||||
};
|
};
|
||||||
auto methodData = mBfIRBuilder->CreateConstStruct(mBfIRBuilder->MapTypeInst(reflectMethodDataType->ToTypeInstance(), BfIRPopulateType_Full), methodDataVals);
|
auto methodData = mBfIRBuilder->CreateConstStruct(mBfIRBuilder->MapTypeInst(reflectMethodDataType->ToTypeInstance(), BfIRPopulateType_Full), methodDataVals);
|
||||||
methodTypes.push_back(methodData);
|
methodTypes.push_back(methodData);
|
||||||
|
@ -16693,6 +16693,12 @@ void BfModule::ProcessMethod(BfMethodInstance* methodInstance, bool isInlineDup)
|
||||||
|
|
||||||
mBfIRBuilder->SetInsertPoint(llvmEntryBlock);
|
mBfIRBuilder->SetInsertPoint(llvmEntryBlock);
|
||||||
|
|
||||||
|
if (methodDef->mName == "__MALFORMED")
|
||||||
|
{
|
||||||
|
auto newBlock = mBfIRBuilder->CreateBlock("malformed", true);
|
||||||
|
mBfIRBuilder->SetInsertPoint(newBlock);
|
||||||
|
}
|
||||||
|
|
||||||
if (methodDef->mBody != NULL)
|
if (methodDef->mBody != NULL)
|
||||||
{
|
{
|
||||||
UpdateSrcPos(methodDef->mBody, BfSrcPosFlag_NoSetDebugLoc);
|
UpdateSrcPos(methodDef->mBody, BfSrcPosFlag_NoSetDebugLoc);
|
||||||
|
@ -18460,7 +18466,7 @@ BfModuleMethodInstance BfModule::GetLocalMethodInstance(BfLocalMethod* localMeth
|
||||||
//methodState.mCurLocalVarId = declMethodState->mCurLocalVarId;
|
//methodState.mCurLocalVarId = declMethodState->mCurLocalVarId;
|
||||||
methodState.mIRFunction = declMethodState->mIRFunction;
|
methodState.mIRFunction = declMethodState->mIRFunction;
|
||||||
methodState.mDeferredLocalAssignData = &deferredLocalAssignData;
|
methodState.mDeferredLocalAssignData = &deferredLocalAssignData;
|
||||||
|
|
||||||
if (auto blockBody = BfNodeDynCast<BfBlock>(body))
|
if (auto blockBody = BfNodeDynCast<BfBlock>(body))
|
||||||
{
|
{
|
||||||
methodState.mCurScope->mAstBlock = blockBody;
|
methodState.mCurScope->mAstBlock = blockBody;
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue