* more switches updates

git-svn-id: trunk@7577 -
This commit is contained in:
pierre 2007-06-04 15:01:39 +00:00
parent 6fca51ea11
commit d7ed6209a9
3 changed files with 101 additions and 32 deletions

View File

@ -534,7 +534,8 @@ resourcestring menu_local_gotosource = '~G~oto source';
label_compiler_mode = 'Compiler ~m~ode';
label_compiler_runtimechecks = 'Run-time checks';
label_compiler_optimizations = 'Optimizations';
label_compiler_targetprocessor = 'Target processor';
label_compiler_opt_targetprocessor = 'Optimization target processor';
label_compiler_codegen_targetprocessor = 'Code generation target processor';
label_compiler_linkafter = 'Linking stage';
label_compiler_verboseswitches = 'Verbose Switches';
label_compiler_browser = 'Browser';

View File

@ -63,7 +63,7 @@ procedure TIDEApp.DoCompilerSwitch;
var R,R2,R3,TabR,TabIR: TRect;
D: PCenterDialog;
CB1,CB2,CB3,CB4,CB5: PCheckBoxes;
RB1,RB2,RB3,RB4,RB5,RB6: PRadioButtons;
RB1,RB1b,RB2,RB3,RB4,RB5,RB6: PRadioButtons;
Items: PSItem;
IL: PEditorInputLine;
IL2: PEditorInputLine;
@ -71,7 +71,7 @@ var R,R2,R3,TabR,TabIR: TRect;
I,L: longint;
Tab: PTab;
Label11,Label12,
Label21,Label22,Label23,
Label21,Label22,Label23,Label23b,
Label31,Label41,
Label51,Label52,Label53: PLabel;
begin
@ -172,22 +172,39 @@ begin
R2.B.Y:=R2.A.Y+1;
{ --- Sheet 3 --- }
Count:=ProcessorSwitches^.ItemCount;
Count:=ProcessorOptimizationSwitches^.ItemCount;
R.Copy(TabIR);
R2.Copy(R);
R2.B.X:=R2.A.X+(R2.B.X-R2.A.X) div 2;
Dec(R2.B.X,4);
R2.B.Y:=R2.A.Y+Count;
Items:=nil;
for I:=Count-1 downto 0 do
Items:=NewSItem(ProcessorSwitches^.ItemName(I), Items);
Items:=NewSItem(ProcessorOptimizationSwitches^.ItemName(I), Items);
New(RB1, Init(R2, Items));
L:=ProcessorSwitches^.GetCurrSel;
L:=ProcessorOptimizationSwitches^.GetCurrSel;
RB1^.SetData(L);
Dec(R2.A.Y);
R2.B.Y:=R2.A.Y+1;
New(Label23, Init(R2, label_compiler_targetprocessor, RB1));
New(Label23, Init(R2, label_compiler_opt_targetprocessor, RB1));
{ --- Sheet 3 --- }
Count:=ProcessorCodeGenerationSwitches^.ItemCount;
R.Copy(TabIR);
R2.Copy(R);
R2.A.X:=R2.A.X+(R2.B.X-R2.A.X) div 2;
R2.B.X:=R2.B.X-3;
R2.B.Y:=R2.A.Y+Count;
Items:=nil;
for I:=Count-1 downto 0 do
Items:=NewSItem(ProcessorCodeGenerationSwitches^.ItemName(I), Items);
New(RB1b, Init(R2, Items));
L:=ProcessorCodeGenerationSwitches^.GetCurrSel;
RB1b^.SetData(L);
Dec(R2.A.Y);
R2.B.Y:=R2.A.Y+1;
New(Label23b, Init(R2, label_compiler_codegen_targetprocessor, RB1b));
{ --- Sheet 4 --- }
Count:=VerboseSwitches^.ItemCount;
R.Copy(TabIR);
R2.Copy(R);
@ -204,7 +221,7 @@ begin
R2.B.Y:=R2.A.Y+1;
New(Label31, Init(R2, label_compiler_verboseswitches, CB4));
{ --- Sheet 4 --- }
{ --- Sheet 5 --- }
Count:=BrowserSwitches^.ItemCount;
R.Copy(TabIR);
R2.Copy(R);
@ -220,7 +237,7 @@ begin
R2.B.Y:=R2.A.Y+1;
New(Label41, Init(R2, label_compiler_browser, RB4));
{ --- Sheet 5 --- }
{ --- Sheet 6 --- }
Count:=AsmReaderSwitches^.ItemCount;
R2.Copy(TabIR);
R2.B.X:=R2.B.X-(R2.B.X-R2.A.X) div 2;
@ -287,7 +304,9 @@ begin
NewTabDef('~P~rocessor',RB1,
NewTabItem(Label23,
NewTabItem(RB1,
nil)),
NewTabItem(Label23b,
NewTabItem(RB1b,
nil)))),
NewTabDef(page_compiler_verbose,CB4,
NewTabItem(Label31,
NewTabItem(CB4,
@ -341,7 +360,8 @@ begin
for I:=0 to VerboseSwitches^.ItemCount-1 do
VerboseSwitches^.SetBooleanItem(I,CB4^.Mark(I));
OptimizingGoalSwitches^.SetCurrSel(RB3^.Value);
ProcessorSwitches^.SetCurrSel(RB1^.Value);
ProcessorOptimizationSwitches^.SetCurrSel(RB1^.Value);
ProcessorCodeGenerationSwitches^.SetCurrSel(RB1b^.Value);
AsmReaderSwitches^.SetCurrSel(RB5^.Value);
for I:=0 to AsmInfoSwitches^.ItemCount-1 do
AsmInfoSwitches^.SetBooleanItem(I,CB5^.Mark(I));

View File

@ -35,7 +35,7 @@ type
idStackSize,idHeapSize,idStrictVarStrings,idExtendedSyntax,
idMMXOps,idTypedAddress,idPackRecords,idPackEnum,idStackFrames,
idReferenceInfo,idDebugInfo,idBoolEval,
idLongString,idTypeInfo);
idAnsiString,idTypeInfo);
TSwitchMode = (om_Normal,om_Debug,om_Release);
@ -170,7 +170,8 @@ var
CodegenSwitches,
OptimizationSwitches,
OptimizingGoalSwitches,
ProcessorSwitches,
ProcessorCodeGenerationSwitches,
ProcessorOptimizationSwitches,
AsmReaderSwitches,
AsmInfoSwitches,
AsmOutputSwitches,
@ -222,6 +223,7 @@ const
opt_allowstaticinobjects = 'Allow STATIC in objects';
opt_assertions = 'Include assertion code';
opt_kylix = 'Load Kylix compat. unit';
opt_ansistring = 'Use Ansi Strings';
opt_strictvarstrings = 'Strict var-strings';
opt_extendedsyntax = 'Extended syntax';
opt_allowmmxoperations = 'Allow MMX operations';
@ -247,15 +249,17 @@ const
opt_overflowchecking = 'Integer ~o~verflow checking';
opt_objmethcallvalid = 'Object ~m~ethod call checking';
{ Code generation }
opt_pic = '~P~osition independend code';
opt_pic = '~P~osition independent code';
opt_smart = '~C~reate smartlinkable units';
{ Code options }
opt_generatefastercode = 'Generate ~f~aster code';
//opt_generatefastercode = 'Generate ~f~aster code';
opt_generatesmallercode = 'Generate s~m~aller code';
opt_useregistervariables = 'Use regis~t~er-variables';
opt_uncertainoptimizations = '~U~ncertain optimizations';
opt_level1optimizations = 'Level ~1~ optimizations';
opt_level2optimizations = 'Level ~2~ optimizations';
opt_level3optimizations = 'Level ~3~ optimizations';
{ optimization processor target }
opt_i386486 = 'i~3~86/i486';
opt_pentium = 'Pentium (tm)';
opt_pentiummmx = 'PentiumMM~X~ (tm)';
@ -265,6 +269,7 @@ const
opt_m68020 = 'm680~2~0';
{ Assembler options }
opt_directassembler = '~D~irect assembler';
opt_defaultassembler = '~D~efault style assembler';
opt_attassembler = '~A~T&T style assembler';
opt_intelassembler = '~I~ntel style assembler';
opt_motassembler = '~M~otorola style assembler';
@ -274,8 +279,10 @@ const
opt_listtempallocation = 'list ~t~emp allocation';
opt_listnodeallocation = 'list ~n~ode allocation';
opt_useasmpipe = 'use ~p~ipe with assembler';
{ Assembler output selection }
opt_usedefaultas = 'Use ~d~efault output';
opt_usegnuas = 'Use ~G~NU as';
{ I386 assembler output selection }
opt_usenasmcoff = 'Use ~N~ASM coff';
opt_usenasmwin32 = 'Use NASM ~w~in32';
opt_usenasmwdosx= 'Use ~N~ASM w~d~osx';
@ -289,6 +296,7 @@ const
opt_usepecoff = 'Use internal ~p~ecoff';
opt_usepecoffwdosx = 'Use internal pewdos~x~';
opt_useelf= 'Use internal ~e~lf';
{ Browser options }
opt_nobrowser = 'N~o~ browser';
opt_globalonlybrowser = 'Only Glob~a~l browser';
@ -887,8 +895,11 @@ function TSwitches.ReadItemsCfg(const s:string):boolean;
begin
{ empty items are not equivalent to others !! }
{ but -dGDB didn't work because of this PM }
CheckItem:=((P^.Param='') and ((S='') or (P^.typ=ot_String))) or
((Length(P^.Param)>0) and (P^.Param=Copy(s,1,length(P^.Param))));
CheckItem:=((P^.Param='') and ((S='') or (P^.typ in [ot_Boolean,ot_String]))) or
((Length(P^.Param)>0) and (P^.Param=S) and
not (P^.typ in [ot_Boolean,ot_String])) or
((Length(P^.Param)>0) and (P^.typ<>ot_Select) and
(P^.Param=Copy(s,1,length(P^.Param))));
end;
var
@ -941,13 +952,14 @@ begin
SwitchesMode := SWM;
Writeln(CfgFile,'#IFDEF '+SwitchesModeStr[SwitchesMode]);
TargetSwitches^.WriteItemsCfg;
CompilerModeSwitches^.WriteItemsCfg;
VerboseSwitches^.WriteItemsCfg;
SyntaxSwitches^.WriteItemsCfg;
CompilerModeSwitches^.WriteItemsCfg;
CodegenSwitches^.WriteItemsCfg;
OptimizationSwitches^.WriteItemsCfg;
OptimizingGoalSwitches^.WriteItemsCfg;
ProcessorSwitches^.WriteItemsCfg;
ProcessorCodeGenerationSwitches^.WriteItemsCfg;
ProcessorOptimizationSwitches^.WriteItemsCfg;
AsmReaderSwitches^.WriteItemsCfg;
AsmInfoSwitches^.WriteItemsCfg;
AsmOutputSwitches^.WriteItemsCfg;
@ -1005,6 +1017,8 @@ begin
res:=CodegenSwitches^.ReadItemsCfg(s);
if not res then
res:=MemorySwitches^.ReadItemsCfg(s);
if not res then
res:=ProcessorCodeGenerationSwitches^.ReadItemsCfg(s);
end;
'd' : res:=ConditionalSwitches^.ReadItemsCfg(s);
'F' : res:=DirectorySwitches^.ReadItemsCfg(s);
@ -1012,7 +1026,7 @@ begin
'O' : begin
res:=true;
if not OptimizationSwitches^.ReadItemsCfg(s) then
if not ProcessorSwitches^.ReadItemsCfg(s) then
if not ProcessorOptimizationSwitches^.ReadItemsCfg(s) then
res:=OptimizingGoalSwitches^.ReadItemsCfg(s);
end;
'M' : res:=CompilerModeSwitches^.ReadItemsCfg(s);
@ -1154,6 +1168,7 @@ begin
// AddBooleanItem(opt_tp7compatibility,'o',idNone);
// AddBooleanItem(opt_delphicompatibility,'d',idNone);
AddBooleanItem(opt_assertions,'a',idNone);
AddBooleanItem(opt_ansistring,'h',idAnsiString);
AddBooleanItem(opt_kylix,'k',idNone);
AddBooleanItem(opt_allowstaticinobjects,'s',idNone);
AddBooleanItem(opt_clikeoperators,'c',idNone);
@ -1198,17 +1213,18 @@ begin
New(OptimizingGoalSwitches,InitSelect('O'));
with OptimizingGoalSwitches^ do
begin
AddSelectItem(opt_generatefastercode,'G',idNone);
AddSelectItem(opt_generatesmallercode,'g',idNone);
//AddSelectItem(opt_generatefastercode,'G',idNone);
AddSelectItem(opt_generatesmallercode,'s',idNone);
end;
New(OptimizationSwitches,Init('O'));
with OptimizationSwitches^ do
begin
{$ifdef I386}
AddBooleanItem(opt_useregistervariables,'r',idNone);
AddBooleanItem(opt_uncertainoptimizations,'u',idNone);
AddBooleanItem(opt_useregistervariables,'oregvar',idNone);
AddBooleanItem(opt_uncertainoptimizations,'ouncertain',idNone);
AddBooleanItem(opt_level1optimizations,'1',idNone);
AddBooleanItem(opt_level2optimizations,'2',idNone);
AddBooleanItem(opt_level3optimizations,'3',idNone);
{$else not I386}
{$ifdef m68k}
AddBooleanItem(opt_level1optimizations,'a',idNone);
@ -1216,8 +1232,36 @@ begin
{$endif m68k}
{$endif I386}
end;
New(ProcessorSwitches,InitSelect('O'));
with ProcessorSwitches^ do
New(ProcessorOptimizationSwitches,InitSelect('O'));
with ProcessorOptimizationSwitches^ do
begin
for cpu:=low(tcputype) to high(tcputype) do
begin
st:=cputypestr[cpu];
{$ifdef I386}
if st='386' then
st:=opt_i386486;
if st='PENTIUM' then
st:=opt_pentium;
if st='PENTIUM2' then
st:=opt_pentiummmx;
if st='PENTIUM3' then
st:=opt_pentiumpro;
if st='PENTIUM4' then
st:=opt_pentiumiv;
{$endif not I386}
{$ifdef m68k}
if st='68000' then
st:=opt_m68000;
if st='68020' then
st:=opt_m68020;
{$endif m68k}
if st<>'' then
AddSelectItem(st,'p'+cputypestr[cpu],idNone);
end;
end;
New(ProcessorCodeGenerationSwitches,InitSelect('C'));
with ProcessorCodeGenerationSwitches^ do
begin
for cpu:=low(tcputype) to high(tcputype) do
begin
@ -1256,12 +1300,14 @@ begin
with AsmReaderSwitches^ do
begin
{$ifdef I386}
AddSelectItem(opt_defaultassembler,'default',idNone);
{ AddSelectItem(opt_directassembler,'direct',idAsmDirect);}
AddSelectItem(opt_attassembler,'att',idAsmATT);
AddSelectItem(opt_intelassembler,'intel',idAsmIntel);
{$endif I386}
{$ifdef M68K}
AddSelectItem(opt_standardassembler,'standard',idAsmStandard);
AddSelectItem(opt_defaultassembler,'default',idNone);
//AddSelectItem(opt_standardassembler,'standard',idAsmStandard);
AddSelectItem(opt_motassembler,'motorola',idAsmMot);
{$endif M68K}
end;
@ -1362,7 +1408,7 @@ begin
SwitchesMode:=i;
{$ifdef i386}
{ default is Pentium }
ProcessorSwitches^.SetCurrSel(1);
ProcessorOptimizationSwitches^.SetCurrSel(1);
{ AT&T reader }
AsmReaderSwitches^.SetCurrSel(1);
{$endif i386}
@ -1432,7 +1478,8 @@ begin
dispose(CodegenSwitches,Done);
dispose(OptimizationSwitches,Done);
dispose(OptimizingGoalSwitches,Done);
dispose(ProcessorSwitches,Done);
dispose(ProcessorOptimizationSwitches,Done);
dispose(ProcessorCodeGenerationSwitches,Done);
dispose(BrowserSwitches,Done);
dispose(TargetSwitches,Done);
dispose(AsmReaderSwitches,Done);
@ -1497,7 +1544,7 @@ begin
idReferenceInfo : AddSwitch('Y'+P^.GetSwitchStr(SM));
idDebugInfo : AddSwitch('D'+P^.GetSwitchStr(SM));
idBoolEval : AddSwitch('B'+P^.GetSwitchStr(SM));
idLongString : AddSwitch('H'+P^.GetSwitchStr(SM));
idAnsiString : AddSwitch('H'+P^.GetSwitchStr(SM));
idTypeInfo : AddSwitch('M'+P^.GetSwitchStr(SM));
end;
end;
@ -1520,7 +1567,8 @@ begin
EnumSwitches(CodegenSwitches);
EnumSwitches(OptimizationSwitches);
EnumSwitches(OptimizingGoalSwitches);
EnumSwitches(ProcessorSwitches);
EnumSwitches(ProcessorOptimizationSwitches);
EnumSwitches(ProcessorCodeGenerationSwitches);
EnumSwitches(AsmReaderSwitches);
EnumSwitches(AsmInfoSwitches);
EnumSwitches(AsmOutputSwitches);