Keep unused variable stores if optimization is turned off
This commit is contained in:
parent
d047152646
commit
30b3ed610e
|
@ -4,6 +4,8 @@
|
|||
#include <stdio.h>
|
||||
#include <math.h>
|
||||
|
||||
static bool CheckFunc;
|
||||
|
||||
int InterTypeSize[] = {
|
||||
0,
|
||||
1,
|
||||
|
@ -14906,6 +14908,8 @@ void InterCodeProcedure::RemoveUnusedInstructions(void)
|
|||
|
||||
void InterCodeProcedure::RemoveUnusedStoreInstructions(InterMemory paramMemory)
|
||||
{
|
||||
if (mCompilerOptions & COPT_OPTIMIZE_BASIC)
|
||||
{
|
||||
if (mLocalVars.Size() > 0 || mParamVars.Size() > 0)
|
||||
{
|
||||
for (int i = 0; i < mLocalAliasedSet.Size(); i++)
|
||||
|
@ -14965,6 +14969,7 @@ void InterCodeProcedure::RemoveUnusedStoreInstructions(InterMemory paramMemory)
|
|||
|
||||
DisassembleDebug("removed unused static stores");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void InterCodeProcedure::MergeCommonPathInstructions(void)
|
||||
|
@ -15336,6 +15341,8 @@ void InterCodeProcedure::Close(void)
|
|||
{
|
||||
GrowingTypeArray tstack(IT_NONE);
|
||||
|
||||
// CheckFunc = !strcmp(mIdent->mString, "joy_poll");
|
||||
|
||||
mEntryBlock = mBlocks[0];
|
||||
|
||||
DisassembleDebug("start");
|
||||
|
@ -16158,9 +16165,12 @@ void InterCodeProcedure::MarkRelevantStatics(void)
|
|||
|
||||
void InterCodeProcedure::RemoveNonRelevantStatics(void)
|
||||
{
|
||||
if (mCompilerOptions & COPT_OPTIMIZE_BASIC)
|
||||
{
|
||||
ResetVisited();
|
||||
mEntryBlock->RemoveNonRelevantStatics();
|
||||
RemoveUnusedInstructions();
|
||||
}
|
||||
}
|
||||
|
||||
void InterCodeProcedure::MapVariables(void)
|
||||
|
@ -16647,6 +16657,9 @@ void InterCodeProcedure::Disassemble(const char* name, bool dumpSets)
|
|||
FILE* file;
|
||||
static bool initial = true;
|
||||
|
||||
if (!CheckFunc)
|
||||
return;
|
||||
|
||||
if (!initial)
|
||||
{
|
||||
fopen_s(&file, "r:\\cldiss.txt", "a");
|
||||
|
|
Loading…
Reference in New Issue