]> git.sur5r.net Git - cc65/blobdiff - src/cc65/exprdesc.h
Fixed two compiler warnings.
[cc65] / src / cc65 / exprdesc.h
index 6091f159791a1b0ba0f20e7e5b985cfca1f73184..16322fb09c9cebdf1dde41be84d6e441dd122cd7 100644 (file)
@@ -6,7 +6,7 @@
 /*                                                                           */
 /*                                                                           */
 /*                                                                           */
-/* (C) 2002-2009, Ullrich von Bassewitz                                      */
+/* (C) 2002-2010, Ullrich von Bassewitz                                      */
 /*                Roemerstrasse 52                                           */
 /*                D-70794 Filderstadt                                        */
 /* EMail:         uz@cc65.org                                                */
@@ -45,6 +45,7 @@
 #include "inline.h"
 
 /* cc65 */
+#include "asmcode.h"
 #include "datatype.h"
 
 
@@ -82,21 +83,33 @@ enum {
 
     /* Test */
     E_NEED_TEST         = 0x0400,       /* Expression needs a test to set cc */
-    E_CC_SET            = 0x0800        /* Condition codes are set */
+    E_CC_SET            = 0x0800,       /* Condition codes are set */
+
+    E_HAVE_MARKS        = 0x1000,       /* Code marks are valid */
+
 };
 
+/* Forward */
+struct Literal;
+
 /* Describe the result of an expression */
 typedef struct ExprDesc ExprDesc;
 struct ExprDesc {
     struct SymEntry*   Sym;            /* Symbol table entry if known */
     Type*              Type;           /* Type array of expression */
     unsigned            Flags;
-    unsigned long      Name;           /* Name or label number */
+    unsigned long      Name;           /* Name or label number */
     long                       IVal;           /* Integer value if expression constant */
     Double              FVal;           /* Floating point value */
+    struct Literal*     LVal;           /* Literal value */
 
+    /* Bit field stuff */
     unsigned            BitOffs;        /* Bit offset for bit fields */
     unsigned            BitWidth;       /* Bit width for bit fields */
+
+    /* Start and end of generated code */
+    CodeMark            Start;
+    CodeMark            End;
 };
 
 
@@ -173,7 +186,7 @@ INLINE int ED_IsLocExpr (const ExprDesc* Expr)
 #if defined(HAVE_INLINE)
 INLINE int ED_IsLocLiteral (const ExprDesc* Expr)
 /* Return true if the expression is a string from the literal pool */
-{
+{               
     return (Expr->Flags & E_MASK_LOC) == E_LOC_LITERAL;
 }
 #else
@@ -294,6 +307,12 @@ INLINE void ED_MarkAsUntested (ExprDesc* Expr)
 #  define ED_MarkAsUntested(Expr)   do { (Expr)->Flags &= ~E_CC_SET; } while (0)
 #endif
 
+void ED_SetCodeRange (ExprDesc* Expr, const CodeMark* Start, const CodeMark* End);
+/* Set the code range for this expression */
+
+int ED_CodeRangeIsEmpty (const ExprDesc* Expr);
+/* Return true if no code was output for this expression */
+
 const char* ED_GetLabelName (const ExprDesc* Expr, long Offs);
 /* Return the assembler label name of the given expression. Beware: This
  * function may use a static buffer, so the name may get "lost" on the second