mirror of
https://github.com/beefytech/Beef.git
synced 2025-06-10 12:32:20 +02:00
More const eval progress
This commit is contained in:
parent
a3ea79cd62
commit
9b80c26d0a
26 changed files with 1673 additions and 460 deletions
|
@ -3933,7 +3933,7 @@ void BfModule::Visit(BfDeleteStatement* deleteStmt)
|
|||
allowPrivate = false;
|
||||
}
|
||||
|
||||
if (mCompiler->mOptions.mObjectHasDebugFlags)
|
||||
if ((mCompiler->mOptions.mObjectHasDebugFlags) && (!mIsConstModule))
|
||||
{
|
||||
auto preDelete = GetInternalMethod((deleteStmt->mTargetTypeToken != NULL) ? "Dbg_ObjectPreCustomDelete" : "Dbg_ObjectPreDelete");
|
||||
SizedArray<BfIRValue, 4> llvmArgs;
|
||||
|
@ -3990,7 +3990,7 @@ void BfModule::Visit(BfDeleteStatement* deleteStmt)
|
|||
}
|
||||
else
|
||||
{
|
||||
if (mCompiler->mOptions.mEnableRealtimeLeakCheck)
|
||||
if ((mCompiler->mOptions.mEnableRealtimeLeakCheck) && (!mIsConstModule))
|
||||
{
|
||||
SizedArray<BfIRValue, 4> llvmArgs;
|
||||
llvmArgs.push_back(mBfIRBuilder->CreateBitCast(val.mValue, mBfIRBuilder->MapType(objectType)));
|
||||
|
@ -6784,7 +6784,7 @@ void BfModule::Visit(BfDeferStatement* deferStmt)
|
|||
|
||||
if (!customAllocator)
|
||||
{
|
||||
if (mCompiler->mOptions.mEnableRealtimeLeakCheck)
|
||||
if ((mCompiler->mOptions.mEnableRealtimeLeakCheck) && (!mIsConstModule))
|
||||
{
|
||||
auto moduleMethodInstance = GetInternalMethod("Dbg_MarkObjectDeleted");
|
||||
AddDeferredCall(moduleMethodInstance, llvmArgs, scope, deleteStmt, false, true);
|
||||
|
@ -6801,7 +6801,7 @@ void BfModule::Visit(BfDeferStatement* deferStmt)
|
|||
auto moduleMethodInstance = GetMethodInstance(objectType, methodInstance->mMethodDef, BfTypeVector());
|
||||
AddDeferredCall(moduleMethodInstance, llvmArgs, scope, deleteStmt, false, true);
|
||||
|
||||
if (mCompiler->mOptions.mObjectHasDebugFlags)
|
||||
if ((mCompiler->mOptions.mObjectHasDebugFlags) && (!mIsConstModule))
|
||||
{
|
||||
auto moduleMethodInstance = GetMethodByName(internalType->ToTypeInstance(), (deleteStmt->mTargetTypeToken != NULL) ? "Dbg_ObjectPreCustomDelete" : "Dbg_ObjectPreDelete");
|
||||
AddDeferredCall(moduleMethodInstance, llvmArgs, scope, deleteStmt, false, true);
|
||||
|
@ -6813,7 +6813,7 @@ void BfModule::Visit(BfDeferStatement* deferStmt)
|
|||
{
|
||||
val = LoadValue(val);
|
||||
BfModuleMethodInstance moduleMethodInstance;
|
||||
if (mCompiler->mOptions.mEnableRealtimeLeakCheck)
|
||||
if ((mCompiler->mOptions.mDebugAlloc) && (!mIsConstModule))
|
||||
moduleMethodInstance = GetMethodByName(internalType->ToTypeInstance(), "Dbg_RawFree");
|
||||
else
|
||||
moduleMethodInstance = GetMethodByName(internalType->ToTypeInstance(), "Free");
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue