X-Git-Url: https://git.gag.com/?a=blobdiff_plain;f=src%2FSDCCsymt.h;h=353f41f6f9fd0164ffc0f20077182b825932d8cb;hb=73345d09819099037a195686d80bf9f8e0c99370;hp=0ac55f77d55de518cfaf45e74a3fd2c718c35bc4;hpb=b59e5e4e1c772b197e15e9f82f42507d18bcb546;p=fw%2Fsdcc diff --git a/src/SDCCsymt.h b/src/SDCCsymt.h index 0ac55f77..353f41f6 100644 --- a/src/SDCCsymt.h +++ b/src/SDCCsymt.h @@ -457,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)) @@ -502,6 +504,17 @@ 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; + /* forward definitions for the symbol table related functions */ void initSymt (); symbol *newSymbol (char *, int); @@ -541,7 +554,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, int); void processFuncArgs (symbol *); int isSymbolEqual (symbol *, symbol *); int powof2 (TYPE_UDWORD); @@ -563,6 +576,7 @@ 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 */