1
0
mirror of https://github.com/sehugg/8bitworkshop.git synced 2025-02-20 14:29:16 +00:00

sdcc: use "#pragma opt_code_speed/size" to activate optimization flags

This commit is contained in:
Steven Hugg 2019-06-01 09:50:31 -04:00
parent 9ddad79326
commit 151ab0353d

View File

@ -1360,7 +1360,6 @@ function compileSDCC(step:BuildStep) {
'--less-pedantic', '--less-pedantic',
///'--fomit-frame-pointer', ///'--fomit-frame-pointer',
//'--opt-code-speed', //'--opt-code-speed',
'--oldralloc',
//'--max-allocs-per-node', '1000', //'--max-allocs-per-node', '1000',
//'--cyclomatic', //'--cyclomatic',
//'--nooverlay', //'--nooverlay',
@ -1370,9 +1369,15 @@ function compileSDCC(step:BuildStep) {
//'--noinduction', //'--noinduction',
//'--nojtbound', //'--nojtbound',
//'--noloopreverse', //'--noloopreverse',
'--no-peep',
'--nolospre',
'-o', outpath]; '-o', outpath];
// if "#pragma opt_code" found do not disable optimziations
if (!/^\s*#pragma\s+opt_code/m.exec(code)) {
args.push.apply(args, [
'--oldralloc',
'--no-peep',
'--nolospre'
]);
}
if (params.extra_compile_args) { if (params.extra_compile_args) {
args.push.apply(args, params.extra_compile_args); args.push.apply(args, params.extra_compile_args);
} }