1
0
mirror of https://github.com/cc65/cc65.git synced 2024-06-07 07:29:33 +00:00

Added an utility function to check for quasi-constant addresses (of stack variables).

This commit is contained in:
acqn 2021-02-08 22:47:51 +08:00 committed by Oliver Schmidt
parent 0a8ca3041a
commit c4a2620e29
2 changed files with 14 additions and 0 deletions

View File

@ -408,6 +408,15 @@ int ED_IsConst (const ExprDesc* Expr)
int ED_IsQuasiConst (const ExprDesc* Expr)
/* Return true if the expression denotes a quasi-constant of some sort. This
** can be a numeric constant, a constant address or a stack variable address.
*/
{
return (Expr->Flags & E_MASK_LOC) == E_LOC_NONE || ED_IsQuasiConstAddr (Expr);
}
int ED_IsConstAddr (const ExprDesc* Expr)
/* Return true if the expression denotes a constant address of some sort. This
** can be the address of a global variable (maybe with offset) or similar.

View File

@ -649,6 +649,11 @@ int ED_IsConst (const ExprDesc* Expr);
** similar.
*/
int ED_IsQuasiConst (const ExprDesc* Expr);
/* Return true if the expression denotes a quasi-constant of some sort. This
** can be a numeric constant, a constant address or a stack variable address.
*/
int ED_IsConstAddr (const ExprDesc* Expr);
/* Return true if the expression denotes a constant address of some sort. This
** can be the address of a global variable (maybe with offset) or similar.