فهرست منبع

* fixes for code generation switches and associated dialog box, with assistance of Robert Riebisch

git-svn-id: trunk@10708 -
Tomas Hajny 17 سال پیش
والد
کامیت
979d1ac07f
3فایلهای تغییر یافته به همراه18 افزوده شده و 45 حذف شده
  1. 2 2
      ide/fpide.pas
  2. 4 21
      ide/fpmopts.inc
  3. 12 22
      ide/fpswitch.pas

+ 2 - 2
ide/fpide.pas

@@ -533,7 +533,7 @@ resourcestring  menu_local_gotosource = '~G~oto source';
                 dialog_compilerswitches = 'Compiler Switches';
                 label_compiler_syntaxswitches = 'S~y~ntax Switches';
                 label_compiler_mode = 'Compiler ~m~ode';
-                label_compiler_runtimechecks = 'Run-time checks';
+                label_compiler_codegeneration = 'Code generation';
                 label_compiler_optimizations = 'Optimizations';
                 label_compiler_opt_targetprocessor = 'Optimization target processor';
                 label_compiler_codegen_targetprocessor = 'Code generation target processor';
@@ -544,7 +544,7 @@ resourcestring  menu_local_gotosource = '~G~oto source';
                 label_compiler_assemblerinfo = 'Assembler info';
                 label_compiler_assembleroutput = 'Assembler output';
                 page_compiler_syntax = 'S~y~ntax';
-                page_compiler_codegeneration = 'Code ~g~eneration';
+                page_compiler_codegeneration = '~G~enerated code';
                 page_compiler_verbose = '~V~erbose';
                 page_compiler_browser = '~B~rowser';
                 page_compiler_assembler = '~A~ssembler';

+ 4 - 21
ide/fpmopts.inc

@@ -63,7 +63,7 @@ procedure TIDEApp.DoCompilerSwitch;
 var R,R2,R3,TabR,TabIR: TRect;
     D: PCenterDialog;
     CB1,CB2,CB3,CB4,CB5: PCheckBoxes;
-    RB1,RB1b,RB2,RB3,RB4,RB5,RB6: PRadioButtons;
+    RB1,RB1b,RB2,RB4,RB5,RB6: PRadioButtons;
     Items: PSItem;
     IL: PEditorInputLine;
     IL2: PEditorInputLine;
@@ -138,28 +138,12 @@ begin
         CB3^.Press(I);
     Dec(R2.A.Y);
     R2.B.Y:=R2.A.Y+1;
-    New(Label21, Init(R2, label_compiler_runtimechecks, CB3));
-
-    Count:=OptimizingGoalSwitches^.ItemCount;
-    R2.Copy(TabIR);
-    R2.A.X:=R2.B.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(OptimizingGoalSwitches^.ItemName(I), Items);
-    New(RB3, Init(R2, Items));
-    L:=OptimizingGoalSwitches^.GetCurrSel;
-    RB3^.SetData(L);
-    Dec(R2.A.Y);
-    R2.B.Y:=R2.A.Y+1;
-    New(Label22, Init(R2, label_compiler_optimizations, RB3));
+    New(Label21, Init(R2, label_compiler_codegeneration, CB3));
 
     Count:=OptimizationSwitches^.ItemCount;
     R2.Copy(TabIR);
     R2.A.X:=R2.B.X-(R2.B.X-R2.A.X) div 2;
     Dec(R2.B.X,4);
-    Inc(R2.A.Y, OptimizingGoalSwitches^.ItemCount);
     R2.B.Y:=R2.A.Y+Count;
     Items:=nil;
     for I:=Count-1 downto 0 do
@@ -170,6 +154,7 @@ begin
         CB2^.Press(I);
     Dec(R2.A.Y);
     R2.B.Y:=R2.A.Y+1;
+    New(Label22, Init(R2, label_compiler_optimizations, CB2));
 
     { --- Sheet 3 --- }
     Count:=ProcessorOptimizationSwitches^.ItemCount;
@@ -299,8 +284,7 @@ begin
         NewTabItem(CB3,
         NewTabItem(Label22,
         NewTabItem(CB2,
-        NewTabItem(RB3,
-        nil))))),
+        nil)))),
       NewTabDef('~P~rocessor',RB1,
         NewTabItem(Label23,
         NewTabItem(RB1,
@@ -359,7 +343,6 @@ begin
       OptimizationSwitches^.SetBooleanItem(I,CB2^.Mark(I));
     for I:=0 to VerboseSwitches^.ItemCount-1 do
       VerboseSwitches^.SetBooleanItem(I,CB4^.Mark(I));
-    OptimizingGoalSwitches^.SetCurrSel(RB3^.Value);
     ProcessorOptimizationSwitches^.SetCurrSel(RB1^.Value);
     ProcessorCodeGenerationSwitches^.SetCurrSel(RB1b^.Value);
     AsmReaderSwitches^.SetCurrSel(RB5^.Value);

+ 12 - 22
ide/fpswitch.pas

@@ -169,7 +169,6 @@ var
     VerboseSwitches,
     CodegenSwitches,
     OptimizationSwitches,
-    OptimizingGoalSwitches,
     ProcessorCodeGenerationSwitches,
     ProcessorOptimizationSwitches,
     AsmReaderSwitches,
@@ -250,10 +249,10 @@ const
       opt_objmethcallvalid = 'Object ~m~ethod call checking';
       { Code generation }
       opt_pic = '~P~osition independent code';
-      opt_smart = '~C~reate smartlinkable units';
+      opt_smart = 'Create smart~l~inkable units';
       { Code options }
       //opt_generatefastercode = 'Generate ~f~aster code';
-      opt_generatesmallercode = 'Generate s~m~aller code';
+      opt_generatesmallercode = 'G~e~nerate smaller code';
       opt_useregistervariables = 'Use regis~t~er-variables';
       opt_uncertainoptimizations = '~U~ncertain optimizations';
       opt_level1optimizations = 'Level ~1~ optimizations';
@@ -790,7 +789,7 @@ end;
 
 procedure TSwitches.SetCurrSel(index:integer);
 begin
-  if IsSel then
+  if index<ItemCount then
    SelNr[SwitchesMode]:=index;
 end;
 
@@ -958,7 +957,6 @@ begin
      SyntaxSwitches^.WriteItemsCfg;
      CodegenSwitches^.WriteItemsCfg;
      OptimizationSwitches^.WriteItemsCfg;
-     OptimizingGoalSwitches^.WriteItemsCfg;
      ProcessorCodeGenerationSwitches^.WriteItemsCfg;
      ProcessorOptimizationSwitches^.WriteItemsCfg;
      AsmReaderSwitches^.WriteItemsCfg;
@@ -1025,10 +1023,9 @@ begin
        'F' : res:=DirectorySwitches^.ReadItemsCfg(s);
        'g' : res:=DebugInfoSwitches^.ReadItemsCfg(s);
        'O' : begin
-               res:=true;
-               if not OptimizationSwitches^.ReadItemsCfg(s) then
-                 if not ProcessorOptimizationSwitches^.ReadItemsCfg(s) then
-                   res:=OptimizingGoalSwitches^.ReadItemsCfg(s);
+               res:=OptimizationSwitches^.ReadItemsCfg(s);
+               if not res then
+                 res:=ProcessorOptimizationSwitches^.ReadItemsCfg(s);
              end;
        'M' : res:=CompilerModeSwitches^.ReadItemsCfg(s);
        'p' : res:=ProfileInfoSwitches^.ReadItemsCfg(s);
@@ -1211,15 +1208,10 @@ begin
      AddBooleanItem(opt_pic,'g',idNone);
      AddBooleanItem(opt_smart,'X',idNone);
    end;
-  New(OptimizingGoalSwitches,InitSelect('O'));
-  with OptimizingGoalSwitches^ do
-    begin
-       //AddSelectItem(opt_generatefastercode,'G',idNone);
-       AddSelectItem(opt_generatesmallercode,'s',idNone);
-    end;
   New(OptimizationSwitches,Init('O'));
   with OptimizationSwitches^ do
    begin
+     AddBooleanItem(opt_generatesmallercode,'s',idNone);
 {$ifdef I386}
      AddBooleanItem(opt_useregistervariables,'oregvar',idNone);
      AddBooleanItem(opt_uncertainoptimizations,'ouncertain',idNone);
@@ -1435,7 +1427,7 @@ begin
        { inline allowed }
        SyntaxSwitches^.SetBooleanItem(3,true);
        { Exe size complaints are louder than speed complaints: Optimize for size by default. }
-       OptimizingGoalSwitches^.SetCurrSel(1);
+       OptimizationSwitches^.SetBooleanItem(0,true);
        case i of
           om_debug:
             begin
@@ -1455,16 +1447,16 @@ begin
           om_normal:
             begin
                {Register variables.}
-               OptimizationSwitches^.SetBooleanItem(0,true);
+               OptimizationSwitches^.SetBooleanItem(1,true);
                {Level 1 optimizations.}
-               OptimizationSwitches^.SetBooleanItem(2,true);
+               OptimizationSwitches^.SetBooleanItem(3,true);
             end;
           om_release:
             begin
                {Register variables.}
-               OptimizationSwitches^.SetBooleanItem(0,true);
+               OptimizationSwitches^.SetBooleanItem(1,true);
                {Level 2 optimizations.}
-               OptimizationSwitches^.SetBooleanItem(3,true);
+               OptimizationSwitches^.SetBooleanItem(4,true);
                {Smart linking.}
                LibLinkerSwitches^.SetCurrSel(3);
                CodegenSwitches^.SetBooleanItem(6,true);
@@ -1486,7 +1478,6 @@ begin
   dispose(VerboseSwitches,Done);
   dispose(CodegenSwitches,Done);
   dispose(OptimizationSwitches,Done);
-  dispose(OptimizingGoalSwitches,Done);
   dispose(ProcessorOptimizationSwitches,Done);
   dispose(ProcessorCodeGenerationSwitches,Done);
   dispose(BrowserSwitches,Done);
@@ -1575,7 +1566,6 @@ begin
   EnumSwitches(VerboseSwitches);
   EnumSwitches(CodegenSwitches);
   EnumSwitches(OptimizationSwitches);
-  EnumSwitches(OptimizingGoalSwitches);
   EnumSwitches(ProcessorOptimizationSwitches);
   EnumSwitches(ProcessorCodeGenerationSwitches);
   EnumSwitches(AsmReaderSwitches);