1
0
mirror of https://github.com/cc65/cc65.git synced 2024-11-19 21:32:19 +00:00

Improved fix for Issues #167 and #784 and somehow #781.

This commit is contained in:
acqn 2020-01-03 08:20:14 +08:00 committed by Oliver Schmidt
parent 48d3578c24
commit 49c5cfd65b
4 changed files with 507 additions and 199 deletions

View File

@ -61,6 +61,7 @@
/* Flags used */
#define CEF_USERMARK 0x0001U /* Generic mark by user functions */
#define CEF_NUMARG 0x0002U /* Insn has numerical argument */
#define CEF_DONT_REMOVE 0x0004U /* Insn shouldn't be removed, marked by user functions */
/* Code entry structure */
typedef struct CodeEntry CodeEntry;

View File

@ -375,7 +375,7 @@ static int CompareFuncInfo (const void* Key, const void* Info)
void GetFuncInfo (const char* Name, unsigned short* Use, unsigned short* Chg)
fncls_t GetFuncInfo (const char* Name, unsigned short* Use, unsigned short* Chg)
/* For the given function, lookup register information and store it into
** the given variables. If the function is unknown, assume it will use and
** load all registers.
@ -430,7 +430,7 @@ void GetFuncInfo (const char* Name, unsigned short* Use, unsigned short* Chg)
*Chg = REG_ALL;
/* Done */
return;
return FNCLS_GLOBAL;
}
} else if (IsDigit (Name[0]) || Name[0] == '$') {
@ -441,7 +441,7 @@ void GetFuncInfo (const char* Name, unsigned short* Use, unsigned short* Chg)
*/
*Use = REG_ALL;
*Chg = REG_ALL;
return;
return FNCLS_NUMERIC;
} else {
@ -466,7 +466,7 @@ void GetFuncInfo (const char* Name, unsigned short* Use, unsigned short* Chg)
*Use = REG_ALL;
*Chg = REG_ALL;
}
return;
return FNCLS_BUILTIN;
}
/* Function not found - assume that the primary register is input, and all
@ -474,6 +474,8 @@ void GetFuncInfo (const char* Name, unsigned short* Use, unsigned short* Chg)
*/
*Use = REG_EAXY;
*Chg = REG_ALL;
return FNCLS_UNKNOWN;
}

View File

@ -120,16 +120,27 @@ typedef enum {
/* Defines for the conditions in a compare */
typedef enum {
FNCLS_UNKNOWN = -1, /* Unknown */
FNCLS_BUILTIN, /* Builtin */
FNCLS_GLOBAL, /* Found in global sym table minus the leading underscore */
FNCLS_NUMERIC /* A call to a numeric address */
} fncls_t;
/*****************************************************************************/
/* Code */
/*****************************************************************************/
void GetFuncInfo (const char* Name, unsigned short* Use, unsigned short* Chg);
fncls_t GetFuncInfo (const char* Name, unsigned short* Use, unsigned short* Chg);
/* For the given function, lookup register information and store it into
** the given variables. If the function is unknown, assume it will use and
** load all registers.
** Return the whatever category the function is in.
*/
const ZPInfo* GetZPInfo (const char* Name);

File diff suppressed because it is too large Load Diff