Fix assert in linux sample build

This commit is contained in:
drmortalwombat 2024-02-28 21:26:25 +01:00
parent 2d50d56606
commit f877e5b8c2
2 changed files with 16 additions and 9 deletions

View File

@ -162,14 +162,15 @@ void GlobalAnalyzer::AutoInline(void)
{
Declaration* f = mTopoFunctions[i];
if (!(f->mFlags & DTF_INLINE) &&
if (f->mType == DT_CONST_FUNCTION &&
!(f->mFlags & DTF_INLINE) &&
!(f->mFlags & DTF_EXPORT) &&
!(f->mFlags & DTF_PREVENT_INLINE) &&
!(f->mBase->mFlags & DTF_VARIADIC) &&
!(f->mFlags & DTF_FUNC_VARIABLE) &&
!((f->mFlags & DTF_FUNC_ASSEMBLER) && !(f->mFlags & DTF_REQUEST_INLINE)) &&
!(f->mFlags & DTF_INTRINSIC) &&
!(f->mFlags & DTF_FUNC_RECURSIVE) && f->mLocalSize < 100)
!(f->mFlags & DTF_FUNC_RECURSIVE))
{
int nparams = 0;
Declaration* dec = f->mBase->mParams;
@ -186,6 +187,8 @@ void GlobalAnalyzer::AutoInline(void)
bool doinline = false;
if ((f->mCompilerOptions & COPT_OPTIMIZE_INLINE) && (f->mFlags & DTF_REQUEST_INLINE))
doinline = true;
if (f->mLocalSize < 100)
{
if ((f->mCompilerOptions & COPT_OPTIMIZE_AUTO_INLINE) && ((cost - 20) * (f->mCallers.Size() - 1) <= 20))
{
if (f->mCallers.Size() == 1 && f->mComplexity > 100)
@ -198,6 +201,7 @@ void GlobalAnalyzer::AutoInline(void)
}
if ((f->mCompilerOptions & COPT_OPTIMIZE_AUTO_INLINE_ALL) && (cost * (f->mCallers.Size() - 1) <= 10000))
doinline = true;
}
if (doinline)
{

View File

@ -423,7 +423,10 @@ NativeCodeInstruction::NativeCodeInstruction(const InterInstruction* ins, AsmIns
NativeCodeInstruction::NativeCodeInstruction(const InterInstruction* ins, AsmInsType type, const NativeCodeInstruction& addr)
: mIns(ins), mType(type), mMode(addr.mMode), mAddress(addr.mAddress), mLinkerObject(addr.mLinkerObject), mFlags(addr.mFlags), mParam(addr.mParam), mLive(LIVE_ALL)
{
if (mIns)
{
assert(mIns->mLocation.mFileName);
}
}