mirror of
https://github.com/beefytech/Beef.git
synced 2025-06-10 04:22:20 +02:00
Fixed the lambda hotswap change
This commit is contained in:
parent
1e04bb1b3e
commit
c5dca50e50
6 changed files with 55 additions and 231 deletions
|
@ -260,7 +260,7 @@ namespace BIStubUI
|
||||||
mCancelButton.mImageHi = Images.sButtonHi;
|
mCancelButton.mImageHi = Images.sButtonHi;
|
||||||
mCancelButton.mOnMouseClick.Add(new (mouseArgs) =>
|
mCancelButton.mOnMouseClick.Add(new (mouseArgs) =>
|
||||||
{
|
{
|
||||||
//gApp.mCancelling = true;
|
gApp.mCancelling = true;
|
||||||
});
|
});
|
||||||
mCancelButton.mMouseInsets = new Insets(4, 4, 4, 4);
|
mCancelButton.mMouseInsets = new Insets(4, 4, 4, 4);
|
||||||
AddWidget(mCancelButton);
|
AddWidget(mCancelButton);
|
||||||
|
|
|
@ -100,6 +100,20 @@ class Blurg
|
||||||
delegate void() mFuncA;
|
delegate void() mFuncA;
|
||||||
delegate void() mFuncB;
|
delegate void() mFuncB;
|
||||||
|
|
||||||
|
int mA = 123;
|
||||||
|
|
||||||
|
public this()
|
||||||
|
{
|
||||||
|
delegate void() dlg = new () =>
|
||||||
|
{
|
||||||
|
//PrintF("Hey! %d\n", mA);
|
||||||
|
};
|
||||||
|
|
||||||
|
dlg();
|
||||||
|
dlg();
|
||||||
|
dlg();
|
||||||
|
dlg();
|
||||||
|
}
|
||||||
|
|
||||||
void TestIt(int a, int b, int c)
|
void TestIt(int a, int b, int c)
|
||||||
{
|
{
|
||||||
|
@ -108,28 +122,7 @@ class Blurg
|
||||||
|
|
||||||
public static void Hey()
|
public static void Hey()
|
||||||
{
|
{
|
||||||
int a = 123;
|
Blurg bl = scope .();
|
||||||
Blurg blurg = scope .();
|
|
||||||
blurg.mFuncA = new () =>
|
|
||||||
{
|
|
||||||
PrintF("YoA!\n");
|
|
||||||
PrintF("A %d!\n", a);
|
|
||||||
PrintF("Blurg: %p\n", blurg);
|
|
||||||
};
|
|
||||||
|
|
||||||
blurg.mFuncB = new () =>
|
|
||||||
{
|
|
||||||
PrintF("YoB!\n");
|
|
||||||
};
|
|
||||||
|
|
||||||
blurg.TestIt(1, 2, 3);
|
|
||||||
blurg.[Friend]TestIt(1, 2, 3);
|
|
||||||
|
|
||||||
while (true)
|
|
||||||
{
|
|
||||||
blurg.mFuncA();
|
|
||||||
blurg.mFuncB();
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -10553,6 +10553,14 @@ namespace IDE
|
||||||
if (isFirstMsg)
|
if (isFirstMsg)
|
||||||
{
|
{
|
||||||
OutputLineSmart(scope String("ERROR: ", errorMsg));
|
OutputLineSmart(scope String("ERROR: ", errorMsg));
|
||||||
|
if (gApp.mRunningTestScript)
|
||||||
|
{
|
||||||
|
// The 'OutputLineSmart' would already call 'Fail' when running test scripts
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
Fail(errorMsg);
|
||||||
|
}
|
||||||
isFirstMsg = false;
|
isFirstMsg = false;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
|
|
|
@ -965,117 +965,8 @@ int64 BfIRBuilder::CheckedShl(int64 a, int64 b)
|
||||||
|
|
||||||
//////////////////////////////////////////////////////////////////////////
|
//////////////////////////////////////////////////////////////////////////
|
||||||
|
|
||||||
struct TestQ
|
|
||||||
{
|
|
||||||
public:
|
|
||||||
int mId;
|
|
||||||
BfIRValueFlags mFlags;
|
|
||||||
|
|
||||||
TestQ()
|
|
||||||
{
|
|
||||||
mId = -1;
|
|
||||||
mFlags = BfIRValueFlags_None;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
/*TestQ(const TestQ& from)
|
|
||||||
{
|
|
||||||
mFlags = from.mFlags;
|
|
||||||
mId = from.mId;
|
|
||||||
}*/
|
|
||||||
|
|
||||||
/*TestQ(BfIRValueFlags flags, int id)
|
|
||||||
{
|
|
||||||
mFlags = flags;
|
|
||||||
mId = id;
|
|
||||||
}
|
|
||||||
|
|
||||||
operator bool() const
|
|
||||||
{
|
|
||||||
return mFlags != BfIRValueFlags_None;
|
|
||||||
}*/
|
|
||||||
|
|
||||||
/*bool IsFake() const;
|
|
||||||
bool IsConst() const;
|
|
||||||
bool IsArg() const;
|
|
||||||
bool IsFunc() const;
|
|
||||||
bool IsFromLLVM() const;
|
|
||||||
|
|
||||||
bool operator==(const TestQ& rhs) const
|
|
||||||
{
|
|
||||||
if (mFlags != rhs.mFlags)
|
|
||||||
return false;
|
|
||||||
if (mId != rhs.mId)
|
|
||||||
return false;
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
|
|
||||||
bool operator!=(const TestQ& rhs) const
|
|
||||||
{
|
|
||||||
if (mFlags != rhs.mFlags)
|
|
||||||
return true;
|
|
||||||
if (mId != rhs.mId)
|
|
||||||
return true;
|
|
||||||
return false;
|
|
||||||
}*/
|
|
||||||
};
|
|
||||||
|
|
||||||
class LTest
|
|
||||||
{
|
|
||||||
public:
|
|
||||||
int mA;
|
|
||||||
int mB;
|
|
||||||
|
|
||||||
void Fiff()
|
|
||||||
{
|
|
||||||
int valZ = 234;
|
|
||||||
mA = 123;
|
|
||||||
mB = 345;
|
|
||||||
|
|
||||||
auto lam = [&]()
|
|
||||||
{
|
|
||||||
mA++;
|
|
||||||
valZ++;
|
|
||||||
};
|
|
||||||
|
|
||||||
lam();
|
|
||||||
}
|
|
||||||
|
|
||||||
static void UseIt(LTest lt)
|
|
||||||
{
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
static void DoIt(BfIRValue irVal)
|
|
||||||
{
|
|
||||||
}
|
|
||||||
|
|
||||||
static void DoIt(TestQ irVal)
|
|
||||||
{
|
|
||||||
}
|
|
||||||
|
|
||||||
BfIRValue CreateCall(BfIRValue func)
|
|
||||||
{
|
|
||||||
return func;
|
|
||||||
}
|
|
||||||
};
|
|
||||||
|
|
||||||
|
|
||||||
void TestIt()
|
|
||||||
{
|
|
||||||
LTest lt;
|
|
||||||
lt.mA = 0;
|
|
||||||
lt.mB = 0;
|
|
||||||
LTest::UseIt(lt);
|
|
||||||
|
|
||||||
LTest::DoIt(BfIRValue());
|
|
||||||
LTest::DoIt(TestQ());
|
|
||||||
}
|
|
||||||
|
|
||||||
BfIRBuilder::BfIRBuilder(BfModule* module) : BfIRConstHolder(module)
|
BfIRBuilder::BfIRBuilder(BfModule* module) : BfIRConstHolder(module)
|
||||||
{
|
{
|
||||||
TestIt();
|
|
||||||
|
|
||||||
mBlockCount = 0;
|
mBlockCount = 0;
|
||||||
mModule = module;
|
mModule = module;
|
||||||
mHasDebugLoc = false;
|
mHasDebugLoc = false;
|
||||||
|
@ -2164,13 +2055,8 @@ void BfIRBuilder::CreateTypeDeclaration(BfType* type, bool forceDefine)
|
||||||
diFieldTypes.push_back(inheritanceType);
|
diFieldTypes.push_back(inheritanceType);
|
||||||
DbgMakePermanent(diForwardDecl, derivedFrom, diFieldTypes);
|
DbgMakePermanent(diForwardDecl, derivedFrom, diFieldTypes);
|
||||||
}
|
}
|
||||||
else if (isPrimEnum)
|
else if (isPrimEnum)
|
||||||
//if (checkType->IsValueType())
|
{
|
||||||
{
|
|
||||||
/*llvm::SmallVector<BfIRMDNode, 0> diEnumValues;
|
|
||||||
diForwardDecl = DbgCreateEnumerationType(curDIScope, typeName, fileDIScope, mModule->mCurFilePosition.mCurLine,
|
|
||||||
typeInstance->mSize * 8, typeInstance->mAlign * 8, diEnumValues, DbgGetType(typeInstance->GetUnderlyingType()));*/
|
|
||||||
|
|
||||||
BF_ASSERT(type->mSize > 0);
|
BF_ASSERT(type->mSize > 0);
|
||||||
|
|
||||||
diForwardDecl = DbgCreateSizedForwardDecl(llvm::dwarf::DW_TAG_enumeration_type,
|
diForwardDecl = DbgCreateSizedForwardDecl(llvm::dwarf::DW_TAG_enumeration_type,
|
||||||
|
@ -2178,53 +2064,20 @@ void BfIRBuilder::CreateTypeDeclaration(BfType* type, bool forceDefine)
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
// diForwardDecl = DbgCreateForwardDecl(llvm::dwarf::DW_TAG_structure_type,
|
|
||||||
// typeName, curDIScope, fileDIScope, 0);
|
|
||||||
|
|
||||||
diForwardDecl = DbgCreateSizedForwardDecl(llvm::dwarf::DW_TAG_structure_type,
|
diForwardDecl = DbgCreateSizedForwardDecl(llvm::dwarf::DW_TAG_structure_type,
|
||||||
typeName, curDIScope, fileDIScope, 0, (int64)BF_ALIGN(type->mSize, type->mAlign) * 8, (int64)type->mAlign * 8);
|
typeName, curDIScope, fileDIScope, 0, (int64)BF_ALIGN(type->mSize, type->mAlign) * 8, (int64)type->mAlign * 8);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
//TODO: We may not have the fields filled in by the time we need the declaration. Why did we have this here instead of in the def?
|
// Will fill in later (during definition phase)
|
||||||
/*if (isPrimEnum)
|
int flags = 0;
|
||||||
{
|
diForwardDecl = DbgCreateReplaceableCompositeType(isPrimEnum ? llvm::dwarf::DW_TAG_enumeration_type : llvm::dwarf::DW_TAG_structure_type,
|
||||||
BF_ASSERT(!typeInstance->IsDataIncomplete());
|
typeName, curDIScope, fileDIScope, 0, (int64)BF_ALIGN(typeInstance->mInstSize, typeInstance->mInstAlign) * 8, (int64)typeInstance->mInstAlign * 8, flags);
|
||||||
|
|
||||||
llvm::SmallVector<BfIRMDNode, 8> diEnumValues;
|
|
||||||
for (auto& fieldInst : typeInstance->mFieldInstances)
|
|
||||||
{
|
|
||||||
auto fieldDef = fieldInst.GetFieldDef();
|
|
||||||
if ((fieldInst.mConstIdx != -1) && (fieldDef->IsEnumCaseEntry()))
|
|
||||||
{
|
|
||||||
auto constant = typeInstance->mConstHolder->GetConstantById(fieldInst.mConstIdx);
|
|
||||||
auto enumValue = DbgCreateEnumerator(fieldInst.GetFieldDef()->mName, constant->mInt64);
|
|
||||||
diEnumValues.push_back(enumValue);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
int flags = 0;
|
|
||||||
diForwardDecl = DbgCreateEnumerationType(curDIScope,
|
|
||||||
typeName, fileDIScope, mModule->mCurFilePosition.mCurLine, (int64)type->mSize * 8, (int64)type->mAlign * 8, diEnumValues, DbgGetType(typeInstance->GetUnderlyingType()));
|
|
||||||
|
|
||||||
DbgSetType(type, diType);
|
|
||||||
DbgSetInstType(type, diType);
|
|
||||||
}
|
|
||||||
else*/
|
|
||||||
{
|
|
||||||
|
|
||||||
//int align = typeInstance->mIsPacked ? 0 : typeInstance->mAlign;
|
|
||||||
|
|
||||||
// Will fill in later (during definition phase)
|
|
||||||
int flags = 0;
|
|
||||||
diForwardDecl = DbgCreateReplaceableCompositeType(isPrimEnum ? llvm::dwarf::DW_TAG_enumeration_type : llvm::dwarf::DW_TAG_structure_type,
|
|
||||||
typeName, curDIScope, fileDIScope, 0, (int64)BF_ALIGN(typeInstance->mInstSize, typeInstance->mInstAlign) * 8, (int64)typeInstance->mInstAlign * 8, flags);
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
mDITemporaryTypes.push_back(typeInstance);
|
mDITemporaryTypes.push_back(typeInstance);
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
DbgSetInstType(type, diForwardDecl);
|
DbgSetInstType(type, diForwardDecl);
|
||||||
|
@ -2234,14 +2087,12 @@ void BfIRBuilder::CreateTypeDeclaration(BfType* type, bool forceDefine)
|
||||||
diType = diForwardDecl;
|
diType = diForwardDecl;
|
||||||
else
|
else
|
||||||
diType = DbgCreatePointerType(diForwardDecl);
|
diType = DbgCreatePointerType(diForwardDecl);
|
||||||
DbgSetType(type, diType);
|
DbgSetType(type, diType);
|
||||||
//DbgTrackDITypes(type);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if (type->IsTypedPrimitive())
|
if (type->IsTypedPrimitive())
|
||||||
{
|
{
|
||||||
auto underlyingType = type->GetUnderlyingType();
|
auto underlyingType = type->GetUnderlyingType();
|
||||||
//mModule->PopulateType(underlyingType, BfPopulateType_Declaration);
|
|
||||||
irType = MapType(underlyingType);
|
irType = MapType(underlyingType);
|
||||||
SetType(type, irType);
|
SetType(type, irType);
|
||||||
SetInstType(type, irType);
|
SetInstType(type, irType);
|
||||||
|
@ -2320,11 +2171,6 @@ void BfIRBuilder::CreateDbgTypeDefinition(BfType* type)
|
||||||
bool isUnion = false;
|
bool isUnion = false;
|
||||||
bool isCRepr = false;
|
bool isCRepr = false;
|
||||||
|
|
||||||
if ((typeDef->mFullName.ToString() == "IDETest.Virtuals.ClassA") || (typeDef->mFullName.ToString() == "IDETest.Virtuals.ClassB"))
|
|
||||||
{
|
|
||||||
NOP;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (typeInstance->IsBoxed())
|
if (typeInstance->IsBoxed())
|
||||||
{
|
{
|
||||||
|
|
||||||
|
@ -2674,11 +2520,6 @@ void BfIRBuilder::CreateDbgTypeDefinition(BfType* type)
|
||||||
flags |= llvm::DINode::FlagArtificial;
|
flags |= llvm::DINode::FlagArtificial;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (methodDef->mMethodType == BfMethodType_Dtor)
|
|
||||||
{
|
|
||||||
NOP;
|
|
||||||
}
|
|
||||||
|
|
||||||
String methodName = methodDef->mName;
|
String methodName = methodDef->mName;
|
||||||
llvm::SmallVector<BfIRMDNode, 1> genericArgs;
|
llvm::SmallVector<BfIRMDNode, 1> genericArgs;
|
||||||
llvm::SmallVector<BfIRValue, 1> genericConstValueArgs;
|
llvm::SmallVector<BfIRValue, 1> genericConstValueArgs;
|
||||||
|
@ -3205,11 +3046,7 @@ void BfIRBuilder::StructSetBody(BfIRType type, const BfSizedArray<BfIRType>& mem
|
||||||
BfIRType BfIRBuilder::MapType(BfType* type, BfIRPopulateType populateType)
|
BfIRType BfIRBuilder::MapType(BfType* type, BfIRPopulateType populateType)
|
||||||
{
|
{
|
||||||
if (!mIgnoreWrites)
|
if (!mIgnoreWrites)
|
||||||
{
|
{
|
||||||
/*if (populateType == BfIRPopulateType_Declaration)
|
|
||||||
mModule->PopulateType(type, BfPopulateType_Declaration);
|
|
||||||
else if (populateType == BfIRPopulateType_Full)
|
|
||||||
mModule->PopulateType(type, BfPopulateType_Data);*/
|
|
||||||
PopulateType(type, populateType);
|
PopulateType(type, populateType);
|
||||||
}
|
}
|
||||||
BfIRType retType;
|
BfIRType retType;
|
||||||
|
@ -3221,11 +3058,7 @@ BfIRType BfIRBuilder::MapType(BfType* type, BfIRPopulateType populateType)
|
||||||
BfIRType BfIRBuilder::MapTypeInst(BfTypeInstance* typeInst, BfIRPopulateType populateType)
|
BfIRType BfIRBuilder::MapTypeInst(BfTypeInstance* typeInst, BfIRPopulateType populateType)
|
||||||
{
|
{
|
||||||
if (!mIgnoreWrites)
|
if (!mIgnoreWrites)
|
||||||
{
|
{
|
||||||
/*if (populateType == BfIRPopulateType_Declaration)
|
|
||||||
mModule->PopulateType(typeInst, BfPopulateType_Declaration);
|
|
||||||
else if (populateType == BfIRPopulateType_Full)
|
|
||||||
mModule->PopulateType(typeInst, BfPopulateType_Data);*/
|
|
||||||
PopulateType(typeInst, populateType);
|
PopulateType(typeInst, populateType);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -3650,13 +3483,7 @@ BfIRValue BfIRBuilder::CreateShl(BfIRValue lhs, BfIRValue rhs)
|
||||||
{
|
{
|
||||||
mOpFailed = false;
|
mOpFailed = false;
|
||||||
if ((lhs.IsConst()) && (rhs.IsConst()))
|
if ((lhs.IsConst()) && (rhs.IsConst()))
|
||||||
{
|
{
|
||||||
/*auto constLHS = GetConstantById(lhs.mId);
|
|
||||||
auto constRHS = GetConstantById(rhs.mId);
|
|
||||||
|
|
||||||
uint64 val = constLHS->mUInt64 << constRHS->mInt32;
|
|
||||||
return CreateConst(constLHS->mTypeCode, val);*/
|
|
||||||
|
|
||||||
INT_BINOPFUNC_APPLY(lhs, rhs, CheckedShl);
|
INT_BINOPFUNC_APPLY(lhs, rhs, CheckedShl);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -3930,12 +3757,7 @@ BfIRValue BfIRBuilder::CreateLifetimeStart(BfIRValue val)
|
||||||
}
|
}
|
||||||
|
|
||||||
BfIRValue BfIRBuilder::CreateLifetimeEnd(BfIRValue val)
|
BfIRValue BfIRBuilder::CreateLifetimeEnd(BfIRValue val)
|
||||||
{
|
{
|
||||||
if (mModule->mCurMethodInstance->mMethodDef->mName == "Fart")
|
|
||||||
{
|
|
||||||
NOP;
|
|
||||||
}
|
|
||||||
|
|
||||||
BfIRValue retVal = WriteCmd(BfIRCmd_LifetimeEnd, val);
|
BfIRValue retVal = WriteCmd(BfIRCmd_LifetimeEnd, val);
|
||||||
NEW_CMD_INSERTED;
|
NEW_CMD_INSERTED;
|
||||||
return retVal;
|
return retVal;
|
||||||
|
@ -4307,11 +4129,6 @@ BfIRFunction BfIRBuilder::CreateFunction(BfIRFunctionType funcType, BfIRLinkageT
|
||||||
NEW_CMD_INSERTED_IRVALUE;
|
NEW_CMD_INSERTED_IRVALUE;
|
||||||
mFunctionMap[name] = retVal;
|
mFunctionMap[name] = retVal;
|
||||||
|
|
||||||
if (name == "??B?$Result@PEAX@System@bf@@SAPEAXU012@@Z")
|
|
||||||
{
|
|
||||||
NOP;
|
|
||||||
}
|
|
||||||
|
|
||||||
//BfLogSys(mModule->mSystem, "BfIRBuilder::CreateFunction: %d %s Module:%p\n", retVal.mId, name.c_str(), mModule);
|
//BfLogSys(mModule->mSystem, "BfIRBuilder::CreateFunction: %d %s Module:%p\n", retVal.mId, name.c_str(), mModule);
|
||||||
|
|
||||||
return retVal;
|
return retVal;
|
||||||
|
@ -4719,7 +4536,7 @@ BfIRMDNode BfIRBuilder::DbgCreateBasicType(const StringImpl& name, int64 sizeInB
|
||||||
}
|
}
|
||||||
|
|
||||||
BfIRMDNode BfIRBuilder::DbgCreateStructType(BfIRMDNode context, const StringImpl& name, BfIRMDNode file, int lineNum, int64 sizeInBits, int64 alignInBits, int flags, BfIRMDNode derivedFrom, const BfSizedArray<BfIRMDNode>& elements)
|
BfIRMDNode BfIRBuilder::DbgCreateStructType(BfIRMDNode context, const StringImpl& name, BfIRMDNode file, int lineNum, int64 sizeInBits, int64 alignInBits, int flags, BfIRMDNode derivedFrom, const BfSizedArray<BfIRMDNode>& elements)
|
||||||
{
|
{
|
||||||
BfIRMDNode retVal = WriteCmd(BfIRCmd_DbgCreateStructType, context, name, file, lineNum, sizeInBits, alignInBits, flags, derivedFrom, elements);
|
BfIRMDNode retVal = WriteCmd(BfIRCmd_DbgCreateStructType, context, name, file, lineNum, sizeInBits, alignInBits, flags, derivedFrom, elements);
|
||||||
NEW_CMD_INSERTED_IRMD;
|
NEW_CMD_INSERTED_IRMD;
|
||||||
return retVal;
|
return retVal;
|
||||||
|
@ -4768,7 +4585,7 @@ BfIRMDNode BfIRBuilder::DbgCreateArrayType(int64 sizeInBits, int64 alignInBits,
|
||||||
}
|
}
|
||||||
|
|
||||||
BfIRMDNode BfIRBuilder::DbgCreateReplaceableCompositeType(int tag, const StringImpl& name, BfIRMDNode scope, BfIRMDNode file, int line, int64 sizeInBits, int64 alignInBits, int flags)
|
BfIRMDNode BfIRBuilder::DbgCreateReplaceableCompositeType(int tag, const StringImpl& name, BfIRMDNode scope, BfIRMDNode file, int line, int64 sizeInBits, int64 alignInBits, int flags)
|
||||||
{
|
{
|
||||||
BfIRMDNode retVal = WriteCmd(BfIRCmd_DbgCreateReplaceableCompositeType, tag, name, scope, file, line, sizeInBits, alignInBits, flags);
|
BfIRMDNode retVal = WriteCmd(BfIRCmd_DbgCreateReplaceableCompositeType, tag, name, scope, file, line, sizeInBits, alignInBits, flags);
|
||||||
NEW_CMD_INSERTED_IRMD;
|
NEW_CMD_INSERTED_IRMD;
|
||||||
return retVal;
|
return retVal;
|
||||||
|
@ -4849,11 +4666,6 @@ BfIRMDNode BfIRBuilder::DbgCreateMethod(BfIRMDNode context, const StringImpl& na
|
||||||
BfIRMDNode retVal = WriteCmd(BfIRCmd_DbgCreateMethod, context, name, linkageName, file, lineNum, type, isLocalToUnit, isDefinition, vk, vIndex, vTableHolder, flags, isOptimized, fn, genericArgs, genericConstValueArgs);
|
BfIRMDNode retVal = WriteCmd(BfIRCmd_DbgCreateMethod, context, name, linkageName, file, lineNum, type, isLocalToUnit, isDefinition, vk, vIndex, vTableHolder, flags, isOptimized, fn, genericArgs, genericConstValueArgs);
|
||||||
NEW_CMD_INSERTED_IRMD;
|
NEW_CMD_INSERTED_IRMD;
|
||||||
|
|
||||||
if (linkageName == "?Unwrap@?$Result@PEAX@System@bf@@AEAAPEAXXZ")
|
|
||||||
{
|
|
||||||
NOP;
|
|
||||||
}
|
|
||||||
|
|
||||||
// if (mDbgVerifyCodeGen && gDebugDbgLoc)
|
// if (mDbgVerifyCodeGen && gDebugDbgLoc)
|
||||||
// {
|
// {
|
||||||
// OutputDebugStrF("DbgCreateFunction Context:%d name:%s = %d\n", context.mId, name.c_str(), retVal.mId);
|
// OutputDebugStrF("DbgCreateFunction Context:%d name:%s = %d\n", context.mId, name.c_str(), retVal.mId);
|
||||||
|
|
|
@ -714,7 +714,7 @@ DbgLanguage DbgSubprogram::GetLanguage()
|
||||||
return DbgLanguage_C; // Parent type would have been set for Beef, so it must be C
|
return DbgLanguage_C; // Parent type would have been set for Beef, so it must be C
|
||||||
}
|
}
|
||||||
|
|
||||||
bool DbgSubprogram::Equals(DbgSubprogram* checkMethod)
|
bool DbgSubprogram::Equals(DbgSubprogram* checkMethod, bool allowThisMismatch)
|
||||||
{
|
{
|
||||||
if ((mLinkName != NULL) && (checkMethod->mLinkName != NULL))
|
if ((mLinkName != NULL) && (checkMethod->mLinkName != NULL))
|
||||||
{
|
{
|
||||||
|
@ -724,14 +724,23 @@ bool DbgSubprogram::Equals(DbgSubprogram* checkMethod)
|
||||||
if (strcmp(mName, checkMethod->mName) != 0)
|
if (strcmp(mName, checkMethod->mName) != 0)
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
|
if (mHasThis != checkMethod->mHasThis)
|
||||||
|
return false;
|
||||||
|
|
||||||
|
int paramIdx = 0;
|
||||||
auto param = mParams.mHead;
|
auto param = mParams.mHead;
|
||||||
auto checkParam = checkMethod->mParams.mHead;
|
auto checkParam = checkMethod->mParams.mHead;
|
||||||
while ((param != NULL) && (checkParam != NULL))
|
while ((param != NULL) && (checkParam != NULL))
|
||||||
{
|
{
|
||||||
if ((param->mType != checkParam->mType) && (!param->mType->Equals(checkParam->mType)))
|
if ((paramIdx == 0) && (allowThisMismatch))
|
||||||
|
{
|
||||||
|
// Allow
|
||||||
|
}
|
||||||
|
else if ((param->mType != checkParam->mType) && (!param->mType->Equals(checkParam->mType)))
|
||||||
return false;
|
return false;
|
||||||
param = param->mNext;
|
param = param->mNext;
|
||||||
checkParam = checkParam->mNext;
|
checkParam = checkParam->mNext;
|
||||||
|
paramIdx++;
|
||||||
}
|
}
|
||||||
|
|
||||||
if ((param != NULL) || (checkParam != NULL))
|
if ((param != NULL) || (checkParam != NULL))
|
||||||
|
@ -5111,7 +5120,7 @@ void DbgModule::HotReplaceType(DbgType* newType)
|
||||||
|
|
||||||
// If we removed captures then we can still do the hot jump. Otherwise we have to fail...
|
// If we removed captures then we can still do the hot jump. Otherwise we have to fail...
|
||||||
doHotJump = false;
|
doHotJump = false;
|
||||||
if ((oldMethod->IsLambda()) && (oldMethod->GetParamCount() == 0) && (newMethod->GetParamCount() == 0) &&
|
if ((oldMethod->IsLambda()) && (oldMethod->Equals(newMethod, true)) &&
|
||||||
(oldMethod->mHasThis) && (newMethod->mHasThis))
|
(oldMethod->mHasThis) && (newMethod->mHasThis))
|
||||||
{
|
{
|
||||||
auto oldParam = oldMethod->mParams.front();
|
auto oldParam = oldMethod->mParams.front();
|
||||||
|
@ -5120,7 +5129,9 @@ void DbgModule::HotReplaceType(DbgType* newType)
|
||||||
if ((oldParam->mType->IsPointer()) && (newParam->mType->IsPointer()))
|
if ((oldParam->mType->IsPointer()) && (newParam->mType->IsPointer()))
|
||||||
{
|
{
|
||||||
auto oldType = oldParam->mType->mTypeParam->GetPrimaryType();
|
auto oldType = oldParam->mType->mTypeParam->GetPrimaryType();
|
||||||
|
oldType->PopulateType();
|
||||||
auto newType = newParam->mType->mTypeParam->GetPrimaryType();
|
auto newType = newParam->mType->mTypeParam->GetPrimaryType();
|
||||||
|
newType->PopulateType();
|
||||||
if ((oldType->IsStruct()) && (newType->IsStruct()))
|
if ((oldType->IsStruct()) && (newType->IsStruct()))
|
||||||
{
|
{
|
||||||
bool wasMatch = true;
|
bool wasMatch = true;
|
||||||
|
|
|
@ -428,7 +428,7 @@ public:
|
||||||
DbgType* GetParent();
|
DbgType* GetParent();
|
||||||
DbgType* GetTargetType(); // usually mParentType except for closures
|
DbgType* GetTargetType(); // usually mParentType except for closures
|
||||||
DbgLanguage GetLanguage();
|
DbgLanguage GetLanguage();
|
||||||
bool Equals(DbgSubprogram* checkMethod);
|
bool Equals(DbgSubprogram* checkMethod, bool allowThisMismatch = false);
|
||||||
int GetParamCount();
|
int GetParamCount();
|
||||||
String GetParamName(int paramIdx);
|
String GetParamName(int paramIdx);
|
||||||
bool IsGenericMethod();
|
bool IsGenericMethod();
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue