X-Git-Url: https://git.gag.com/?a=blobdiff_plain;f=src%2FSDCCsymt.h;h=2b06d0dd653dc98e8c2d79c4edebc3246cb295e9;hb=d46b4a50e1b8b1819d974533a9012b013090f8fd;hp=72a7c6ca4d2fb1e35daf50ffead9a41e727b421b;hpb=490c4d9e05231c1e6cbc339ccbde7600a7eb47f3;p=fw%2Fsdcc diff --git a/src/SDCCsymt.h b/src/SDCCsymt.h index 72a7c6ca..2b06d0dd 100644 --- a/src/SDCCsymt.h +++ b/src/SDCCsymt.h @@ -55,14 +55,15 @@ structdef; /* noun definitions */ typedef enum { - V_INT = 0, + V_INT = 1, V_FLOAT, V_CHAR, V_VOID, V_STRUCT, V_LABEL, V_BIT, - V_SBIT + V_SBIT, + V_DOUBLE } NOUN; @@ -72,7 +73,6 @@ typedef enum S_FIXED = 0, S_AUTO, S_REGISTER, - S_CONSTANT, S_SFR, S_SBIT, S_CODE, @@ -88,15 +88,6 @@ typedef enum } STORAGE_CLASS; -#define TF_LONG 0x00000001 /* type long int */ -#define TF_SHORT 0x00000002 /* type short */ -#define TF_UNSIGNED 0x00000004 /* type is unsigned */ -#define TF_STATIC 0x00000008 /* type is static */ -#define TF_EXTERN 0x00000010 /* type is extern */ -#define TF_ABSADDR 0x00000020 /* type has absolute address */ -#define TF_REENT 0x00000040 /* type of func is reentrant func */ -#define TF_INTRRNT 0x00000080 /* is an interrupt routine */ - /* specifier is the last in the type-chain */ typedef struct specifier { @@ -106,6 +97,7 @@ typedef struct specifier unsigned _long:1; /* 1=long */ unsigned _short:1; /* 1=short int */ unsigned _unsigned:1; /* 1=unsigned, 0=signed */ + unsigned _signed:1; /* just for sanity checks only*/ unsigned _static:1; /* 1=static keyword found */ unsigned _extern:1; /* 1=extern found */ unsigned _absadr:1; /* absolute address specfied */ @@ -115,6 +107,7 @@ typedef struct specifier unsigned _volatile:1; /* is marked as volatile */ unsigned _const:1; /* is a constant */ unsigned _critical:1; /* critical function */ + unsigned _naked:1; /* naked function */ unsigned _typedef:1; /* is typedefed */ unsigned _isregparm:1; /* is the first parameter */ unsigned _isenum:1; /* is an enumerated type */ @@ -285,7 +278,6 @@ symbol; #define DCL_TSPEC(l) l->select.d.tspec #define SPEC_NOUN(x) x->select.s.noun #define SPEC_LONG(x) x->select.s._long -#define SPEC_SHORT(x) x->select.s._short #define SPEC_USIGN(x) x->select.s._unsigned #define SPEC_SCLS(x) x->select.s.sclass #define SPEC_ENUM(x) x->select.s._isenum @@ -312,6 +304,7 @@ symbol; #define SPEC_BNKF(x) x->select.s._rbank #define SPEC_INTRTN(x) x->select.s._intrtn #define SPEC_CRTCL(x) x->select.s._critical +#define SPEC_NAKED(x) x->select.s._naked #define SPEC_VOLATILE(x) x->select.s._volatile #define SPEC_CONST(x) x->select.s._const #define SPEC_STRUCT(x) x->select.s.v_struct @@ -338,7 +331,6 @@ symbol; #define IS_GENPTR(x) (IS_DECL(x) && DCL_TYPE(x) == GPOINTER) #define IS_FUNC(x) (IS_DECL(x) && DCL_TYPE(x) == FUNCTION) #define IS_LONG(x) (IS_SPEC(x) && x->select.s._long) -#define IS_SHORT(x) (IS_SPEC(x) && x->select.s._short) #define IS_TYPEDEF(x)(IS_SPEC(x) && x->select.s._typedef) #define IS_CONSTANT(x) (IS_SPEC(x) && ( x->select.s._const == 1)) #define IS_STRUCT(x) (IS_SPEC(x) && x->select.s.noun == V_STRUCT) @@ -391,6 +383,8 @@ extern symbol *__muldiv[3][3][2]; extern sym_link *__multypes[3][2]; /* Dims: to/from float, BYTE/WORD/DWORD, SIGNED/USIGNED */ extern symbol *__conv[2][3][2]; +/* Dims: shift left/shift right, BYTE/WORD/DWORD, SIGNED/UNSIGNED */ +symbol *__rlrr[2][3][2]; #define CHARTYPE __multypes[0][0] #define UCHARTYPE __multypes[0][1] @@ -411,7 +405,7 @@ sym_link *newLink (); sym_link *newFloatLink (); structdef *newStruct (char *); void addDecl (symbol *, int, sym_link *); -sym_link *mergeSpec (sym_link *, sym_link *); +sym_link *mergeSpec (sym_link *, sym_link *, char *name); sym_link *cloneSpec (sym_link *); symbol *reverseSyms (symbol *); sym_link *reverseLink (sym_link *); @@ -435,7 +429,7 @@ unsigned int bitsForType (sym_link *); sym_link *newIntLink (); sym_link *newCharLink (); sym_link *newLongLink (); -int checkType (sym_link *, sym_link *); +int compareType (sym_link *, sym_link *); int checkFunction (symbol *); void cleanUpLevel (bucket **, int); void cleanUpBlock (bucket **, int); @@ -455,13 +449,14 @@ void cdbSymbol (symbol *, FILE *, int, int); void cdbStructBlock (int, FILE *); void initHashT (); bucket *newBucket (); -void addSym (bucket **, void *, char *, int, int); +void addSym (bucket **, void *, char *, int, int, int checkType); void deleteSym (bucket **, void *, char *); void *findSym (bucket **, void *, const char *); void *findSymWithLevel (bucket **, struct symbol *); void *findSymWithBlock (bucket **, struct symbol *, int); void changePointer (symbol * sym); - -#include "SDCCmem.h" +void checkTypeSanity(sym_link *etype, char *name); +/* noun strings */ +extern char *nounName(sym_link *); #endif