symbol *sym ; /* symbol table pointer */
structdef *sdef; /* structure definition */
char yychar[SDCC_NAME_MAX+1];
- link *lnk ; /* declarator or specifier */
+ sym_link *lnk ; /* declarator or specifier */
int yyint; /* integer value returned */
value *val ; /* for integer constant */
initList *ilist; /* initial list */
symbol *sym , *sym1;
for (sym1 = sym = reverseSyms($2);sym != NULL;sym = sym->next) {
- link *lnk = copyLinkChain($1);
+ sym_link *lnk = copyLinkChain($1);
/* do the pointer stuff */
pointerTypes(sym->type,lnk);
addDecl (sym,0,lnk) ;
/* if the decl $2 is not a specifier */
/* find the spec and replace it */
if ( !IS_SPEC($2)) {
- link *lnk = $2 ;
+ sym_link *lnk = $2 ;
while (lnk && !IS_SPEC(lnk->next))
lnk = lnk->next;
lnk->next = mergeSpec($1,lnk->next);
/* if the decl $2 is not a specifier */
/* find the spec and replace it */
if ( !IS_SPEC($2)) {
- link *lnk = $2 ;
+ sym_link *lnk = $2 ;
while (lnk && !IS_SPEC(lnk->next))
lnk = lnk->next;
lnk->next = mergeSpec($1,lnk->next);
| TYPE_NAME
{
symbol *sym;
- link *p ;
+ sym_link *p ;
sym = findSym(TypedefTab,NULL,$1) ;
$$ = p = copyLinkChain(sym->type);
| '(' declarator ')' { $$ = $2; }
| declarator2 '[' ']'
{
- link *p;
+ sym_link *p;
p = newLink ();
DCL_TYPE(p) = ARRAY ;
}
| declarator2 '[' constant_expr ']'
{
- link *p ;
+ sym_link *p ;
value *tval;
p = (tval = constExprValue($3,TRUE))->etype;
| type_specifier_list abstract_declarator
{
/* go to the end of the list */
- link *p;
+ sym_link *p;
pointerTypes($2,$1);
for ( p = $2 ; p->next ; p=p->next);
p->next = $1 ;
int noLineno = 0;
int noAlloc = 0 ;
symbol *currFunc ;
-ast *createIval (ast *, link *, initList *, ast *);
-ast *createIvalCharPtr (ast *, link *, ast *);
+ast *createIval (ast *, sym_link *, initList *, ast *);
+ast *createIvalCharPtr (ast *, sym_link *, ast *);
ast *optimizeRRCRLC ( ast * );
ast *optimizeGetHbit(ast *);
ast *backPatchLabels (ast *,symbol *,symbol *);
ex->opval.op = (long) op ;
break ;
case EX_LINK :
- ex->opval.lnk = (link *) op;
+ ex->opval.lnk = (sym_link *) op;
break ;
case EX_STMNT :
ex->opval.stmnt= (unsigned) op;
return ex;
}
-ast* newAst_LINK(link*val)
+ast* newAst_LINK(sym_link*val)
{
ast* ex = newAst_(EX_LINK);
ex->opval.lnk = val;
/*-----------------------------------------------------------------*/
/* funcOfType :- function of type with name */
/*-----------------------------------------------------------------*/
-symbol *funcOfType (char *name, link *type, link *argType,
+symbol *funcOfType (char *name, sym_link *type, sym_link *argType,
int nArgs , int rent)
{
symbol *sym;
ast *actParm,
int *parmNumber)
{
- link *fetype = func->etype;
+ sym_link *fetype = func->etype;
/* if none of them exist */
if ( !defParm && !actParm)
/*-----------------------------------------------------------------*/
/* createIvalType - generates ival for basic types */
/*-----------------------------------------------------------------*/
-ast *createIvalType ( ast *sym,link *type, initList *ilist)
+ast *createIvalType ( ast *sym,sym_link *type, initList *ilist)
{
ast *iExpr;
/*-----------------------------------------------------------------*/
/* createIvalStruct - generates initial value for structures */
/*-----------------------------------------------------------------*/
-ast *createIvalStruct (ast *sym,link *type,initList *ilist)
+ast *createIvalStruct (ast *sym,sym_link *type,initList *ilist)
{
ast *rast = NULL ;
symbol *sflds ;
/*-----------------------------------------------------------------*/
/* createIvalArray - generates code for array initialization */
/*-----------------------------------------------------------------*/
-ast *createIvalArray (ast *sym, link *type, initList *ilist)
+ast *createIvalArray (ast *sym, sym_link *type, initList *ilist)
{
ast *rast = NULL;
initList *iloop ;
/*-----------------------------------------------------------------*/
/* createIvalCharPtr - generates initial values for char pointers */
/*-----------------------------------------------------------------*/
-ast *createIvalCharPtr (ast *sym, link *type, ast *iexpr)
+ast *createIvalCharPtr (ast *sym, sym_link *type, ast *iexpr)
{
ast *rast = NULL ;
/*-----------------------------------------------------------------*/
/* createIvalPtr - generates initial value for pointers */
/*-----------------------------------------------------------------*/
-ast *createIvalPtr (ast *sym,link *type,initList *ilist)
+ast *createIvalPtr (ast *sym,sym_link *type,initList *ilist)
{
ast *rast;
ast *iexpr ;
/*-----------------------------------------------------------------*/
/* createIval - generates code for initial value */
/*-----------------------------------------------------------------*/
-ast *createIval (ast *sym, link *type, initList *ilist, ast *wid)
+ast *createIval (ast *sym, sym_link *type, initList *ilist, ast *wid)
{
ast *rast = NULL;
ast *decorateType (ast *tree)
{
int parmNumber ;
- link *p;
+ sym_link *p;
if ( ! tree )
return tree ;
case INC_OP: /* incerement operator unary so left only */
case DEC_OP:
{
- link *ltc = (tree->right ? RTYPE(tree) : LTYPE(tree) );
+ sym_link *ltc = (tree->right ? RTYPE(tree) : LTYPE(tree) );
COPYTYPE(TTYPE(tree),TETYPE(tree),ltc);
if (!tree->initMode && IS_CONSTANT(TETYPE(tree)))
werror(E_CODE_WRITE,"++/--");
/*-----------------------------------------------------------------*/
/* sizeofOp - processes size of operation */
/*-----------------------------------------------------------------*/
-value *sizeofOp( link *type)
+value *sizeofOp( sym_link *type)
{
char buff[10];
ast *ex ;
symbol *csym;
int stack = 0 ;
- link *fetype;
+ sym_link *fetype;
iCode *piCode = NULL;
/* if check function return 0 then some problem */
/* union of values expression can have */
union {
value *val ; /* value if type = EX_VALUE */
- link *lnk ; /* link * if type= EX_LINK */
+ sym_link *lnk ; /* sym_link * if type= EX_LINK */
struct operand *oprnd; /* used only for side effecting function calls */
unsigned stmnt ; /* statement if type=EX_STMNT */
unsigned op ; /* operator if type= EX_OP */
int lineno ; /* source file line number */
char *filename ; /* filename of the source file */
- link *ftype ; /* start of type chain for this subtree */
- 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 */
/* forward definitions for functions */
ast* newAst_VALUE(value*val);
ast* newAst_OP (unsigned op);
-ast* newAst_LINK (link*val);
+ast* newAst_LINK (sym_link*val);
ast* newAst_STMNT(unsigned val);
void initAst ( );
ast *newNode (long ,ast * ,ast * );
ast *copyAst (ast * );
-value *sizeofOp (link * );
+value *sizeofOp (sym_link * );
value *evalStmnt (ast * );
ast *createFunction(symbol *,ast * );
ast *createBlock (symbol *,ast * );
ast *createFor (symbol *,symbol *,symbol *,symbol *,ast *,ast *,ast *, ast *);
void eval2icode (ast *);
value *constExprValue (ast *,int);
-symbol *funcOfType (char *,link *,link *,int,int);
+symbol *funcOfType (char *,sym_link *,sym_link *,int,int);
ast *initAggregates ( symbol *,initList *, ast *);
bool hasSEFcalls ( ast *);
void addSymToBlock (symbol *, ast *) ;
/*-----------------------------------------------------------------*/
static bool isGlobalInNearSpace (operand *op)
{
- link *type = getSpec(operandType(op));
+ sym_link *type = getSpec(operandType(op));
/* this is 8051 specific: optimization
suggested by Jean-Louis VERN, with 8051s we have no
advantage of putting variables in near space into
void updateSpillLocation ( iCode *ic)
{
- link *setype;
+ sym_link *setype;
if (POINTER_SET(ic))
return;
/*-----------------------------------------------------------------*/
static void fixUpTypes(iCode *ic)
{
- link *t1 = operandType(IC_LEFT(ic)) ,*t2;
+ sym_link *t1 = operandType(IC_LEFT(ic)) ,*t2;
if (IS_DS390_PORT)
{
#include <time.h>
#ifndef __BORLANDC__
+#if 0 /* This should no longer be necessary. */
// This is a bit messy because we define link ourself
#define link NoLiNk
#include <unistd.h>
#undef link
#else
+#include <unistd.h>
+#endif
+#else
// No unistd.h in Borland C++
#endif
symbol *interrupts[256];
-void printIval (symbol *, link *, initList *, FILE *);
+void printIval (symbol *, sym_link *, initList *, FILE *);
set *publics = NULL; /* public variables */
set *externs = NULL; /* Varibles that are declared as extern */
/*-----------------------------------------------------------------*/
/* printIvalType - generates ival for int/char */
/*-----------------------------------------------------------------*/
-void printIvalType (link * type, initList * ilist, FILE * oFile)
+void printIvalType (sym_link * type, initList * ilist, FILE * oFile)
{
value *val;
/*-----------------------------------------------------------------*/
/* printIvalStruct - generates initial value for structures */
/*-----------------------------------------------------------------*/
-void printIvalStruct (symbol * sym,link * type,
+void printIvalStruct (symbol * sym,sym_link * type,
initList * ilist, FILE * oFile)
{
symbol *sflds;
/*-----------------------------------------------------------------*/
/* printIvalChar - generates initital value for character array */
/*-----------------------------------------------------------------*/
-int printIvalChar (link * type, initList * ilist, FILE * oFile, char *s)
+int printIvalChar (sym_link * type, initList * ilist, FILE * oFile, char *s)
{
value *val;
int remain;
/*-----------------------------------------------------------------*/
/* printIvalArray - generates code for array initialization */
/*-----------------------------------------------------------------*/
-void printIvalArray (symbol * sym, link * type, initList * ilist,
+void printIvalArray (symbol * sym, sym_link * type, initList * ilist,
FILE * oFile)
{
initList *iloop;
/*-----------------------------------------------------------------*/
/* printIvalFuncPtr - generate initial value for function pointers */
/*-----------------------------------------------------------------*/
-void printIvalFuncPtr (link * type, initList * ilist, FILE * oFile)
+void printIvalFuncPtr (sym_link * type, initList * ilist, FILE * oFile)
{
value *val;
int dLvl = 0;
/*-----------------------------------------------------------------*/
/* printIvalCharPtr - generates initial values for character pointers */
/*-----------------------------------------------------------------*/
-int printIvalCharPtr (symbol * sym, link * type, value * val, FILE * oFile)
+int printIvalCharPtr (symbol * sym, sym_link * type, value * val, FILE * oFile)
{
int size = 0;
/*-----------------------------------------------------------------*/
/* printIvalPtr - generates initial value for pointers */
/*-----------------------------------------------------------------*/
-void printIvalPtr (symbol * sym, link * type, initList * ilist, FILE * oFile)
+void printIvalPtr (symbol * sym, sym_link * type, initList * ilist, FILE * oFile)
{
value *val;
int size;
/*-----------------------------------------------------------------*/
/* printIval - generates code for initial value */
/*-----------------------------------------------------------------*/
-void printIval (symbol * sym, link * type, initList * ilist, FILE * oFile)
+void printIval (symbol * sym, sym_link * type, initList * ilist, FILE * oFile)
{
if (!ilist)
return;
/*-----------------------------------------------------------------*/
int printOperand (operand *op, FILE *file)
{
- link *opetype;
+ sym_link *opetype;
int pnl = 0;
if (!op)
/*-----------------------------------------------------------------*/
/* newiTempOperand - new intermediate temp operand */
/*-----------------------------------------------------------------*/
-operand *newiTempOperand (link *type, char throwType)
+operand *newiTempOperand (sym_link *type, char throwType)
{
symbol *itmp;
operand *op = newOperand();
- link *etype;
+ sym_link *etype;
op->type = SYMBOL ;
itmp = newiTemp(NULL);
/*-----------------------------------------------------------------*/
/* operandType - returns the type chain for an operand */
/*-----------------------------------------------------------------*/
-link *operandType (operand *op)
+sym_link *operandType (operand *op)
{
/* depending on type of operand */
switch (op->type) {
" operand type not known ");
assert (0) ; /* should never come here */
/* Just to keep the compiler happy */
- return (link *)0;
+ return (sym_link *)0;
}
}
/*-----------------------------------------------------------------*/
int isOperandVolatile ( operand *op , bool chkTemp)
{
- link *optype ;
- link *opetype ;
+ sym_link *optype ;
+ sym_link *opetype ;
if (IS_ITEMP(op) && !chkTemp)
return 0;
/*-----------------------------------------------------------------*/
int isOperandLiteral ( operand *op )
{
- link *opetype ;
+ sym_link *opetype ;
if (!op)
return 0;
/*-----------------------------------------------------------------*/
bool isOperandInFarSpace (operand *op)
{
- link *etype;
+ sym_link *etype;
if (!op)
return FALSE;
/*-----------------------------------------------------------------*/
bool isOperandOnStack(operand *op)
{
- link *etype;
+ sym_link *etype;
if (!op)
return FALSE;
/* operandOperation - perforoms operations on operands */
/*-----------------------------------------------------------------*/
operand *operandOperation (operand *left,operand *right,
- int op, link *type)
+ int op, sym_link *type)
{
operand *retval = (operand *)0;
/*-----------------------------------------------------------------*/
/* operandFromLink - operand from typeChain */
/*-----------------------------------------------------------------*/
-operand *operandFromLink (link *type)
+operand *operandFromLink (sym_link *type)
{
operand *op ;
- /* operand from link */
+ /* operand from sym_link */
if ( ! type )
return NULL ;
/*-----------------------------------------------------------------*/
/* setOperandType - sets the operand's type to the given type */
/*-----------------------------------------------------------------*/
-void setOperandType (operand *op, link *type)
+void setOperandType (operand *op, sym_link *type)
{
/* depending on the type of operand */
switch (op->type) {
operand *geniCodeRValue (operand *op, bool force)
{
iCode *ic ;
- link *type = operandType(op);
- link *etype= getSpec(type);
+ sym_link *type = operandType(op);
+ sym_link *etype= getSpec(type);
/* if this is an array & already */
/* an address then return this */
/*-----------------------------------------------------------------*/
/* geniCodeCast - changes the value from one type to another */
/*-----------------------------------------------------------------*/
-operand *geniCodeCast (link *type, operand *op, bool implicit)
+operand *geniCodeCast (sym_link *type, operand *op, bool implicit)
{
iCode *ic ;
- link *optype ;
- link *opetype = getSpec(optype = operandType(op));
- link *restype ;
+ sym_link *optype ;
+ sym_link *opetype = getSpec(optype = operandType(op));
+ sym_link *restype ;
/* one of them has size zero then error */
if (IS_VOID(optype)) {
{
iCode *ic ;
int p2 = 0;
- link *resType ;
+ sym_link *resType ;
LRTYPE ;
/* if they are both literal then we know the result */
{
iCode *ic ;
int p2 = 0;
- link *resType;
- link *rtype = operandType(right);
- link *retype= getSpec(rtype);
- link *ltype = operandType(left);
- link *letype= getSpec(ltype);
+ sym_link *resType;
+ sym_link *rtype = operandType(right);
+ sym_link *retype= getSpec(rtype);
+ sym_link *ltype = operandType(left);
+ sym_link *letype= getSpec(ltype);
resType = computeType (ltype,rtype) ;
left = geniCodeCast(resType,left,TRUE);
operand *geniCodeModulus (operand *left, operand *right)
{
iCode *ic ;
- link *resType;
+ sym_link *resType;
LRTYPE ;
/* if they are both literal then we know the result */
{
iCode *ic ;
int isarray= 0;
- link *resType;
+ sym_link *resType;
LRTYPE ;
/* if they both pointers then */
operand *geniCodeAdd (operand *left, operand *right )
{
iCode *ic ;
- link *resType ;
+ sym_link *resType ;
operand *size ;
int isarray = 0;
LRTYPE ;
/*-----------------------------------------------------------------*/
/* aggrToPtr - changes an aggregate to pointer to an aggregate */
/*-----------------------------------------------------------------*/
-link *aggrToPtr ( link *type, bool force)
+sym_link *aggrToPtr ( sym_link *type, bool force)
{
- link *etype ;
- link *ptype ;
+ sym_link *etype ;
+ sym_link *ptype ;
if (IS_PTR(type) && !force)
/*-----------------------------------------------------------------*/
operand *geniCodeArray2Ptr (operand *op)
{
- link *optype = operandType(op);
- link *opetype = getSpec(optype);
+ sym_link *optype = operandType(op);
+ sym_link *opetype = getSpec(optype);
/* set the pointer depending on the storage class */
if ((DCL_TYPE(optype) = PTR_TYPE(SPEC_OCLS(opetype))) == CPOINTER)
operand *geniCodeArray (operand *left,operand *right)
{
iCode *ic;
- link *ltype = operandType(left);
+ sym_link *ltype = operandType(left);
if (IS_PTR(ltype)) {
if (IS_PTR(ltype->next) && left->isaddr)
operand *geniCodeStruct (operand *left, operand *right, bool islval)
{
iCode *ic ;
- link *type = operandType(left);
- link *etype = getSpec(type);
- link *retype ;
+ sym_link *type = operandType(left);
+ sym_link *etype = getSpec(type);
+ sym_link *retype ;
symbol *element = getStructElement(SPEC_STRUCT(etype),
right->operand.symOperand);
{
iCode *ic ;
operand *rOp ;
- link *optype = operandType(op);
+ sym_link *optype = operandType(op);
operand *result ;
operand *rv = (IS_ITEMP(op) ?
geniCodeRValue(op,(IS_PTR(optype) ? TRUE : FALSE)) :
op);
- link *rvtype = operandType(rv);
+ sym_link *rvtype = operandType(rv);
int size = 0;
/* if this is not an address we have trouble */
operand *geniCodePreInc (operand *op)
{
iCode *ic ;
- link *optype = operandType(op);
+ sym_link *optype = operandType(op);
operand *rop = (IS_ITEMP(op) ?
geniCodeRValue (op,(IS_PTR(optype) ? TRUE : FALSE)) :
op);
- link *roptype = operandType(rop);
+ sym_link *roptype = operandType(rop);
operand *result;
int size = 0;
{
iCode *ic ;
operand *rOp ;
- link *optype = operandType(op);
+ sym_link *optype = operandType(op);
operand *result ;
operand *rv = (IS_ITEMP(op) ?
geniCodeRValue(op,(IS_PTR(optype) ? TRUE : FALSE)) :
op);
- link *rvtype = operandType(rv);
+ sym_link *rvtype = operandType(rv);
int size = 0;
/* if this is not an address we have trouble */
operand *geniCodePreDec (operand *op)
{
iCode *ic ;
- link *optype = operandType(op);
+ sym_link *optype = operandType(op);
operand *rop = (IS_ITEMP(op) ?
geniCodeRValue (op,(IS_PTR(optype) ? TRUE : FALSE)) :
op);
- link *roptype = operandType(rop);
+ sym_link *roptype = operandType(rop);
operand *result;
int size = 0;
/* geniCodeBitwise - gen int code for bitWise operators */
/*-----------------------------------------------------------------*/
operand *geniCodeBitwise (operand *left, operand *right,
- int oper, link *resType)
+ int oper, sym_link *resType)
{
iCode *ic;
operand *geniCodeAddressOf (operand *op)
{
iCode *ic;
- link *p ;
- link *optype = operandType(op);
- link *opetype= getSpec(optype);
+ sym_link *p ;
+ sym_link *optype = operandType(op);
+ sym_link *opetype= getSpec(optype);
/* lvalue check already done in decorateType */
/* this must be a lvalue */
/*-----------------------------------------------------------------*/
/* setOClass - sets the output class depending on the pointer type */
/*-----------------------------------------------------------------*/
-void setOClass (link *ptr, link *spec)
+void setOClass (sym_link *ptr, sym_link *spec)
{
switch (DCL_TYPE(ptr)) {
case POINTER:
/*-----------------------------------------------------------------*/
operand *geniCodeDerefPtr (operand *op)
{
- link *rtype , *retype ;
- link *optype = operandType(op);
+ sym_link *rtype , *retype ;
+ sym_link *optype = operandType(op);
/* if this is a pointer then generate the rvalue */
if (IS_PTR(optype)) {
operand *geniCodeUnaryMinus (operand *op)
{
iCode *ic ;
- link *optype = operandType(op);
+ sym_link *optype = operandType(op);
if (IS_LITERAL(optype))
return operandFromLit(- floatFromVal(op->operand.valOperand));
operand *geniCodeLeftShift (operand *left, operand *right)
{
iCode *ic;
- link *ltype = operandType(left);
+ sym_link *ltype = operandType(left);
ic = newiCode(LEFT_OP,left,right);
IC_RESULT(ic) = newiTempOperand(ltype,0);
operand *geniCodeRightShift (operand *left, operand *right)
{
iCode *ic;
- link *ltype = operandType(left);
+ sym_link *ltype = operandType(left);
ic = newiCode(RIGHT_OP,left,right);
IC_RESULT(ic) = newiTempOperand(ltype,0);
operand *geniCodeLogic (operand *left, operand *right, int op )
{
iCode *ic ;
- link *ctype;
- link *rtype = operandType(right);
- link *ltype = operandType(left);
+ sym_link *ctype;
+ sym_link *rtype = operandType(right);
+ sym_link *ltype = operandType(left);
/* left is integral type and right is literal then
check if the literal value is within bounds */
operand *geniCodeAssign (operand *left, operand *right, int nosupdate)
{
iCode *ic ;
- link *ltype = operandType(left);
- link *rtype = operandType(right);
+ sym_link *ltype = operandType(left);
+ sym_link *rtype = operandType(right);
if (!left->isaddr && !IS_ITEMP(left)) {
werror(E_LVALUE_REQUIRED,"assignment");
/*-----------------------------------------------------------------*/
/* geniCodeParms - generates parameters */
/*-----------------------------------------------------------------*/
-static void geniCodeParms ( ast *parms , int *stack, link *fetype, symbol *func)
+static void geniCodeParms ( ast *parms , int *stack, sym_link *fetype, symbol *func)
{
iCode *ic ;
operand *pval ;
geniCodeAssign(top,pval,1);
}
else {
- link *p = operandType(pval);
+ sym_link *p = operandType(pval);
/* push */
ic = newiCode(IPUSH,pval,NULL);
ic->parmPush = 1;
{
iCode *ic ;
operand *result ;
- link *type, *etype;
+ sym_link *type, *etype;
int stack = 0 ;
/* take care of parameters with side-effecting
{
iCode *ic ;
operand *func ;
- link *fetype ;
+ sym_link *fetype ;
int savelineno ;
/* reset the auto generation */
{
iCode *ic;
operand *condition = ast2iCode(tree->left);
- link *cetype;
+ sym_link *cetype;
/* if condition is null then exit */
if (!condition)
/* first we rule out the boundary conditions */
/* if only optimization says so */
if ( ! optimize.noJTabBoundary ) {
- link *cetype = getSpec(operandType(cond));
+ sym_link *cetype = getSpec(operandType(cond));
/* no need to check the lower bound if
the condition is unsigned & minimum value is zero */
if (!( min == 0 && SPEC_USIGN(cetype))) {
case '[' : /* array operation */
{
- link *ltype = operandType(left);
+ sym_link *ltype = operandType(left);
left= geniCodeRValue (left,IS_PTR(ltype->next) ? TRUE : FALSE);
right=geniCodeRValue (right,TRUE);
}
case PTR_OP: /* structure pointer dereference */
{
- link *pType;
+ sym_link *pType;
pType = operandType(left);
left = geniCodeRValue(left,TRUE);
case '=' :
{
- link *rtype = operandType(right);
- link *ltype = operandType(left);
+ sym_link *rtype = operandType(right);
+ sym_link *ltype = operandType(left);
if (IS_PTR(rtype) && IS_ITEMP(right)
&& right->isaddr && checkType(rtype->next,ltype)==1)
right = geniCodeRValue(right,TRUE);
geniCodeRValue(right,FALSE)),0);
case ADD_ASSIGN:
{
- link *rtype = operandType(right);
- link *ltype = operandType(left);
+ sym_link *rtype = operandType(right);
+ sym_link *ltype = operandType(left);
if (IS_PTR(rtype) && IS_ITEMP(right)
&& right->isaddr && checkType(rtype->next,ltype)==1)
right = geniCodeRValue(right,TRUE);
}
case SUB_ASSIGN:
{
- link *rtype = operandType(right);
- link *ltype = operandType(left);
+ sym_link *rtype = operandType(right);
+ sym_link *ltype = operandType(left);
if (IS_PTR(rtype) && IS_ITEMP(right)
&& right->isaddr && checkType(rtype->next,ltype)==1) {
right = geniCodeRValue(right,TRUE);
#define IS_SYMOP(op) (op && op->type == SYMBOL)
#define ADDTOCHAIN(x) addSetHead(&iCodeChain,x)
-#define LRFTYPE link *ltype = operandType(left), \
+#define LRFTYPE sym_link *ltype = operandType(left), \
*rtype = operandType(right) ;
-#define LRETYPE link *letype= getSpec(ltype) , \
+#define LRETYPE sym_link *letype= getSpec(ltype) , \
*retype= getSpec(rtype);
#define LRTYPE LRFTYPE LRETYPE
#define IS_ITEMP(op) (IS_SYMOP(op) && op->operand.symOperand->isitmp == 1)
union {
struct symbol *symOperand ; /* operand is of type symbol */
struct value *valOperand ; /* operand is of type value */
- struct link *typeOperand; /* operand is of type typechain */
+ struct sym_link *typeOperand; /* operand is of type typechain */
} operand ;
bitVect *usesDefs; /* which definitions are used by this */
int isOperandGlobal (operand *);
void printiCChain ( iCode * , FILE *);
operand *ast2iCode ( ast *);
-operand *geniCodeCast ( link *, operand *,bool);
+operand *geniCodeCast ( sym_link *, operand *,bool);
operand *geniCodePtrPtrSubtract (operand *, operand *);
void initiCode ();
iCode *iCodeFromAst ( ast * );
int isOperandEqual ( operand *, operand *);
iCodeTable *getTableEntry (int );
int isOperandLiteral (operand *);
-operand *operandOperation (operand *,operand *,int,link *);
+operand *operandOperation (operand *,operand *,int,sym_link *);
double operandLitValue ( operand * );
operand *operandFromLit (float);
operand *operandFromOperand(operand *);
symbol *newiTempLabel (char *);
symbol *newiTempPreheaderLabel ();
iCode *newiCode (int, operand *, operand *);
-link *operandType(operand *);
+sym_link *operandType(operand *);
operand *operandFromValue (value *);
operand *operandFromSymbol(symbol *);
-link *aggrToPtr ( link *, bool);
+sym_link *aggrToPtr ( sym_link *, bool);
int piCode (void *, FILE * );
int printOperand (operand *,FILE *);
-void setOperandType (operand *, link *);
+void setOperandType (operand *, sym_link *);
bool isOperandInFarSpace (operand *);
operand *opFromOpWithDU (operand *,bitVect *,bitVect *);
iCode *copyiCode (iCode *);
if (!OP_SYMBOL(op)->udChked)
{
- link *type = operandType(op);
- link *etype = getSpec(type);
+ sym_link *type = operandType(op);
+ sym_link *etype = getSpec(type);
OP_SYMBOL(op)->udChked = 1;
/* good place to check if unintialised */
{
iCode *ip, *newic;
symbol *func;
- link *type = operandType(IC_RIGHT(ic));
+ sym_link *type = operandType(IC_RIGHT(ic));
int linenno = ic->lineno;
int bwd, su;
{
iCode *ip, *newic;
symbol *func;
- link *type = operandType(IC_LEFT(ic));
+ sym_link *type = operandType(IC_LEFT(ic));
int lineno = ic->lineno ;
int bwd, su;
/*-----------------------------------------------------------------*/
/* convilong - converts int or long mults or divs to fcalls */
/*-----------------------------------------------------------------*/
-static void convilong (iCode *ic, eBBlock *ebp, link *type, int op)
+static void convilong (iCode *ic, eBBlock *ebp, sym_link *type, int op)
{
symbol *func = NULL;
iCode *ip = ic->next;
/* if long / int mult or divide or mod */
if (ic->op == '*' || ic->op == '/' || ic->op == '%' ) {
- link *type = operandType(IC_LEFT(ic));
+ sym_link *type = operandType(IC_LEFT(ic));
if (IS_INTEGRAL(type) && getSize(type) > port->muldiv.native_below)
convilong (ic,ebbs[i],type,ic->op);
}
/*------------------------------------------------------------------*/
/* newLink - creates a new link (declarator,specifier) */
/*------------------------------------------------------------------*/
-link *newLink ()
+sym_link *newLink ()
{
- link *p ;
+ sym_link *p ;
- ALLOC(p,sizeof(link));
+ ALLOC(p,sizeof(sym_link));
return p;
}
/*------------------------------------------------------------------*/
/* pointerTypes - do the computation for the pointer types */
/*------------------------------------------------------------------*/
-void pointerTypes (link *ptr, link *type)
+void pointerTypes (sym_link *ptr, sym_link *type)
{
if (IS_SPEC(ptr))
return ;
/*------------------------------------------------------------------*/
/* addDecl - adds a declarator @ the end of a chain */
/*------------------------------------------------------------------*/
-void addDecl ( symbol *sym, int type , link *p )
+void addDecl ( symbol *sym, int type , sym_link *p )
{
- link *head;
- link *tail;
- link *t ;
+ sym_link *head;
+ sym_link *tail;
+ sym_link *t ;
/* if we are passed a link then set head & tail */
if ( p ) {
/*------------------------------------------------------------------*/
/* mergeSpec - merges two specifiers and returns the new one */
/*------------------------------------------------------------------*/
-link *mergeSpec ( link *dest, link *src )
+sym_link *mergeSpec ( sym_link *dest, sym_link *src )
{
/* if noun different then src overrides */
if ( SPEC_NOUN(dest) != SPEC_NOUN(src) && !SPEC_NOUN(dest))
/*------------------------------------------------------------------*/
/* cloneSpec - copies the entire spec and returns a new spec */
/*------------------------------------------------------------------*/
-link *cloneSpec ( link *src )
+sym_link *cloneSpec ( sym_link *src )
{
- link *spec ;
+ sym_link *spec ;
/* go thru chain till we find the specifier */
while ( src && src->class != SPECIFIER )
src = src->next ;
spec = newLink() ;
- memcpy (spec,src,sizeof(link));
+ memcpy (spec,src,sizeof(sym_link));
return spec ;
}
/*------------------------------------------------------------------*/
/* getSpec - returns the specifier part from a declaration chain */
/*------------------------------------------------------------------*/
-link *getSpec ( link *p )
+sym_link *getSpec ( sym_link *p )
{
- link *loop ;
+ sym_link *loop ;
loop = p ;
while ( p && ! (IS_SPEC(p)))
/*------------------------------------------------------------------*/
/* newCharLink() - creates an int type */
/*------------------------------------------------------------------*/
-link *newCharLink()
+sym_link *newCharLink()
{
- link *p;
+ sym_link *p;
p = newLink();
p->class = SPECIFIER ;
/*------------------------------------------------------------------*/
/* newFloatLink - a new Float type */
/*------------------------------------------------------------------*/
-link *newFloatLink()
+sym_link *newFloatLink()
{
- link *p;
+ sym_link *p;
p = newLink();
p->class = SPECIFIER ;
/*------------------------------------------------------------------*/
/* newLongLink() - new long type */
/*------------------------------------------------------------------*/
-link *newLongLink()
+sym_link *newLongLink()
{
- link *p;
+ sym_link *p;
p = newLink();
p->class = SPECIFIER ;
/*------------------------------------------------------------------*/
/* newIntLink() - creates an int type */
/*------------------------------------------------------------------*/
-link *newIntLink()
+sym_link *newIntLink()
{
- link *p;
+ sym_link *p;
p = newLink();
p->class = SPECIFIER ;
/*------------------------------------------------------------------*/
/* getSize - returns size of a type chain in bits */
/*------------------------------------------------------------------*/
-unsigned int getSize ( link *p )
+unsigned int getSize ( sym_link *p )
{
/* if nothing return 0 */
if ( ! p )
/*------------------------------------------------------------------*/
/* bitsForType - returns # of bits required to store this type */
/*------------------------------------------------------------------*/
-unsigned int bitsForType ( link *p )
+unsigned int bitsForType ( sym_link *p )
{
/* if nothing return 0 */
if ( ! p )
/*------------------------------------------------------------------*/
/* reverseLink - reverses the links for a type chain */
/*------------------------------------------------------------------*/
-link *reverseLink ( link *type)
+sym_link *reverseLink ( sym_link *type)
{
- link *prev , *curr, *next ;
+ sym_link *prev , *curr, *next ;
if (!type)
return NULL ;
/*------------------------------------------------------------------*/
/* funcInChain - DCL Type 'FUNCTION' found in type chain */
/*------------------------------------------------------------------*/
-int funcInChain (link *lnk)
+int funcInChain (sym_link *lnk)
{
while (lnk) {
if (IS_FUNC(lnk))
/*------------------------------------------------------------------*/
/* structElemType - returns the type info of a sturct member */
/*------------------------------------------------------------------*/
-link *structElemType (link *stype, value *id ,value **argsp)
+sym_link *structElemType (sym_link *stype, value *id ,value **argsp)
{
symbol *fields = (SPEC_STRUCT(stype) ? SPEC_STRUCT(stype)->fields : NULL);
- link *type, *etype;
- link *petype = getSpec(stype);
+ sym_link *type, *etype;
+ sym_link *petype = getSpec(stype);
if ( ! fields || ! id)
return NULL ;
/*------------------------------------------------------------------*/
void changePointer (symbol *sym)
{
- link *p ;
+ sym_link *p ;
/* go thru the chain of declarations */
/* if we find a pointer to a function */
/*------------------------------------------------------------------*/
/* copyLinkChain - makes a copy of the link chain & rets ptr 2 head */
/*------------------------------------------------------------------*/
-link *copyLinkChain ( link *p)
+sym_link *copyLinkChain ( sym_link *p)
{
- link *head, *curr , *loop;
+ sym_link *head, *curr , *loop;
curr = p ;
head = loop = ( curr ? newLink() : (void *) NULL) ;
while (curr) {
- memcpy(loop,curr,sizeof(link)) ; /* copy it */
+ memcpy(loop,curr,sizeof(sym_link)) ; /* copy it */
loop->next = (curr->next ? newLink() : (void *) NULL) ;
loop = loop->next ;
curr = curr->next ;
/*------------------------------------------------------------------*/
/* computeType - computes the resultant type from two types */
/*------------------------------------------------------------------*/
-link *computeType ( link *type1, link *type2)
+sym_link *computeType ( sym_link *type1, sym_link *type2)
{
- link *rType ;
- link *reType;
- link *etype1 = getSpec(type1);
- link *etype2 = getSpec(type2);
+ sym_link *rType ;
+ sym_link *reType;
+ sym_link *etype1 = getSpec(type1);
+ sym_link *etype2 = getSpec(type2);
/* if one of them is a float then result is a float */
/* here we assume that the types passed are okay */
/*------------------------------------------------------------------*/
/* checkType - will do type check return 1 if match */
/*------------------------------------------------------------------*/
-int checkType ( link *dest, link *src )
+int checkType ( sym_link *dest, sym_link *src )
{
if ( !dest && !src)
return 1;
/* then we need to add a new link */
if (IS_STRUCT(val->type)) {
/* first lets add DECLARATOR type */
- link *p = val->type ;
+ sym_link *p = val->type ;
werror(W_STRUCT_AS_ARG,val->name);
val->type = newLink();
/*-----------------------------------------------------------------*/
/* printTypeChain - prints the type chain in human readable form */
/*-----------------------------------------------------------------*/
-void printTypeChain (link *type, FILE *of)
+void printTypeChain (sym_link *type, FILE *of)
{
int nlr = 0;
/*-----------------------------------------------------------------*/
/* cdbTypeInfo - print the type information for debugger */
/*-----------------------------------------------------------------*/
-void cdbTypeInfo (link *type,FILE *of)
+void cdbTypeInfo (sym_link *type,FILE *of)
{
fprintf(of,"{%d}",getSize(type));
while (type) {
/* Dims: mul/div/mod, BYTE/WORD/DWORD, SIGNED/UNSIGNED */
symbol *__muldiv[3][3][2];
/* Dims: BYTE/WORD/DWORD SIGNED/UNSIGNED */
-link *__multypes[3][2];
+sym_link *__multypes[3][2];
/* Dims: to/from float, BYTE/WORD/DWORD, SIGNED/USIGNED */
symbol *__conv[2][3][2];
-link *floatType;
+sym_link *floatType;
static void _makeRegParam(symbol *sym)
{
floatType= newFloatLink();
for (bwd = 0; bwd < 3; bwd++) {
- link *l;
+ sym_link *l;
switch (bwd) {
case 0:
l = newCharLink();
unsigned int num_elem; /* # of elems if type==array */
short ptr_const :1; /* pointer is constant */
short ptr_volatile:1; /* pointer is volatile */
- struct link *tspec; /* pointer type specifier */
+ struct sym_link *tspec; /* pointer type specifier */
} declarator ;
#define DECLARATOR 0
#define SPECIFIER 1
-typedef struct link {
+typedef struct sym_link {
unsigned class : 1 ; /* DECLARATOR or SPECIFIER */
unsigned tdef : 1 ; /* current link created by */
/* typedef if this flag is set*/
declarator d ; /* if CLASS == DECLARATOR */
} select ;
- struct link *next ; /* next element on the chain */
-} link ;
+ struct sym_link *next ; /* next element on the chain */
+} sym_link ;
typedef struct symbol {
char name [SDCC_NAME_MAX+1] ; /* Input Variable Name */
int lineDef ; /* defined line number */
int lastLine ; /* for functions the last line*/
- struct link *type ; /* 1st link to declator chain */
- struct link *etype ; /* last link to declarator chn*/
+ struct sym_link *type ; /* 1st link to declator chain */
+ struct sym_link *etype ; /* last link to declarator chn*/
struct value *args ; /* arguments if function */
struct symbol *next ; /* crosslink to next symbol */
struct symbol *localof ; /* local variable of which function */
- struct initList *ival ; /* ptr to initializer if any */
+ struct initList *ival ; /* ptr to initializer if any */
struct bitVect *defs ; /* bit vector for definitions */
struct bitVect *uses ; /* bit vector for uses */
struct bitVect *regsUsed ; /* for functions registers used */
/* Dims: mul/div/mod, BYTE/WORD/DWORD, SIGNED/UNSIGNED */
extern symbol *__muldiv[3][3][2];
/* Dims: BYTE/WORD/DWORD SIGNED/UNSIGNED */
-extern link *__multypes[3][2];
+extern sym_link *__multypes[3][2];
/* Dims: to/from float, BYTE/WORD/DWORD, SIGNED/USIGNED */
extern symbol *__conv[2][3][2];
#define INTTYPE __multypes[1][0]
#define UCHARTYPE __multypes[0][1]
-extern link *floatType;
+extern sym_link *floatType;
#include "SDCCval.h"
/* forward definitions for the symbol table related functions */
void initSymt ( );
symbol *newSymbol ( char *, int );
-link *newLink ( );
+sym_link *newLink ( );
structdef *newStruct ( char * );
-void addDecl ( symbol *, int , link * );
-link *mergeSpec ( link *, link * );
-link *cloneSpec ( link * );
-symbol *reverseSyms ( symbol * );
-link *reverseLink ( link * );
+void addDecl ( symbol *, int , sym_link * );
+sym_link *mergeSpec ( sym_link *, sym_link * );
+sym_link *cloneSpec ( sym_link * );
+symbol *reverseSyms ( symbol * );
+sym_link *reverseLink ( sym_link * );
symbol *copySymbol ( symbol * );
symbol *copySymbolChain ( symbol * );
void printSymChain ( symbol *, int );
void printStruct ( structdef *, int );
char *genSymName ( int );
-link *getSpec ( link * );
+sym_link *getSpec ( sym_link * );
char *genSymName ( int );
int compStructSize ( int ,structdef * );
-link *copyLinkChain ( link * );
+sym_link *copyLinkChain ( sym_link * );
int checkDecl ( symbol * );
-void checkBasic ( link *, link * );
-value *checkPointerIval ( link *, value * );
+void checkBasic ( sym_link *, sym_link * );
+value *checkPointerIval ( sym_link *, value * );
value *checkStructIval ( symbol *, value * );
-value *checkArrayIval ( link *, value * );
-value *checkIval ( link *, value * );
-unsigned int getSize ( link * );
-unsigned int bitsForType ( link * );
-link *newIntLink ( );
-link *newCharLink ( );
-link *newLongLink ( );
-int checkType ( link *, link * );
+value *checkArrayIval ( sym_link *, value * );
+value *checkIval ( sym_link *, value * );
+unsigned int getSize ( sym_link * );
+unsigned int bitsForType ( sym_link * );
+sym_link *newIntLink ( );
+sym_link *newCharLink ( );
+sym_link *newLongLink ( );
+int checkType ( sym_link *, sym_link * );
int checkFunction ( symbol * );
void cleanUpLevel ( bucket **,int );
void cleanUpBlock ( bucket **,int );
-int funcInChain ( link * );
+int funcInChain ( sym_link * );
void addSymChain ( symbol * );
-link *structElemType ( link *, value * , value ** );
+sym_link *structElemType ( sym_link *, value * , value ** );
symbol *getStructElement ( structdef *, symbol *) ;
-link *computeType ( link *, link *);
+sym_link *computeType ( sym_link *, sym_link *);
void processFuncArgs (symbol *,int);
int isSymbolEqual (symbol *, symbol *);
int powof2 (unsigned long );
-void printTypeChain (link *,FILE *);
+void printTypeChain (sym_link *,FILE *);
void initCSupport ();
-void pointerTypes (link *, link * );
-void cdbTypeInfo (link *,FILE *);
+void pointerTypes (sym_link *, sym_link * );
+void cdbTypeInfo (sym_link *,FILE *);
void cdbSymbol (symbol *,FILE *,int,int);
void cdbStructBlock (int ,FILE *);
void initHashT ( );
/*------------------------------------------------------------------*/
value *reverseValWithType ( value *val )
{
- link *type ;
- link *etype;
+ sym_link *type ;
+ sym_link *etype;
if (!val)
return NULL ;
/*------------------------------------------------------------------*/
/* valFromType - creates a value from type given */
/*------------------------------------------------------------------*/
-value *valFromType ( link *type)
+value *valFromType ( sym_link *type)
{
value *val = newValue();
val->type = copyLinkChain(type);
/*------------------------------------------------------------------*/
/* valCastLiteral - casts a literal value to another type */
/*------------------------------------------------------------------*/
-value *valCastLiteral (link *dtype, double fval)
+value *valCastLiteral (sym_link *dtype, double fval)
{
value *val ;
/*------------------------------------------------------------------*/
/* getNelements - determines # of elements from init list */
/*------------------------------------------------------------------*/
-int getNelements (link *type,initList *ilist)
+int getNelements (sym_link *type,initList *ilist)
{
- link *etype = getSpec(type);
+ sym_link *etype = getSpec(type);
int i;
if (! ilist)
/* valForCastAggr - will return value for a cast of an aggregate */
/* plus minus a constant */
/*-----------------------------------------------------------------*/
-value *valForCastAggr (ast *aexpr, link *type, ast *cnst, int op)
+value *valForCastAggr (ast *aexpr, sym_link *type, ast *cnst, int op)
{
value *val;
/* 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 */
+ 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 *valCompare (value *, value *,int);
value *valBitwise (value *, value *,int);
value *valLogicAndOr (value *, value *,int);
-value *valCastLiteral (link *, double );
+value *valCastLiteral (sym_link *, double );
value *valueFromLit (float );
initList *newiList (int , void * );
initList *revinit (initList * );
value *list2val (initList * );
struct ast *list2expr (initList * );
void resolveIvalSym (initList * );
-value *valFromType (link * );
+value *valFromType (sym_link * );
value *constFloatVal (char * );
-int getNelements (link *, initList * );
+int getNelements (sym_link *, initList * );
value *valForArray (struct ast * );
value *valForStructElem (struct ast *, struct ast *);
-value *valForCastAggr (struct ast *, link *, struct ast *, int ) ;
+value *valForCastAggr (struct ast *, sym_link *, struct ast *, int ) ;
#endif
/*-----------------------------------------------------------------*/
/* pointerCode - returns the code for a pointer type */
/*-----------------------------------------------------------------*/
-static int pointerCode (link *etype)
+static int pointerCode (sym_link *etype)
{
return PTR_TYPE(SPEC_OCLS(etype));
/*-----------------------------------------------------------------*/
static int opIsGptr(operand *op)
{
- link *type = operandType(op);
+ sym_link *type = operandType(op);
if ((AOP_SIZE(op) == GPTRSIZE) && IS_GENPTR(type))
{
size = AOP_SIZE(op);
if (size == GPTRSIZE)
{
- link *type = operandType(op);
+ sym_link *type = operandType(op);
if (IS_GENPTR(type))
{
/* generic pointer; arithmetic operations
static void genNot (iCode *ic)
{
symbol *tlbl;
- link *optype = operandType(IC_LEFT(ic));
+ sym_link *optype = operandType(IC_LEFT(ic));
int size, offset = 1;
/* assign asmOps to operand & result */
static void genUminus (iCode *ic)
{
int offset ,size ;
- link *optype, *rtype;
+ sym_link *optype, *rtype;
int samer ;
/* assign asmops */
static void genFunction (iCode *ic)
{
symbol *sym;
- link *fetype;
+ sym_link *fetype;
int i = 0;
_G.nRegsSaved = 0;
operand *right,
operand *result)
{
- link *opetype = operandType(result);
+ sym_link *opetype = operandType(result);
symbol *lbl ;
int size,offset;
static void genCmp (iCode *ic, iCode *ifx, int br_type)
{
operand *left, *right, *result;
- link *letype , *retype;
+ sym_link *letype , *retype;
symbol *lbl;
int sign, size, offset =0;
,*result=IC_RESULT(ic);
int size , shCount, offset =0;
int hByteZ=0;
- link *letype = getSpec(operandType(left));
+ sym_link *letype = getSpec(operandType(left));
int sign = !SPEC_USIGN(letype);
right = IC_RIGHT(ic);
static void genRightShift (iCode *ic)
{
operand *right, *left, *result;
- link *letype ;
+ sym_link *letype ;
int size, offset;
int sign = 0, first =1;
symbol *tlbl;
{
int shCnt ;
int rlen = 0 ;
- link *etype;
+ sym_link *etype;
int offset = 0 ;
etype = getSpec(operandType(result));
asmop *aop = NULL;
regs *preg = NULL ;
char *rname ;
- link *rtype, *retype;
- link *ltype = operandType(left);
+ sym_link *rtype, *retype;
+ sym_link *ltype = operandType(left);
char buffer[80];
rtype = operandType(result);
asmop *aop = NULL;
regs *preg = NULL ;
char *rname ;
- link *rtype, *retype;
+ sym_link *rtype, *retype;
rtype = operandType(result);
retype= getSpec(rtype);
operand *result, iCode *ic)
{
int size, offset ;
- link *retype = getSpec(operandType(result));
+ sym_link *retype = getSpec(operandType(result));
aopOp(left,ic,FALSE);
operand *result, iCode *ic)
{
int size, offset ;
- link *retype = getSpec(operandType(result));
+ sym_link *retype = getSpec(operandType(result));
aopOp(left,ic,FALSE);
operand *result, iCode *ic)
{
int size, offset ;
- link *retype = getSpec(operandType(result));
+ sym_link *retype = getSpec(operandType(result));
aopOp(left,ic,FALSE);
static void genPointerGet (iCode *ic)
{
operand *left, *result ;
- link *type, *etype;
+ sym_link *type, *etype;
int p_type;
left = IC_LEFT(ic);
/*-----------------------------------------------------------------*/
/* genPackBits - generates code for packed bit storage */
/*-----------------------------------------------------------------*/
-static void genPackBits (link *etype ,
+static void genPackBits (sym_link *etype ,
operand *right ,
char *rname, int p_type)
{
asmop *aop = NULL;
regs *preg = NULL ;
char *rname , *l;
- link *retype;
- link *ptype = operandType(result);
+ sym_link *retype;
+ sym_link *ptype = operandType(result);
retype= getSpec(operandType(right));
asmop *aop = NULL;
regs *preg = NULL ;
char *rname , *l;
- link *retype;
+ sym_link *retype;
retype= getSpec(operandType(right));
operand *result, iCode *ic)
{
int size, offset ;
- link *retype = getSpec(operandType(right));
+ sym_link *retype = getSpec(operandType(right));
aopOp(result,ic,FALSE);
operand *result, iCode *ic)
{
int size, offset ;
- link *retype = getSpec(operandType(right));
+ sym_link *retype = getSpec(operandType(right));
aopOp(result,ic,FALSE);
static void genPointerSet (iCode *ic)
{
operand *right, *result ;
- link *type, *etype;
+ sym_link *type, *etype;
int p_type;
right = IC_RIGHT(ic);
static void genCast (iCode *ic)
{
operand *result = IC_RESULT(ic);
- link *ctype = operandType(IC_LEFT(ic));
- link *rtype = operandType(IC_RIGHT(ic));
+ sym_link *ctype = operandType(IC_LEFT(ic));
+ sym_link *rtype = operandType(IC_RIGHT(ic));
operand *right = IC_RIGHT(ic);
int size, offset ;
if (IS_PTR(ctype)) {
int p_type;
- link *type = operandType(right);
- link *etype = getSpec(type);
+ sym_link *type = operandType(right);
+ sym_link *etype = getSpec(type);
/* pointer to generic pointer */
if (IS_GENPTR(ctype)) {
regParmFlg = 0;
}
-static int _avr_regparm( link *l)
+static int _avr_regparm( sym_link *l)
{
/* the first eight bytes will be passed in
registers r16-r23. but we won't split variables
/*-----------------------------------------------------------------*/
static bool isSpiltOnStack (symbol *sym)
{
- link *etype;
+ sym_link *etype;
if (!sym)
return FALSE ;
/* if this is a subtraction & the result
is a true symbol in far space then don't pack */
if (ic->op == '-' && IS_TRUE_SYMOP(IC_RESULT(dic))) {
- link *etype =getSpec(operandType(IC_RESULT(dic)));
+ sym_link *etype =getSpec(operandType(IC_RESULT(dic)));
if (IN_FARSPACE(SPEC_OCLS(etype)))
return change ;
}
/*-----------------------------------------------------------------*/
static bool isBitwiseOptimizable (iCode *ic)
{
- link *ltype = getSpec(operandType(IC_LEFT(ic)));
- link *rtype = getSpec(operandType(IC_RIGHT(ic)));
+ sym_link *ltype = getSpec(operandType(IC_LEFT(ic)));
+ sym_link *rtype = getSpec(operandType(IC_RIGHT(ic)));
/* bitwise operations are considered optimizable
under the following conditions (Jean-Louis VERN)
the result of that arithmetic operation with
this result and get rid of the cast */
if (ic->op == CAST) {
- link *fromType = operandType(IC_RIGHT(ic));
- link *toType = operandType(IC_LEFT(ic));
+ sym_link *fromType = operandType(IC_RIGHT(ic));
+ sym_link *toType = operandType(IC_LEFT(ic));
if (IS_INTEGRAL(fromType) && IS_INTEGRAL(toType) &&
getSize(fromType) != getSize(toType) &&
/*-----------------------------------------------------------------*/
/* pointerCode - returns the code for a pointer type */
/*-----------------------------------------------------------------*/
-static int pointerCode (link *etype)
+static int pointerCode (sym_link *etype)
{
return PTR_TYPE(SPEC_OCLS(etype));
/*-----------------------------------------------------------------*/
static int opIsGptr(operand *op)
{
- link *type = operandType(op);
+ sym_link *type = operandType(op);
if ((AOP_SIZE(op) == GPTRSIZE) && IS_GENPTR(type))
{
size = AOP_SIZE(op);
if (size == GPTRSIZE)
{
- link *type = operandType(op);
+ sym_link *type = operandType(op);
if (IS_GENPTR(type))
{
/* generic pointer; arithmetic operations
static void genNot (iCode *ic)
{
symbol *tlbl;
- link *optype = operandType(IC_LEFT(ic));
+ sym_link *optype = operandType(IC_LEFT(ic));
D(emitcode(";", "genNot "););
static void genUminus (iCode *ic)
{
int offset ,size ;
- link *optype, *rtype;
+ sym_link *optype, *rtype;
D(emitcode(";", "genUminus "););
int i;
iCode *ic;
bitVect *rsave;
- link *detype;
+ sym_link *detype;
/* look for call */
for (ic = lic ; ic ; ic = ic->next)
/*-----------------------------------------------------------------*/
static void genCall (iCode *ic)
{
- link *detype;
+ sym_link *detype;
D(emitcode(";", "genCall "););
/*-----------------------------------------------------------------*/
static void genPcall (iCode *ic)
{
- link *detype;
+ sym_link *detype;
symbol *rlbl = newiTempLabel(NULL);
D(emitcode(";", "genPcall "););
static void genFunction (iCode *ic)
{
symbol *sym;
- link *fetype;
+ sym_link *fetype;
D(emitcode(";", "genFunction "););
operand *right,
operand *result)
{
- link *opetype = operandType(result);
+ sym_link *opetype = operandType(result);
char *l ;
symbol *lbl ;
int size,offset;
operand *right,
operand *result)
{
- link *opetype = operandType(result);
+ sym_link *opetype = operandType(result);
char *l ;
symbol *lbl ;
int size,offset;
operand *right,
operand *result)
{
- link *opetype = operandType(result);
+ sym_link *opetype = operandType(result);
char *l ;
symbol *lbl ;
static void genCmpGt (iCode *ic, iCode *ifx)
{
operand *left, *right, *result;
- link *letype , *retype;
+ sym_link *letype , *retype;
int sign ;
D(emitcode(";", "genCmpGt "););
static void genCmpLt (iCode *ic, iCode *ifx)
{
operand *left, *right, *result;
- link *letype , *retype;
+ sym_link *letype , *retype;
int sign ;
D(emitcode(";", "genCmpLt "););
static void genRightShift (iCode *ic)
{
operand *right, *left, *result;
- link *retype ;
+ sym_link *retype ;
int size, offset;
char *l;
symbol *tlbl, *tlbl1 ;
{
int shCnt ;
int rlen = 0 ;
- link *etype;
+ sym_link *etype;
int offset = 0 ;
D(emitcode(";", "genUnpackBits "););
asmop *aop = NULL;
regs *preg = NULL ;
char *rname ;
- link *rtype, *retype, *letype;
- link *ltype = operandType(left);
+ sym_link *rtype, *retype, *letype;
+ sym_link *ltype = operandType(left);
char buffer[80];
rtype = operandType(result);
asmop *aop = NULL;
regs *preg = NULL ;
char *rname;
- link *rtype, *retype, *letype;
+ sym_link *rtype, *retype, *letype;
rtype = operandType(result);
retype= getSpec(rtype);
operand *result, iCode *ic)
{
int size, offset ;
- link *retype = getSpec(operandType(result));
- link *letype = getSpec(operandType(left));
+ sym_link *retype = getSpec(operandType(result));
+ sym_link *letype = getSpec(operandType(left));
D(emitcode(";", "genFarPointerGet"););
aopOp(left,ic,FALSE, FALSE);
operand *result, iCode *ic)
{
int size, offset ;
- link *retype = getSpec(operandType(result));
+ sym_link *retype = getSpec(operandType(result));
aopOp(left,ic,FALSE, FALSE);
operand *result, iCode *ic)
{
int size, offset ;
- link *retype = getSpec(operandType(result));
- link *letype = getSpec(operandType(left));
+ sym_link *retype = getSpec(operandType(result));
+ sym_link *letype = getSpec(operandType(left));
aopOp(left,ic,FALSE, TRUE);
static void genPointerGet (iCode *ic)
{
operand *left, *result ;
- link *type, *etype;
+ sym_link *type, *etype;
int p_type;
D(emitcode(";", "genPointerGet "););
/*-----------------------------------------------------------------*/
/* genPackBits - generates code for packed bit storage */
/*-----------------------------------------------------------------*/
-static void genPackBits (link *etype ,
+static void genPackBits (sym_link *etype ,
operand *right ,
char *rname, int p_type)
{
asmop *aop = NULL;
regs *preg = NULL ;
char *rname , *l;
- link *retype, *letype;
- link *ptype = operandType(result);
+ sym_link *retype, *letype;
+ sym_link *ptype = operandType(result);
retype= getSpec(operandType(right));
letype= getSpec(ptype);
asmop *aop = NULL;
regs *preg = NULL ;
char *rname , *l;
- link *retype, *letype;
+ sym_link *retype, *letype;
retype= getSpec(operandType(right));
letype= getSpec(operandType(result));
operand *result, iCode *ic)
{
int size, offset ;
- link *retype = getSpec(operandType(right));
- link *letype = getSpec(operandType(result));
+ sym_link *retype = getSpec(operandType(right));
+ sym_link *letype = getSpec(operandType(result));
aopOp(result,ic,FALSE, FALSE);
operand *result, iCode *ic)
{
int size, offset ;
- link *retype = getSpec(operandType(right));
- link *letype = getSpec(operandType(result));
+ sym_link *retype = getSpec(operandType(right));
+ sym_link *letype = getSpec(operandType(result));
aopOp(result,ic,FALSE, TRUE);
static void genPointerSet (iCode *ic)
{
operand *right, *result ;
- link *type, *etype;
+ sym_link *type, *etype;
int p_type;
D(emitcode(";", "genPointerSet "););
static void genCast (iCode *ic)
{
operand *result = IC_RESULT(ic);
- link *ctype = operandType(IC_LEFT(ic));
- link *rtype = operandType(IC_RIGHT(ic));
+ sym_link *ctype = operandType(IC_LEFT(ic));
+ sym_link *rtype = operandType(IC_RIGHT(ic));
operand *right = IC_RIGHT(ic);
int size, offset ;
if (IS_PTR(ctype)) {
int p_type;
- link *type = operandType(right);
+ sym_link *type = operandType(right);
/* pointer to generic pointer */
if (IS_GENPTR(ctype)) {
*
* char _generic *gp = (char _xdata *)(intVar);
*/
- link *etype = getSpec(type);
+ sym_link *etype = getSpec(type);
/* we have to go by the storage class */
if (SPEC_OCLS(etype) != generic)
regParmFlg = 0;
}
-static int _ds390_regparm( link *l)
+static int _ds390_regparm( sym_link *l)
{
/* for this processor it is simple
can pass only the first parameter in a register */
/*-----------------------------------------------------------------*/
static bool isSpiltOnStack (symbol *sym)
{
- link *etype;
+ sym_link *etype;
if (!sym)
return FALSE ;
/* if this is a subtraction & the result
is a true symbol in far space then don't pack */
if (ic->op == '-' && IS_TRUE_SYMOP(IC_RESULT(dic))) {
- link *etype =getSpec(operandType(IC_RESULT(dic)));
+ sym_link *etype =getSpec(operandType(IC_RESULT(dic)));
if (IN_FARSPACE(SPEC_OCLS(etype)))
return change ;
}
/*-----------------------------------------------------------------*/
static bool isBitwiseOptimizable (iCode *ic)
{
- link *ltype = getSpec(operandType(IC_LEFT(ic)));
- link *rtype = getSpec(operandType(IC_RIGHT(ic)));
+ sym_link *ltype = getSpec(operandType(IC_LEFT(ic)));
+ sym_link *rtype = getSpec(operandType(IC_RIGHT(ic)));
/* bitwise operations are considered optimizable
under the following conditions (Jean-Louis VERN)
the result of that arithmetic operation with
this result and get rid of the cast */
if (ic->op == CAST) {
- link *fromType = operandType(IC_RIGHT(ic));
- link *toType = operandType(IC_LEFT(ic));
+ sym_link *fromType = operandType(IC_RIGHT(ic));
+ sym_link *toType = operandType(IC_LEFT(ic));
if (IS_INTEGRAL(fromType) && IS_INTEGRAL(toType) &&
getSize(fromType) != getSize(toType) &&
/*-----------------------------------------------------------------*/
/* pointerCode - returns the code for a pointer type */
/*-----------------------------------------------------------------*/
-static int pointerCode (link *etype)
+static int pointerCode (sym_link *etype)
{
return PTR_TYPE(SPEC_OCLS(etype));
/*-----------------------------------------------------------------*/
static int opIsGptr(operand *op)
{
- link *type = operandType(op);
+ sym_link *type = operandType(op);
if ((AOP_SIZE(op) == GPTRSIZE) && IS_GENPTR(type))
{
size = AOP_SIZE(op);
if (size == GPTRSIZE)
{
- link *type = operandType(op);
+ sym_link *type = operandType(op);
if (IS_GENPTR(type))
{
/* generic pointer; arithmetic operations
static void genNot (iCode *ic)
{
symbol *tlbl;
- link *optype = operandType(IC_LEFT(ic));
+ sym_link *optype = operandType(IC_LEFT(ic));
/* assign asmOps to operand & result */
aopOp (IC_LEFT(ic),ic,FALSE);
static void genUminus (iCode *ic)
{
int offset ,size ;
- link *optype, *rtype;
+ sym_link *optype, *rtype;
/* assign asmops */
int i;
iCode *ic;
bitVect *rsave;
- link *detype;
+ sym_link *detype;
/* look for call */
for (ic = lic ; ic ; ic = ic->next)
/*-----------------------------------------------------------------*/
static void genCall (iCode *ic)
{
- link *detype;
+ sym_link *detype;
/* if caller saves & we have not saved then */
if (!ic->regsSaved)
/*-----------------------------------------------------------------*/
static void genPcall (iCode *ic)
{
- link *detype;
+ sym_link *detype;
symbol *rlbl = newiTempLabel(NULL);
static void genFunction (iCode *ic)
{
symbol *sym;
- link *fetype;
+ sym_link *fetype;
_G.nRegsSaved = 0;
/* create the function header */
operand *right,
operand *result)
{
- link *opetype = operandType(result);
+ sym_link *opetype = operandType(result);
char *l ;
symbol *lbl ;
int size,offset;
operand *right,
operand *result)
{
- link *opetype = operandType(result);
+ sym_link *opetype = operandType(result);
char *l ;
symbol *lbl ;
int size,offset;
operand *right,
operand *result)
{
- link *opetype = operandType(result);
+ sym_link *opetype = operandType(result);
char *l ;
symbol *lbl ;
static void genCmpGt (iCode *ic, iCode *ifx)
{
operand *left, *right, *result;
- link *letype , *retype;
+ sym_link *letype , *retype;
int sign ;
left = IC_LEFT(ic);
static void genCmpLt (iCode *ic, iCode *ifx)
{
operand *left, *right, *result;
- link *letype , *retype;
+ sym_link *letype , *retype;
int sign ;
left = IC_LEFT(ic);
static void genRightShift (iCode *ic)
{
operand *right, *left, *result;
- link *retype ;
+ sym_link *retype ;
int size, offset;
char *l;
symbol *tlbl, *tlbl1 ;
{
int shCnt ;
int rlen = 0 ;
- link *etype;
+ sym_link *etype;
int offset = 0 ;
int rsize ;
asmop *aop = NULL;
regs *preg = NULL ;
char *rname ;
- link *rtype, *retype;
- link *ltype = operandType(left);
+ sym_link *rtype, *retype;
+ sym_link *ltype = operandType(left);
char buffer[80];
rtype = operandType(result);
asmop *aop = NULL;
regs *preg = NULL ;
char *rname ;
- link *rtype, *retype;
+ sym_link *rtype, *retype;
rtype = operandType(result);
retype= getSpec(rtype);
operand *result, iCode *ic)
{
int size, offset ;
- link *retype = getSpec(operandType(result));
+ sym_link *retype = getSpec(operandType(result));
aopOp(left,ic,FALSE);
operand *result, iCode *ic)
{
int size, offset ;
- link *retype = getSpec(operandType(result));
+ sym_link *retype = getSpec(operandType(result));
aopOp(left,ic,FALSE);
operand *result, iCode *ic)
{
int size, offset ;
- link *retype = getSpec(operandType(result));
+ sym_link *retype = getSpec(operandType(result));
aopOp(left,ic,FALSE);
static void genPointerGet (iCode *ic)
{
operand *left, *result ;
- link *type, *etype;
+ sym_link *type, *etype;
int p_type;
left = IC_LEFT(ic);
/*-----------------------------------------------------------------*/
/* genPackBits - generates code for packed bit storage */
/*-----------------------------------------------------------------*/
-static void genPackBits (link *etype ,
+static void genPackBits (sym_link *etype ,
operand *right ,
char *rname, int p_type)
{
asmop *aop = NULL;
regs *preg = NULL ;
char *rname , *l;
- link *retype, *letype;
- link *ptype = operandType(result);
+ sym_link *retype, *letype;
+ sym_link *ptype = operandType(result);
retype= getSpec(operandType(right));
letype= getSpec(ptype);
asmop *aop = NULL;
regs *preg = NULL ;
char *rname , *l;
- link *retype, *letype;
+ sym_link *retype, *letype;
retype= getSpec(operandType(right));
letype= getSpec(operandType(result));
operand *result, iCode *ic)
{
int size, offset ;
- link *retype = getSpec(operandType(right));
- link *letype = getSpec(operandType(result));
+ sym_link *retype = getSpec(operandType(right));
+ sym_link *letype = getSpec(operandType(result));
aopOp(result,ic,FALSE);
/* if the operand is already in dptr
operand *result, iCode *ic)
{
int size, offset ;
- link *retype = getSpec(operandType(right));
- link *letype = getSpec(operandType(result));
+ sym_link *retype = getSpec(operandType(right));
+ sym_link *letype = getSpec(operandType(result));
aopOp(result,ic,FALSE);
static void genPointerSet (iCode *ic)
{
operand *right, *result ;
- link *type, *etype;
+ sym_link *type, *etype;
int p_type;
right = IC_RIGHT(ic);
static void genCast (iCode *ic)
{
operand *result = IC_RESULT(ic);
- link *ctype = operandType(IC_LEFT(ic));
- link *rtype = operandType(IC_RIGHT(ic));
+ sym_link *ctype = operandType(IC_LEFT(ic));
+ sym_link *rtype = operandType(IC_RIGHT(ic));
operand *right = IC_RIGHT(ic);
int size, offset ;
if (IS_PTR(ctype)) {
int p_type;
- link *type = operandType(right);
- link *etype = getSpec(type);
+ sym_link *type = operandType(right);
+ sym_link *etype = getSpec(type);
/* pointer to generic pointer */
if (IS_GENPTR(ctype)) {
regParmFlg = 0;
}
-static int _mcs51_regparm( link *l)
+static int _mcs51_regparm( sym_link *l)
{
/* for this processor it is simple
can pass only the first parameter in a register */
/*-----------------------------------------------------------------*/
static bool isSpiltOnStack (symbol *sym)
{
- link *etype;
+ sym_link *etype;
if (!sym)
return FALSE ;
static int packRegsForAssign (iCode *ic,eBBlock *ebp)
{
iCode *dic, *sic;
- link *etype = operandType(IC_RIGHT(ic));
+ sym_link *etype = operandType(IC_RIGHT(ic));
if (!IS_ITEMP(IC_RIGHT(ic)) ||
OP_SYMBOL(IC_RIGHT(ic))->isind ||
/* if assignment then check that right is not a bit */
if (ASSIGNMENT(dic) && !POINTER_SET(dic)) {
- link *etype = operandType(IC_RIGHT(dic));
+ sym_link *etype = operandType(IC_RIGHT(dic));
if (IS_BITFIELD(etype)) return 0;
}
/* if the result is on stack or iaccess then it must be
/* if this is a subtraction & the result
is a true symbol in far space then don't pack */
if (ic->op == '-' && IS_TRUE_SYMOP(IC_RESULT(dic))) {
- link *etype =getSpec(operandType(IC_RESULT(dic)));
+ sym_link *etype =getSpec(operandType(IC_RESULT(dic)));
if (IN_FARSPACE(SPEC_OCLS(etype)))
return change ;
}
/*-----------------------------------------------------------------*/
static bool isBitwiseOptimizable (iCode *ic)
{
- link *ltype = getSpec(operandType(IC_LEFT(ic)));
- link *rtype = getSpec(operandType(IC_RIGHT(ic)));
+ sym_link *ltype = getSpec(operandType(IC_LEFT(ic)));
+ sym_link *rtype = getSpec(operandType(IC_RIGHT(ic)));
/* bitwise operations are considered optimizable
under the following conditions (Jean-Louis VERN)
the result of that arithmetic operation with
this result and get rid of the cast */
if (ic->op == CAST) {
- link *fromType = operandType(IC_RIGHT(ic));
- link *toType = operandType(IC_LEFT(ic));
+ sym_link *fromType = operandType(IC_RIGHT(ic));
+ sym_link *toType = operandType(IC_LEFT(ic));
if (IS_INTEGRAL(fromType) && IS_INTEGRAL(toType) &&
getSize(fromType) != getSize(toType) &&
/*-----------------------------------------------------------------*/
/* pointerCode - returns the code for a pointer type */
/*-----------------------------------------------------------------*/
-static int pointerCode (link *etype)
+static int pointerCode (sym_link *etype)
{
return PTR_TYPE(SPEC_OCLS(etype));
/*-----------------------------------------------------------------*/
static int opIsGptr(operand *op)
{
- link *type = operandType(op);
+ sym_link *type = operandType(op);
DEBUGemitcode ("; ***","%s %d",__FUNCTION__,__LINE__);
if ((AOP_SIZE(op) == GPTRSIZE) && IS_GENPTR(type))
size = AOP_SIZE(op);
if (size == GPTRSIZE)
{
- link *type = operandType(op);
+ sym_link *type = operandType(op);
if (IS_GENPTR(type))
{
/* generic pointer; arithmetic operations
static void genNot (iCode *ic)
{
symbol *tlbl;
- link *optype = operandType(IC_LEFT(ic));
+ sym_link *optype = operandType(IC_LEFT(ic));
DEBUGemitcode ("; ***","%s %d",__FUNCTION__,__LINE__);
/* assign asmOps to operand & result */
static void genUminus (iCode *ic)
{
int offset ,size ;
- link *optype, *rtype;
+ sym_link *optype, *rtype;
DEBUGemitcode ("; ***","%s %d",__FUNCTION__,__LINE__);
int i;
iCode *ic;
bitVect *rsave;
- link *detype;
+ sym_link *detype;
DEBUGemitcode ("; ***","%s %d",__FUNCTION__,__LINE__);
/* look for call */
/*-----------------------------------------------------------------*/
static void genCall (iCode *ic)
{
- link *detype;
+ sym_link *detype;
DEBUGemitcode ("; ***","%s %d",__FUNCTION__,__LINE__);
/*-----------------------------------------------------------------*/
static void genPcall (iCode *ic)
{
- link *detype;
+ sym_link *detype;
symbol *rlbl = newiTempLabel(NULL);
static void genFunction (iCode *ic)
{
symbol *sym;
- link *fetype;
+ sym_link *fetype;
DEBUGemitcode ("; ***","%s %d",__FUNCTION__,__LINE__);
labelOffset += FUNCTION_LABEL_INC;
operand *right,
operand *result)
{
- link *opetype = operandType(result);
+ sym_link *opetype = operandType(result);
char *l ;
symbol *lbl ;
int size,offset;
operand *right,
operand *result)
{
- link *opetype = operandType(result);
+ sym_link *opetype = operandType(result);
char *l ;
symbol *lbl ;
int size,offset;
operand *right,
operand *result)
{
- link *opetype = operandType(result);
+ sym_link *opetype = operandType(result);
char *l ;
symbol *lbl ;
static void genCmpGt (iCode *ic, iCode *ifx)
{
operand *left, *right, *result;
- link *letype , *retype;
+ sym_link *letype , *retype;
int sign ;
DEBUGemitcode ("; ***","%s %d",__FUNCTION__,__LINE__);
static void genCmpLt (iCode *ic, iCode *ifx)
{
operand *left, *right, *result;
- link *letype , *retype;
+ sym_link *letype , *retype;
int sign ;
DEBUGemitcode ("; ***","%s %d",__FUNCTION__,__LINE__);
static void genRightShift (iCode *ic)
{
operand *right, *left, *result;
- link *retype ;
+ sym_link *retype ;
int size, offset;
char *l;
symbol *tlbl, *tlbl1 ;
{
int shCnt ;
int rlen = 0 ;
- link *etype;
+ sym_link *etype;
int offset = 0 ;
DEBUGemitcode ("; ***","%s %d",__FUNCTION__,__LINE__);
asmop *aop = NULL;
regs *preg = NULL ;
char *rname ;
- link *rtype, *retype;
- link *ltype = operandType(left);
+ sym_link *rtype, *retype;
+ sym_link *ltype = operandType(left);
char buffer[80];
DEBUGemitcode ("; ***","%s %d",__FUNCTION__,__LINE__);
asmop *aop = NULL;
regs *preg = NULL ;
char *rname ;
- link *rtype, *retype;
+ sym_link *rtype, *retype;
DEBUGemitcode ("; ***","%s %d",__FUNCTION__,__LINE__);
operand *result, iCode *ic)
{
int size, offset ;
- link *retype = getSpec(operandType(result));
+ sym_link *retype = getSpec(operandType(result));
DEBUGemitcode ("; ***","%s %d",__FUNCTION__,__LINE__);
operand *result, iCode *ic)
{
int size, offset ;
- link *retype = getSpec(operandType(result));
+ sym_link *retype = getSpec(operandType(result));
DEBUGemitcode ("; ***","%s %d",__FUNCTION__,__LINE__);
operand *result, iCode *ic)
{
int size, offset ;
- link *retype = getSpec(operandType(result));
+ sym_link *retype = getSpec(operandType(result));
DEBUGemitcode ("; ***","%s %d",__FUNCTION__,__LINE__);
aopOp(left,ic,FALSE);
static void genPointerGet (iCode *ic)
{
operand *left, *result ;
- link *type, *etype;
+ sym_link *type, *etype;
int p_type;
DEBUGemitcode ("; ***","%s %d",__FUNCTION__,__LINE__);
/*-----------------------------------------------------------------*/
/* genPackBits - generates code for packed bit storage */
/*-----------------------------------------------------------------*/
-static void genPackBits (link *etype ,
+static void genPackBits (sym_link *etype ,
operand *right ,
char *rname, int p_type)
{
asmop *aop = NULL;
regs *preg = NULL ;
char *rname , *l;
- link *retype;
- link *ptype = operandType(result);
+ sym_link *retype;
+ sym_link *ptype = operandType(result);
DEBUGemitcode ("; ***","%s %d",__FUNCTION__,__LINE__);
retype= getSpec(operandType(right));
asmop *aop = NULL;
regs *preg = NULL ;
char *rname , *l;
- link *retype;
+ sym_link *retype;
DEBUGemitcode ("; ***","%s %d",__FUNCTION__,__LINE__);
operand *result, iCode *ic)
{
int size, offset ;
- link *retype = getSpec(operandType(right));
+ sym_link *retype = getSpec(operandType(right));
DEBUGemitcode ("; ***","%s %d",__FUNCTION__,__LINE__);
aopOp(result,ic,FALSE);
operand *result, iCode *ic)
{
int size, offset ;
- link *retype = getSpec(operandType(right));
+ sym_link *retype = getSpec(operandType(right));
DEBUGemitcode ("; ***","%s %d",__FUNCTION__,__LINE__);
static void genPointerSet (iCode *ic)
{
operand *right, *result ;
- link *type, *etype;
+ sym_link *type, *etype;
int p_type;
DEBUGemitcode ("; ***","%s %d",__FUNCTION__,__LINE__);
{
#if 0
operand *result = IC_RESULT(ic);
- link *ctype = operandType(IC_LEFT(ic));
+ sym_link *ctype = operandType(IC_LEFT(ic));
operand *right = IC_RIGHT(ic);
int ret = 0;
int big,small;
static void genCast (iCode *ic)
{
operand *result = IC_RESULT(ic);
- link *ctype = operandType(IC_LEFT(ic));
+ sym_link *ctype = operandType(IC_LEFT(ic));
operand *right = IC_RIGHT(ic);
int size, offset ;
if (IS_PTR(ctype)) {
int p_type;
- link *type = operandType(right);
- link *etype = getSpec(type);
+ sym_link *type = operandType(right);
+ sym_link *etype = getSpec(type);
/* pointer to generic pointer */
if (IS_GENPTR(ctype)) {
extern symbol *interrupts[256];
-void printIval (symbol *, link *, initList *, FILE *);
+void printIval (symbol *, sym_link *, initList *, FILE *);
extern int noAlloc;
extern set *publics;
extern int maxInterrupts;
char *aopLiteral (value *val, int offset)
static void emitRegularMap (memmap * map, bool addPublics, bool arFlag)
value *initPointer (initList *ilist)
-void printIvalType (link * type, initList * ilist, FILE * oFile)
-void printIvalStruct (symbol * sym,link * type,
+void printIvalType (sym_link * type, initList * ilist, FILE * oFile)
+void printIvalStruct (symbol * sym,sym_link * type,
initList * ilist, FILE * oFile)
-int printIvalChar (link * type, initList * ilist, FILE * oFile, char *s)
-void printIvalArray (symbol * sym, link * type, initList * ilist,
+int printIvalChar (sym_link * type, initList * ilist, FILE * oFile, char *s)
+void printIvalArray (symbol * sym, sym_link * type, initList * ilist,
FILE * oFile)
-void printIvalFuncPtr (link * type, initList * ilist, FILE * oFile)
-int printIvalCharPtr (symbol * sym, link * type, value * val, FILE * oFile)
-void printIvalPtr (symbol * sym, link * type, initList * ilist, FILE * oFile)
+void printIvalFuncPtr (sym_link * type, initList * ilist, FILE * oFile)
+int printIvalCharPtr (symbol * sym, sym_link * type, value * val, FILE * oFile)
+void printIvalPtr (symbol * sym, sym_link * type, initList * ilist, FILE * oFile)
#endif
/*-----------------------------------------------------------------*/
/* printIvalType - generates ival for int/char */
/*-----------------------------------------------------------------*/
-void printIvalType (link * type, initList * ilist, FILE * oFile)
+void printIvalType (sym_link * type, initList * ilist, FILE * oFile)
{
value *val;
/*-----------------------------------------------------------------*/
/* printIvalStruct - generates initial value for structures */
/*-----------------------------------------------------------------*/
-void printIvalStruct (symbol * sym,link * type,
+void printIvalStruct (symbol * sym,sym_link * type,
initList * ilist, FILE * oFile)
{
symbol *sflds;
/*-----------------------------------------------------------------*/
/* printIvalChar - generates initital value for character array */
/*-----------------------------------------------------------------*/
-int printIvalChar (link * type, initList * ilist, FILE * oFile, char *s)
+int printIvalChar (sym_link * type, initList * ilist, FILE * oFile, char *s)
{
value *val;
int remain;
/*-----------------------------------------------------------------*/
/* printIvalArray - generates code for array initialization */
/*-----------------------------------------------------------------*/
-void printIvalArray (symbol * sym, link * type, initList * ilist,
+void printIvalArray (symbol * sym, sym_link * type, initList * ilist,
FILE * oFile)
{
initList *iloop;
/*-----------------------------------------------------------------*/
/* printIvalFuncPtr - generate initial value for function pointers */
/*-----------------------------------------------------------------*/
-void printIvalFuncPtr (link * type, initList * ilist, FILE * oFile)
+void printIvalFuncPtr (sym_link * type, initList * ilist, FILE * oFile)
{
value *val;
int dLvl = 0;
/*-----------------------------------------------------------------*/
/* printIvalCharPtr - generates initial values for character pointers */
/*-----------------------------------------------------------------*/
-int printIvalCharPtr (symbol * sym, link * type, value * val, FILE * oFile)
+int printIvalCharPtr (symbol * sym, sym_link * type, value * val, FILE * oFile)
{
int size = 0;
/*-----------------------------------------------------------------*/
/* printIvalPtr - generates initial value for pointers */
/*-----------------------------------------------------------------*/
-void printIvalPtr (symbol * sym, link * type, initList * ilist, FILE * oFile)
+void printIvalPtr (symbol * sym, sym_link * type, initList * ilist, FILE * oFile)
{
value *val;
/*-----------------------------------------------------------------*/
/* printIval - generates code for initial value */
/*-----------------------------------------------------------------*/
-void printIval (symbol * sym, link * type, initList * ilist, FILE * oFile)
+void printIval (symbol * sym, sym_link * type, initList * ilist, FILE * oFile)
{
if (!ilist)
return;
regParmFlg = 0;
}
-static int _pic14_regparm( link *l)
+static int _pic14_regparm( sym_link *l)
{
/* for this processor it is simple
can pass only the first parameter in a register */
/*-----------------------------------------------------------------*/
static bool isSpiltOnStack (symbol *sym)
{
- link *etype;
+ sym_link *etype;
if (!sym)
return FALSE ;
/* if this is a subtraction & the result
is a true symbol in far space then don't pack */
if (ic->op == '-' && IS_TRUE_SYMOP(IC_RESULT(dic))) {
- link *etype =getSpec(operandType(IC_RESULT(dic)));
+ sym_link *etype =getSpec(operandType(IC_RESULT(dic)));
if (IN_FARSPACE(SPEC_OCLS(etype)))
return change ;
}
/*-----------------------------------------------------------------*/
static bool isBitwiseOptimizable (iCode *ic)
{
- link *ltype = getSpec(operandType(IC_LEFT(ic)));
- link *rtype = getSpec(operandType(IC_RIGHT(ic)));
+ sym_link *ltype = getSpec(operandType(IC_LEFT(ic)));
+ sym_link *rtype = getSpec(operandType(IC_RIGHT(ic)));
/* bitwise operations are considered optimizable
under the following conditions (Jean-Louis VERN)
the result of that arithmetic operation with
this result and get rid of the cast */
if (ic->op == CAST) {
- link *fromType = operandType(IC_RIGHT(ic));
- link *toType = operandType(IC_LEFT(ic));
+ sym_link *fromType = operandType(IC_RIGHT(ic));
+ sym_link *toType = operandType(IC_LEFT(ic));
if (IS_INTEGRAL(fromType) && IS_INTEGRAL(toType) &&
getSize(fromType) != getSize(toType) ) {
/* parameter passing in register related functions */
void (*reset_regparms)(); /* reset the register count */
- int (*reg_parm)(struct link *); /* will return 1 if can be passed in register */
+ int (*reg_parm)(struct sym_link *); /* will return 1 if can be passed in register */
/** Process the pragma string 'sz'. Returns 0 if recognised and
processed, 1 otherwise. May be NULL.
/*-----------------------------------------------------------------*/
static void genNot (iCode *ic)
{
- link *optype = operandType(IC_LEFT(ic));
+ sym_link *optype = operandType(IC_LEFT(ic));
/* assign asmOps to operand & result */
aopOp (IC_LEFT(ic),ic,FALSE, TRUE);
static void genUminus (iCode *ic)
{
int offset ,size ;
- link *optype, *rtype;
+ sym_link *optype, *rtype;
/* assign asmops */
aopOp(IC_LEFT(ic),ic,FALSE, FALSE);
static void emitCall(iCode *ic, bool ispcall)
{
int pushed_de = 0;
- link *detype = getSpec(operandType(IC_LEFT(ic)));
+ sym_link *detype = getSpec(operandType(IC_LEFT(ic)));
/* if caller saves & we have not saved then */
if (!ic->regsSaved) {
/*-----------------------------------------------------------------*/
static void genCall (iCode *ic)
{
- link *detype = getSpec(operandType(IC_LEFT(ic)));
+ sym_link *detype = getSpec(operandType(IC_LEFT(ic)));
emitCall(ic, FALSE);
}
static void genFunction (iCode *ic)
{
symbol *sym = OP_SYMBOL(IC_LEFT(ic));
- link *fetype;
+ sym_link *fetype;
nregssaved = 0;
setArea(IS_NONBANKED(sym->etype));
static void genCmpGt (iCode *ic, iCode *ifx)
{
operand *left, *right, *result;
- link *letype , *retype;
+ sym_link *letype , *retype;
int sign ;
left = IC_LEFT(ic);
static void genCmpLt (iCode *ic, iCode *ifx)
{
operand *left, *right, *result;
- link *letype , *retype;
+ sym_link *letype , *retype;
int sign ;
left = IC_LEFT(ic);
static void genRightShift (iCode *ic)
{
operand *right, *left, *result;
- link *retype ;
+ sym_link *retype ;
int size, offset, first = 1;
char *l;
bool is_signed;
operand *result, iCode *ic)
{
int size, offset ;
- link *retype = getSpec(operandType(result));
+ sym_link *retype = getSpec(operandType(result));
int pair = PAIR_HL;
if (IS_GB)
static void genPointerGet (iCode *ic)
{
operand *left, *result ;
- link *type, *etype;
+ sym_link *type, *etype;
left = IC_LEFT(ic);
result = IC_RESULT(ic) ;
operand *result, iCode *ic)
{
int size, offset ;
- link *retype = getSpec(operandType(right));
+ sym_link *retype = getSpec(operandType(right));
PAIR_ID pairId = PAIR_HL;
aopOp(result,ic,FALSE, FALSE);
static void genPointerSet (iCode *ic)
{
operand *right, *result ;
- link *type, *etype;
+ sym_link *type, *etype;
right = IC_RIGHT(ic);
result = IC_RESULT(ic) ;
static void genCast (iCode *ic)
{
operand *result = IC_RESULT(ic);
- link *ctype = operandType(IC_LEFT(ic));
+ sym_link *ctype = operandType(IC_LEFT(ic));
operand *right = IC_RIGHT(ic);
int size, offset ;
regParmFlg = 0;
}
-static int _reg_parm(link *l)
+static int _reg_parm(sym_link *l)
{
if (regParmFlg == 2)
return 0;
/*-----------------------------------------------------------------*/
bool isSpiltOnStack (symbol *sym)
{
- link *etype;
+ sym_link *etype;
if (!sym)
return FALSE ;
/*-----------------------------------------------------------------*/
static bool isBitwiseOptimizable (iCode *ic)
{
- link *rtype = getSpec(operandType(IC_RIGHT(ic)));
+ sym_link *rtype = getSpec(operandType(IC_RIGHT(ic)));
/* bitwise operations are considered optimizable
under the following conditions (Jean-Louis VERN)