X-Git-Url: https://git.gag.com/?a=blobdiff_plain;f=src%2FSDCCast.h;h=9865bb297e1c9fbe8cfcd3cd273c964460ba1002;hb=25991ff3ca6bdbc0b10204adc00022c0777b9ab9;hp=dc1b6e65f7c71766558f2ecb5b4f54495f651ad1;hpb=414926f4500085d27af9a107ba1c3649b060aa8c;p=fw%2Fsdcc diff --git a/src/SDCCast.h b/src/SDCCast.h index dc1b6e65..9865bb29 100644 --- a/src/SDCCast.h +++ b/src/SDCCast.h @@ -29,6 +29,7 @@ #include "SDCCsymt.h" #include "SDCCval.h" #include "SDCCset.h" +#include "SDCCmem.h" #define EX_OP 0 #define EX_VALUE 1 @@ -42,7 +43,6 @@ typedef struct ast unsigned type:3; unsigned decorated:1; - unsigned hasVargs:1; unsigned isError:1; unsigned funcName:1; unsigned rvalue:1; @@ -65,6 +65,7 @@ typedef struct ast union { char *inlineasm; /* pointer to inline assembler code */ + literalList *constlist; /* init list for array initializer. */ symbol *sym; /* if block then -> symbols */ value *args; /* if function then args */ /* if switch then switch values */ @@ -90,6 +91,7 @@ typedef struct ast unsigned literalFromCast; /* true if this is an EX_VALUE of LITERAL * type resulting from a typecast. */ + int argreg; /* argreg number when operand type == EX_OPERAND */ } values; @@ -99,8 +101,6 @@ typedef struct ast sym_link *ftype; /* start of type chain for this subtree */ sym_link *etype; /* end of type chain for this subtree */ - symbol *argSym; /* argument symbols */ - value *args; /* args of a function */ struct ast *left; /* pointer to left tree */ struct ast *right; /* pointer to right tree */ symbol *trueLabel; /* if statement trueLabel */ @@ -143,6 +143,8 @@ ast; #define AST_VALUE(x) (x->opval.val) #define AST_VALUES(x,y) (x->values.y) #define AST_FOR(x,y) x->values.forVals.y +#define AST_ARGREG(x) x->values.argreg + #define IS_AST_PARAM(x) (IS_AST_OP(x) && x->opval.op == PARAM) #define CAN_EVAL(x) ( x == '[' || x == '.' || x == PTR_OP || \ @@ -170,7 +172,7 @@ ast; /* forward declarations for global variables */ extern ast *staticAutos; extern FILE *codeOutFile; -extern memmap *GcurMemmap; +extern struct memmap *GcurMemmap; /* forward definitions for functions */ ast *newAst_VALUE (value * val); @@ -181,6 +183,7 @@ ast *newAst_STMNT (unsigned val); void initAst (); ast *newNode (long, ast *, ast *); ast *copyAst (ast *); +ast *removeIncDecOps (ast *); value *sizeofOp (sym_link *); value *evalStmnt (ast *); ast *createFunction (symbol *, ast *); @@ -188,7 +191,6 @@ ast *createBlock (symbol *, ast *); ast *createLabel (symbol *, ast *); ast *createCase (ast *, ast *, ast *); ast *createDefault (ast *, ast *); -ast *optimizeCompare (ast *); ast *forLoopOptForm (ast *); ast *argAst (ast *); ast *resolveSymbols (ast *); @@ -199,13 +201,19 @@ ast *createDo (symbol *, symbol *, symbol *, ast *, ast *); ast *createFor (symbol *, symbol *, symbol *, symbol *, ast *, ast *, ast *, ast *); void eval2icode (ast *); value *constExprValue (ast *, int); +bool constExprTree (ast *); +int setAstLineno (ast *, int); symbol *funcOfType (char *, sym_link *, sym_link *, int, int); +symbol * funcOfTypeVarg (char *, char * , int , char **); ast *initAggregates (symbol *, initList *, ast *); bool hasSEFcalls (ast *); void addSymToBlock (symbol *, ast *); +void freeStringSymbol(symbol *); +DEFSETFUNC(resetParmKey); // exported variables extern set *operKeyReset; extern int noAlloc; +extern int inInitMode; #endif