more options for sdcc compiler

This commit is contained in:
Roy Qu 2023-08-21 22:03:21 +08:00
parent 6021667c54
commit 23a1a80890
5 changed files with 50 additions and 13 deletions

View File

@ -446,8 +446,17 @@ void SDCCCompilerInfo::prepareCompilerOptions()
sl.append(QPair<QString,QString>("SDCC C2x","sdcc2x"));
addOption(SDCC_CMD_OPT_STD, QObject::tr("Language standard (--std)"), groupName, true, false, false, "--std-", CompilerOptionType::Choice,sl);
// Memory Model
sl.clear();
sl.append(QPair<QString,QString>("Small","-small"));
sl.append(QPair<QString,QString>("Medium","-medium"));
sl.append(QPair<QString,QString>("Large","-large"));
sl.append(QPair<QString,QString>("Huge","-huge"));
addOption(SDCC_OPT_MEMORY_MODEL, QObject::tr("Memory model (--model)"), groupName, true, false, false, "--model", CompilerOptionType::Choice,sl);
addOption(SDCC_OPT_XSTACK, QObject::tr("Use external stack"),groupName,true,false,false,"--xstack");
addOption(SDCC_OPT_XRAM_MOVC, QObject::tr("Use movc instead of movx to read from external ram"),groupName,true,false,false,"--xram-movc");
addOption(SDCC_OPT_ACALL_AJMP, QObject::tr("Replaces lcall/ljmp with acall/ajmp"),groupName,true,false,false,"--acall-ajmp");
addOption(SDCC_OPT_NO_XINIT_OPT, QObject::tr("Don't memcpy initialized xram from code"),groupName,true,false,false,"--no-xinit-opt");
addOption(SDCC_OPT_NOSTARTUP, QObject::tr("Don't generate startup code"),groupName,false,false,false,"nostartup");

View File

@ -51,8 +51,10 @@
#ifdef ENABLE_SDCC
#define SDCC_CMD_OPT_PROCESSOR "sdcc_cmd_opt_processor"
#define SDCC_CMD_OPT_STD "sdcc_cmd_opt_std"
#define SDCC_OPT_MEMORY_MODEL "sdcc_opt_memory_model"
#define SDCC_OPT_XSTACK "sdcc_opt_xstack"
#define SDCC_OPT_XRAM_MOVC "sdcc_opt_xram_movc"
#define SDCC_OPT_ACALL_AJMP "sdcc_opt_acall_ajmp"
#define SDCC_OPT_NO_XINIT_OPT "sdcc_opt_no_xinit_opt"
#define SDCC_OPT_NOSTARTUP "sdcc_opt_nostartup"

View File

@ -7017,6 +7017,14 @@
<source>Code segment size</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Memory model (--model)</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Replaces lcall/ljmp with acall/ajmp</source>
<translation type="unfinished"></translation>
</message>
</context>
<context>
<name>RegisterModel</name>

View File

@ -8981,67 +8981,77 @@ Are you really want to continue?</oldsource>
<translation>C语言标准(--std)</translation>
</message>
<message>
<location filename="../compiler/compilerinfo.cpp" line="449"/>
<location filename="../compiler/compilerinfo.cpp" line="455"/>
<source>Memory model (--model)</source>
<translation>(--model)</translation>
</message>
<message>
<location filename="../compiler/compilerinfo.cpp" line="457"/>
<source>Use external stack</source>
<translation>使</translation>
</message>
<message>
<location filename="../compiler/compilerinfo.cpp" line="450"/>
<location filename="../compiler/compilerinfo.cpp" line="458"/>
<source>Use movc instead of movx to read from external ram</source>
<translation>使movc代替movx访问外部RAM</translation>
</message>
<message>
<location filename="../compiler/compilerinfo.cpp" line="451"/>
<location filename="../compiler/compilerinfo.cpp" line="459"/>
<source>Replaces lcall/ljmp with acall/ajmp</source>
<translation>acall/ajmp代替lcall/ljmp</translation>
</message>
<message>
<location filename="../compiler/compilerinfo.cpp" line="460"/>
<source>Don&apos;t memcpy initialized xram from code</source>
<translation>Don&apos;t memcpy initialized xram from code</translation>
</message>
<message>
<location filename="../compiler/compilerinfo.cpp" line="452"/>
<location filename="../compiler/compilerinfo.cpp" line="461"/>
<source>Don&apos;t generate startup code</source>
<translation>main函数时不生成起始代码(edsim51模拟器)</translation>
</message>
<message>
<location filename="../compiler/compilerinfo.cpp" line="454"/>
<location filename="../compiler/compilerinfo.cpp" line="463"/>
<source>MCU Specification</source>
<translation></translation>
</message>
<message>
<location filename="../compiler/compilerinfo.cpp" line="456"/>
<location filename="../compiler/compilerinfo.cpp" line="465"/>
<source>Internal ram size</source>
<translation>RAM大小</translation>
</message>
<message>
<location filename="../compiler/compilerinfo.cpp" line="457"/>
<location filename="../compiler/compilerinfo.cpp" line="466"/>
<source>External ram start location</source>
<translation>RAM起始地址</translation>
</message>
<message>
<location filename="../compiler/compilerinfo.cpp" line="458"/>
<location filename="../compiler/compilerinfo.cpp" line="467"/>
<source>External ram size</source>
<translation>RAM大小</translation>
</message>
<message>
<location filename="../compiler/compilerinfo.cpp" line="459"/>
<location filename="../compiler/compilerinfo.cpp" line="468"/>
<source>Stack pointer initial value</source>
<translation></translation>
</message>
<message>
<location filename="../compiler/compilerinfo.cpp" line="460"/>
<location filename="../compiler/compilerinfo.cpp" line="469"/>
<source>External stack start location</source>
<translation></translation>
</message>
<message>
<location filename="../compiler/compilerinfo.cpp" line="461"/>
<location filename="../compiler/compilerinfo.cpp" line="470"/>
<source>Direct data start location</source>
<translation></translation>
</message>
<message>
<location filename="../compiler/compilerinfo.cpp" line="462"/>
<location filename="../compiler/compilerinfo.cpp" line="471"/>
<source>Code segment location</source>
<translation></translation>
</message>
<message>
<location filename="../compiler/compilerinfo.cpp" line="463"/>
<location filename="../compiler/compilerinfo.cpp" line="472"/>
<source>Code segment size</source>
<translation></translation>
</message>

View File

@ -6542,6 +6542,14 @@
<source>Code segment size</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Memory model (--model)</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Replaces lcall/ljmp with acall/ajmp</source>
<translation type="unfinished"></translation>
</message>
</context>
<context>
<name>RegisterModel</name>