xa51 updates
authorjohanknol <johanknol@4a8a32a2-be11-0410-ad9d-d568d2c75423>
Fri, 18 Jan 2002 15:14:21 +0000 (15:14 +0000)
committerjohanknol <johanknol@4a8a32a2-be11-0410-ad9d-d568d2c75423>
Fri, 18 Jan 2002 15:14:21 +0000 (15:14 +0000)
git-svn-id: https://sdcc.svn.sourceforge.net/svnroot/sdcc/trunk/sdcc@1813 4a8a32a2-be11-0410-ad9d-d568d2c75423

src/SDCCicode.c
src/SDCCicode.h

index f9076153b113853f5bf0aeb46dee52520272c195..5396f85691a17599e47ebfcb18baaf3ec724eeaf 100644 (file)
@@ -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                   */
index 51301d88f69a35d669fafc4b1fea992e5fafc03c..7d043fb987ef055ee1b39a80de9724be726d7369 100644 (file)
@@ -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 *);