projects
/
fw
/
sdcc
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
another small stack fix, no test case but this should be better
[fw/sdcc]
/
src
/
SDCCast.h
diff --git
a/src/SDCCast.h
b/src/SDCCast.h
index 44d1242516971de2ec407bdaae816a60849edf66..3e5f763231dd49cd9c1f7c316b97c5e0a8f4b29c 100644
(file)
--- a/
src/SDCCast.h
+++ b/
src/SDCCast.h
@@
-29,6
+29,7
@@
#include "SDCCsymt.h"
#include "SDCCval.h"
#include "SDCCset.h"
#include "SDCCsymt.h"
#include "SDCCval.h"
#include "SDCCset.h"
+#include "SDCCmem.h"
#define EX_OP 0
#define EX_VALUE 1
#define EX_OP 0
#define EX_VALUE 1
@@
-42,7
+43,6
@@
typedef struct ast
unsigned type:3;
unsigned decorated:1;
unsigned type:3;
unsigned decorated:1;
- unsigned hasVargs:1;
unsigned isError:1;
unsigned funcName:1;
unsigned rvalue: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 */
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 */
symbol *sym; /* if block then -> symbols */
value *args; /* if function then args */
/* if switch then switch values */
@@
-99,8
+100,6
@@
typedef struct ast
sym_link *ftype; /* start of type chain for this subtree */
sym_link *etype; /* end of type chain for this subtree */
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 */
struct ast *left; /* pointer to left tree */
struct ast *right; /* pointer to right tree */
symbol *trueLabel; /* if statement trueLabel */
@@
-111,6
+110,7
@@
ast;
/* easy access macros */
#define IS_AST_OP(x) (x && x->type == EX_OP)
/* easy access macros */
#define IS_AST_OP(x) (x && x->type == EX_OP)
+#define IS_CALLOP(x) (IS_AST_OP(x) && x->opval.op == CALL)
#define IS_BITOR(x) (IS_AST_OP(x) && x->opval.op == '|')
#define IS_BITAND(x) (IS_AST_OP(x) && x->opval.op == '&' && \
x->left && x->right )
#define IS_BITOR(x) (IS_AST_OP(x) && x->opval.op == '|')
#define IS_BITAND(x) (IS_AST_OP(x) && x->opval.op == '&' && \
x->left && x->right )
@@
-129,6
+129,8
@@
ast;
x->opval.op == EQ_OP || \
x->opval.op == NE_OP ))
#define IS_CAST_OP(x) (IS_AST_OP(x) && x->opval.op == CAST)
x->opval.op == EQ_OP || \
x->opval.op == NE_OP ))
#define IS_CAST_OP(x) (IS_AST_OP(x) && x->opval.op == CAST)
+#define IS_TERNARY_OP(x) (IS_AST_OP(x) && x->opval.op == '?')
+#define IS_COLON_OP(x) (IS_AST_OP(x) && x->opval.op == ':')
#define IS_ADDRESS_OF_OP(x) (IS_AST_OP(x) && \
x->opval.op == '&' && \
x->right == NULL )
#define IS_ADDRESS_OF_OP(x) (IS_AST_OP(x) && \
x->opval.op == '&' && \
x->right == NULL )
@@
-140,6
+142,7
@@
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_VALUE(x) (x->opval.val)
#define AST_VALUES(x,y) (x->values.y)
#define AST_FOR(x,y) x->values.forVals.y
+#define IS_AST_PARAM(x) (IS_AST_OP(x) && x->opval.op == PARAM)
#define CAN_EVAL(x) ( x == '[' || x == '.' || x == PTR_OP || \
x == '&' || x == '|' || x == '^' || x == '*' || \
#define CAN_EVAL(x) ( x == '[' || x == '.' || x == PTR_OP || \
x == '&' || x == '|' || x == '^' || x == '*' || \
@@
-166,6
+169,7
@@
ast;
/* forward declarations for global variables */
extern ast *staticAutos;
extern FILE *codeOutFile;
/* forward declarations for global variables */
extern ast *staticAutos;
extern FILE *codeOutFile;
+extern struct memmap *GcurMemmap;
/* forward definitions for functions */
ast *newAst_VALUE (value * val);
/* forward definitions for functions */
ast *newAst_VALUE (value * val);
@@
-202,5
+206,6
@@
void addSymToBlock (symbol *, ast *);
// exported variables
extern set *operKeyReset;
extern int noAlloc;
// exported variables
extern set *operKeyReset;
extern int noAlloc;
+extern int inInitMode;
#endif
#endif