unsigned intrtn:1; /* this is an interrupt routin */
unsigned rbank:1; /* seperate register bank */
unsigned intno; /* 1=Interrupt svc routine */
- unsigned regbank; /* register bank 2b used */
+ short regbank; /* register bank 2b used */
unsigned builtin; /* is a builtin function */
unsigned javaNative; /* is a JavaNative Function (TININative ONLY) */
unsigned overlay; /* force parameters & locals into overlay segment */
struct iCode *rematiCode; /* rematerialse with which instruction */
struct operand *reqv; /* register equivalent of a local variable */
struct symbol *prereqv; /* symbol before register equiv. substituion */
+ struct symbol *psbase; /* if pseudo symbol, the symbol it is based on */
union
{
struct symbol *spillLoc; /* register spil location */
#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))
#define IS_CODE(x) (IS_SPEC(x) && SPEC_SCLS(x) == S_CODE)
#define IS_REGPARM(x) (IS_SPEC(x) && SPEC_REGPARM(x))
+/* symbol check macros */
+#define IS_AUTO(x) (x->level && !IS_STATIC(x->etype) && !IS_EXTERN(x->etype))
+
/* forward declaration for the global vars */
extern bucket *SymbolTab[];
extern bucket *StructTab[];
#include "SDCCval.h"
+typedef enum
+{
+ RESULT_TYPE_NONE = 0, /* operands will be promoted to int */
+ RESULT_TYPE_BIT,
+ RESULT_TYPE_CHAR,
+ RESULT_TYPE_INT,
+ RESULT_TYPE_OTHER, /* operands will be promoted to int */
+ RESULT_TYPE_IFX,
+} RESULT_TYPE;
+
/* forward definitions for the symbol table related functions */
void initSymt ();
symbol *newSymbol (char *, int);
value *checkArrayIval (sym_link *, value *);
value *checkIval (sym_link *, value *);
unsigned int getSize (sym_link *);
+unsigned int getAllocSize (sym_link *);
unsigned int bitsForType (sym_link *);
sym_link *newIntLink ();
sym_link *newCharLink ();
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, int);
void processFuncArgs (symbol *);
int isSymbolEqual (symbol *, symbol *);
int powof2 (TYPE_UDWORD);
void *findSym (bucket **, void *, const char *);
void *findSymWithLevel (bucket **, struct symbol *);
void *findSymWithBlock (bucket **, struct symbol *, int);
-void changePointer (symbol * sym);
+void changePointer (sym_link * p);
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 */