From 2a28ee5b8857a0566628730368453d250ffbd859 Mon Sep 17 00:00:00 2001 From: johanknol Date: Fri, 18 Jan 2002 15:14:21 +0000 Subject: [PATCH] xa51 updates git-svn-id: https://sdcc.svn.sourceforge.net/svnroot/sdcc/trunk/sdcc@1813 4a8a32a2-be11-0410-ad9d-d568d2c75423 --- src/SDCCicode.c | 30 ++++++++++++++++++++---------- src/SDCCicode.h | 1 + 2 files changed, 21 insertions(+), 10 deletions(-) diff --git a/src/SDCCicode.c b/src/SDCCicode.c index f9076153..5396f856 100644 --- a/src/SDCCicode.c +++ b/src/SDCCicode.c @@ -918,12 +918,11 @@ isOperandInDirSpace (operand * op) return (IN_DIRSPACE (SPEC_OCLS (etype)) ? TRUE : FALSE); } -/*-----------------------------------------------------------------*/ -/* isOperandOnStack - will return true if operand is on stack */ -/*-----------------------------------------------------------------*/ -#if 0 +/*------------------------------------------------------------------*/ +/* isOperandInDirSpace - will return true if operand is in dirSpace */ +/*------------------------------------------------------------------*/ bool -isOperandOnStack (operand * op) +isOperandInCodeSpace (operand * op) { sym_link *etype; @@ -933,11 +932,23 @@ isOperandOnStack (operand * op) if (!IS_SYMOP (op)) return FALSE; - etype = getSpec (operandType (op)); - - return ((IN_STACK (etype)) ? TRUE : FALSE); + if (!IS_TRUE_SYMOP (op)) + { + if (SPIL_LOC (op)) + etype = SPIL_LOC (op)->etype; + else + return FALSE; + } + else + { + etype = getSpec (operandType (op)); + } + return (IN_CODESPACE (SPEC_OCLS (etype)) ? TRUE : FALSE); } -#else + +/*-----------------------------------------------------------------*/ +/* isOperandOnStack - will return true if operand is on stack */ +/*-----------------------------------------------------------------*/ bool isOperandOnStack (operand * op) { @@ -957,7 +968,6 @@ isOperandOnStack (operand * op) return FALSE; } -#endif /*-----------------------------------------------------------------*/ /* operandLitValue - literal value of an operand */ diff --git a/src/SDCCicode.h b/src/SDCCicode.h index 51301d88..7d043fb9 100644 --- a/src/SDCCicode.h +++ b/src/SDCCicode.h @@ -313,6 +313,7 @@ int printOperand (operand *, FILE *); void setOperandType (operand *, sym_link *); bool isOperandInFarSpace (operand *); bool isOperandInDirSpace (operand *); +bool isOperandInCodeSpace (operand *); operand *opFromOpWithDU (operand *, bitVect *, bitVect *); iCode *copyiCode (iCode *); operand *newiTempFromOp (operand *); -- 2.30.2