fixed a warning about the new enum ASTTYPE
authorjohanknol <johanknol@4a8a32a2-be11-0410-ad9d-d568d2c75423>
Sat, 5 Apr 2003 16:43:19 +0000 (16:43 +0000)
committerjohanknol <johanknol@4a8a32a2-be11-0410-ad9d-d568d2c75423>
Sat, 5 Apr 2003 16:43:19 +0000 (16:43 +0000)
git-svn-id: https://sdcc.svn.sourceforge.net/svnroot/sdcc/trunk/sdcc@2483 4a8a32a2-be11-0410-ad9d-d568d2c75423

src/SDCCast.c
src/SDCCast.h
src/SDCCicode.c

index dd7e0de77da28fae6ffe172bd35a800e5a9e8c26..5fd567323c44e56ee27c456b757f2b77786108d6 100644 (file)
@@ -110,14 +110,6 @@ newAst_LINK (sym_link * val)
   return ex;
 }
 
-ast *
-newAst_STMNT (unsigned val)
-{
-  ast *ex = newAst_ (EX_STMNT);
-  ex->opval.stmnt = val;
-  return ex;
-}
-
 /*-----------------------------------------------------------------*/
 /* newNode - creates a new node                                    */
 /*-----------------------------------------------------------------*/
@@ -1287,6 +1279,8 @@ bool constExprTree (ast *cexpr) {
       if (constExprTree(cexpr->left) && constExprTree(cexpr->right)) {
        return TRUE;
       }
+    case EX_OPERAND:
+      return IS_CONSTANT(operandType(cexpr->opval.oprnd));
     }
   return FALSE;
 }  
index 194612d58fafcc798949071836e88015db6e963b..24cc4f7aebcc29d398935c85631509a14392eaa5 100644 (file)
@@ -35,7 +35,6 @@ typedef enum {
   EX_OP=0,
   EX_VALUE,
   EX_LINK,
-  EX_STMNT,
   EX_OPERAND
 } ASTTYPE;
 
@@ -58,7 +57,6 @@ typedef struct ast
        value *val;             /* value if type = EX_VALUE */
        sym_link *lnk;          /* sym_link * if type= EX_LINK  */
        struct operand *oprnd;  /* used only for side effecting function calls */
-       unsigned stmnt;         /* statement if type=EX_STMNT */
        unsigned op;            /* operator if type= EX_OP  */
       }
     opval;
@@ -180,7 +178,6 @@ extern struct memmap *GcurMemmap;
 ast *newAst_VALUE (value * val);
 ast *newAst_OP (unsigned op);
 ast *newAst_LINK (sym_link * val);
-ast *newAst_STMNT (unsigned val);
 
 void initAst ();
 ast *newNode (long, ast *, ast *);
index a94d664f9d2e9aaea0fdbd3e9d4971d3be984a30..cc65ac066028318a58201eaa772154e872c304c3 100644 (file)
@@ -1521,10 +1521,13 @@ operandFromAst (ast * tree,int lvl)
 
     case EX_LINK:
       return operandFromLink (tree->opval.lnk);
-    }
+      break;
 
-  assert (0);
-  /*  Just to keep the comiler happy */
+    default:
+      assert (0);
+    }
+  
+  /*  Just to keep the compiler happy */
   return (operand *) 0;
 }