#define INTNO_MAX 255 /* maximum allowed interrupt number */
#define INTNO_UNSPEC (INTNO_MAX+1) /* interrupt number unspecified */
#define INTNO_MAX 255 /* maximum allowed interrupt number */
#define INTNO_UNSPEC (INTNO_MAX+1) /* interrupt number unspecified */
unsigned char level; /* Nesting level */
struct symbol *fields; /* pointer to fields */
unsigned size; /* sizeof the table in bytes */
unsigned char level; /* Nesting level */
struct symbol *fields; /* pointer to fields */
unsigned size; /* sizeof the table in bytes */
struct iCode *fuse; /* furthest use */
struct iCode *rematiCode; /* rematerialse with which instruction */
struct operand *reqv; /* register equivalent of a local variable */
struct iCode *fuse; /* furthest use */
struct iCode *rematiCode; /* rematerialse with which instruction */
struct operand *reqv; /* register equivalent of a local variable */
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 */
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 */
#define SPEC_NOUN(x) validateLink(x, "SPEC_NOUN", #x, SPECIFIER, __FILE__, __LINE__)->select.s.noun
#define SPEC_LONG(x) validateLink(x, "SPEC_LONG", #x, SPECIFIER, __FILE__, __LINE__)->select.s._long
#define SPEC_NOUN(x) validateLink(x, "SPEC_NOUN", #x, SPECIFIER, __FILE__, __LINE__)->select.s.noun
#define SPEC_LONG(x) validateLink(x, "SPEC_LONG", #x, SPECIFIER, __FILE__, __LINE__)->select.s._long
#define SPEC_USIGN(x) validateLink(x, "SPEC_USIGN", #x, SPECIFIER, __FILE__, __LINE__)->select.s._unsigned
#define SPEC_SCLS(x) validateLink(x, "SPEC_SCLS", #x, SPECIFIER, __FILE__, __LINE__)->select.s.sclass
#define SPEC_ENUM(x) validateLink(x, "SPEC_ENUM", #x, SPECIFIER, __FILE__, __LINE__)->select.s._isenum
#define SPEC_USIGN(x) validateLink(x, "SPEC_USIGN", #x, SPECIFIER, __FILE__, __LINE__)->select.s._unsigned
#define SPEC_SCLS(x) validateLink(x, "SPEC_SCLS", #x, SPECIFIER, __FILE__, __LINE__)->select.s.sclass
#define SPEC_ENUM(x) validateLink(x, "SPEC_ENUM", #x, SPECIFIER, __FILE__, __LINE__)->select.s._isenum
x->select.d.ptr_volatile)
#define IS_INTEGRAL(x) (IS_SPEC(x) && (x->select.s.noun == V_INT || \
x->select.s.noun == V_CHAR || \
x->select.d.ptr_volatile)
#define IS_INTEGRAL(x) (IS_SPEC(x) && (x->select.s.noun == V_INT || \
x->select.s.noun == V_CHAR || \
-#define IS_BITFIELD(x) (IS_SPEC(x) && (x->select.s.noun == V_BIT))
-#define IS_BITVAR(x) (IS_SPEC(x) && (x->select.s.noun == V_BIT || \
+#define IS_BITFIELD(x) (IS_SPEC(x) && (x->select.s.noun == V_BITFIELD))
+#define IS_BITVAR(x) (IS_SPEC(x) && (x->select.s.noun == V_BITFIELD || \
+ x->select.s.noun == V_BIT || \
#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))
#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))
+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);
/* forward definitions for the symbol table related functions */
void initSymt ();
symbol *newSymbol (char *, int);
sym_link *newCharLink ();
sym_link *newLongLink ();
int compareType (sym_link *, sym_link *);
sym_link *newCharLink ();
sym_link *newLongLink ();
int compareType (sym_link *, sym_link *);
int checkFunction (symbol *, symbol *);
void cleanUpLevel (bucket **, int);
void cleanUpBlock (bucket **, int);
int checkFunction (symbol *, symbol *);
void cleanUpLevel (bucket **, int);
void cleanUpBlock (bucket **, int);
void addSymChain (symbol *);
sym_link *structElemType (sym_link *, value *);
symbol *getStructElement (structdef *, symbol *);
void addSymChain (symbol *);
sym_link *structElemType (sym_link *, value *);
symbol *getStructElement (structdef *, symbol *);
void processFuncArgs (symbol *);
int isSymbolEqual (symbol *, symbol *);
void processFuncArgs (symbol *);
int isSymbolEqual (symbol *, symbol *);
void changePointer (symbol * sym);
void checkTypeSanity(sym_link *etype, char *name);
sym_link *typeFromStr (char *) ;
void changePointer (symbol * sym);
void checkTypeSanity(sym_link *etype, char *name);
sym_link *typeFromStr (char *) ;