"near" { count(); TKEYWORD(DATA); }
"pdata" { count(); TKEYWORD(PDATA); }
"reentrant" { count(); TKEYWORD(REENTRANT); }
+"shadowregs" { count(); TKEYWORD(SHADOWREGS); }
+"wparam" { count(); TKEYWORD(WPARAM); }
"register" { count(); return(REGISTER); }
"return" { count(); return(RETURN); }
"sfr" { count(); TKEYWORD(SFR); }
"_overlay" { count(); TKEYWORD(OVERLAY); }
{L}({L}|{D})* { count(); return(check_type()); }
0[xX]{H}+{IS}? { count(); yylval.val = constVal(yytext); return(CONSTANT); }
-0{D}+{IS}? { count(); yylval.val = constVal(yytext); return(CONSTANT); }
-{D}+{IS}? { count(); yylval.val = constVal(yytext); return(CONSTANT); }
+0[0-7]*{IS}? { count(); yylval.val = constVal(yytext); return(CONSTANT); }
+[1-9]{D}*{IS}? { count(); yylval.val = constVal(yytext); return(CONSTANT); }
'(\\.|[^\\'])+' { count();yylval.val = charVal (yytext); return(CONSTANT); /* ' make syntax highliter happy */ }
{D}+{E}{FS}? { count(); yylval.val = constFloatVal(yytext);return(CONSTANT); }
{D}*"."{D}+({E})?{FS}? { count(); yylval.val = constFloatVal(yytext);return(CONSTANT); }
P_LOOPREV,
P_OVERLAY_, /* I had a strange conflict with P_OVERLAY while */
/* cross-compiling for MINGW32 with gcc 3.2 */
- P_DISABLEWARN
+ P_DISABLEWARN,
+ P_OPTCODESPEED,
+ P_OPTCODESIZE,
+ P_OPTCODEBALANCED
};
STACK_DCL(options_stack, struct options *, SAVE_RESTORE_SIZE)
STACK_DCL(optimize_stack, struct optimize *, SAVE_RESTORE_SIZE)
+STACK_DCL(SDCCERRG_stack, struct SDCCERRG *, SAVE_RESTORE_SIZE)
/*
* cloneXxx functions should be updated every time a new set is
{
struct optimize *new_opt;
- new_opt = Safe_malloc(sizeof (struct options));
+ new_opt = Safe_malloc(sizeof (struct optimize));
/* clone scalar values */
*new_opt = *opt;
return new_opt;
}
+static struct SDCCERRG *cloneSDCCERRG (struct SDCCERRG *val)
+{
+ struct SDCCERRG *new_val;
+
+ new_val = Safe_malloc(sizeof (struct SDCCERRG));
+
+ /* clone scalar values */
+ *new_val = *val;
+
+ return new_val;
+}
+
static void copyAndFreeOptions(struct options *dest, struct options *src)
{
/* delete dest sets */
/* not implemented yet: */
/* deleteSet(&dest->olaysSet); */
- /* dopy src to dest */
+ /* copy src to dest */
*dest = *src;
Safe_free(src);
static void copyAndFreeOptimize(struct optimize *dest, struct optimize *src)
{
- /* dopy src to dest */
+ /* copy src to dest */
+ *dest = *src;
+
+ Safe_free(src);
+}
+
+static void copyAndFreeSDCCERRG(struct SDCCERRG *dest, struct SDCCERRG *src)
+{
+ /* copy src to dest */
*dest = *src;
Safe_free(src);
{
STACK_PUSH(options_stack, cloneOptions(&options));
STACK_PUSH(optimize_stack, cloneOptimize(&optimize));
+ STACK_PUSH(SDCCERRG_stack, cloneSDCCERRG(&_SDCCERRG));
}
break;
{
struct options *optionsp;
struct optimize *optimizep;
+ struct SDCCERRG *sdccerrgp;
optionsp = STACK_POP(options_stack);
copyAndFreeOptions(&options, optionsp);
optimizep = STACK_POP(optimize_stack);
copyAndFreeOptimize(&optimize, optimizep);
+
+ sdccerrgp = STACK_POP(SDCCERRG_stack);
+ copyAndFreeSDCCERRG(&_SDCCERRG, sdccerrgp);
}
break;
case P_LESSPEDANTIC:
options.lessPedantic = 1;
+ setErrorLogLevel(ERROR_LEVEL_WARNING);
break;
case P_CALLEE_SAVES:
setWarningDisabled(i);
}
break;
+
+ case P_OPTCODESPEED:
+ optimize.codeSpeed = 1;
+ optimize.codeSize = 0;
+ break;
+
+ case P_OPTCODESIZE:
+ optimize.codeSpeed = 0;
+ optimize.codeSize = 1;
+ break;
+
+ case P_OPTCODEBALANCED:
+ optimize.codeSpeed = 0;
+ optimize.codeSize = 0;
+ break;
+
}
}
{ "overlay", P_OVERLAY_, 0 },
{ "less_pedantic", P_LESSPEDANTIC, 0 },
{ "disable_warning",P_DISABLEWARN, 0 },
+ { "opt_code_speed", P_OPTCODESPEED, 0 },
+ { "opt_code_size", P_OPTCODESIZE, 0 },
+ { "opt_code_balanced", P_OPTCODEBALANCED, 0 },
/*
* The following lines are deprecated pragmas,
while ((!isspace(*s)) && (*s != '\n'))
s++ ;
+ /* skip separating whitespace */
+ while (isspace(*s) && (*s != '\n'))
+ s++;
+
/* First give the port a chance */
if (port->process_pragma && !port->process_pragma(cp))
return 0;
if (pragma_tbl[i].deprecated != 0)
werror(W_DEPRECATED_PRAGMA, pragma_tbl[i].name);
- doPragma(pragma_tbl[i].id, cp + len);
+ doPragma(pragma_tbl[i].id, s);
return 0;
}
}