mirror of
https://github.com/cc65/cc65.git
synced 2025-04-13 06:37:20 +00:00
Changd all Find*Last*InOpenRange() to return the beginning of the open range.
Fixed FindArgLastUsageInOpenRange().
This commit is contained in:
parent
4376b83390
commit
0a8ca3041a
@ -3038,13 +3038,13 @@ int FindArgLastUsageInOpenRange (CodeSeg* S, int First, int Last, CodeEntry* E,
|
||||
/* Find the last index where the arg of E might be used or changed in the range (First, Last).
|
||||
** ReloadY indicates whether Y is supposed to be reloaded.
|
||||
** The code block in the range must be basic without any jump backwards.
|
||||
** Return the index of the found entry, or -1 if not found.
|
||||
** Return the index of the found entry, or First if not found.
|
||||
*/
|
||||
{
|
||||
LoadRegInfo LRI;
|
||||
CodeEntry* X;
|
||||
unsigned CheckedFlags = LI_SRC_USE | LI_SRC_CHG;
|
||||
int Found = -1;
|
||||
int Found = First;
|
||||
|
||||
CHECK (Last <= (int)CollCount (&S->Entries));
|
||||
|
||||
@ -3066,8 +3066,8 @@ int FindArgLastUsageInOpenRange (CodeSeg* S, int First, int Last, CodeEntry* E,
|
||||
|
||||
/* TODO: We don't currently check for all cases */
|
||||
if ((LRI.Flags & (LI_DIRECT | LI_CHECK_ARG | LI_CHECK_Y | LI_RELOAD_Y)) == 0) {
|
||||
/* Just bail out as if the src would change right away */
|
||||
return 0;
|
||||
/* Just bail out as if the src would change everywhere */
|
||||
return First < Last ? Last - 1 : First;
|
||||
}
|
||||
|
||||
if ((LRI.Flags & LI_CHECK_Y) != 0) {
|
||||
@ -3145,11 +3145,11 @@ int FindRegLastChangeInOpenRange (CodeSeg* S, int First, int Last, unsigned what
|
||||
/* Find the last possible spot where the queried ZPs, registers and/or processor
|
||||
** states might be changed in the range (First, Last). The code block in the
|
||||
** range must be basic without any jump backwards.
|
||||
** Return the index of the found entry, or -1 if not found.
|
||||
** Return the index of the found entry, or First if not found.
|
||||
*/
|
||||
{
|
||||
CodeEntry* X;
|
||||
int Found = -1;
|
||||
int Found = First;
|
||||
|
||||
CHECK (Last <= (int)CollCount (&S->Entries));
|
||||
|
||||
@ -3169,11 +3169,11 @@ int FindRegLastUseInOpenRange (CodeSeg* S, int First, int Last, unsigned what)
|
||||
/* Find the last possible spot where the queried ZPs, registers and/or processor
|
||||
** states might be used in the range (First, Last). The code block in the range
|
||||
** must be basic without any jump backwards.
|
||||
** Return the index of the found entry, or -1 if not found.
|
||||
** Return the index of the found entry, or First if not found.
|
||||
*/
|
||||
{
|
||||
CodeEntry* X;
|
||||
int Found = -1;
|
||||
int Found = First;
|
||||
|
||||
CHECK (Last <= (int)CollCount (&S->Entries));
|
||||
|
||||
|
@ -433,7 +433,7 @@ int FindArgLastUsageInOpenRange (CodeSeg* S, int First, int Last, CodeEntry* E,
|
||||
/* Find the last index where the arg of E might be used or changed in the range (First, Last).
|
||||
** ReloadY indicates whether Y is supposed to be reloaded.
|
||||
** The code block in the range must be basic without any jump backwards.
|
||||
** Return the index of the found entry, or -1 if not found.
|
||||
** Return the index of the found entry, or First if not found.
|
||||
*/
|
||||
|
||||
int FindRegFirstChangeInOpenRange (CodeSeg* S, int First, int Last, unsigned what);
|
||||
@ -454,14 +454,14 @@ int FindRegLastChangeInOpenRange (CodeSeg* S, int First, int Last, unsigned what
|
||||
/* Find the last possible spot where the queried ZPs, registers and/or processor
|
||||
** states might be changed in the range (First, Last). The code block in the
|
||||
** range must be basic without any jump backwards.
|
||||
** Return the index of the found entry, or -1 if not found.
|
||||
** Return the index of the found entry, or First if not found.
|
||||
*/
|
||||
|
||||
int FindRegLastUseInOpenRange (CodeSeg* S, int First, int Last, unsigned what);
|
||||
/* Find the last possible spot where the queried ZPs, registers and/or processor
|
||||
** states might be used in the range (First, Last). The code block in the range
|
||||
** must be basic without any jump backwards.
|
||||
** Return the index of the found entry, or -1 if not found.
|
||||
** Return the index of the found entry, or First if not found.
|
||||
*/
|
||||
|
||||
/* End of codeoptutil.h */
|
||||
|
Loading…
x
Reference in New Issue
Block a user