* sim/ucsim/configure.in,
[fw/sdcc] / src / SDCCsymt.h
index f79b049322de30f01738d081eb6b4dd91341e24a..82acf79b6bab1546cf9fcf7e44a034597af80c15 100644 (file)
@@ -297,6 +297,7 @@ typedef struct symbol
     struct iCode *fuse;                /* furthest use */
     struct iCode *rematiCode;  /* rematerialse with which instruction */
     struct operand *reqv;      /* register equivalent of a local variable */
+    struct symbol *prereqv;    /* symbol before register equiv. substituion */
     union
       {
        struct symbol *spillLoc;        /* register spil location */
@@ -307,6 +308,7 @@ typedef struct symbol
     unsigned offset;           /* offset from top if struct */
 
     int lineDef;               /* defined line number        */
+    char *fileDef;             /* defined filename           */
     int lastLine;              /* for functions the last line */
     struct sym_link *type;     /* 1st link to declator chain */
     struct sym_link *etype;    /* last link to declarator chn */
@@ -455,6 +457,8 @@ extern sym_link *validateLink(sym_link      *l,
 #define IS_BITVAR(x) (IS_SPEC(x) && (x->select.s.noun == V_BITFIELD || \
                                      x->select.s.noun  == V_BIT ||   \
                                      x->select.s.noun == V_SBIT ))
+#define IS_BIT(x) (IS_SPEC(x) && (x->select.s.noun  == V_BIT ||   \
+                                  x->select.s.noun == V_SBIT ))
 #define IS_FLOAT(x)  (IS_SPEC(x) && x->select.s.noun == V_FLOAT)
 #define IS_ARITHMETIC(x) (IS_INTEGRAL(x) || IS_FLOAT(x))
 #define IS_AGGREGATE(x) (IS_ARRAY(x) || IS_STRUCT(x))
@@ -500,6 +504,18 @@ extern sym_link *floatType;
 
 #include "SDCCval.h"
 
+typedef enum
+{
+  RESULT_TYPE_NONE = 0,        /* operands will be promoted to int */
+  RESULT_CHECK = 0, /* TODO: replace all occurences with the appropriate type and remove me */
+  RESULT_TYPE_BIT,
+  RESULT_TYPE_CHAR,
+  RESULT_TYPE_INT,
+  RESULT_TYPE_OTHER,   /* operands will be promoted to int */
+  RESULT_TYPE_IFX,
+  RESULT_TYPE_NOPROM,  /* operands will be promoted to int */
+} RESULT_TYPE;
+
 /* forward definitions for the symbol table related functions */
 void initSymt ();
 symbol *newSymbol (char *, int);
@@ -539,7 +555,7 @@ int funcInChain (sym_link *);
 void addSymChain (symbol *);
 sym_link *structElemType (sym_link *, value *);
 symbol *getStructElement (structdef *, symbol *);
-sym_link *computeType (sym_link *, sym_link *, bool promoteCharToInt);
+sym_link *computeType (sym_link *, sym_link *, RESULT_TYPE, char);
 void processFuncArgs (symbol *);
 int isSymbolEqual (symbol *, symbol *);
 int powof2 (TYPE_UDWORD);
@@ -560,6 +576,8 @@ void changePointer (symbol * sym);
 void checkTypeSanity(sym_link *etype, char *name);
 sym_link *typeFromStr (char *) ;
 STORAGE_CLASS sclsFromPtr(sym_link *ptr);
+sym_link *newEnumType (symbol *);
+void  promoteAnonStructs (int, structdef *);
 
 
 extern char *nounName(sym_link *); /* noun strings */