1) Enum problems
2) parmBytes not set correctly
3) copyiCode
git-svn-id: https://sdcc.svn.sourceforge.net/svnroot/sdcc/trunk/sdcc@68
4a8a32a2-be11-0410-ad9d-
d568d2c75423
switch (ic->op) {
case IFX:
IC_COND(nic) = operandFromOperand(IC_COND(ic));
switch (ic->op) {
case IFX:
IC_COND(nic) = operandFromOperand(IC_COND(ic));
- IC_TRUE(nic) = operandFromOperand(IC_TRUE(ic));
- IC_FALSE(nic)= operandFromOperand(IC_FALSE(ic));
+ IC_TRUE(nic) = IC_TRUE(ic);
+ IC_FALSE(nic)= IC_FALSE(ic);
geniCodeAssign(top,pval,1);
}
else {
geniCodeAssign(top,pval,1);
}
else {
+ link *p = operandType(pval);
/* push */
ic = newiCode(IPUSH,pval,NULL);
ic->parmPush = 1;
/* update the stack adjustment */
/* push */
ic = newiCode(IPUSH,pval,NULL);
ic->parmPush = 1;
/* update the stack adjustment */
- *stack += getSize(operandType(pval));
+ *stack += getSize(IS_AGGREGATE(p)? aggrToPtr(p,FALSE):p);
/* assembler options */
if (argv[i][2] == 'a') {
if (argv[i][3])
/* assembler options */
if (argv[i][2] == 'a') {
if (argv[i][3])
- parseWithComma(asmOptions,&argv[i][3]);
+ parseWithComma((char **)asmOptions,&argv[i][3]);
- parseWithComma(asmOptions,argv[++i]);
+ parseWithComma((char **)asmOptions,argv[++i]);
} else {
werror(W_UNKNOWN_OPTION,argv[i]);
} else {
werror(W_UNKNOWN_OPTION,argv[i]);
for ( lval = val ; lval ; lval = lval->next, pNum++ ) {
for ( lval = val ; lval ; lval = lval->next, pNum++ ) {
- /* if this is a literal e.g. enumerated type */
- if (IS_LITERAL(lval->etype)) {
- SPEC_OCLS(lval->etype) = SPEC_OCLS(lval->sym->etype) =
- ( options.model ? xdata : data );
- continue;
- }
+ /* check the declaration */
+ checkDecl (lval->sym);
+
+ // /* if this is a literal e.g. enumerated type */
+ // if (IS_LITERAL(lval->etype)) {
+ // SPEC_OCLS(lval->etype) = SPEC_OCLS(lval->sym->etype) =
+ // ( options.model ? xdata : data );
+ // continue;
+ //}
/* if this a register parm then allocate
it as a local variable by adding it
to the first block we see in the body */
if (IS_REGPARM(lval->etype))
continue ;
/* if this a register parm then allocate
it as a local variable by adding it
to the first block we see in the body */
if (IS_REGPARM(lval->etype))
continue ;
- /* check the declaration */
- checkDecl (lval->sym);
-
/* mark it as my parameter */
lval->sym->ismyparm = 1;
lval->sym->localof = currFunc;
/* mark it as my parameter */
lval->sym->ismyparm = 1;
lval->sym->localof = currFunc;
/*------------------------------------------------------------------*/
/* checkSClass - check the storage class specification */
/*------------------------------------------------------------------*/
/*------------------------------------------------------------------*/
/* checkSClass - check the storage class specification */
/*------------------------------------------------------------------*/
-void checkSClass ( symbol *sym )
+static void checkSClass ( symbol *sym )
+ /* type is literal can happen foe enums change
+ to auto */
+ if (SPEC_SCLS(sym->etype) == S_LITERAL && !SPEC_ENUM(sym->etype))
+ SPEC_SCLS(sym->etype) = S_AUTO;
+
/* if sfr or sbit then must also be */
/* volatile the initial value will be xlated */
/* to an absolute address */
/* if sfr or sbit then must also be */
/* volatile the initial value will be xlated */
/* to an absolute address */
( SPEC_SCLS(sym->etype) != S_AUTO &&
SPEC_SCLS(sym->etype) != S_FIXED &&
SPEC_SCLS(sym->etype) != S_REGISTER &&
( SPEC_SCLS(sym->etype) != S_AUTO &&
SPEC_SCLS(sym->etype) != S_FIXED &&
SPEC_SCLS(sym->etype) != S_REGISTER &&
- SPEC_SCLS(sym->etype) != S_CONSTANT )) {
+ SPEC_SCLS(sym->etype) != S_CONSTANT )) {
werror(E_AUTO_ASSUMED,sym->name) ;
SPEC_SCLS(sym->etype) = S_AUTO ;
werror(E_AUTO_ASSUMED,sym->name) ;
SPEC_SCLS(sym->etype) = S_AUTO ;
int compStructSize ( int ,structdef * );
link *copyLinkChain ( link * );
int checkDecl ( symbol * );
int compStructSize ( int ,structdef * );
link *copyLinkChain ( link * );
int checkDecl ( symbol * );
-void checkSClass ( symbol * );
void checkBasic ( link *, link * );
value *checkPointerIval ( link *, value * );
value *checkStructIval ( symbol *, value * );
void checkBasic ( link *, link * );
value *checkPointerIval ( link *, value * );
value *checkStructIval ( symbol *, value * );