X-Git-Url: https://git.gag.com/?a=blobdiff_plain;f=src%2FSDCCval.h;h=906bc7e5b603d198ff94c1d72b2b6cf5007c787e;hb=e5c62ddb5b835550d3e4f84dbe9939b5c74b87af;hp=23b03936be455fb3f52a54ecc238d211e68c9e24;hpb=b09af35f2f1cde7649d3ac4a6f5d2af6d97895a0;p=fw%2Fsdcc diff --git a/src/SDCCval.h b/src/SDCCval.h index 23b03936..906bc7e5 100644 --- a/src/SDCCval.h +++ b/src/SDCCval.h @@ -20,80 +20,101 @@ You are forbidden to forbid anyone else to use, share and improve what you give them. Help stamp out software-hoarding! -------------------------------------------------------------------------*/ -#include "SDCCsymt.h" #ifndef SDCCVAL_H #define SDCCVAL_H +#include "SDCCsymt.h" + /* value wrapper */ -typedef struct value { - char name[ SDCC_NAME_MAX + 1 ]; /* operand accessing this value */ - link *type ; /* start of type chain */ - link *etype; /* end of type chain */ - symbol *sym ; /* Original Symbol */ - struct value *next ; /* used in initializer list*/ - unsigned vArgs : 1 ; /* arg list ended with variable arg */ +typedef struct value + { + char name[SDCC_NAME_MAX + 1]; /* operand accessing this value */ + sym_link *type; /* start of type chain */ + sym_link *etype; /* end of type chain */ + symbol *sym; /* Original Symbol */ + struct value *next; /* used in initializer list */ + unsigned vArgs:1; /* arg list ended with variable arg */ -} value ; + } +value; -enum { - INIT_NODE , - INIT_DEEP , - INIT_HOLE -}; +typedef struct literalList +{ + double literalValue; + unsigned count; + struct literalList *next; +} literalList; + + +enum + { + INIT_NODE, + INIT_DEEP, + INIT_HOLE + }; /* initializer lists use this structure */ -typedef struct initList { - int type ; - int lineno ; - union { - struct ast *node ; - struct initList *deep ; - } init ; - - struct initList *next ; -} initList ; +typedef struct initList + { + int type; + int lineno; + char *filename; + union + { + struct ast *node; + struct initList *deep; + } + init; + + struct initList *next; + } +initList; #define IS_VARG(x) (x->vArgs) /* forward definitions for the symbol table related functions */ -void initValue ( ); -value *newValue ( ); -value *constVal (char * ); -value *reverseVal (value * ); -value *reverseValWithType(value * ); -value *copyValue (value * ); -value *copyValueChain (value * ); -value *strVal (char * ); -value *charVal (char * ); -value *symbolVal (symbol * ); -void printVal (value * ); -double floatFromVal (value * ); -value *array2Ptr (value * ); -value *valUnaryPM (value * ); -value *valComplement (value * ); -value *valNot (value * ); -value *valMult (value *, value * ); -value *valDiv (value *, value * ); -value *valMod (value *, value * ); -value *valPlus (value *, value * ); -value *valMinus (value *, value * ); -value *valShift (value *, value *,int); -value *valCompare (value *, value *,int); -value *valBitwise (value *, value *,int); -value *valLogicAndOr (value *, value *,int); -value *valCastLiteral (link *, double ); -value *valueFromLit (float ); -initList *newiList (int , void * ); -initList *revinit (initList * ); -initList *copyIlist (initList * ); -double list2int (initList * ); -value *list2val (initList * ); -struct ast *list2expr (initList * ); -void resolveIvalSym (initList * ); -value *valFromType (link * ); -value *constFloatVal (char * ); -int getNelements (link *, initList * ); -value *valForArray (struct ast * ); -value *valForStructElem (struct ast *, struct ast *); - +void initValue (); +value *newValue (); +value *constVal (char *); +value *reverseVal (value *); +value *reverseValWithType (value *); +value *copyValue (value *); +value *copyValueChain (value *); +value *strVal (char *); +value *charVal (char *); +value *symbolVal (symbol *); +void printVal (value *); +double floatFromVal (value *); +value *array2Ptr (value *); +value *valUnaryPM (value *); +value *valComplement (value *); +value *valNot (value *); +value *valMult (value *, value *); +value *valDiv (value *, value *); +value *valMod (value *, value *); +value *valPlus (value *, value *); +value *valMinus (value *, value *); +value *valShift (value *, value *, int); +value *valCompare (value *, value *, int); +value *valBitwise (value *, value *, int); +value *valLogicAndOr (value *, value *, int); +value *valCastLiteral (sym_link *, double); +value *valueFromLit (double); +initList *newiList (int, void *); +initList *revinit (initList *); +initList *copyIlist (initList *); +double list2int (initList *); +value *list2val (initList *); +struct ast *list2expr (initList *); +void resolveIvalSym (initList *, sym_link *); +value *valFromType (sym_link *); +value *constFloatVal (char *); +value *constFixed16x16Val (char *); +int getNelements (sym_link *, initList *); +value *valForArray (struct ast *); +value *valForStructElem (struct ast *, struct ast *); +value *valForCastAggr (struct ast *, sym_link *, struct ast *, int); +value *valForCastArr (struct ast * , sym_link *); +bool convertIListToConstList(initList *src, literalList **lList); +literalList *copyLiteralList(literalList *src); #endif