1
0
mirror of https://github.com/cc65/cc65.git synced 2024-06-01 13:41:34 +00:00

Wrapper functions use all registers

This commit is contained in:
Lauri Kasanen 2017-05-19 15:20:36 +03:00
parent 80e6afd335
commit 901ac80026
3 changed files with 7 additions and 1 deletions

View File

@ -401,6 +401,10 @@ void GetFuncInfo (const char* Name, unsigned short* Use, unsigned short* Chg)
*/
if ((D->Flags & FD_VARIADIC) != 0) {
*Use = REG_Y;
} else if (D->Flags & FD_CALL_WRAPPER) {
/* Wrappers may go to any functions, so mark them as using all
registers */
*Use = REG_EAXY;
} else if (D->ParamCount > 0 &&
(AutoCDecl ?
IsQualFastcall (E->Type) :

View File

@ -52,9 +52,10 @@
#define FD_OLDSTYLE 0x0010U /* Old style (K&R) function */
#define FD_OLDSTYLE_INTRET 0x0020U /* K&R func has implicit int return */
#define FD_UNNAMED_PARAMS 0x0040U /* Function has unnamed params */
#define FD_CALL_WRAPPER 0x0080U /* This function is used as a wrapper */
/* Bits that must be ignored when comparing funcs */
#define FD_IGNORE (FD_OLDSTYLE | FD_OLDSTYLE_INTRET | FD_UNNAMED_PARAMS)
#define FD_IGNORE (FD_OLDSTYLE | FD_OLDSTYLE_INTRET | FD_UNNAMED_PARAMS | FD_CALL_WRAPPER)

View File

@ -513,6 +513,7 @@ static void WrappedCallPragma (StrBuf* B)
PushWrappedCall(Entry, Val);
Entry->Flags |= SC_REF;
Entry->V.F.Func->Flags |= FD_CALL_WRAPPER;
} else {