Kaynağa Gözat

* settings refactored

git-svn-id: trunk@5094 -
florian 19 yıl önce
ebeveyn
işleme
85d63d9fa9
100 değiştirilmiş dosya ile 887 ekleme ve 951 silme
  1. 1 1
      compiler/aasmbase.pas
  2. 3 3
      compiler/aasmtai.pas
  3. 9 9
      compiler/aggas.pas
  4. 1 1
      compiler/aopt.pas
  5. 2 2
      compiler/aoptobj.pas
  6. 4 4
      compiler/arm/cgcpu.pas
  7. 2 2
      compiler/arm/cpupara.pas
  8. 3 3
      compiler/arm/cpupi.pas
  9. 1 1
      compiler/arm/narmadd.pas
  10. 1 1
      compiler/arm/narmcnv.pas
  11. 9 9
      compiler/arm/narmcon.pas
  12. 3 3
      compiler/arm/narminl.pas
  13. 15 15
      compiler/assemble.pas
  14. 7 7
      compiler/browcol.pas
  15. 2 2
      compiler/browlog.pas
  16. 7 7
      compiler/cgobj.pas
  17. 8 8
      compiler/comprsrc.pas
  18. 1 1
      compiler/dbgdwarf.pas
  19. 4 4
      compiler/dbgstabs.pas
  20. 24 24
      compiler/defcmp.pas
  21. 5 5
      compiler/defutil.pas
  22. 8 8
      compiler/fppu.pas
  23. 1 1
      compiler/gendef.pas
  24. 64 75
      compiler/globals.pas
  25. 17 17
      compiler/htypechk.pas
  26. 6 6
      compiler/i386/ag386nsm.pas
  27. 2 2
      compiler/i386/aopt386.pas
  28. 3 3
      compiler/i386/cgcpu.pas
  29. 1 1
      compiler/i386/cpupi.pas
  30. 7 7
      compiler/i386/csopt386.pas
  31. 4 4
      compiler/i386/daopt386.pas
  32. 2 2
      compiler/i386/n386add.pas
  33. 2 2
      compiler/i386/n386cal.pas
  34. 2 2
      compiler/i386/n386mat.pas
  35. 4 4
      compiler/i386/n386set.pas
  36. 20 20
      compiler/i386/popt386.pas
  37. 24 24
      compiler/link.pas
  38. 19 19
      compiler/m68k/cgcpu.pas
  39. 1 1
      compiler/m68k/n68kadd.pas
  40. 1 1
      compiler/m68k/n68kcnv.pas
  41. 2 2
      compiler/m68k/n68kmat.pas
  42. 1 1
      compiler/m68k/ra68kmot.pas
  43. 24 24
      compiler/nadd.pas
  44. 2 2
      compiler/nbas.pas
  45. 11 11
      compiler/ncal.pas
  46. 16 16
      compiler/ncgadd.pas
  47. 3 3
      compiler/ncgbas.pas
  48. 3 3
      compiler/ncgcal.pas
  49. 1 1
      compiler/ncgcnv.pas
  50. 9 9
      compiler/ncgcon.pas
  51. 13 13
      compiler/ncgflw.pas
  52. 1 1
      compiler/ncginl.pas
  53. 2 2
      compiler/ncgmat.pas
  54. 17 17
      compiler/ncgmem.pas
  55. 3 3
      compiler/ncgset.pas
  56. 13 13
      compiler/ncgutil.pas
  57. 8 8
      compiler/ncnv.pas
  58. 5 5
      compiler/nflw.pas
  59. 13 13
      compiler/ninl.pas
  60. 3 3
      compiler/nld.pas
  61. 8 8
      compiler/nmat.pas
  62. 5 5
      compiler/nmem.pas
  63. 2 2
      compiler/nobj.pas
  64. 1 1
      compiler/node.pas
  65. 2 2
      compiler/nopt.pas
  66. 2 2
      compiler/nset.pas
  67. 1 1
      compiler/nutils.pas
  68. 6 6
      compiler/ogbase.pas
  69. 5 5
      compiler/ogcoff.pas
  70. 1 1
      compiler/oglx.pas
  71. 140 140
      compiler/options.pas
  72. 2 2
      compiler/optunrol.pas
  73. 12 65
      compiler/parser.pas
  74. 10 10
      compiler/pass_1.pas
  75. 5 5
      compiler/pass_2.pas
  76. 2 2
      compiler/pbase.pas
  77. 7 7
      compiler/pdecl.pas
  78. 15 15
      compiler/pdecobj.pas
  79. 30 30
      compiler/pdecsub.pas
  80. 17 17
      compiler/pdecvar.pas
  81. 21 21
      compiler/pexpr.pas
  82. 6 6
      compiler/pinline.pas
  83. 41 41
      compiler/pmodules.pas
  84. 5 5
      compiler/powerpc/agppcmpw.pas
  85. 7 7
      compiler/powerpc/cgcpu.pas
  86. 3 3
      compiler/powerpc/cpupi.pas
  87. 1 1
      compiler/powerpc/itcpugas.pas
  88. 6 6
      compiler/powerpc/nppcadd.pas
  89. 4 4
      compiler/powerpc/nppcmat.pas
  90. 16 16
      compiler/powerpc64/cgcpu.pas
  91. 2 2
      compiler/powerpc64/cpupi.pas
  92. 1 1
      compiler/powerpc64/itcpugas.pas
  93. 2 2
      compiler/powerpc64/nppcadd.pas
  94. 3 3
      compiler/powerpc64/nppcmat.pas
  95. 1 1
      compiler/ppcgen/ngppcadd.pas
  96. 1 1
      compiler/procinfo.pas
  97. 7 7
      compiler/pstatmnt.pas
  98. 27 27
      compiler/psub.pas
  99. 2 2
      compiler/psystem.pas
  100. 8 8
      compiler/ptconst.pas

+ 1 - 1
compiler/aasmbase.pas

@@ -134,7 +134,7 @@ implementation
 
 
     function maybe_smartlink_symbol:boolean;
     function maybe_smartlink_symbol:boolean;
       begin
       begin
-        result:=(cs_create_smart in aktmoduleswitches) or
+        result:=(cs_create_smart in current_settings.moduleswitches) or
                 use_smartlink_section;
                 use_smartlink_section;
       end;
       end;
 
 

+ 3 - 3
compiler/aasmtai.pas

@@ -660,7 +660,7 @@ implementation
 
 
     procedure maybe_new_object_file(list:TAsmList);
     procedure maybe_new_object_file(list:TAsmList);
       begin
       begin
-        if (cs_create_smart in aktmoduleswitches) and
+        if (cs_create_smart in current_settings.moduleswitches) and
            (not use_smartlink_section) then
            (not use_smartlink_section) then
           list.concat(tai_cutobject.create);
           list.concat(tai_cutobject.create);
       end;
       end;
@@ -779,7 +779,7 @@ implementation
      begin
      begin
        inherited create;
        inherited create;
        if not(inlining_procedure and
        if not(inlining_procedure and
-              (cs_gdb_valgrind in aktglobalswitches)) then
+              (cs_gdb_valgrind in current_settings.globalswitches)) then
          fileinfo:=aktfilepos;
          fileinfo:=aktfilepos;
      end;
      end;
 
 
@@ -2079,7 +2079,7 @@ implementation
               segprefix:=ref^.segment;
               segprefix:=ref^.segment;
 {$endif}
 {$endif}
 {$ifdef extdebug}
 {$ifdef extdebug}
-            if (cs_create_pic in aktmoduleswitches) and
+            if (cs_create_pic in current_settings.moduleswitches) and
               assigned(r.symbol) and
               assigned(r.symbol) and
               (r.refaddr=addr_no) then
               (r.refaddr=addr_no) then
               internalerror(200502052);
               internalerror(200502052);

+ 9 - 9
compiler/aggas.pas

@@ -284,7 +284,7 @@ implementation
       var
       var
         secname : string;
         secname : string;
       begin
       begin
-        if (cs_create_pic in aktmoduleswitches) and
+        if (cs_create_pic in current_settings.moduleswitches) and
            not(target_info.system in [system_powerpc_darwin,system_i386_darwin]) then
            not(target_info.system in [system_powerpc_darwin,system_i386_darwin]) then
           secname:=secnames_pic[atype]
           secname:=secnames_pic[atype]
         else
         else
@@ -422,8 +422,8 @@ implementation
       last_align := 2;
       last_align := 2;
       InlineLevel:=0;
       InlineLevel:=0;
       { lineinfo is only needed for al_procedures (PFV) }
       { lineinfo is only needed for al_procedures (PFV) }
-      do_line:=(cs_asm_source in aktglobalswitches) or
-               ((cs_lineinfo in aktmoduleswitches)
+      do_line:=(cs_asm_source in current_settings.globalswitches) or
+               ((cs_lineinfo in current_settings.moduleswitches)
                  and (p=current_asmdata.asmlists[al_procedures]));
                  and (p=current_asmdata.asmlists[al_procedures]));
       hp:=tai(p.first);
       hp:=tai(p.first);
       while assigned(hp) do
       while assigned(hp) do
@@ -442,7 +442,7 @@ implementation
                    if assigned(infile) then
                    if assigned(infile) then
                     begin
                     begin
                       { open only if needed !! }
                       { open only if needed !! }
-                      if (cs_asm_source in aktglobalswitches) then
+                      if (cs_asm_source in current_settings.globalswitches) then
                        infile.open;
                        infile.open;
                     end;
                     end;
                    { avoid unnecessary reopens of the same file !! }
                    { avoid unnecessary reopens of the same file !! }
@@ -451,7 +451,7 @@ implementation
                    lastfileinfo.line:=-1;
                    lastfileinfo.line:=-1;
                  end;
                  end;
               { write source }
               { write source }
-                if (cs_asm_source in aktglobalswitches) and
+                if (cs_asm_source in current_settings.globalswitches) and
                    assigned(infile) then
                    assigned(infile) then
                  begin
                  begin
                    if (infile<>lastinfile) then
                    if (infile<>lastinfile) then
@@ -489,7 +489,7 @@ implementation
 
 
            ait_regalloc :
            ait_regalloc :
              begin
              begin
-               if (cs_asm_regalloc in aktglobalswitches) then
+               if (cs_asm_regalloc in current_settings.globalswitches) then
                  begin
                  begin
                    AsmWrite(#9+target_asm.comment+'Register ');
                    AsmWrite(#9+target_asm.comment+'Register ');
                    repeat
                    repeat
@@ -508,7 +508,7 @@ implementation
 
 
            ait_tempalloc :
            ait_tempalloc :
              begin
              begin
-               if (cs_asm_tempalloc in aktglobalswitches) then
+               if (cs_asm_tempalloc in current_settings.globalswitches) then
                  begin
                  begin
 {$ifdef EXTDEBUG}
 {$ifdef EXTDEBUG}
                    if assigned(tai_tempalloc(hp).problem) then
                    if assigned(tai_tempalloc(hp).problem) then
@@ -861,7 +861,7 @@ implementation
            ait_symbol :
            ait_symbol :
              begin
              begin
                if (target_info.system = system_powerpc64_linux) and
                if (target_info.system = system_powerpc64_linux) and
-                 (tai_symbol(hp).sym.typ = AT_FUNCTION) and (cs_profile in aktmoduleswitches) then
+                 (tai_symbol(hp).sym.typ = AT_FUNCTION) and (cs_profile in current_settings.moduleswitches) then
                  begin
                  begin
                  AsmWriteLn('.globl _mcount');
                  AsmWriteLn('.globl _mcount');
                end;
                end;
@@ -1063,7 +1063,7 @@ implementation
           AsmWriteLn(target_asm.comment+'End asmlist '+AsmlistTypeStr[hal]);
           AsmWriteLn(target_asm.comment+'End asmlist '+AsmlistTypeStr[hal]);
         end;
         end;
 
 
-      if (cs_create_smart in aktmoduleswitches) and
+      if (cs_create_smart in current_settings.moduleswitches) and
          (target_info.system in [system_powerpc_darwin,system_i386_darwin]) then
          (target_info.system in [system_powerpc_darwin,system_i386_darwin]) then
         AsmWriteLn(#9'.subsections_via_symbols');
         AsmWriteLn(#9'.subsections_via_symbols');
 
 

+ 1 - 1
compiler/aopt.pas

@@ -220,7 +220,7 @@ Unit aopt;
             { Only perform them twice in the first pass }
             { Only perform them twice in the first pass }
              if pass = 0 then
              if pass = 0 then
                PeepHoleOptPass1;
                PeepHoleOptPass1;
-            If (cs_opt_asmcse in aktoptimizerswitches) Then
+            If (cs_opt_asmcse in current_settings.optimizerswitches) Then
               Begin
               Begin
 //                DFA:=TAOptDFACpu.Create(AsmL,BlockStart,BlockEnd,LabelInfo);
 //                DFA:=TAOptDFACpu.Create(AsmL,BlockStart,BlockEnd,LabelInfo);
                 { data flow analyzer }
                 { data flow analyzer }

+ 2 - 2
compiler/aoptobj.pas

@@ -505,7 +505,7 @@ Unit AoptObj;
               With Regs[Counter] Do
               With Regs[Counter] Do
                 Begin
                 Begin
                   If (typ = Con_Ref) And
                   If (typ = Con_Ref) And
-                     ((Not(cs_opt_size in aktoptimizerswitches) And
+                     ((Not(cs_opt_size in current_settings.optimizerswitches) And
                        (NrOfMods <> 1)
                        (NrOfMods <> 1)
                       ) Or
                       ) Or
                       (RefInSequence(Ref,Regs[Counter], RefsEq) And
                       (RefInSequence(Ref,Regs[Counter], RefsEq) And
@@ -533,7 +533,7 @@ Unit AoptObj;
             For Counter := LoGPReg to HiGPReg Do
             For Counter := LoGPReg to HiGPReg Do
               With Regs[Counter] Do
               With Regs[Counter] Do
                 If (typ = Con_Ref) And
                 If (typ = Con_Ref) And
-                   (Not(cs_opt_size in aktoptimizerswitches) Or
+                   (Not(cs_opt_size in current_settings.optimizerswitches) Or
       {$ifdef x86}
       {$ifdef x86}
               {for movsl}
               {for movsl}
                     (Ref.Base = R_EDI) Or
                     (Ref.Base = R_EDI) Or

+ 4 - 4
compiler/arm/cgcpu.pas

@@ -1567,7 +1567,7 @@ unit cgcpu;
         helpsize:=12+maxtmpreg*4;//52 with maxtmpreg=10
         helpsize:=12+maxtmpreg*4;//52 with maxtmpreg=10
         dstref:=dest;
         dstref:=dest;
         srcref:=source;
         srcref:=source;
-        if cs_opt_size in aktoptimizerswitches then
+        if cs_opt_size in current_settings.optimizerswitches then
           helpsize:=8;
           helpsize:=8;
         if (len<=helpsize) and aligned then
         if (len<=helpsize) and aligned then
           begin
           begin
@@ -1674,7 +1674,7 @@ unit cgcpu;
 
 
                 countreg:=getintregister(list,OS_32);
                 countreg:=getintregister(list,OS_32);
 
 
-//            if cs_opt_size in aktoptimizerswitches  then
+//            if cs_opt_size in current_settings.optimizerswitches  then
                 { roozbeh : it seems loading 1 byte is faster becouse of caching/fetching(?) }
                 { roozbeh : it seems loading 1 byte is faster becouse of caching/fetching(?) }
                 {if aligned then
                 {if aligned then
                 genloop(len,4)
                 genloop(len,4)
@@ -1715,7 +1715,7 @@ unit cgcpu;
         ai:TAiCpu;
         ai:TAiCpu;
         hflags : tresflags;
         hflags : tresflags;
       begin
       begin
-        if not(cs_check_overflow in aktlocalswitches) then
+        if not(cs_check_overflow in current_settings.localswitches) then
           exit;
           exit;
         current_asmdata.getjumplabel(hl);
         current_asmdata.getjumplabel(hl);
         case ovloc.loc of
         case ovloc.loc of
@@ -1813,7 +1813,7 @@ unit cgcpu;
 
 
         make_global:=false;
         make_global:=false;
         if (not current_module.is_unit) or
         if (not current_module.is_unit) or
-           (cs_create_smart in aktmoduleswitches) or
+           (cs_create_smart in current_settings.moduleswitches) or
            (procdef.owner.defowner.owner.symtabletype=globalsymtable) then
            (procdef.owner.defowner.owner.symtabletype=globalsymtable) then
           make_global:=true;
           make_global:=true;
 
 

+ 2 - 2
compiler/arm/cpupara.pas

@@ -108,7 +108,7 @@ unit cpupara;
             orddef:
             orddef:
               getparaloc:=LOC_REGISTER;
               getparaloc:=LOC_REGISTER;
             floatdef:
             floatdef:
-              if (calloption in [pocall_cdecl,pocall_cppdecl,pocall_softfloat]) or (cs_fp_emulation in aktmoduleswitches) then
+              if (calloption in [pocall_cdecl,pocall_cppdecl,pocall_softfloat]) or (cs_fp_emulation in current_settings.moduleswitches) then
                 getparaloc:=LOC_REGISTER
                 getparaloc:=LOC_REGISTER
               else
               else
                 getparaloc:=LOC_FPUREGISTER;
                 getparaloc:=LOC_FPUREGISTER;
@@ -448,7 +448,7 @@ unit cpupara;
         { Return in FPU register? }
         { Return in FPU register? }
         if p.returndef.deftype=floatdef then
         if p.returndef.deftype=floatdef then
           begin
           begin
-            if (p.proccalloption in [pocall_softfloat]) or (cs_fp_emulation in aktmoduleswitches) then
+            if (p.proccalloption in [pocall_softfloat]) or (cs_fp_emulation in current_settings.moduleswitches) then
               begin
               begin
                 case retcgsize of
                 case retcgsize of
                   OS_64,
                   OS_64,

+ 3 - 3
compiler/arm/cpupi.pas

@@ -72,7 +72,7 @@ unit cpupi;
          r : byte;
          r : byte;
          floatsavesize : aword;
          floatsavesize : aword;
       begin
       begin
-        maxpushedparasize:=align(maxpushedparasize,max(aktalignment.localalignmin,4));
+        maxpushedparasize:=align(maxpushedparasize,max(current_settings.alignment.localalignmin,4));
         firstfloatreg:=RS_NO;
         firstfloatreg:=RS_NO;
         { save floating point registers? }
         { save floating point registers? }
         for r:=RS_F0 to RS_F7 do
         for r:=RS_F0 to RS_F7 do
@@ -86,8 +86,8 @@ unit cpupi;
           floatsavesize:=(lastfloatreg-firstfloatreg+1)*12
           floatsavesize:=(lastfloatreg-firstfloatreg+1)*12
         else
         else
           floatsavesize:=0;
           floatsavesize:=0;
-        floatsavesize:=align(floatsavesize,max(aktalignment.localalignmin,4));
-        result:=Align(tg.direction*tg.lasttemp,max(aktalignment.localalignmin,4))+maxpushedparasize+floatsavesize;
+        floatsavesize:=align(floatsavesize,max(current_settings.alignment.localalignmin,4));
+        result:=Align(tg.direction*tg.lasttemp,max(current_settings.alignment.localalignmin,4))+maxpushedparasize+floatsavesize;
         floatregstart:=-result+maxpushedparasize;
         floatregstart:=-result+maxpushedparasize;
       end;
       end;
 
 

+ 1 - 1
compiler/arm/narmadd.pas

@@ -124,7 +124,7 @@ interface
       var
       var
         op : TAsmOp;
         op : TAsmOp;
       begin
       begin
-        case aktfputype of
+        case current_settings.fputype of
           fpu_fpa,
           fpu_fpa,
           fpu_fpa10,
           fpu_fpa10,
           fpu_fpa11:
           fpu_fpa11:

+ 1 - 1
compiler/arm/narmcnv.pas

@@ -76,7 +76,7 @@ implementation
       var
       var
         fname: string[19];
         fname: string[19];
       begin
       begin
-        if cs_fp_emulation in aktmoduleswitches then
+        if cs_fp_emulation in current_settings.moduleswitches then
           begin
           begin
             if target_info.system in system_wince then
             if target_info.system in system_wince then
               begin
               begin

+ 9 - 9
compiler/arm/narmcon.pas

@@ -66,7 +66,7 @@ interface
         location_reset(location,LOC_CREFERENCE,def_cgsize(resultdef));
         location_reset(location,LOC_CREFERENCE,def_cgsize(resultdef));
         lastlabel:=nil;
         lastlabel:=nil;
         realait:=floattype2ait[tfloatdef(resultdef).typ];
         realait:=floattype2ait[tfloatdef(resultdef).typ];
-        hiloswapped:=aktfputype in [fpu_fpa,fpu_fpa10,fpu_fpa11];
+        hiloswapped:=current_settings.fputype in [fpu_fpa,fpu_fpa10,fpu_fpa11];
         { const already used ? }
         { const already used ? }
         if not assigned(lab_real) then
         if not assigned(lab_real) then
           begin
           begin
@@ -79,8 +79,8 @@ interface
                 begin
                 begin
                   current_procinfo.aktlocaldata.concat(Tai_real_32bit.Create(ts32real(value_real)));
                   current_procinfo.aktlocaldata.concat(Tai_real_32bit.Create(ts32real(value_real)));
                   { range checking? }
                   { range checking? }
-                  if ((cs_check_range in aktlocalswitches) or
-                    (cs_check_overflow in aktlocalswitches)) and
+                  if ((cs_check_range in current_settings.localswitches) or
+                    (cs_check_overflow in current_settings.localswitches)) and
                     (tai_real_32bit(current_asmdata.asmlists[al_typedconsts].last).value=MathInf.Value) then
                     (tai_real_32bit(current_asmdata.asmlists[al_typedconsts].last).value=MathInf.Value) then
                     Message(parser_e_range_check_error);
                     Message(parser_e_range_check_error);
                 end;
                 end;
@@ -93,8 +93,8 @@ interface
                     current_procinfo.aktlocaldata.concat(Tai_real_64bit.Create(ts64real(value_real)));
                     current_procinfo.aktlocaldata.concat(Tai_real_64bit.Create(ts64real(value_real)));
 
 
                   { range checking? }
                   { range checking? }
-                  if ((cs_check_range in aktlocalswitches) or
-                    (cs_check_overflow in aktlocalswitches)) and
+                  if ((cs_check_range in current_settings.localswitches) or
+                    (cs_check_overflow in current_settings.localswitches)) and
                     (tai_real_64bit(current_asmdata.asmlists[al_typedconsts].last).value=MathInf.Value) then
                     (tai_real_64bit(current_asmdata.asmlists[al_typedconsts].last).value=MathInf.Value) then
                     Message(parser_e_range_check_error);
                     Message(parser_e_range_check_error);
                end;
                end;
@@ -104,8 +104,8 @@ interface
                   current_procinfo.aktlocaldata.concat(Tai_real_80bit.Create(value_real));
                   current_procinfo.aktlocaldata.concat(Tai_real_80bit.Create(value_real));
 
 
                   { range checking? }
                   { range checking? }
-                  if ((cs_check_range in aktlocalswitches) or
-                    (cs_check_overflow in aktlocalswitches)) and
+                  if ((cs_check_range in current_settings.localswitches) or
+                    (cs_check_overflow in current_settings.localswitches)) and
                     (tai_real_80bit(current_asmdata.asmlists[al_typedconsts].last).value=MathInf.Value) then
                     (tai_real_80bit(current_asmdata.asmlists[al_typedconsts].last).value=MathInf.Value) then
                     Message(parser_e_range_check_error);
                     Message(parser_e_range_check_error);
                 end;
                 end;
@@ -115,8 +115,8 @@ interface
                   current_procinfo.aktlocaldata.concat(Tai_real_128bit.Create(value_real));
                   current_procinfo.aktlocaldata.concat(Tai_real_128bit.Create(value_real));
 
 
                   { range checking? }
                   { range checking? }
-                  if ((cs_check_range in aktlocalswitches) or
-                    (cs_check_overflow in aktlocalswitches)) and
+                  if ((cs_check_range in current_settings.localswitches) or
+                    (cs_check_overflow in current_settings.localswitches)) and
                     (tai_real_128bit(current_asmdata.asmlists[al_typedconsts].last).value=MathInf.Value) then
                     (tai_real_128bit(current_asmdata.asmlists[al_typedconsts].last).value=MathInf.Value) then
                     Message(parser_e_range_check_error);
                     Message(parser_e_range_check_error);
                 end;
                 end;

+ 3 - 3
compiler/arm/narminl.pas

@@ -85,7 +85,7 @@ implementation
 
 
     function tarminlinenode.first_abs_real : tnode;
     function tarminlinenode.first_abs_real : tnode;
       begin
       begin
-        if cs_fp_emulation in aktmoduleswitches then
+        if cs_fp_emulation in current_settings.moduleswitches then
           result:=inherited first_abs_real
           result:=inherited first_abs_real
         else
         else
           begin
           begin
@@ -99,7 +99,7 @@ implementation
 
 
     function tarminlinenode.first_sqr_real : tnode;
     function tarminlinenode.first_sqr_real : tnode;
       begin
       begin
-        if cs_fp_emulation in aktmoduleswitches then
+        if cs_fp_emulation in current_settings.moduleswitches then
           result:=inherited first_sqr_real
           result:=inherited first_sqr_real
         else
         else
           begin
           begin
@@ -113,7 +113,7 @@ implementation
 
 
     function tarminlinenode.first_sqrt_real : tnode;
     function tarminlinenode.first_sqrt_real : tnode;
       begin
       begin
-        if cs_fp_emulation in aktmoduleswitches then
+        if cs_fp_emulation in current_settings.moduleswitches then
           result:=inherited first_sqrt_real
           result:=inherited first_sqrt_real
         else
         else
           begin
           begin

+ 15 - 15
compiler/assemble.pas

@@ -252,8 +252,8 @@ Implementation
 
 
     Function DoPipe:boolean;
     Function DoPipe:boolean;
       begin
       begin
-        DoPipe:=(cs_asm_pipe in aktglobalswitches) and
-                (([cs_asm_leave,cs_link_on_target] * aktglobalswitches) = []) and
+        DoPipe:=(cs_asm_pipe in current_settings.globalswitches) and
+                (([cs_asm_leave,cs_link_on_target] * current_settings.globalswitches) = []) and
                 ((target_asm.id in [as_gas,as_darwin]));
                 ((target_asm.id in [as_gas,as_darwin]));
       end;
       end;
 
 
@@ -336,7 +336,7 @@ Implementation
         UtilExe  : string;
         UtilExe  : string;
       begin
       begin
         asfound:=false;
         asfound:=false;
-        if cs_link_on_target in aktglobalswitches then
+        if cs_link_on_target in current_settings.globalswitches then
          begin
          begin
            { If linking on target, don't add any path PM }
            { If linking on target, don't add any path PM }
            FindAssembler:=utilsprefix+AddExtension(target_asm.asmbin,target_info.exeext);
            FindAssembler:=utilsprefix+AddExtension(target_asm.asmbin,target_info.exeext);
@@ -352,10 +352,10 @@ Implementation
              asfound:=FindFile(UtilExe,utilsdirectory,LastASBin);
              asfound:=FindFile(UtilExe,utilsdirectory,LastASBin);
            if not AsFound then
            if not AsFound then
              asfound:=FindExe(UtilExe,LastASBin);
              asfound:=FindExe(UtilExe,LastASBin);
-           if (not asfound) and not(cs_asm_extern in aktglobalswitches) then
+           if (not asfound) and not(cs_asm_extern in current_settings.globalswitches) then
             begin
             begin
               Message1(exec_e_assembler_not_found,LastASBin);
               Message1(exec_e_assembler_not_found,LastASBin);
-              aktglobalswitches:=aktglobalswitches+[cs_asm_extern];
+              current_settings.globalswitches:=current_settings.globalswitches+[cs_asm_extern];
             end;
             end;
            if asfound then
            if asfound then
             Message1(exec_t_using_assembler,LastASBin);
             Message1(exec_t_using_assembler,LastASBin);
@@ -371,7 +371,7 @@ Implementation
 {$ENDIF USE_SYSUTILS}
 {$ENDIF USE_SYSUTILS}
       begin
       begin
         callassembler:=true;
         callassembler:=true;
-        if not(cs_asm_extern in aktglobalswitches) then
+        if not(cs_asm_extern in current_settings.globalswitches) then
 {$IFDEF USE_SYSUTILS}
 {$IFDEF USE_SYSUTILS}
         try
         try
           FlushOutput;
           FlushOutput;
@@ -384,7 +384,7 @@ Implementation
         except on E:EOSError do
         except on E:EOSError do
           begin
           begin
             Message1(exec_e_cant_call_assembler,tostr(E.ErrorCode));
             Message1(exec_e_cant_call_assembler,tostr(E.ErrorCode));
-            aktglobalswitches:=aktglobalswitches+[cs_asm_extern];
+            current_settings.globalswitches:=current_settings.globalswitches+[cs_asm_extern];
             callassembler:=false;
             callassembler:=false;
           end
           end
         end
         end
@@ -397,7 +397,7 @@ Implementation
            if (doserror<>0) then
            if (doserror<>0) then
             begin
             begin
               Message1(exec_e_cant_call_assembler,tostr(doserror));
               Message1(exec_e_cant_call_assembler,tostr(doserror));
-              aktglobalswitches:=aktglobalswitches+[cs_asm_extern];
+              current_settings.globalswitches:=current_settings.globalswitches+[cs_asm_extern];
               callassembler:=false;
               callassembler:=false;
             end
             end
            else
            else
@@ -417,9 +417,9 @@ Implementation
       var
       var
         g : file;
         g : file;
       begin
       begin
-        if cs_asm_leave in aktglobalswitches then
+        if cs_asm_leave in current_settings.globalswitches then
          exit;
          exit;
-        if cs_asm_extern in aktglobalswitches then
+        if cs_asm_extern in current_settings.globalswitches then
          AsmRes.AddDeleteCommand(AsmFileName)
          AsmRes.AddDeleteCommand(AsmFileName)
         else
         else
          begin
          begin
@@ -437,7 +437,7 @@ Implementation
         DoAssemble:=true;
         DoAssemble:=true;
         if DoPipe then
         if DoPipe then
          exit;
          exit;
-        if not(cs_asm_extern in aktglobalswitches) then
+        if not(cs_asm_extern in current_settings.globalswitches) then
          begin
          begin
            if SmartAsm then
            if SmartAsm then
             begin
             begin
@@ -519,7 +519,7 @@ Implementation
       begin
       begin
         if OutCnt>=AsmOutSize-2 then
         if OutCnt>=AsmOutSize-2 then
          AsmFlush;
          AsmFlush;
-        if (cs_link_on_target in aktglobalswitches) then
+        if (cs_link_on_target in current_settings.globalswitches) then
           begin
           begin
             OutBuf[OutCnt]:=target_info.newline[1];
             OutBuf[OutCnt]:=target_info.newline[1];
             inc(OutCnt);
             inc(OutCnt);
@@ -550,12 +550,12 @@ Implementation
       begin
       begin
         result:=target_asm.asmcmd;
         result:=target_asm.asmcmd;
 {$ifdef m68k}
 {$ifdef m68k}
-        if aktcputype = cpu_MC68020 then
+        if current_settings.cputype = cpu_MC68020 then
           result:='-m68020 '+result
           result:='-m68020 '+result
         else
         else
           result:='-m68000 '+result;
           result:='-m68000 '+result;
 {$endif}
 {$endif}
-        if (cs_link_on_target in aktglobalswitches) then
+        if (cs_link_on_target in current_settings.globalswitches) then
          begin
          begin
            Replace(result,'$ASM',maybequoted(ScriptFixFileName(AsmFileName)));
            Replace(result,'$ASM',maybequoted(ScriptFixFileName(AsmFileName)));
            Replace(result,'$OBJ',maybequoted(ScriptFixFileName(ObjFileName)));
            Replace(result,'$OBJ',maybequoted(ScriptFixFileName(ObjFileName)));
@@ -1266,7 +1266,7 @@ Implementation
         place: tcutplace;
         place: tcutplace;
         ObjWriter : TObjectWriter;
         ObjWriter : TObjectWriter;
       begin
       begin
-        if not(cs_asm_leave in aktglobalswitches) then
+        if not(cs_asm_leave in current_settings.globalswitches) then
           ObjWriter:=TARObjectWriter.create(current_module.staticlibfilename^)
           ObjWriter:=TARObjectWriter.create(current_module.staticlibfilename^)
         else
         else
           ObjWriter:=TObjectwriter.create;
           ObjWriter:=TObjectwriter.create;

+ 7 - 7
compiler/browcol.pas

@@ -1503,7 +1503,7 @@ end;
               with tprocsym(sym) do
               with tprocsym(sym) do
               if assigned(first_procdef) then
               if assigned(first_procdef) then
               begin
               begin
-                if cs_local_browser in aktmoduleswitches then
+                if cs_local_browser in current_settings.moduleswitches then
                   ProcessSymTable(Symbol,Symbol^.Items,first_procdef.parast);
                   ProcessSymTable(Symbol,Symbol^.Items,first_procdef.parast);
                 if assigned(first_procdef.parast) then
                 if assigned(first_procdef.parast) then
                   begin
                   begin
@@ -1515,7 +1515,7 @@ end;
                   begin
                   begin
                     Symbol^.Params:=TypeNames^.Add('...');
                     Symbol^.Params:=TypeNames^.Add('...');
                   end;
                   end;
-                if cs_local_browser in aktmoduleswitches then
+                if cs_local_browser in current_settings.moduleswitches then
                  begin
                  begin
                    if assigned(first_procdef.localst) and
                    if assigned(first_procdef.localst) and
                      (first_procdef.localst.symtabletype<>staticsymtable) then
                      (first_procdef.localst.symtabletype<>staticsymtable) then
@@ -1618,10 +1618,10 @@ var
   pif: tinputfile;
   pif: tinputfile;
 begin
 begin
   DisposeBrowserCol;
   DisposeBrowserCol;
-  if (cs_browser in aktmoduleswitches) then
+  if (cs_browser in current_settings.moduleswitches) then
     NewBrowserCol;
     NewBrowserCol;
   hp:=tmodule(loaded_units.first);
   hp:=tmodule(loaded_units.first);
-  if (cs_browser in aktmoduleswitches) then
+  if (cs_browser in current_settings.moduleswitches) then
    while assigned(hp) do
    while assigned(hp) do
     begin
     begin
        t:=tsymtable(hp.globalsymtable);
        t:=tsymtable(hp.globalsymtable);
@@ -1645,7 +1645,7 @@ begin
 
 
            Modules^.Insert(UnitS);
            Modules^.Insert(UnitS);
            ProcessSymTable(UnitS,UnitS^.Items,T);
            ProcessSymTable(UnitS,UnitS^.Items,T);
-           if cs_local_browser in aktmoduleswitches then
+           if cs_local_browser in current_settings.moduleswitches then
              begin
              begin
                 t:=tsymtable(hp.localsymtable);
                 t:=tsymtable(hp.localsymtable);
                 if assigned(t) then
                 if assigned(t) then
@@ -1656,7 +1656,7 @@ begin
     end;
     end;
 
 
   hp:=tmodule(loaded_units.first);
   hp:=tmodule(loaded_units.first);
-  if (cs_browser in aktmoduleswitches) then
+  if (cs_browser in current_settings.moduleswitches) then
    while assigned(hp) do
    while assigned(hp) do
     begin
     begin
        t:=tsymtable(hp.globalsymtable);
        t:=tsymtable(hp.globalsymtable);
@@ -1683,7 +1683,7 @@ begin
        hp:=tmodule(hp.next);
        hp:=tmodule(hp.next);
     end;
     end;
 
 
-  if (cs_browser in aktmoduleswitches) then
+  if (cs_browser in current_settings.moduleswitches) then
     BuildObjectInfo;
     BuildObjectInfo;
   { can allways be done
   { can allways be done
     needed to know when recompilation of sources is necessary }
     needed to know when recompilation of sources is necessary }

+ 2 - 2
compiler/browlog.pas

@@ -429,7 +429,7 @@ implementation
       var
       var
         hp : tsym;
         hp : tsym;
       begin
       begin
-        if cs_browser in aktmoduleswitches then
+        if cs_browser in current_settings.moduleswitches then
          begin
          begin
            if assigned(p.name) then
            if assigned(p.name) then
              Browserlog.AddLog('---Symtable '+p.name^)
              Browserlog.AddLog('---Symtable '+p.name^)
@@ -485,7 +485,7 @@ implementation
             p:=tstoredsymtable(hp.globalsymtable);
             p:=tstoredsymtable(hp.globalsymtable);
             if assigned(p) then
             if assigned(p) then
               writesymtable(p);
               writesymtable(p);
-            if cs_local_browser in aktmoduleswitches then
+            if cs_local_browser in current_settings.moduleswitches then
               begin
               begin
                  p:=tstoredsymtable(hp.localsymtable);
                  p:=tstoredsymtable(hp.localsymtable);
                  if assigned(p) then
                  if assigned(p) then

+ 7 - 7
compiler/cgobj.pas

@@ -1798,7 +1798,7 @@ implementation
               { division by 1 returns result }
               { division by 1 returns result }
               if a = 1 then
               if a = 1 then
                 op:=OP_NONE
                 op:=OP_NONE
-              else if ispowerof2(int64(a), powerval) and not(cs_check_overflow in aktlocalswitches) then
+              else if ispowerof2(int64(a), powerval) and not(cs_check_overflow in current_settings.localswitches) then
                 begin
                 begin
                   a := powerval;
                   a := powerval;
                   op:= OP_SHR;
                   op:= OP_SHR;
@@ -1816,7 +1816,7 @@ implementation
                else
                else
                  if a=0 then
                  if a=0 then
                    op:=OP_MOVE
                    op:=OP_MOVE
-               else if ispowerof2(int64(a), powerval) and not(cs_check_overflow in aktlocalswitches)  then
+               else if ispowerof2(int64(a), powerval) and not(cs_check_overflow in current_settings.localswitches)  then
                  begin
                  begin
                    a := powerval;
                    a := powerval;
                    op:= OP_SHL;
                    op:= OP_SHL;
@@ -2625,7 +2625,7 @@ implementation
         from_signed, to_signed: boolean;
         from_signed, to_signed: boolean;
       begin
       begin
         { range checking on and range checkable value? }
         { range checking on and range checkable value? }
-        if not(cs_check_range in aktlocalswitches) or
+        if not(cs_check_range in current_settings.localswitches) or
            not(fromdef.deftype in [orddef,enumdef]) then
            not(fromdef.deftype in [orddef,enumdef]) then
           exit;
           exit;
 {$ifndef cpu64bit}
 {$ifndef cpu64bit}
@@ -2811,8 +2811,8 @@ implementation
         OKLabel : tasmlabel;
         OKLabel : tasmlabel;
         cgpara1 : TCGPara;
         cgpara1 : TCGPara;
       begin
       begin
-        if (cs_check_object in aktlocalswitches) or
-           (cs_check_range in aktlocalswitches) then
+        if (cs_check_object in current_settings.localswitches) or
+           (cs_check_range in current_settings.localswitches) then
          begin
          begin
            current_asmdata.getjumplabel(oklabel);
            current_asmdata.getjumplabel(oklabel);
            a_cmp_const_reg_label(list,OS_ADDR,OC_NE,0,reg,oklabel);
            a_cmp_const_reg_label(list,OS_ADDR,OC_NE,0,reg,oklabel);
@@ -2837,7 +2837,7 @@ implementation
         cgpara2.init;
         cgpara2.init;
         paramanager.getintparaloc(pocall_default,1,cgpara1);
         paramanager.getintparaloc(pocall_default,1,cgpara1);
         paramanager.getintparaloc(pocall_default,2,cgpara2);
         paramanager.getintparaloc(pocall_default,2,cgpara2);
-        if (cs_check_object in aktlocalswitches) then
+        if (cs_check_object in current_settings.localswitches) then
          begin
          begin
            reference_reset_symbol(hrefvmt,current_asmdata.RefAsmSymbol(objdef.vmt_mangledname),0);
            reference_reset_symbol(hrefvmt,current_asmdata.RefAsmSymbol(objdef.vmt_mangledname),0);
            paramanager.allocparaloc(list,cgpara2);
            paramanager.allocparaloc(list,cgpara2);
@@ -2851,7 +2851,7 @@ implementation
            deallocallcpuregisters(list);
            deallocallcpuregisters(list);
          end
          end
         else
         else
-         if (cs_check_range in aktlocalswitches) then
+         if (cs_check_range in current_settings.localswitches) then
           begin
           begin
             paramanager.allocparaloc(list,cgpara1);
             paramanager.allocparaloc(list,cgpara1);
             a_param_reg(list,OS_ADDR,reg,cgpara1);
             a_param_reg(list,OS_ADDR,reg,cgpara1);

+ 8 - 8
compiler/comprsrc.pas

@@ -92,10 +92,10 @@ begin
 {$ELSE USE_SYSUTILS}
 {$ELSE USE_SYSUTILS}
   fsplit(resbin,respath,n,e);
   fsplit(resbin,respath,n,e);
 {$ENDIF USE_SYSUTILS}
 {$ENDIF USE_SYSUTILS}
-  if (not resfound) and not(cs_link_nolink in aktglobalswitches) then
+  if (not resfound) and not(cs_link_nolink in current_settings.globalswitches) then
    begin
    begin
      Message(exec_e_res_not_found);
      Message(exec_e_res_not_found);
-     aktglobalswitches:=aktglobalswitches+[cs_link_nolink];
+     current_settings.globalswitches:=current_settings.globalswitches+[cs_link_nolink];
    end;
    end;
 {$IFDEF USE_SYSUTILS}
 {$IFDEF USE_SYSUTILS}
   srcfilepath := SplitPath(current_module.mainsource^);
   srcfilepath := SplitPath(current_module.mainsource^);
@@ -117,7 +117,7 @@ begin
      (srcfilepath<>'') then
      (srcfilepath<>'') then
     s:=s+' --include '+maybequoted(srcfilepath);
     s:=s+' --include '+maybequoted(srcfilepath);
 { Execute the command }
 { Execute the command }
-  if not (cs_link_nolink in aktglobalswitches) then
+  if not (cs_link_nolink in current_settings.globalswitches) then
    begin
    begin
      Message1(exec_i_compilingresource,fname);
      Message1(exec_i_compilingresource,fname);
      Message2(exec_d_resbin_params,resbin,s);
      Message2(exec_d_resbin_params,resbin,s);
@@ -127,13 +127,13 @@ begin
        if ExecuteProcess(resbin,s) <> 0 then
        if ExecuteProcess(resbin,s) <> 0 then
        begin
        begin
          Message(exec_e_error_while_linking);
          Message(exec_e_error_while_linking);
-         aktglobalswitches:=aktglobalswitches+[cs_link_nolink];
+         current_settings.globalswitches:=current_settings.globalswitches+[cs_link_nolink];
        end;
        end;
      except
      except
        on E:EOSError do
        on E:EOSError do
        begin
        begin
          Message(exec_e_cant_call_linker);
          Message(exec_e_cant_call_linker);
-         aktglobalswitches:=aktglobalswitches+[cs_link_nolink];
+         current_settings.globalswitches:=current_settings.globalswitches+[cs_link_nolink];
        end
        end
      end;
      end;
 {$ELSE USE_SYSUTILS}
 {$ELSE USE_SYSUTILS}
@@ -143,18 +143,18 @@ begin
      if (doserror<>0) then
      if (doserror<>0) then
       begin
       begin
         Message(exec_e_cant_call_linker);
         Message(exec_e_cant_call_linker);
-        aktglobalswitches:=aktglobalswitches+[cs_link_nolink];
+        current_settings.globalswitches:=current_settings.globalswitches+[cs_link_nolink];
       end
       end
      else
      else
       if (dosexitcode<>0) then
       if (dosexitcode<>0) then
        begin
        begin
          Message(exec_e_error_while_linking);
          Message(exec_e_error_while_linking);
-         aktglobalswitches:=aktglobalswitches+[cs_link_nolink];
+         current_settings.globalswitches:=current_settings.globalswitches+[cs_link_nolink];
        end;
        end;
 {$ENDIF USE_SYSUTILS}
 {$ENDIF USE_SYSUTILS}
     end;
     end;
   { Update asmres when externmode is set }
   { Update asmres when externmode is set }
-  if cs_link_nolink in aktglobalswitches then
+  if cs_link_nolink in current_settings.globalswitches then
     AsmRes.AddLinkCommand(resbin,s,'');
     AsmRes.AddLinkCommand(resbin,s,'');
   if ObjUsed then
   if ObjUsed then
     current_module.linkotherofiles.add(resobj,link_always);
     current_module.linkotherofiles.add(resobj,link_always);

+ 1 - 1
compiler/dbgdwarf.pas

@@ -1531,7 +1531,7 @@ end;
                     templist.concat(Tai_stab.create(stab_stabs,strpnew(
                     templist.concat(Tai_stab.create(stab_stabs,strpnew(
                        '"'+pd.procsym.name+':'+hs+def_stab_number(pd.returndef)+'",'+
                        '"'+pd.procsym.name+':'+hs+def_stab_number(pd.returndef)+'",'+
                        tostr(N_tsym)+',0,0,'+tostr(tabstractnormalvarsym(pd.funcretsym).localloc.reference.offset))));
                        tostr(N_tsym)+',0,0,'+tostr(tabstractnormalvarsym(pd.funcretsym).localloc.reference.offset))));
-                    if (m_result in aktmodeswitches) then
+                    if (m_result in current_settings.modeswitches) then
                       templist.concat(Tai_stab.create(stab_stabs,strpnew(
                       templist.concat(Tai_stab.create(stab_stabs,strpnew(
                          '"RESULT:'+hs+def_stab_number(pd.returndef)+'",'+
                          '"RESULT:'+hs+def_stab_number(pd.returndef)+'",'+
                          tostr(N_tsym)+',0,0,'+tostr(tabstractnormalvarsym(pd.funcretsym).localloc.reference.offset))));
                          tostr(N_tsym)+',0,0,'+tostr(tabstractnormalvarsym(pd.funcretsym).localloc.reference.offset))));

+ 4 - 4
compiler/dbgstabs.pas

@@ -518,7 +518,7 @@ implementation
 
 
         function orddef_stabstr(def:torddef):pchar;
         function orddef_stabstr(def:torddef):pchar;
           begin
           begin
-            if cs_gdb_valgrind in aktglobalswitches then
+            if cs_gdb_valgrind in current_settings.globalswitches then
               begin
               begin
                 case def.typ of
                 case def.typ of
                   uvoid :
                   uvoid :
@@ -615,7 +615,7 @@ implementation
              begin
              begin
                if (def.owner.symtabletype = objectsymtable) then
                if (def.owner.symtabletype = objectsymtable) then
                  obj := def.owner.name^+'__'+def.procsym.name;
                  obj := def.owner.name^+'__'+def.procsym.name;
-               if not(cs_gdb_valgrind in aktglobalswitches) and
+               if not(cs_gdb_valgrind in current_settings.globalswitches) and
                   (def.owner.symtabletype=localsymtable) and
                   (def.owner.symtabletype=localsymtable) and
                   assigned(def.owner.defowner) and
                   assigned(def.owner.defowner) and
                   assigned(tprocdef(def.owner.defowner).procsym) then
                   assigned(tprocdef(def.owner.defowner).procsym) then
@@ -967,7 +967,7 @@ implementation
                     templist.concat(Tai_stab.create(stab_stabs,strpnew(
                     templist.concat(Tai_stab.create(stab_stabs,strpnew(
                        '"'+pd.procsym.name+':'+hs+def_stab_number(pd.returndef)+'",'+
                        '"'+pd.procsym.name+':'+hs+def_stab_number(pd.returndef)+'",'+
                        tostr(N_tsym)+',0,0,'+tostr(tabstractnormalvarsym(pd.funcretsym).localloc.reference.offset))));
                        tostr(N_tsym)+',0,0,'+tostr(tabstractnormalvarsym(pd.funcretsym).localloc.reference.offset))));
-                    if (m_result in aktmodeswitches) then
+                    if (m_result in current_settings.modeswitches) then
                       templist.concat(Tai_stab.create(stab_stabs,strpnew(
                       templist.concat(Tai_stab.create(stab_stabs,strpnew(
                          '"RESULT:'+hs+def_stab_number(pd.returndef)+'",'+
                          '"RESULT:'+hs+def_stab_number(pd.returndef)+'",'+
                          tostr(N_tsym)+',0,0,'+tostr(tabstractnormalvarsym(pd.funcretsym).localloc.reference.offset))));
                          tostr(N_tsym)+',0,0,'+tostr(tabstractnormalvarsym(pd.funcretsym).localloc.reference.offset))));
@@ -1243,7 +1243,7 @@ implementation
               the N_Func for the function itself.
               the N_Func for the function itself.
               Valgrind does not support constants }
               Valgrind does not support constants }
             if (sym.owner.symtabletype=parasymtable) or
             if (sym.owner.symtabletype=parasymtable) or
-               (cs_gdb_valgrind in aktglobalswitches) then
+               (cs_gdb_valgrind in current_settings.globalswitches) then
               exit;
               exit;
             case sym.consttyp of
             case sym.consttyp of
               conststring:
               conststring:

+ 24 - 24
compiler/defcmp.pas

@@ -288,7 +288,7 @@ implementation
                    end;
                    end;
                  arraydef :
                  arraydef :
                    begin
                    begin
-                     if (m_mac in aktmodeswitches) and
+                     if (m_mac in current_settings.modeswitches) and
                         (fromtreetype=stringconstn) then
                         (fromtreetype=stringconstn) then
                        begin
                        begin
                          eq:=te_convert_l3;
                          eq:=te_convert_l3;
@@ -370,7 +370,7 @@ implementation
                         doconv:=tc_char_2_string;
                         doconv:=tc_char_2_string;
                         eq:=te_convert_l1;
                         eq:=te_convert_l1;
                       end;
                       end;
-                     if (m_mac in aktmodeswitches) and
+                     if (m_mac in current_settings.modeswitches) and
                         is_integer(def_from) and
                         is_integer(def_from) and
                         (def_from.size = 4) then
                         (def_from.size = 4) then
                        begin
                        begin
@@ -388,10 +388,10 @@ implementation
                           begin
                           begin
                             doconv:=tc_string_2_string;
                             doconv:=tc_string_2_string;
                             { prefered string type depends on the $H switch }
                             { prefered string type depends on the $H switch }
-                            if not(cs_ansistrings in aktlocalswitches) and
+                            if not(cs_ansistrings in current_settings.localswitches) and
                                (tstringdef(def_to).string_typ=st_shortstring) then
                                (tstringdef(def_to).string_typ=st_shortstring) then
                               eq:=te_equal
                               eq:=te_equal
-                            else if (cs_ansistrings in aktlocalswitches) and
+                            else if (cs_ansistrings in current_settings.localswitches) and
                                (tstringdef(def_to).string_typ=st_ansistring) then
                                (tstringdef(def_to).string_typ=st_ansistring) then
                               eq:=te_equal
                               eq:=te_equal
                             else if tstringdef(def_to).string_typ=st_widestring then
                             else if tstringdef(def_to).string_typ=st_widestring then
@@ -453,7 +453,7 @@ implementation
                    begin
                    begin
                    { pchar can be assigned to short/ansistrings,
                    { pchar can be assigned to short/ansistrings,
                      but not in tp7 compatible mode }
                      but not in tp7 compatible mode }
-                     if not(m_tp7 in aktmodeswitches) then
+                     if not(m_tp7 in current_settings.modeswitches) then
                        begin
                        begin
                           if is_pchar(def_from) then
                           if is_pchar(def_from) then
                            begin
                            begin
@@ -461,9 +461,9 @@ implementation
                              { prefer ansistrings because pchars can overflow shortstrings, }
                              { prefer ansistrings because pchars can overflow shortstrings, }
                              { but only if ansistrings are the default (JM)                 }
                              { but only if ansistrings are the default (JM)                 }
                              if (is_shortstring(def_to) and
                              if (is_shortstring(def_to) and
-                                 not(cs_ansistrings in aktlocalswitches)) or
+                                 not(cs_ansistrings in current_settings.localswitches)) or
                                 (is_ansistring(def_to) and
                                 (is_ansistring(def_to) and
-                                 (cs_ansistrings in aktlocalswitches)) then
+                                 (cs_ansistrings in current_settings.localswitches)) then
                                eq:=te_convert_l1
                                eq:=te_convert_l1
                              else
                              else
                                eq:=te_convert_l2;
                                eq:=te_convert_l2;
@@ -488,7 +488,7 @@ implementation
                    begin { ordinal to real }
                    begin { ordinal to real }
                      { only for implicit and internal typecasts in tp/delphi }
                      { only for implicit and internal typecasts in tp/delphi }
                      if (([cdo_explicit,cdo_internal] * cdoptions <> [cdo_explicit]) or
                      if (([cdo_explicit,cdo_internal] * cdoptions <> [cdo_explicit]) or
-                         ([m_tp7,m_delphi] * aktmodeswitches = [])) and
+                         ([m_tp7,m_delphi] * current_settings.modeswitches = [])) and
                         (is_integer(def_from) or
                         (is_integer(def_from) or
                          (is_currency(def_from) and
                          (is_currency(def_from) and
                           (s64currencytype.deftype = floatdef))) then
                           (s64currencytype.deftype = floatdef))) then
@@ -514,7 +514,7 @@ implementation
                        begin
                        begin
                          if (fromtreetype=realconstn) or
                          if (fromtreetype=realconstn) or
                             not((cdo_explicit in cdoptions) and
                             not((cdo_explicit in cdoptions) and
-                                (m_delphi in aktmodeswitches)) then
+                                (m_delphi in current_settings.modeswitches)) then
                            begin
                            begin
                              doconv:=tc_real_2_real;
                              doconv:=tc_real_2_real;
                              { do we loose precision? }
                              { do we loose precision? }
@@ -582,7 +582,7 @@ implementation
                    begin
                    begin
                      { ugly, but delphi allows it }
                      { ugly, but delphi allows it }
                      if (cdo_explicit in cdoptions) and
                      if (cdo_explicit in cdoptions) and
-                       (m_delphi in aktmodeswitches) and
+                       (m_delphi in current_settings.modeswitches) and
                        (eq=te_incompatible) then
                        (eq=te_incompatible) then
                        begin
                        begin
                          doconv:=tc_int_2_int;
                          doconv:=tc_int_2_int;
@@ -634,7 +634,7 @@ implementation
                                if is_dynamic_array(def_from) then
                                if is_dynamic_array(def_from) then
                                  eq:=te_equal
                                  eq:=te_equal
                                { fpc modes only: array -> dyn. array }
                                { fpc modes only: array -> dyn. array }
-                               else if (aktmodeswitches*[m_objfpc,m_fpc]<>[]) and
+                               else if (current_settings.modeswitches*[m_objfpc,m_fpc]<>[]) and
                                  not(is_special_array(def_from)) and
                                  not(is_special_array(def_from)) and
                                  is_zero_based_array(def_from) then
                                  is_zero_based_array(def_from) then
                                  begin
                                  begin
@@ -730,8 +730,8 @@ implementation
                               end
                               end
                             else
                             else
                             { array -> array }
                             { array -> array }
-                             if not(m_tp7 in aktmodeswitches) and
-                                not(m_delphi in aktmodeswitches) and
+                             if not(m_tp7 in current_settings.modeswitches) and
+                                not(m_delphi in current_settings.modeswitches) and
                                 (tarraydef(def_from).lowrange=tarraydef(def_to).lowrange) and
                                 (tarraydef(def_from).lowrange=tarraydef(def_to).lowrange) and
                                 (tarraydef(def_from).highrange=tarraydef(def_to).highrange) and
                                 (tarraydef(def_from).highrange=tarraydef(def_to).highrange) and
                                 equal_defs(tarraydef(def_from).elementdef,tarraydef(def_to).elementdef) and
                                 equal_defs(tarraydef(def_from).elementdef,tarraydef(def_to).elementdef) and
@@ -876,7 +876,7 @@ implementation
                            eq:=te_convert_l1;
                            eq:=te_convert_l1;
                          end
                          end
                         else
                         else
-                         if (m_delphi in aktmodeswitches) and is_integer(def_from) then
+                         if (m_delphi in current_settings.modeswitches) and is_integer(def_from) then
                           begin
                           begin
                             doconv:=tc_cord_2_pointer;
                             doconv:=tc_cord_2_pointer;
                             eq:=te_convert_l2;
                             eq:=te_convert_l2;
@@ -889,7 +889,7 @@ implementation
                         not is_void(def_from) and
                         not is_void(def_from) and
                         (
                         (
                          (
                          (
-                          (m_delphi in aktmodeswitches) and
+                          (m_delphi in current_settings.modeswitches) and
                           (cdo_explicit in cdoptions)
                           (cdo_explicit in cdoptions)
                          ) or
                          ) or
                          (cdo_internal in cdoptions)
                          (cdo_internal in cdoptions)
@@ -925,7 +925,7 @@ implementation
                         end
                         end
                      else
                      else
                        { dynamic array to pointer, delphi only }
                        { dynamic array to pointer, delphi only }
-                       if (m_delphi in aktmodeswitches) and
+                       if (m_delphi in current_settings.modeswitches) and
                           is_dynamic_array(def_from) then
                           is_dynamic_array(def_from) then
                         begin
                         begin
                           eq:=te_equal;
                           eq:=te_equal;
@@ -998,7 +998,7 @@ implementation
                      { procedure variable can be assigned to an void pointer,
                      { procedure variable can be assigned to an void pointer,
                        this not allowed for methodpointers }
                        this not allowed for methodpointers }
                      if (is_void(tpointerdef(def_to).pointeddef) or
                      if (is_void(tpointerdef(def_to).pointeddef) or
-                         (m_mac_procvar in aktmodeswitches)) and
+                         (m_mac_procvar in current_settings.modeswitches)) and
                         tprocvardef(def_from).is_addressonly then
                         tprocvardef(def_from).is_addressonly then
                       begin
                       begin
                         doconv:=tc_equal;
                         doconv:=tc_equal;
@@ -1009,7 +1009,7 @@ implementation
                    begin
                    begin
                      { procedure variable can be assigned to an void pointer,
                      { procedure variable can be assigned to an void pointer,
                        this not allowed for methodpointers }
                        this not allowed for methodpointers }
-                     if (m_mac_procvar in aktmodeswitches) and
+                     if (m_mac_procvar in current_settings.modeswitches) and
                         tprocdef(def_from).is_addressonly then
                         tprocdef(def_from).is_addressonly then
                       begin
                       begin
                         doconv:=tc_proc_2_procvar;
                         doconv:=tc_proc_2_procvar;
@@ -1070,8 +1070,8 @@ implementation
                  procdef :
                  procdef :
                    begin
                    begin
                      { proc -> procvar }
                      { proc -> procvar }
-                     if (m_tp_procvar in aktmodeswitches) or
-                        (m_mac_procvar in aktmodeswitches) then
+                     if (m_tp_procvar in current_settings.modeswitches) or
+                        (m_mac_procvar in current_settings.modeswitches) then
                       begin
                       begin
                         subeq:=proc_to_procvar_equal(tprocdef(def_from),tprocvardef(def_to));
                         subeq:=proc_to_procvar_equal(tprocdef(def_from),tprocvardef(def_to));
                         if subeq>te_incompatible then
                         if subeq>te_incompatible then
@@ -1097,7 +1097,7 @@ implementation
                      else
                      else
                       { for example delphi allows the assignement from pointers }
                       { for example delphi allows the assignement from pointers }
                       { to procedure variables                                  }
                       { to procedure variables                                  }
-                      if (m_pointer_2_procedure in aktmodeswitches) and
+                      if (m_pointer_2_procedure in current_settings.modeswitches) and
                          is_void(tpointerdef(def_from).pointeddef) and
                          is_void(tpointerdef(def_from).pointeddef) and
                          tprocvardef(def_to).is_addressonly then
                          tprocvardef(def_to).is_addressonly then
                        begin
                        begin
@@ -1122,7 +1122,7 @@ implementation
                 if is_class_or_interface(def_to) then
                 if is_class_or_interface(def_to) then
                  begin
                  begin
                    { void pointer also for delphi mode }
                    { void pointer also for delphi mode }
-                   if (m_delphi in aktmodeswitches) and
+                   if (m_delphi in current_settings.modeswitches) and
                       is_voidpointer(def_from) then
                       is_voidpointer(def_from) then
                     begin
                     begin
                       doconv:=tc_equal;
                       doconv:=tc_equal;
@@ -1172,7 +1172,7 @@ implementation
                    { ugly, but delphi allows it }
                    { ugly, but delphi allows it }
                    else if (eq=te_incompatible) and
                    else if (eq=te_incompatible) and
                      (def_from.deftype=orddef) and
                      (def_from.deftype=orddef) and
-                     (m_delphi in aktmodeswitches) and
+                     (m_delphi in current_settings.modeswitches) and
                      (cdo_explicit in cdoptions) then
                      (cdo_explicit in cdoptions) then
                      begin
                      begin
                        doconv:=tc_int_2_int;
                        doconv:=tc_int_2_int;
@@ -1523,7 +1523,7 @@ implementation
          { check return value and options, methodpointer is already checked }
          { check return value and options, methodpointer is already checked }
          po_comp:=[po_staticmethod,po_interrupt,
          po_comp:=[po_staticmethod,po_interrupt,
                    po_iocheck,po_varargs];
                    po_iocheck,po_varargs];
-         if (m_delphi in aktmodeswitches) then
+         if (m_delphi in current_settings.modeswitches) then
            exclude(po_comp,po_varargs);
            exclude(po_comp,po_varargs);
          if (def1.proccalloption=def2.proccalloption) and
          if (def1.proccalloption=def2.proccalloption) and
             ((po_comp * def1.procoptions)= (po_comp * def2.procoptions)) and
             ((po_comp * def1.procoptions)= (po_comp * def2.procoptions)) and

+ 5 - 5
compiler/defutil.pas

@@ -711,7 +711,7 @@ implementation
                    l:=0; }
                    l:=0; }
                    if not explicit then
                    if not explicit then
                     begin
                     begin
-                      if (cs_check_range in aktlocalswitches) then
+                      if (cs_check_range in current_settings.localswitches) then
                         Message(parser_e_range_check_error)
                         Message(parser_e_range_check_error)
                       else
                       else
                         Message(parser_w_range_check_error);
                         Message(parser_w_range_check_error);
@@ -729,8 +729,8 @@ implementation
                       if ((def.deftype=enumdef) and
                       if ((def.deftype=enumdef) and
                           { delphi allows range check errors in
                           { delphi allows range check errors in
                            enumeration type casts FK }
                            enumeration type casts FK }
-                          not(m_delphi in aktmodeswitches)) or
-                         (cs_check_range in aktlocalswitches) then
+                          not(m_delphi in current_settings.modeswitches)) or
+                         (cs_check_range in current_settings.localswitches) then
                         Message(parser_e_range_check_error)
                         Message(parser_e_range_check_error)
                       else
                       else
                         Message(parser_w_range_check_error);
                         Message(parser_w_range_check_error);
@@ -853,7 +853,7 @@ implementation
     function is_mmx_able_array(p : tdef) : boolean;
     function is_mmx_able_array(p : tdef) : boolean;
       begin
       begin
 {$ifdef SUPPORT_MMX}
 {$ifdef SUPPORT_MMX}
-         if (cs_mmx_saturation in aktlocalswitches) then
+         if (cs_mmx_saturation in current_settings.localswitches) then
            begin
            begin
               is_mmx_able_array:=(p.deftype=arraydef) and
               is_mmx_able_array:=(p.deftype=arraydef) and
                 not(is_special_array(p)) and
                 not(is_special_array(p)) and
@@ -967,7 +967,7 @@ implementation
                 result:=int_cgsize(def.size);
                 result:=int_cgsize(def.size);
             end;
             end;
           floatdef:
           floatdef:
-            if cs_fp_emulation in aktmoduleswitches then
+            if cs_fp_emulation in current_settings.moduleswitches then
               result:=int_cgsize(def.size)
               result:=int_cgsize(def.size)
             else
             else
               result:=tfloat2tcgsize[tfloatdef(def).typ];
               result:=tfloat2tcgsize[tfloatdef(def).typ];

+ 8 - 8
compiler/fppu.pas

@@ -230,7 +230,7 @@ uses
        { check if floating point emulation is on?}
        { check if floating point emulation is on?}
        { fpu emulation isn't unit levelwise
        { fpu emulation isn't unit levelwise
         if ((ppufile.header.flags and uf_fpu_emulation)<>0) and
         if ((ppufile.header.flags and uf_fpu_emulation)<>0) and
-            (cs_fp_emulation in aktmoduleswitches) then
+            (cs_fp_emulation in current_settings.moduleswitches) then
          begin
          begin
            ppufile.free;
            ppufile.free;
            ppufile:=nil;
            ppufile:=nil;
@@ -302,7 +302,7 @@ uses
               { Check for .pas }
               { Check for .pas }
               Found:=UnitExists(pasext,hs);
               Found:=UnitExists(pasext,hs);
             end;
             end;
-           if not Found and (m_mac in aktmodeswitches) then
+           if not Found and (m_mac in current_settings.modeswitches) then
             begin
             begin
               { Check for .p, if mode is macpas}
               { Check for .p, if mode is macpas}
               Found:=UnitExists(pext,hs);
               Found:=UnitExists(pext,hs);
@@ -384,7 +384,7 @@ uses
                Message1(unit_t_unitsearch,AddExtension(sourcefn^,pasext));
                Message1(unit_t_unitsearch,AddExtension(sourcefn^,pasext));
                fnd:=FindFile(AddExtension(sourcefn^,pasext),'',hs);
                fnd:=FindFile(AddExtension(sourcefn^,pasext),'',hs);
              end;
              end;
-            if not fnd and ((m_mac in aktmodeswitches) or (tf_p_ext_support in target_info.flags)) then
+            if not fnd and ((m_mac in current_settings.modeswitches) or (tf_p_ext_support in target_info.flags)) then
              begin
              begin
                Message1(unit_t_unitsearch,AddExtension(sourcefn^,pext));
                Message1(unit_t_unitsearch,AddExtension(sourcefn^,pext));
                fnd:=FindFile(AddExtension(sourcefn^,pext),'',hs);
                fnd:=FindFile(AddExtension(sourcefn^,pext),'',hs);
@@ -888,7 +888,7 @@ uses
              ibmodulename :
              ibmodulename :
                begin
                begin
                  newmodulename:=ppufile.getstring;
                  newmodulename:=ppufile.getstring;
-                 if (cs_check_unit_name in aktglobalswitches) and
+                 if (cs_check_unit_name in current_settings.globalswitches) and
                     (upper(newmodulename)<>modulename^) then
                     (upper(newmodulename)<>modulename^) then
                    Message2(unit_f_unit_name_error,realmodulename^,newmodulename);
                    Message2(unit_f_unit_name_error,realmodulename^,newmodulename);
                  stringdispose(modulename);
                  stringdispose(modulename);
@@ -982,16 +982,16 @@ uses
          Message1(unit_u_ppu_write,realmodulename^);
          Message1(unit_u_ppu_write,realmodulename^);
 
 
          { create unit flags }
          { create unit flags }
-         if cs_browser in aktmoduleswitches then
+         if cs_browser in current_settings.moduleswitches then
           flags:=flags or uf_has_browser;
           flags:=flags or uf_has_browser;
-         if cs_local_browser in aktmoduleswitches then
+         if cs_local_browser in current_settings.moduleswitches then
           flags:=flags or uf_local_browser;
           flags:=flags or uf_local_browser;
          if do_release then
          if do_release then
           flags:=flags or uf_release;
           flags:=flags or uf_release;
          if assigned(localsymtable) then
          if assigned(localsymtable) then
            flags:=flags or uf_local_symtable;
            flags:=flags or uf_local_symtable;
 {$ifdef cpufpemu}
 {$ifdef cpufpemu}
-         if (cs_fp_emulation in aktmoduleswitches) then
+         if (cs_fp_emulation in current_settings.moduleswitches) then
            flags:=flags or uf_fpu_emulation;
            flags:=flags or uf_fpu_emulation;
 {$endif cpufpemu}
 {$endif cpufpemu}
 {$ifdef Test_Double_checksum_write}
 {$ifdef Test_Double_checksum_write}
@@ -1032,7 +1032,7 @@ uses
 
 
          { generate implementation deref data, the interface deref data is
          { generate implementation deref data, the interface deref data is
            already generated when calculating the interface crc }
            already generated when calculating the interface crc }
-         if (cs_compilesystem in aktmoduleswitches) then
+         if (cs_compilesystem in current_settings.moduleswitches) then
            begin
            begin
              tstoredsymtable(globalsymtable).buildderef;
              tstoredsymtable(globalsymtable).buildderef;
              derefdataintflen:=derefdata.size;
              derefdataintflen:=derefdata.size;

+ 1 - 1
compiler/gendef.pas

@@ -69,7 +69,7 @@ end;
 destructor tdeffile.destroy;
 destructor tdeffile.destroy;
 begin
 begin
   if WrittenOnDisk and
   if WrittenOnDisk and
-     not(cs_link_nolink in aktglobalswitches) then
+     not(cs_link_nolink in current_settings.globalswitches) then
    RemoveFile(FName);
    RemoveFile(FName);
   importlist.Free;
   importlist.Free;
   exportlist.Free;
   exportlist.Free;

+ 64 - 75
compiler/globals.pas

@@ -113,6 +113,32 @@ interface
          fileindex : word;
          fileindex : word;
          { moduleindex : word; }
          { moduleindex : word; }
        end;
        end;
+       
+       tcodepagestring = string[20];
+
+       tsettings = record
+         globalswitches  : tglobalswitches;
+         moduleswitches  : tmoduleswitches;
+         localswitches   : tlocalswitches;
+         modeswitches    : tmodeswitches;
+         optimizerswitches : toptimizerswitches;
+         { 0: old behaviour for sets <=256 elements
+           >0: round to this size }
+         setalloc,
+         packenum        : shortint;
+         alignment       : talignmentinfo;
+         cputype,
+         optimizecputype : tcputype;
+         fputype         : tfputype;
+         asmmode         : tasmmode;
+         interfacetype   : tinterfacetypes;
+         defproccall     : tproccalloption;
+         sourcecodepage  : tcodepagestring;
+
+         packrecords     : shortint;
+         maxfpuregisters : byte;
+       end;
+
 
 
        TSearchPathList = class(TStringList)
        TSearchPathList = class(TStringList)
          procedure AddPath(s:string;addfirst:boolean);overload;
          procedure AddPath(s:string;addfirst:boolean);overload;
@@ -121,8 +147,6 @@ interface
          function  FindFile(const f : string;var foundfile:string):boolean;
          function  FindFile(const f : string;var foundfile:string):boolean;
        end;
        end;
 
 
-       tcodepagestring = string[20];
-
     var
     var
        { specified inputfile }
        { specified inputfile }
        inputdir          : dirstr;
        inputdir          : dirstr;
@@ -216,46 +240,11 @@ interface
        LinkLibraryAliases : TLinkStrMap;
        LinkLibraryAliases : TLinkStrMap;
        LinkLibraryOrder   : TLinkStrMap;
        LinkLibraryOrder   : TLinkStrMap;
 
 
-
-     { commandline values }
-       initglobalswitches : tglobalswitches;
-       initmoduleswitches : tmoduleswitches;
-       initlocalswitches  : tlocalswitches;
-       initmodeswitches   : tmodeswitches;
-       initoptimizerswitches : toptimizerswitches;
-       { 0: old behaviour for sets <=256 elements
-         >0: round to this size }
-       initsetalloc,
-       initpackenum       : shortint;
-       initalignment      : talignmentinfo;
-       initcputype,
-       initoptimizecputype : tcputype;
-       initfputype        : tfputype;
-       initasmmode        : tasmmode;
-       initinterfacetype  : tinterfacetypes;
-       initdefproccall    : tproccalloption;
-       initsourcecodepage : tcodepagestring;
-
-     { current state values }
-       aktglobalswitches  : tglobalswitches;
-       aktmoduleswitches  : tmoduleswitches;
-       aktlocalswitches   : tlocalswitches;
-       aktoptimizerswitches : toptimizerswitches;
-       nextaktlocalswitches : tlocalswitches;
+       init_settings,
+       current_settings   : tsettings;
+       
+       nextlocalswitches : tlocalswitches;
        localswitcheschanged : boolean;
        localswitcheschanged : boolean;
-       aktmodeswitches    : tmodeswitches;
-       aktsetalloc,
-       aktpackrecords,
-       aktpackenum        : shortint;
-       aktmaxfpuregisters : longint;
-       aktalignment       : talignmentinfo;
-       aktcputype,
-       aktoptimizecputype      : tcputype;
-       aktfputype         : tfputype;
-       aktasmmode         : tasmmode;
-       aktinterfacetype   : tinterfacetypes;
-       aktdefproccall     : tproccalloption;
-       aktsourcecodepage  : tcodepagestring;
 
 
      { Memory sizes }
      { Memory sizes }
        heapsize,
        heapsize,
@@ -2101,14 +2090,14 @@ end;
     function var_align(siz: shortint): shortint;
     function var_align(siz: shortint): shortint;
       begin
       begin
         siz := size_2_align(siz);
         siz := size_2_align(siz);
-        var_align := used_align(siz,aktalignment.varalignmin,aktalignment.varalignmax);
+        var_align := used_align(siz,current_settings.alignment.varalignmin,current_settings.alignment.varalignmax);
       end;
       end;
 
 
 
 
     function const_align(siz: shortint): shortint;
     function const_align(siz: shortint): shortint;
       begin
       begin
         siz := size_2_align(siz);
         siz := size_2_align(siz);
-        const_align := used_align(siz,aktalignment.constalignmin,aktalignment.constalignmax);
+        const_align := used_align(siz,current_settings.alignment.constalignmin,current_settings.alignment.constalignmax);
       end;
       end;
 
 
 
 
@@ -2251,55 +2240,55 @@ end;
         apptype:=app_cui;
         apptype:=app_cui;
 
 
         { Init values }
         { Init values }
-        initmodeswitches:=fpcmodeswitches;
-        initlocalswitches:=[cs_check_io,cs_typed_const_writable];
-        initmoduleswitches:=[cs_extsyntax,cs_implicit_exceptions];
-        initglobalswitches:=[cs_check_unit_name,cs_link_static];
-        initoptimizerswitches:=[];
-        initsourcecodepage:='8859-1';
-        initpackenum:=4;
-        initsetalloc:=0;
-        fillchar(initalignment,sizeof(talignmentinfo),0);
+        init_settings.modeswitches:=fpcmodeswitches;
+        init_settings.localswitches:=[cs_check_io,cs_typed_const_writable];
+        init_settings.moduleswitches:=[cs_extsyntax,cs_implicit_exceptions];
+        init_settings.globalswitches:=[cs_check_unit_name,cs_link_static];
+        init_settings.optimizerswitches:=[];
+        init_settings.sourcecodepage:='8859-1';
+        init_settings.packenum:=4;
+        init_settings.setalloc:=0;
+        fillchar(init_settings.alignment,sizeof(talignmentinfo),0);
         { might be overridden later }
         { might be overridden later }
-        initasmmode:=asmmode_standard;
-        initcputype:=cpu_none;
-        initoptimizecputype:=cpu_none;
-        initfputype:=fpu_none;
-        initinterfacetype:=it_interfacecom;
-        initdefproccall:=pocall_default;
+        init_settings.asmmode:=asmmode_standard;
+        init_settings.cputype:=cpu_none;
+        init_settings.optimizecputype:=cpu_none;
+        init_settings.fputype:=fpu_none;
+        init_settings.interfacetype:=it_interfacecom;
+        init_settings.defproccall:=pocall_default;
 
 
         { Target specific defaults, these can override previous default options }
         { Target specific defaults, these can override previous default options }
 {$ifdef i386}
 {$ifdef i386}
-        initcputype:=cpu_Pentium;
-        initoptimizecputype:=cpu_Pentium3;
-        initfputype:=fpu_x87;
+        init_settings.cputype:=cpu_Pentium;
+        init_settings.optimizecputype:=cpu_Pentium3;
+        init_settings.fputype:=fpu_x87;
 {$endif i386}
 {$endif i386}
 {$ifdef m68k}
 {$ifdef m68k}
-        initcputype:=cpu_MC68020;
-        initfputype:=fpu_soft;
+        init_settings.cputype:=cpu_MC68020;
+        init_settings.fputype:=fpu_soft;
 {$endif m68k}
 {$endif m68k}
 {$ifdef powerpc}
 {$ifdef powerpc}
-        initcputype:=cpu_PPC604;
-        initfputype:=fpu_standard;
+        init_settings.cputype:=cpu_PPC604;
+        init_settings.fputype:=fpu_standard;
 {$endif powerpc}
 {$endif powerpc}
 {$ifdef POWERPC64}
 {$ifdef POWERPC64}
-        initcputype:=cpu_PPC970;
-        initfputype:=fpu_standard;
+        init_settings.cputype:=cpu_PPC970;
+        init_settings.fputype:=fpu_standard;
 {$endif POWERPC64}
 {$endif POWERPC64}
 {$ifdef sparc}
 {$ifdef sparc}
-        initcputype:=cpu_SPARC_V8;
-        initfputype:=fpu_hard;
+        init_settings.cputype:=cpu_SPARC_V8;
+        init_settings.fputype:=fpu_hard;
 {$endif sparc}
 {$endif sparc}
 {$ifdef arm}
 {$ifdef arm}
-        initcputype:=cpu_armv3;
-        initfputype:=fpu_fpa;
+        init_settings.cputype:=cpu_armv3;
+        init_settings.fputype:=fpu_fpa;
 {$endif arm}
 {$endif arm}
 {$ifdef x86_64}
 {$ifdef x86_64}
-        initcputype:=cpu_athlon64;
-        initfputype:=fpu_sse64;
+        init_settings.cputype:=cpu_athlon64;
+        init_settings.fputype:=fpu_sse64;
 {$endif x86_64}
 {$endif x86_64}
-        if initoptimizecputype=cpu_none then
-          initoptimizecputype:=initcputype;
+        if init_settings.optimizecputype=cpu_none then
+          init_settings.optimizecputype:=init_settings.cputype;
 
 
         LinkLibraryAliases :=TLinkStrMap.Create;
         LinkLibraryAliases :=TLinkStrMap.Create;
         LinkLibraryOrder   :=TLinkStrMap.Create;
         LinkLibraryOrder   :=TLinkStrMap.Create;

+ 17 - 17
compiler/htypechk.pas

@@ -230,9 +230,9 @@ implementation
             arraydef :
             arraydef :
               begin
               begin
                 { not vector/mmx }
                 { not vector/mmx }
-                if ((cs_mmx in aktlocalswitches) and
+                if ((cs_mmx in current_settings.localswitches) and
                    is_mmx_able_array(ld)) or
                    is_mmx_able_array(ld)) or
-                   ((cs_support_vectors in aktglobalswitches) and
+                   ((cs_support_vectors in current_settings.globalswitches) and
                    is_vector(ld)) then
                    is_vector(ld)) then
                  begin
                  begin
                    allowed:=false;
                    allowed:=false;
@@ -326,7 +326,7 @@ implementation
                 exit;
                 exit;
 
 
 {$ifdef SUPPORT_MMX}
 {$ifdef SUPPORT_MMX}
-              if (cs_mmx in aktlocalswitches) and
+              if (cs_mmx in current_settings.localswitches) and
                  is_mmx_able_array(ld) then
                  is_mmx_able_array(ld) then
                 exit;
                 exit;
 {$endif SUPPORT_MMX}
 {$endif SUPPORT_MMX}
@@ -340,7 +340,7 @@ implementation
                 exit;
                 exit;
 
 
 {$ifdef SUPPORT_MMX}
 {$ifdef SUPPORT_MMX}
-              if (cs_mmx in aktlocalswitches) and
+              if (cs_mmx in current_settings.localswitches) and
                  is_mmx_able_array(ld) then
                  is_mmx_able_array(ld) then
                 exit;
                 exit;
 {$endif SUPPORT_MMX}
 {$endif SUPPORT_MMX}
@@ -742,8 +742,8 @@ implementation
       begin
       begin
         result:=false;
         result:=false;
         { remove voidpointer typecast for tp procvars }
         { remove voidpointer typecast for tp procvars }
-        if ((m_tp_procvar in aktmodeswitches) or
-            (m_mac_procvar in aktmodeswitches)) and
+        if ((m_tp_procvar in current_settings.modeswitches) or
+            (m_mac_procvar in current_settings.modeswitches)) and
            (p.nodetype=typeconvn) and
            (p.nodetype=typeconvn) and
            is_voidpointer(p.resultdef) then
            is_voidpointer(p.resultdef) then
           p:=tunarynode(p).left;
           p:=tunarynode(p).left;
@@ -1030,7 +1030,7 @@ implementation
                   begin
                   begin
                     { in TP it is allowed to typecast to smaller types. But the variable can't
                     { in TP it is allowed to typecast to smaller types. But the variable can't
                       be in a register }
                       be in a register }
-                    if (m_tp7 in aktmodeswitches) or
+                    if (m_tp7 in current_settings.modeswitches) or
                        (todef.size<fromdef.size) then
                        (todef.size<fromdef.size) then
                       make_not_regable(hp,vr_addr)
                       make_not_regable(hp,vr_addr)
                     else
                     else
@@ -1080,7 +1080,7 @@ implementation
                    end;
                    end;
                  gotvec:=true;
                  gotvec:=true;
                  { accesses to dyn. arrays override read only access in delphi }
                  { accesses to dyn. arrays override read only access in delphi }
-                 if (m_delphi in aktmodeswitches) and is_dynamic_array(tunarynode(hp).left.resultdef) then
+                 if (m_delphi in current_settings.modeswitches) and is_dynamic_array(tunarynode(hp).left.resultdef) then
                    gotdynarray:=true;
                    gotdynarray:=true;
                  hp:=tunarynode(hp).left;
                  hp:=tunarynode(hp).left;
                end;
                end;
@@ -1144,7 +1144,7 @@ implementation
                  else
                  else
                  { Temp strings are stored in memory, for compatibility with
                  { Temp strings are stored in memory, for compatibility with
                    delphi only }
                    delphi only }
-                   if (m_delphi in aktmodeswitches) and
+                   if (m_delphi in current_settings.modeswitches) and
                       ((valid_addr in opts) or
                       ((valid_addr in opts) or
                        (valid_const in opts)) and
                        (valid_const in opts)) and
                       (hp.resultdef.deftype=stringdef) then
                       (hp.resultdef.deftype=stringdef) then
@@ -1209,7 +1209,7 @@ implementation
                  else
                  else
                  { Temp strings are stored in memory, for compatibility with
                  { Temp strings are stored in memory, for compatibility with
                    delphi only }
                    delphi only }
-                   if (m_delphi in aktmodeswitches) and
+                   if (m_delphi in current_settings.modeswitches) and
                       (valid_addr in opts) and
                       (valid_addr in opts) and
                       (hp.resultdef.deftype=stringdef) then
                       (hp.resultdef.deftype=stringdef) then
                      result:=true
                      result:=true
@@ -1375,7 +1375,7 @@ implementation
             begin
             begin
               { allows conversion from word to integer and
               { allows conversion from word to integer and
                 byte to shortint, but only for TP7 compatibility }
                 byte to shortint, but only for TP7 compatibility }
-              if (m_tp7 in aktmodeswitches) and
+              if (m_tp7 in current_settings.modeswitches) and
                  (def_from.deftype=orddef) and
                  (def_from.deftype=orddef) and
                  (def_from.size=def_to.size) then
                  (def_from.size=def_to.size) then
                 eq:=te_convert_l1;
                 eq:=te_convert_l1;
@@ -1413,7 +1413,7 @@ implementation
               { if they are objects              }
               { if they are objects              }
               if (def_from.deftype=objectdef) and
               if (def_from.deftype=objectdef) and
                  (
                  (
-                  not(m_delphi in aktmodeswitches) or
+                  not(m_delphi in current_settings.modeswitches) or
                   (
                   (
                    (tobjectdef(def_from).objecttype=odt_object) and
                    (tobjectdef(def_from).objecttype=odt_object) and
                    (tobjectdef(def_to).objecttype=odt_object)
                    (tobjectdef(def_to).objecttype=odt_object)
@@ -1477,13 +1477,13 @@ implementation
           procvardef :
           procvardef :
             begin
             begin
               { in tp7 mode proc -> procvar is allowed }
               { in tp7 mode proc -> procvar is allowed }
-              if ((m_tp_procvar in aktmodeswitches) or
-                  (m_mac_procvar in aktmodeswitches)) and
+              if ((m_tp_procvar in current_settings.modeswitches) or
+                  (m_mac_procvar in current_settings.modeswitches)) and
                  (p.left.nodetype=calln) and
                  (p.left.nodetype=calln) and
                  (proc_to_procvar_equal(tprocdef(tcallnode(p.left).procdefinition),tprocvardef(def_to))>=te_equal) then
                  (proc_to_procvar_equal(tprocdef(tcallnode(p.left).procdefinition),tprocvardef(def_to))>=te_equal) then
                 eq:=te_equal
                 eq:=te_equal
               else
               else
-                if (m_mac_procvar in aktmodeswitches) and
+                if (m_mac_procvar in current_settings.modeswitches) and
                    is_procvar_load(p.left) then
                    is_procvar_load(p.left) then
                   eq:=te_convert_l2;
                   eq:=te_convert_l2;
             end;
             end;
@@ -1494,7 +1494,7 @@ implementation
     function allowenumop(nt:tnodetype):boolean;
     function allowenumop(nt:tnodetype):boolean;
       begin
       begin
         result:=(nt in [equaln,unequaln,ltn,lten,gtn,gten]) or
         result:=(nt in [equaln,unequaln,ltn,lten,gtn,gten]) or
-                ((cs_allow_enum_calc in aktlocalswitches) and
+                ((cs_allow_enum_calc in current_settings.localswitches) and
                  (nt in [addn,subn]));
                  (nt in [addn,subn]));
       end;
       end;
 
 
@@ -2319,7 +2319,7 @@ implementation
          begin
          begin
            if (destdef.size < source.resultdef.size) then
            if (destdef.size < source.resultdef.size) then
              begin
              begin
-               if (cs_check_range in aktlocalswitches) then
+               if (cs_check_range in current_settings.localswitches) then
                  MessagePos(location,type_w_smaller_possible_range_check)
                  MessagePos(location,type_w_smaller_possible_range_check)
                else
                else
                  MessagePos(location,type_h_smaller_possible_range_check);
                  MessagePos(location,type_h_smaller_possible_range_check);

+ 6 - 6
compiler/i386/ag386nsm.pas

@@ -398,8 +398,8 @@ interface
        exit;
        exit;
       InlineLevel:=0;
       InlineLevel:=0;
       { lineinfo is only needed for al_procedures (PFV) }
       { lineinfo is only needed for al_procedures (PFV) }
-      do_line:=(cs_asm_source in aktglobalswitches) or
-               ((cs_lineinfo in aktmoduleswitches)
+      do_line:=(cs_asm_source in current_settings.globalswitches) or
+               ((cs_lineinfo in current_settings.moduleswitches)
                  and (p=current_asmdata.asmlists[al_procedures]));
                  and (p=current_asmdata.asmlists[al_procedures]));
       hp:=tai(p.first);
       hp:=tai(p.first);
       while assigned(hp) do
       while assigned(hp) do
@@ -418,7 +418,7 @@ interface
                    if assigned(infile) then
                    if assigned(infile) then
                     begin
                     begin
                       { open only if needed !! }
                       { open only if needed !! }
-                      if (cs_asm_source in aktglobalswitches) then
+                      if (cs_asm_source in current_settings.globalswitches) then
                        infile.open;
                        infile.open;
                     end;
                     end;
                    { avoid unnecessary reopens of the same file !! }
                    { avoid unnecessary reopens of the same file !! }
@@ -427,7 +427,7 @@ interface
                    lastfileinfo.line:=-1;
                    lastfileinfo.line:=-1;
                  end;
                  end;
               { write source }
               { write source }
-                if (cs_asm_source in aktglobalswitches) and
+                if (cs_asm_source in current_settings.globalswitches) and
                    assigned(infile) then
                    assigned(infile) then
                  begin
                  begin
                    if (infile<>lastinfile) then
                    if (infile<>lastinfile) then
@@ -463,14 +463,14 @@ interface
 
 
            ait_regalloc :
            ait_regalloc :
              begin
              begin
-               if (cs_asm_regalloc in aktglobalswitches) then
+               if (cs_asm_regalloc in current_settings.globalswitches) then
                  AsmWriteLn(#9#9+target_asm.comment+'Register '+nasm_regname(tai_regalloc(hp).reg)+
                  AsmWriteLn(#9#9+target_asm.comment+'Register '+nasm_regname(tai_regalloc(hp).reg)+
                    regallocstr[tai_regalloc(hp).ratype]);
                    regallocstr[tai_regalloc(hp).ratype]);
              end;
              end;
 
 
            ait_tempalloc :
            ait_tempalloc :
              begin
              begin
-               if (cs_asm_tempalloc in aktglobalswitches) then
+               if (cs_asm_tempalloc in current_settings.globalswitches) then
                  begin
                  begin
 {$ifdef EXTDEBUG}
 {$ifdef EXTDEBUG}
                    if assigned(tai_tempalloc(hp).problem) then
                    if assigned(tai_tempalloc(hp).problem) then

+ 2 - 2
compiler/i386/aopt386.pas

@@ -46,7 +46,7 @@ Var
   pass: longint;
   pass: longint;
   slowopt, changed, lastLoop: boolean;
   slowopt, changed, lastLoop: boolean;
 Begin
 Begin
-  slowopt := (cs_opt_level3 in aktoptimizerswitches);
+  slowopt := (cs_opt_level3 in current_settings.optimizerswitches);
   pass := 0;
   pass := 0;
   changed := false;
   changed := false;
   dfa := TDFAObj.create(asml);
   dfa := TDFAObj.create(asml);
@@ -72,7 +72,7 @@ Begin
          if pass = 0 then
          if pass = 0 then
            PeepHoleOptPass1(AsmL, BlockStart, BlockEnd);
            PeepHoleOptPass1(AsmL, BlockStart, BlockEnd);
         { Data flow analyzer }
         { Data flow analyzer }
-         If (cs_opt_asmcse in aktoptimizerswitches) Then
+         If (cs_opt_asmcse in current_settings.optimizerswitches) Then
            begin
            begin
              if dfa.pass_generate_code then
              if dfa.pass_generate_code then
               { common subexpression elimination }
               { common subexpression elimination }

+ 3 - 3
compiler/i386/cgcpu.pas

@@ -81,7 +81,7 @@ unit cgcpu;
     procedure tcg386.init_register_allocators;
     procedure tcg386.init_register_allocators;
       begin
       begin
         inherited init_register_allocators;
         inherited init_register_allocators;
-        if cs_create_pic in aktmoduleswitches then
+        if cs_create_pic in current_settings.moduleswitches then
           rg[R_INTREGISTER]:=trgcpu.create(R_INTREGISTER,R_SUBWHOLE,[RS_EAX,RS_EDX,RS_ECX,RS_ESI,RS_EDI],first_int_imreg,[RS_EBP])
           rg[R_INTREGISTER]:=trgcpu.create(R_INTREGISTER,R_SUBWHOLE,[RS_EAX,RS_EDX,RS_ECX,RS_ESI,RS_EDI],first_int_imreg,[RS_EBP])
         else
         else
           rg[R_INTREGISTER]:=trgcpu.create(R_INTREGISTER,R_SUBWHOLE,[RS_EAX,RS_EDX,RS_ECX,RS_EBX,RS_ESI,RS_EDI],first_int_imreg,[RS_EBP]);
           rg[R_INTREGISTER]:=trgcpu.create(R_INTREGISTER,R_SUBWHOLE,[RS_EAX,RS_EDX,RS_ECX,RS_EBX,RS_ESI,RS_EDI],first_int_imreg,[RS_EBP]);
@@ -246,7 +246,7 @@ unit cgcpu;
         stacksize : longint;
         stacksize : longint;
       begin
       begin
         { Release PIC register }
         { Release PIC register }
-        if cs_create_pic in aktmoduleswitches then
+        if cs_create_pic in current_settings.moduleswitches then
           list.concat(tai_regalloc.dealloc(NR_PIC_OFFSET_REG,nil));
           list.concat(tai_regalloc.dealloc(NR_PIC_OFFSET_REG,nil));
 
 
         { MMX needs to call EMMS }
         { MMX needs to call EMMS }
@@ -581,7 +581,7 @@ unit cgcpu;
 
 
         make_global:=false;
         make_global:=false;
         if (not current_module.is_unit) or
         if (not current_module.is_unit) or
-           (cs_create_smart in aktmoduleswitches) or
+           (cs_create_smart in current_settings.moduleswitches) or
            (af_smartlink_sections in target_asm.flags) or
            (af_smartlink_sections in target_asm.flags) or
            (procdef.owner.defowner.owner.symtabletype=globalsymtable) then
            (procdef.owner.defowner.owner.symtabletype=globalsymtable) then
           make_global:=true;
           make_global:=true;

+ 1 - 1
compiler/i386/cpupi.pas

@@ -72,7 +72,7 @@ unit cpupi;
         { align to 4 bytes at least
         { align to 4 bytes at least
           otherwise all those subl $2,%esp are meaningless PM }
           otherwise all those subl $2,%esp are meaningless PM }
         if (target_info.system <> system_i386_darwin) then
         if (target_info.system <> system_i386_darwin) then
-          result:=Align(tg.direction*tg.lasttemp,min(aktalignment.localalignmin,4))
+          result:=Align(tg.direction*tg.lasttemp,min(current_settings.alignment.localalignmin,4))
         else
         else
           result:=tg.direction*tg.lasttemp+maxpushedparasize;
           result:=tg.direction*tg.lasttemp+maxpushedparasize;
       end;
       end;

+ 7 - 7
compiler/i386/csopt386.pas

@@ -241,7 +241,7 @@ var
         hp: tai;
         hp: tai;
       begin
       begin
         { only regvars are still used at jump instructions }
         { only regvars are still used at jump instructions }
-        if (cs_opt_regvar in aktoptimizerswitches) and
+        if (cs_opt_regvar in current_settings.optimizerswitches) and
            (p.typ = ait_instruction) and
            (p.typ = ait_instruction) and
            taicpu(p).is_jmp then
            taicpu(p).is_jmp then
          regsstillvalid := regsstillvalid - ptaiprop(p.optinfo)^.usedregs;
          regsstillvalid := regsstillvalid - ptaiprop(p.optinfo)^.usedregs;
@@ -312,7 +312,7 @@ var
     getPrevSequence := RS_INVALID;
     getPrevSequence := RS_INVALID;
     passedFlagsModifyingInstr := passedFlagsModifyingInstr or
     passedFlagsModifyingInstr := passedFlagsModifyingInstr or
       instrWritesFlags(currentPrev);
       instrWritesFlags(currentPrev);
-    if (cs_opt_regvar in aktoptimizerswitches) and
+    if (cs_opt_regvar in current_settings.optimizerswitches) and
        (currentprev.typ = ait_instruction) and
        (currentprev.typ = ait_instruction) and
        taicpu(currentprev).is_jmp then
        taicpu(currentprev).is_jmp then
       regsstillvalid := regsstillvalid - ptaiprop(currentprev.optinfo)^.usedregs;
       regsstillvalid := regsstillvalid - ptaiprop(currentprev.optinfo)^.usedregs;
@@ -2072,7 +2072,7 @@ begin
                                 end;
                                 end;
                             end;
                             end;
                         Ch_MOp1:
                         Ch_MOp1:
-                          if not(cs_opt_size in aktoptimizerswitches) and
+                          if not(cs_opt_size in current_settings.optimizerswitches) and
                              (taicpu(p).oper[0]^.typ = top_ref) then
                              (taicpu(p).oper[0]^.typ = top_ref) then
                             begin
                             begin
                               memreg :=
                               memreg :=
@@ -2119,7 +2119,7 @@ begin
                                 end;
                                 end;
                             end;
                             end;
                         Ch_MOp2:
                         Ch_MOp2:
-                          if not(cs_opt_size in aktoptimizerswitches) and
+                          if not(cs_opt_size in current_settings.optimizerswitches) and
                              (taicpu(p).oper[1]^.typ = top_ref) and
                              (taicpu(p).oper[1]^.typ = top_ref) and
                              ((taicpu(p).opcode < A_BT) or
                              ((taicpu(p).opcode < A_BT) or
                               ((taicpu(p).opcode > A_IN) and
                               ((taicpu(p).opcode > A_IN) and
@@ -2243,10 +2243,10 @@ end;
 
 
 function CSE(asml: TAsmList; First, Last: tai; pass: longint): boolean;
 function CSE(asml: TAsmList; First, Last: tai; pass: longint): boolean;
 begin
 begin
-  doCSE(asml, First, Last, not(cs_opt_level3 in aktoptimizerswitches) or (pass >= 2),
-        not(cs_opt_level3 in aktoptimizerswitches) or (pass >= 1));
+  doCSE(asml, First, Last, not(cs_opt_level3 in current_settings.optimizerswitches) or (pass >= 2),
+        not(cs_opt_level3 in current_settings.optimizerswitches) or (pass >= 1));
  { register renaming }
  { register renaming }
-  if not(cs_opt_level3 in aktoptimizerswitches) or (pass > 0) then
+  if not(cs_opt_level3 in current_settings.optimizerswitches) or (pass > 0) then
     doRenaming(asml, first, last);
     doRenaming(asml, first, last);
   cse := removeInstructs(asml, first, last);
   cse := removeInstructs(asml, first, last);
 end;
 end;

+ 4 - 4
compiler/i386/daopt386.pas

@@ -1816,7 +1816,7 @@ begin
         refsEq := @refsOverlapping;
         refsEq := @refsOverlapping;
       invalsmemwrite :=
       invalsmemwrite :=
         assigned(c.memwrite) and
         assigned(c.memwrite) and
-        ((not(cs_opt_size in aktoptimizerswitches) and
+        ((not(cs_opt_size in current_settings.optimizerswitches) and
           containsPointerRef(c.memwrite)) or
           containsPointerRef(c.memwrite)) or
          refsEq(c.memwrite.oper[1]^.ref^,ref,topsize2tcgsize[c.memwrite.opsize],size));
          refsEq(c.memwrite.oper[1]^.ref^,ref,topsize2tcgsize[c.memwrite.opsize],size));
       if not(c.typ in [con_ref,con_noRemoveRef,con_invalid]) then
       if not(c.typ in [con_ref,con_noRemoveRef,con_invalid]) then
@@ -1837,7 +1837,7 @@ begin
       with c do
       with c do
         writeToMemDestroysContents :=
         writeToMemDestroysContents :=
           (typ in [con_ref,con_noRemoveRef]) and
           (typ in [con_ref,con_noRemoveRef]) and
-          ((not(cs_opt_size in aktoptimizerswitches) and
+          ((not(cs_opt_size in current_settings.optimizerswitches) and
             containsPointerLoad(c)
             containsPointerLoad(c)
            ) or
            ) or
            (refInSequence(ref,c,refsEq,size) and
            (refInSequence(ref,c,refsEq,size) and
@@ -1861,7 +1861,7 @@ begin
     begin
     begin
       invalsmemwrite :=
       invalsmemwrite :=
         assigned(c.memwrite) and
         assigned(c.memwrite) and
-        (not(cs_opt_size in aktoptimizerswitches) or
+        (not(cs_opt_size in current_settings.optimizerswitches) or
          containsPointerRef(c.memwrite));
          containsPointerRef(c.memwrite));
       if not(c.typ in [con_ref,con_noRemoveRef,con_invalid]) then
       if not(c.typ in [con_ref,con_noRemoveRef,con_invalid]) then
         begin
         begin
@@ -1871,7 +1871,7 @@ begin
       with c do
       with c do
         writeToMemDestroysContents :=
         writeToMemDestroysContents :=
           (typ in [con_ref,con_noRemoveRef]) and
           (typ in [con_ref,con_noRemoveRef]) and
-          (not(cs_opt_size in aktoptimizerswitches) or
+          (not(cs_opt_size in current_settings.optimizerswitches) or
          { for movsl }
          { for movsl }
            ((ref.base = NR_EDI) and (ref.index = NR_EDI)) or
            ((ref.base = NR_EDI) and (ref.index = NR_EDI)) or
          { don't destroy if reg contains a parameter, local or global variable }
          { don't destroy if reg contains a parameter, local or global variable }

+ 2 - 2
compiler/i386/n386add.pas

@@ -166,7 +166,7 @@ interface
         { is in unsigned VAR!!                              }
         { is in unsigned VAR!!                              }
         if mboverflow then
         if mboverflow then
          begin
          begin
-           if cs_check_overflow in aktlocalswitches  then
+           if cs_check_overflow in current_settings.localswitches  then
             begin
             begin
               current_asmdata.getjumplabel(hl4);
               current_asmdata.getjumplabel(hl4);
               if unsigned then
               if unsigned then
@@ -364,7 +364,7 @@ interface
       {Also allocate EDX, since it is also modified by a mul (JM).}
       {Also allocate EDX, since it is also modified by a mul (JM).}
       cg.getcpuregister(current_asmdata.CurrAsmList,NR_EDX);
       cg.getcpuregister(current_asmdata.CurrAsmList,NR_EDX);
       emit_reg(A_MUL,S_L,r);
       emit_reg(A_MUL,S_L,r);
-      if cs_check_overflow in aktlocalswitches  then
+      if cs_check_overflow in current_settings.localswitches  then
        begin
        begin
          current_asmdata.getjumplabel(hl4);
          current_asmdata.getjumplabel(hl4);
          cg.a_jmp_flags(current_asmdata.CurrAsmList,F_AE,hl4);
          cg.a_jmp_flags(current_asmdata.CurrAsmList,F_AE,hl4);

+ 2 - 2
compiler/i386/n386cal.pas

@@ -91,8 +91,8 @@ implementation
         { but the registers must be different!        }
         { but the registers must be different!        }
         else
         else
           if (pop_size=8) and
           if (pop_size=8) and
-             not(cs_opt_size in aktoptimizerswitches) and
-             (aktoptimizecputype=cpu_Pentium) then
+             not(cs_opt_size in current_settings.optimizerswitches) and
+             (current_settings.optimizecputype=cpu_Pentium) then
             begin
             begin
                hreg:=cg.getintregister(current_asmdata.CurrAsmList,OS_INT);
                hreg:=cg.getintregister(current_asmdata.CurrAsmList,OS_INT);
                current_asmdata.CurrAsmList.concat(taicpu.op_reg(A_POP,S_L,hreg));
                current_asmdata.CurrAsmList.concat(taicpu.op_reg(A_POP,S_L,hreg));

+ 2 - 2
compiler/i386/n386mat.pas

@@ -106,8 +106,8 @@ implementation
                   "Cardinal($ffffffff) div 16" overflows! (JM) }
                   "Cardinal($ffffffff) div 16" overflows! (JM) }
                 if is_signed(left.resultdef) Then
                 if is_signed(left.resultdef) Then
                   begin
                   begin
-                    if (aktoptimizecputype <> cpu_386) and
-                       not(cs_opt_size in aktoptimizerswitches) then
+                    if (current_settings.optimizecputype <> cpu_386) and
+                       not(cs_opt_size in current_settings.optimizerswitches) then
                       { use a sequence without jumps, saw this in
                       { use a sequence without jumps, saw this in
                         comp.compilers (JM) }
                         comp.compilers (JM) }
                       begin
                       begin

+ 4 - 4
compiler/i386/n386set.pas

@@ -59,13 +59,13 @@ implementation
     procedure ti386casenode.optimizevalues(var max_linear_list:aint;var max_dist:aword);
     procedure ti386casenode.optimizevalues(var max_linear_list:aint;var max_dist:aword);
       begin
       begin
         { a jump table crashes the pipeline! }
         { a jump table crashes the pipeline! }
-        if aktoptimizecputype=cpu_386 then
+        if current_settings.optimizecputype=cpu_386 then
           inc(max_linear_list,3)
           inc(max_linear_list,3)
-        else if aktoptimizecputype=cpu_Pentium then
+        else if current_settings.optimizecputype=cpu_Pentium then
           inc(max_linear_list,6)
           inc(max_linear_list,6)
-        else if aktoptimizecputype in [cpu_Pentium2,cpu_Pentium3] then
+        else if current_settings.optimizecputype in [cpu_Pentium2,cpu_Pentium3] then
           inc(max_linear_list,9)
           inc(max_linear_list,9)
-        else if aktoptimizecputype=cpu_Pentium4 then
+        else if current_settings.optimizecputype=cpu_Pentium4 then
           inc(max_linear_list,14);
           inc(max_linear_list,14);
       end;
       end;
 
 

+ 20 - 20
compiler/i386/popt386.pas

@@ -148,9 +148,9 @@ begin
                     else if
                     else if
                      ((taicpu(p).ops <= 2) or
                      ((taicpu(p).ops <= 2) or
                       (taicpu(p).oper[2]^.typ = Top_Reg)) and
                       (taicpu(p).oper[2]^.typ = Top_Reg)) and
-                     (aktoptimizecputype < cpu_Pentium2) and
+                     (current_settings.optimizecputype < cpu_Pentium2) and
                      (taicpu(p).oper[0]^.val <= 12) and
                      (taicpu(p).oper[0]^.val <= 12) and
-                     not(cs_opt_size in aktoptimizerswitches) and
+                     not(cs_opt_size in current_settings.optimizerswitches) and
                      (not(GetNextInstruction(p, hp1)) or
                      (not(GetNextInstruction(p, hp1)) or
                        {GetNextInstruction(p, hp1) and}
                        {GetNextInstruction(p, hp1) and}
                        not((tai(hp1).typ = ait_instruction) and
                        not((tai(hp1).typ = ait_instruction) and
@@ -198,7 +198,7 @@ begin
                              imul 6, reg1 to
                              imul 6, reg1 to
                                lea (reg1,reg1,2), reg1
                                lea (reg1,reg1,2), reg1
                                add reg1, reg1}
                                add reg1, reg1}
-                              if (aktoptimizecputype <= cpu_386) then
+                              if (current_settings.optimizecputype <= cpu_386) then
                                 begin
                                 begin
                                   TmpRef.index := taicpu(p).oper[1]^.reg;
                                   TmpRef.index := taicpu(p).oper[1]^.reg;
                                   if (taicpu(p).ops = 3) then
                                   if (taicpu(p).ops = 3) then
@@ -255,7 +255,7 @@ begin
                              imul 10, reg1 to
                              imul 10, reg1 to
                                lea (reg1,reg1,4), reg1
                                lea (reg1,reg1,4), reg1
                                add reg1, reg1}
                                add reg1, reg1}
-                               if (aktoptimizecputype <= cpu_386) then
+                               if (current_settings.optimizecputype <= cpu_386) then
                                  begin
                                  begin
                                    if (taicpu(p).ops = 3) then
                                    if (taicpu(p).ops = 3) then
                                      hp1 :=  taicpu.op_reg_reg(A_ADD, S_L,
                                      hp1 :=  taicpu.op_reg_reg(A_ADD, S_L,
@@ -283,7 +283,7 @@ begin
                              imul 12, reg1 to
                              imul 12, reg1 to
                                lea (reg1,reg1,2), reg1
                                lea (reg1,reg1,2), reg1
                                lea (,reg1,4), reg1}
                                lea (,reg1,4), reg1}
-                               if (aktoptimizecputype <= cpu_386)
+                               if (current_settings.optimizecputype <= cpu_386)
                                  then
                                  then
                                    begin
                                    begin
                                      TmpRef.index := taicpu(p).oper[1]^.reg;
                                      TmpRef.index := taicpu(p).oper[1]^.reg;
@@ -337,7 +337,7 @@ begin
                      (taicpu(hp1).oper[1]^.typ = taicpu(p).oper[1]^.typ) and
                      (taicpu(hp1).oper[1]^.typ = taicpu(p).oper[1]^.typ) and
                      OpsEqual(taicpu(hp1).oper[1]^, taicpu(p).oper[1]^) then
                      OpsEqual(taicpu(hp1).oper[1]^, taicpu(p).oper[1]^) then
                     if (taicpu(p).oper[0]^.val > taicpu(hp1).oper[0]^.val) and
                     if (taicpu(p).oper[0]^.val > taicpu(hp1).oper[0]^.val) and
-                       not(cs_opt_size in aktoptimizerswitches) then
+                       not(cs_opt_size in current_settings.optimizerswitches) then
                   { shr/sar const1, %reg
                   { shr/sar const1, %reg
                     shl     const2, %reg
                     shl     const2, %reg
                     with const1 > const2 }
                     with const1 > const2 }
@@ -352,7 +352,7 @@ begin
                         end;
                         end;
                       end
                       end
                     else if (taicpu(p).oper[0]^.val<taicpu(hp1).oper[0]^.val) and
                     else if (taicpu(p).oper[0]^.val<taicpu(hp1).oper[0]^.val) and
-                            not(cs_opt_size in aktoptimizerswitches) then
+                            not(cs_opt_size in current_settings.optimizerswitches) then
                   { shr/sar const1, %reg
                   { shr/sar const1, %reg
                     shl     const2, %reg
                     shl     const2, %reg
                     with const1 < const2 }
                     with const1 < const2 }
@@ -1244,7 +1244,7 @@ begin
                             S_BW:
                             S_BW:
                               begin
                               begin
                                 if (getsupreg(taicpu(p).oper[0]^.reg)=getsupreg(taicpu(p).oper[1]^.reg)) and
                                 if (getsupreg(taicpu(p).oper[0]^.reg)=getsupreg(taicpu(p).oper[1]^.reg)) and
-                                   not(cs_opt_size in aktoptimizerswitches) then
+                                   not(cs_opt_size in current_settings.optimizerswitches) then
                                   {Change "movzbw %al, %ax" to "andw $0x0ffh, %ax"}
                                   {Change "movzbw %al, %ax" to "andw $0x0ffh, %ax"}
                                   begin
                                   begin
                                     taicpu(p).opcode := A_AND;
                                     taicpu(p).opcode := A_AND;
@@ -1269,7 +1269,7 @@ begin
                             S_BL:
                             S_BL:
                               begin
                               begin
                                 if (getsupreg(taicpu(p).oper[0]^.reg)=getsupreg(taicpu(p).oper[1]^.reg)) and
                                 if (getsupreg(taicpu(p).oper[0]^.reg)=getsupreg(taicpu(p).oper[1]^.reg)) and
-                                   not(cs_opt_size in aktoptimizerswitches) then
+                                   not(cs_opt_size in current_settings.optimizerswitches) then
                                   {Change "movzbl %al, %eax" to "andl $0x0ffh, %eax"}
                                   {Change "movzbl %al, %eax" to "andl $0x0ffh, %eax"}
                                   begin
                                   begin
                                     taicpu(p).opcode := A_AND;
                                     taicpu(p).opcode := A_AND;
@@ -1294,7 +1294,7 @@ begin
                             S_WL:
                             S_WL:
                               begin
                               begin
                                 if (getsupreg(taicpu(p).oper[0]^.reg)=getsupreg(taicpu(p).oper[1]^.reg)) and
                                 if (getsupreg(taicpu(p).oper[0]^.reg)=getsupreg(taicpu(p).oper[1]^.reg)) and
-                                   not(cs_opt_size in aktoptimizerswitches) then
+                                   not(cs_opt_size in current_settings.optimizerswitches) then
                                 {Change "movzwl %ax, %eax" to "andl $0x0ffffh, %eax"}
                                 {Change "movzwl %ax, %eax" to "andl $0x0ffffh, %eax"}
                                   begin
                                   begin
                                     taicpu(p).opcode := A_AND;
                                     taicpu(p).opcode := A_AND;
@@ -1510,9 +1510,9 @@ begin
                                   end;
                                   end;
                             end;
                             end;
                           if TmpBool2 or
                           if TmpBool2 or
-                             ((aktoptimizecputype < cpu_Pentium2) and
+                             ((current_settings.optimizecputype < cpu_Pentium2) and
                              (taicpu(p).oper[0]^.val <= 3) and
                              (taicpu(p).oper[0]^.val <= 3) and
-                             not(cs_opt_size in aktoptimizerswitches)) then
+                             not(cs_opt_size in current_settings.optimizerswitches)) then
                             begin
                             begin
                               if not(TmpBool2) and
                               if not(TmpBool2) and
                                   (taicpu(p).oper[0]^.val = 1) then
                                   (taicpu(p).oper[0]^.val = 1) then
@@ -1529,7 +1529,7 @@ begin
                             end;
                             end;
                         end
                         end
                       else
                       else
-                        if (aktoptimizecputype < cpu_Pentium2) and
+                        if (current_settings.optimizecputype < cpu_Pentium2) and
                            (taicpu(p).oper[0]^.typ = top_const) and
                            (taicpu(p).oper[0]^.typ = top_const) and
                            (taicpu(p).oper[1]^.typ = top_reg) then
                            (taicpu(p).oper[1]^.typ = top_reg) then
                           if (taicpu(p).oper[0]^.val = 1) then
                           if (taicpu(p).oper[0]^.val = 1) then
@@ -1699,7 +1699,7 @@ begin
             case taicpu(p).opcode Of
             case taicpu(p).opcode Of
 {$ifdef USECMOV}
 {$ifdef USECMOV}
               A_Jcc:
               A_Jcc:
-                if (aktcputype>=cpu_Pentium2) then
+                if (current_settings.cputype>=cpu_Pentium2) then
                   begin
                   begin
                      { check for
                      { check for
                             jCC   xxx
                             jCC   xxx
@@ -1931,7 +1931,7 @@ begin
           begin
           begin
             case taicpu(p).opcode Of
             case taicpu(p).opcode Of
               A_CALL:
               A_CALL:
-                if (aktoptimizecputype < cpu_Pentium2) and
+                if (current_settings.optimizecputype < cpu_Pentium2) and
                    GetNextInstruction(p, hp1) and
                    GetNextInstruction(p, hp1) and
                    (hp1.typ = ait_instruction) and
                    (hp1.typ = ait_instruction) and
                    (taicpu(hp1).opcode = A_JMP) and
                    (taicpu(hp1).opcode = A_JMP) and
@@ -1974,7 +1974,7 @@ See test/tgadint64 in the test suite.
                 {   "cmpl $3,%eax; movzbl 8(%ebp),%ebx; je .Lxxx"           }
                 {   "cmpl $3,%eax; movzbl 8(%ebp),%ebx; je .Lxxx"           }
                 { so we can't safely replace the movzx then with xor/mov,   }
                 { so we can't safely replace the movzx then with xor/mov,   }
                 { since that would change the flags (JM)                    }
                 { since that would change the flags (JM)                    }
-                if not(cs_opt_regvar in aktoptimizerswitches) then
+                if not(cs_opt_regvar in current_settings.optimizerswitches) then
                  begin
                  begin
                   if (taicpu(p).oper[1]^.typ = top_reg) then
                   if (taicpu(p).oper[1]^.typ = top_reg) then
                     if (taicpu(p).oper[0]^.typ = top_reg)
                     if (taicpu(p).oper[0]^.typ = top_reg)
@@ -1983,8 +1983,8 @@ See test/tgadint64 in the test suite.
                           S_BL:
                           S_BL:
                             begin
                             begin
                               if IsGP32Reg(getsupreg(taicpu(p).oper[1]^.reg)) and
                               if IsGP32Reg(getsupreg(taicpu(p).oper[1]^.reg)) and
-                                 not(cs_opt_size in aktoptimizerswitches) and
-                                 (aktoptimizecputype = cpu_Pentium) then
+                                 not(cs_opt_size in current_settings.optimizerswitches) and
+                                 (current_settings.optimizecputype = cpu_Pentium) then
                                   {Change "movzbl %reg1, %reg2" to
                                   {Change "movzbl %reg1, %reg2" to
                                    "xorl %reg2, %reg2; movb %reg1, %reg2" for Pentium and
                                    "xorl %reg2, %reg2; movb %reg1, %reg2" for Pentium and
                                    PentiumMMX}
                                    PentiumMMX}
@@ -2001,9 +2001,9 @@ See test/tgadint64 in the test suite.
                       else if (taicpu(p).oper[0]^.typ = top_ref) and
                       else if (taicpu(p).oper[0]^.typ = top_ref) and
                           (taicpu(p).oper[0]^.ref^.base <> taicpu(p).oper[1]^.reg) and
                           (taicpu(p).oper[0]^.ref^.base <> taicpu(p).oper[1]^.reg) and
                           (taicpu(p).oper[0]^.ref^.index <> taicpu(p).oper[1]^.reg) and
                           (taicpu(p).oper[0]^.ref^.index <> taicpu(p).oper[1]^.reg) and
-                          not(cs_opt_size in aktoptimizerswitches) and
+                          not(cs_opt_size in current_settings.optimizerswitches) and
                           IsGP32Reg(getsupreg(taicpu(p).oper[1]^.reg)) and
                           IsGP32Reg(getsupreg(taicpu(p).oper[1]^.reg)) and
-                          (aktoptimizecputype = cpu_Pentium) and
+                          (current_settings.optimizecputype = cpu_Pentium) and
                           (taicpu(p).opsize = S_BL) then
                           (taicpu(p).opsize = S_BL) then
                         {changes "movzbl mem, %reg" to "xorl %reg, %reg; movb mem, %reg8" for
                         {changes "movzbl mem, %reg" to "xorl %reg, %reg; movb mem, %reg8" for
                           Pentium and PentiumMMX}
                           Pentium and PentiumMMX}

+ 24 - 24
compiler/link.pas

@@ -154,7 +154,7 @@ Implementation
          so there is no object files to look for at
          so there is no object files to look for at
          the host. Look for the corresponding assembler file instead,
          the host. Look for the corresponding assembler file instead,
          because it will be assembled to object file on the target.}
          because it will be assembled to object file on the target.}
-        if isunit and (cs_link_on_target in aktglobalswitches) then
+        if isunit and (cs_link_on_target in current_settings.globalswitches) then
           s:= ForceExtension(s,target_info.asmext);
           s:= ForceExtension(s,target_info.asmext);
 
 
         { when it does not belong to the unit then check if
         { when it does not belong to the unit then check if
@@ -194,13 +194,13 @@ Implementation
          found:=current_module.localobjectsearchpath.FindFile(s,foundfile);
          found:=current_module.localobjectsearchpath.FindFile(s,foundfile);
         if (not found) then
         if (not found) then
          found:=objectsearchpath.FindFile(s,foundfile);
          found:=objectsearchpath.FindFile(s,foundfile);
-        if not(cs_link_on_target in aktglobalswitches) and (not found) then
+        if not(cs_link_on_target in current_settings.globalswitches) and (not found) then
          found:=FindFile(s,exepath,foundfile);
          found:=FindFile(s,exepath,foundfile);
-        if not(cs_link_nolink in aktglobalswitches) and (not found) then
+        if not(cs_link_nolink in current_settings.globalswitches) and (not found) then
          Message1(exec_w_objfile_not_found,s);
          Message1(exec_w_objfile_not_found,s);
 
 
         {Restore file extension}
         {Restore file extension}
-        if isunit and (cs_link_on_target in aktglobalswitches) then
+        if isunit and (cs_link_on_target in current_settings.globalswitches) then
           foundfile:= ForceExtension(foundfile,target_info.objext);
           foundfile:= ForceExtension(foundfile,target_info.objext);
 
 
         findobjectfile:=ScriptFixFileName(foundfile);
         findobjectfile:=ScriptFixFileName(foundfile);
@@ -278,7 +278,7 @@ Implementation
          found:=current_module.locallibrarysearchpath.FindFile(s,foundfile);
          found:=current_module.locallibrarysearchpath.FindFile(s,foundfile);
         if (not found) then
         if (not found) then
          found:=librarysearchpath.FindFile(s,foundfile);
          found:=librarysearchpath.FindFile(s,foundfile);
-        if not(cs_link_on_target in aktglobalswitches) and (not found) then
+        if not(cs_link_on_target in current_settings.globalswitches) and (not found) then
          found:=FindFile(s,exepath,foundfile);
          found:=FindFile(s,exepath,foundfile);
         foundfile:=ScriptFixFileName(foundfile);
         foundfile:=ScriptFixFileName(foundfile);
         findlibraryfile:=found;
         findlibraryfile:=found;
@@ -325,7 +325,7 @@ Implementation
               { create mask which unit files need linking }
               { create mask which unit files need linking }
               mask:=link_always;
               mask:=link_always;
               { static linking ? }
               { static linking ? }
-              if (cs_link_static in aktglobalswitches) then
+              if (cs_link_static in current_settings.globalswitches) then
                begin
                begin
                  if (flags and uf_static_linked)=0 then
                  if (flags and uf_static_linked)=0 then
                   begin
                   begin
@@ -342,7 +342,7 @@ Implementation
                    mask:=mask or link_static;
                    mask:=mask or link_static;
                end;
                end;
               { smart linking ? }
               { smart linking ? }
-              if (cs_link_smart in aktglobalswitches) then
+              if (cs_link_smart in current_settings.globalswitches) then
                begin
                begin
                  if (flags and uf_smart_linked)=0 then
                  if (flags and uf_smart_linked)=0 then
                   begin
                   begin
@@ -359,7 +359,7 @@ Implementation
                   mask:=mask or link_smart;
                   mask:=mask or link_smart;
                end;
                end;
               { shared linking }
               { shared linking }
-              if (cs_link_shared in aktglobalswitches) then
+              if (cs_link_shared in current_settings.globalswitches) then
                begin
                begin
                  if (flags and uf_shared_linked)=0 then
                  if (flags and uf_shared_linked)=0 then
                   begin
                   begin
@@ -439,7 +439,7 @@ Implementation
         if s='' then
         if s='' then
           exit;
           exit;
         found:=FindLibraryFile(s,target_info.staticlibprefix,target_info.staticlibext,ns);
         found:=FindLibraryFile(s,target_info.staticlibprefix,target_info.staticlibext,ns);
-        if not(cs_link_nolink in aktglobalswitches) and (not found) then
+        if not(cs_link_nolink in current_settings.globalswitches) and (not found) then
           Message1(exec_w_libfile_not_found,s);
           Message1(exec_w_libfile_not_found,s);
         StaticLibFiles.Concat(ns);
         StaticLibFiles.Concat(ns);
       end;
       end;
@@ -468,7 +468,7 @@ Implementation
         if s='' then
         if s='' then
          exit;
          exit;
         found:=FindLibraryFile(s,target_info.staticclibprefix,target_info.staticclibext,ns);
         found:=FindLibraryFile(s,target_info.staticclibprefix,target_info.staticclibext,ns);
-        if not(cs_link_nolink in aktglobalswitches) and (not found) then
+        if not(cs_link_nolink in current_settings.globalswitches) and (not found) then
          Message1(exec_w_libfile_not_found,s);
          Message1(exec_w_libfile_not_found,s);
         StaticLibFiles.Concat(ns);
         StaticLibFiles.Concat(ns);
       end;
       end;
@@ -548,7 +548,7 @@ Implementation
         inherited Create;
         inherited Create;
         { set generic defaults }
         { set generic defaults }
         FillChar(Info,sizeof(Info),0);
         FillChar(Info,sizeof(Info),0);
-        if cs_link_on_target in aktglobalswitches then
+        if cs_link_on_target in current_settings.globalswitches then
           begin
           begin
             Info.ResName:=outputexedir+inputfile+'_link.res';
             Info.ResName:=outputexedir+inputfile+'_link.res';
             Info.ScriptName:=outputexedir+inputfile+'_script.res';
             Info.ScriptName:=outputexedir+inputfile+'_script.res';
@@ -588,7 +588,7 @@ Implementation
         FoundBin : string;
         FoundBin : string;
         UtilExe  : string;
         UtilExe  : string;
       begin
       begin
-        if cs_link_on_target in aktglobalswitches then
+        if cs_link_on_target in current_settings.globalswitches then
           begin
           begin
             { If linking on target, don't add any path PM }
             { If linking on target, don't add any path PM }
             FindUtil:=AddExtension(s,target_info.exeext);
             FindUtil:=AddExtension(s,target_info.exeext);
@@ -601,10 +601,10 @@ Implementation
          Found:=FindFile(utilexe,utilsdirectory,Foundbin);
          Found:=FindFile(utilexe,utilsdirectory,Foundbin);
         if (not Found) then
         if (not Found) then
          Found:=FindExe(utilexe,Foundbin);
          Found:=FindExe(utilexe,Foundbin);
-        if (not Found) and not(cs_link_nolink in aktglobalswitches) then
+        if (not Found) and not(cs_link_nolink in current_settings.globalswitches) then
          begin
          begin
            Message1(exec_e_util_not_found,utilexe);
            Message1(exec_e_util_not_found,utilexe);
-           aktglobalswitches:=aktglobalswitches+[cs_link_nolink];
+           current_settings.globalswitches:=current_settings.globalswitches+[cs_link_nolink];
          end;
          end;
         if (FoundBin<>'') then
         if (FoundBin<>'') then
          Message1(exec_t_using_util,FoundBin);
          Message1(exec_t_using_util,FoundBin);
@@ -617,7 +617,7 @@ Implementation
         exitcode: longint;
         exitcode: longint;
       begin
       begin
         DoExec:=true;
         DoExec:=true;
-        if not(cs_link_nolink in aktglobalswitches) then
+        if not(cs_link_nolink in current_settings.globalswitches) then
          begin
          begin
            FlushOutput;
            FlushOutput;
            if useshell then
            if useshell then
@@ -628,13 +628,13 @@ Implementation
              if ExecuteProcess(command,para) <> 0
              if ExecuteProcess(command,para) <> 0
              then begin
              then begin
                Message(exec_e_error_while_linking);
                Message(exec_e_error_while_linking);
-               aktglobalswitches:=aktglobalswitches+[cs_link_nolink];
+               current_settings.globalswitches:=current_settings.globalswitches+[cs_link_nolink];
                DoExec:=false;
                DoExec:=false;
              end;
              end;
            except on E:EOSError do
            except on E:EOSError do
              begin
              begin
                Message(exec_e_cant_call_linker);
                Message(exec_e_cant_call_linker);
-               aktglobalswitches:=aktglobalswitches+[cs_link_nolink];
+               current_settings.globalswitches:=current_settings.globalswitches+[cs_link_nolink];
                DoExec:=false;
                DoExec:=false;
              end;
              end;
            end
            end
@@ -649,20 +649,20 @@ Implementation
            if (doserror<>0) then
            if (doserror<>0) then
             begin
             begin
                Message(exec_e_cant_call_linker);
                Message(exec_e_cant_call_linker);
-               aktglobalswitches:=aktglobalswitches+[cs_link_nolink];
+               current_settings.globalswitches:=current_settings.globalswitches+[cs_link_nolink];
                DoExec:=false;
                DoExec:=false;
             end
             end
            else
            else
             if (exitcode<>0) then
             if (exitcode<>0) then
              begin
              begin
               Message(exec_e_error_while_linking);
               Message(exec_e_error_while_linking);
-              aktglobalswitches:=aktglobalswitches+[cs_link_nolink];
+              current_settings.globalswitches:=current_settings.globalswitches+[cs_link_nolink];
               DoExec:=false;
               DoExec:=false;
              end;
              end;
          end;
          end;
       {$ENDIF USE_SYSUTILS}
       {$ENDIF USE_SYSUTILS}
       { Update asmres when externmode is set }
       { Update asmres when externmode is set }
-        if cs_link_nolink in aktglobalswitches then
+        if cs_link_nolink in current_settings.globalswitches then
          begin
          begin
            if showinfo then
            if showinfo then
              begin
              begin
@@ -750,8 +750,8 @@ Implementation
           end;
           end;
 
 
         { Clean up }
         { Clean up }
-        if not(cs_asm_leave in aktglobalswitches) then
-         if not(cs_link_nolink in aktglobalswitches) then
+        if not(cs_asm_leave in current_settings.globalswitches) then
+         if not(cs_link_nolink in current_settings.globalswitches) then
           begin
           begin
             while not SmartLinkOFiles.Empty do
             while not SmartLinkOFiles.Empty do
               RemoveFile(SmartLinkOFiles.GetFirst);
               RemoveFile(SmartLinkOFiles.GetFirst);
@@ -982,7 +982,7 @@ Implementation
 
 
         exeoutput:=CExeOutput.Create;
         exeoutput:=CExeOutput.Create;
 
 
-        if (cs_link_map in aktglobalswitches) then
+        if (cs_link_map in current_settings.globalswitches) then
           exemap:=texemap.create(current_module.mapfilename^);
           exemap:=texemap.create(current_module.mapfilename^);
 
 
         PrintLinkerScript;
         PrintLinkerScript;
@@ -1063,7 +1063,7 @@ Implementation
       var
       var
         lk : TlinkerClass;
         lk : TlinkerClass;
       begin
       begin
-        if (cs_link_extern in aktglobalswitches) and
+        if (cs_link_extern in current_settings.globalswitches) and
            assigned(target_info.linkextern) then
            assigned(target_info.linkextern) then
           begin
           begin
             lk:=TlinkerClass(target_info.linkextern);
             lk:=TlinkerClass(target_info.linkextern);

+ 19 - 19
compiler/m68k/cgcpu.pas

@@ -212,7 +212,7 @@ unit cgcpu;
            addressing capabilities with a 32-bit
            addressing capabilities with a 32-bit
            displacement.
            displacement.
          }
          }
-         if (aktcputype<>cpu_MC68000) then
+         if (current_settings.cputype<>cpu_MC68000) then
            exit;
            exit;
          if (ref.base<>NR_NO) then
          if (ref.base<>NR_NO) then
            begin
            begin
@@ -333,7 +333,7 @@ unit cgcpu;
     procedure tcg68k.a_loadfpu_reg_reg(list: TAsmList; size: tcgsize; reg1, reg2: tregister);
     procedure tcg68k.a_loadfpu_reg_reg(list: TAsmList; size: tcgsize; reg1, reg2: tregister);
       begin
       begin
         { in emulation mode, only 32-bit single is supported }
         { in emulation mode, only 32-bit single is supported }
-        if cs_fp_emulation in aktmoduleswitches then
+        if cs_fp_emulation in current_settings.moduleswitches then
           list.concat(taicpu.op_reg_reg(A_MOVE,S_L,reg1,reg2))
           list.concat(taicpu.op_reg_reg(A_MOVE,S_L,reg1,reg2))
         else
         else
           list.concat(taicpu.op_reg_reg(A_FMOVE,S_FD,reg1,reg2));
           list.concat(taicpu.op_reg_reg(A_FMOVE,S_FD,reg1,reg2));
@@ -352,7 +352,7 @@ unit cgcpu;
         href := ref;
         href := ref;
         fixref(list,href);
         fixref(list,href);
         { in emulation mode, only 32-bit single is supported }
         { in emulation mode, only 32-bit single is supported }
-        if cs_fp_emulation in aktmoduleswitches then
+        if cs_fp_emulation in current_settings.moduleswitches then
            list.concat(taicpu.op_ref_reg(A_MOVE,S_L,href,reg))
            list.concat(taicpu.op_ref_reg(A_MOVE,S_L,href,reg))
         else
         else
            list.concat(taicpu.op_ref_reg(A_FMOVE,opsize,href,reg));
            list.concat(taicpu.op_ref_reg(A_FMOVE,opsize,href,reg));
@@ -367,7 +367,7 @@ unit cgcpu;
         if opsize = S_FX then
         if opsize = S_FX then
           internalerror(20020729);
           internalerror(20020729);
         { in emulation mode, only 32-bit single is supported }
         { in emulation mode, only 32-bit single is supported }
-        if cs_fp_emulation in aktmoduleswitches then
+        if cs_fp_emulation in current_settings.moduleswitches then
           list.concat(taicpu.op_reg_ref(A_MOVE,S_L,reg, ref))
           list.concat(taicpu.op_reg_ref(A_MOVE,S_L,reg, ref))
         else
         else
           list.concat(taicpu.op_reg_ref(A_FMOVE,opsize,reg, ref));
           list.concat(taicpu.op_reg_ref(A_FMOVE,opsize,reg, ref));
@@ -442,7 +442,7 @@ unit cgcpu;
               end;
               end;
           OP_IMUL :
           OP_IMUL :
               begin
               begin
-                if aktcputype = cpu_MC68000 then
+                if current_settings.cputype = cpu_MC68000 then
                    begin
                    begin
                      r:=NR_D0;
                      r:=NR_D0;
                      r2:=NR_D1;
                      r2:=NR_D1;
@@ -471,7 +471,7 @@ unit cgcpu;
               end;
               end;
           OP_MUL :
           OP_MUL :
               begin
               begin
-                 if aktcputype = cpu_MC68000 then
+                 if current_settings.cputype = cpu_MC68000 then
                    begin
                    begin
                      r:=NR_D0;
                      r:=NR_D0;
                      r2:=NR_D1;
                      r2:=NR_D1;
@@ -558,7 +558,7 @@ unit cgcpu;
         case op of
         case op of
           OP_ADD :
           OP_ADD :
               begin
               begin
-                 if aktcputype = cpu_ColdFire then
+                 if current_settings.cputype = cpu_ColdFire then
                   begin
                   begin
                     { operation only allowed only a longword }
                     { operation only allowed only a longword }
                     sign_extend(list, size, reg1);
                     sign_extend(list, size, reg1);
@@ -591,7 +591,7 @@ unit cgcpu;
                  else
                  else
                    hreg2 := reg2;
                    hreg2 := reg2;
 
 
-                 if aktcputype = cpu_ColdFire then
+                 if current_settings.cputype = cpu_ColdFire then
                   begin
                   begin
                     { operation only allowed only a longword }
                     { operation only allowed only a longword }
                     {!***************************************
                     {!***************************************
@@ -628,7 +628,7 @@ unit cgcpu;
               begin
               begin
                  sign_extend(list, size,reg1);
                  sign_extend(list, size,reg1);
                  sign_extend(list, size,reg2);
                  sign_extend(list, size,reg2);
-                 if aktcputype = cpu_MC68000 then
+                 if current_settings.cputype = cpu_MC68000 then
                    begin
                    begin
                      r:=NR_D0;
                      r:=NR_D0;
                      r2:=NR_D1;
                      r2:=NR_D1;
@@ -671,7 +671,7 @@ unit cgcpu;
               begin
               begin
                  sign_extend(list, size,reg1);
                  sign_extend(list, size,reg1);
                  sign_extend(list, size,reg2);
                  sign_extend(list, size,reg2);
-                 if aktcputype = cpu_MC68000 then
+                 if current_settings.cputype = cpu_MC68000 then
                    begin
                    begin
                      r:=NR_D0;
                      r:=NR_D0;
                      r2:=NR_D1;
                      r2:=NR_D1;
@@ -730,7 +730,7 @@ unit cgcpu;
                     hreg2 := reg2;
                     hreg2 := reg2;
 
 
                 { coldfire only supports long version }
                 { coldfire only supports long version }
-                if aktcputype = cpu_ColdFire then
+                if current_settings.cputype = cpu_ColdFire then
                   begin
                   begin
                     sign_extend(list, size,hreg2);
                     sign_extend(list, size,hreg2);
                     list.concat(taicpu.op_reg(topcg2tasmop[op],S_L,hreg2));
                     list.concat(taicpu.op_reg(topcg2tasmop[op],S_L,hreg2));
@@ -764,7 +764,7 @@ unit cgcpu;
          end
          end
        else
        else
          begin
          begin
-           if (aktcputype = cpu_ColdFire) then
+           if (current_settings.cputype = cpu_ColdFire) then
              begin
              begin
                {
                {
                  only longword comparison is supported,
                  only longword comparison is supported,
@@ -826,7 +826,7 @@ unit cgcpu;
               ai.SetCondition(flags_to_cond(f));
               ai.SetCondition(flags_to_cond(f));
               list.concat(ai);
               list.concat(ai);
 
 
-              if (aktcputype = cpu_ColdFire) then
+              if (current_settings.cputype = cpu_ColdFire) then
                 begin
                 begin
                  { neg.b does not exist on the Coldfire
                  { neg.b does not exist on the Coldfire
                    so we need to sign extend the value
                    so we need to sign extend the value
@@ -848,7 +848,7 @@ unit cgcpu;
             ai.SetCondition(flags_to_cond(f));
             ai.SetCondition(flags_to_cond(f));
             list.concat(ai);
             list.concat(ai);
 
 
-            if (aktcputype = cpu_ColdFire) then
+            if (current_settings.cputype = cpu_ColdFire) then
               begin
               begin
                  { neg.b does not exist on the Coldfire
                  { neg.b does not exist on the Coldfire
                    so we need to sign extend the value
                    so we need to sign extend the value
@@ -897,7 +897,7 @@ unit cgcpu;
 //            reference_release(list,source);
 //            reference_release(list,source);
 
 
          { from 12 bytes movs is being used }
          { from 12 bytes movs is being used }
-         if {(not loadref) and} ((len<=8) or (not(cs_opt_size in aktoptimizerswitches) and (len<=12))) then
+         if {(not loadref) and} ((len<=8) or (not(cs_opt_size in current_settings.optimizerswitches) and (len<=12))) then
            begin
            begin
               srcref := source;
               srcref := source;
               dstref := dest;
               dstref := dest;
@@ -951,7 +951,7 @@ unit cgcpu;
               { double word move only on 68020+ machines }
               { double word move only on 68020+ machines }
               { because of possible alignment problems   }
               { because of possible alignment problems   }
               { use fast loop mode }
               { use fast loop mode }
-              if (aktcputype=cpu_MC68020) then
+              if (current_settings.cputype=cpu_MC68020) then
                 begin
                 begin
                    helpsize := len - len mod 4;
                    helpsize := len - len mod 4;
                    len := len mod 4;
                    len := len mod 4;
@@ -1067,7 +1067,7 @@ unit cgcpu;
             { return with immediate size possible here
             { return with immediate size possible here
               signed!
               signed!
               RTD is not supported on the coldfire     }
               RTD is not supported on the coldfire     }
-            if (aktcputype=cpu_MC68020) and (parasize<$7FFF) then
+            if (current_settings.cputype=cpu_MC68020) and (parasize<$7FFF) then
                 list.concat(taicpu.op_const(A_RTD,S_NO,parasize))
                 list.concat(taicpu.op_const(A_RTD,S_NO,parasize))
             { manually restore the stack }
             { manually restore the stack }
             else
             else
@@ -1151,7 +1151,7 @@ unit cgcpu;
               begin
               begin
                 if (isaddressregister(reg)) then
                 if (isaddressregister(reg)) then
                    internalerror(20020729);
                    internalerror(20020729);
-                if (aktcputype = cpu_MC68000) then
+                if (current_settings.cputype = cpu_MC68000) then
                   begin
                   begin
                     list.concat(taicpu.op_reg(A_EXT,S_W,reg));
                     list.concat(taicpu.op_reg(A_EXT,S_W,reg));
                     list.concat(taicpu.op_reg(A_EXT,S_L,reg));
                     list.concat(taicpu.op_reg(A_EXT,S_L,reg));
@@ -1241,7 +1241,7 @@ unit cgcpu;
 
 
         make_global:=false;
         make_global:=false;
         if (not current_module.is_unit) or
         if (not current_module.is_unit) or
-           (cs_create_smart in aktmoduleswitches) or
+           (cs_create_smart in current_settings.moduleswitches) or
            (procdef.owner.defowner.owner.symtabletype=globalsymtable) then
            (procdef.owner.defowner.owner.symtabletype=globalsymtable) then
           make_global:=true;
           make_global:=true;
 
 

+ 1 - 1
compiler/m68k/n68kadd.pas

@@ -368,7 +368,7 @@ implementation
         else
         else
            cgsize:=OS_32;
            cgsize:=OS_32;
 
 
-        if (cs_full_boolean_eval in aktlocalswitches) or
+        if (cs_full_boolean_eval in current_settings.localswitches) or
            (nodetype in [unequaln,ltn,lten,gtn,gten,equaln,xorn]) then
            (nodetype in [unequaln,ltn,lten,gtn,gten,equaln,xorn]) then
           begin
           begin
             if left.nodetype in [ordconstn,realconstn] then
             if left.nodetype in [ordconstn,realconstn] then

+ 1 - 1
compiler/m68k/n68kcnv.pas

@@ -61,7 +61,7 @@ implementation
         { In case we are in emulation mode, we must
         { In case we are in emulation mode, we must
           always call the helpers
           always call the helpers
         }
         }
-        if (cs_fp_emulation in aktmoduleswitches) then
+        if (cs_fp_emulation in current_settings.moduleswitches) then
           begin
           begin
             result := inherited first_int_to_real;
             result := inherited first_int_to_real;
             exit;
             exit;

+ 2 - 2
compiler/m68k/n68kmat.pas

@@ -145,7 +145,7 @@ implementation
      paraloc1 : tcgpara;
      paraloc1 : tcgpara;
    begin
    begin
      { no RTL call, so inline a zero denominator verification }
      { no RTL call, so inline a zero denominator verification }
-     if aktcputype <> cpu_MC68000 then
+     if current_settings.cputype <> cpu_MC68000 then
        begin
        begin
          { verify if denominator is zero }
          { verify if denominator is zero }
          current_asmdata.getjumplabel(continuelabel);
          current_asmdata.getjumplabel(continuelabel);
@@ -193,7 +193,7 @@ implementation
     begin
     begin
 //     writeln('emit mod reg reg');
 //     writeln('emit mod reg reg');
      { no RTL call, so inline a zero denominator verification }
      { no RTL call, so inline a zero denominator verification }
-     if aktcputype <> cpu_MC68000 then
+     if current_settings.cputype <> cpu_MC68000 then
        begin
        begin
          { verify if denominator is zero }
          { verify if denominator is zero }
          current_asmdata.getjumplabel(continuelabel);
          current_asmdata.getjumplabel(continuelabel);

+ 1 - 1
compiler/m68k/ra68kmot.pas

@@ -1555,7 +1555,7 @@ const
                    { DIVSL/DIVS/MULS/MULU with long for MC68020 only }
                    { DIVSL/DIVS/MULS/MULU with long for MC68020 only }
                    if (actasmtoken = AS_COLON) then
                    if (actasmtoken = AS_COLON) then
                    begin
                    begin
-                     if (aktcputype = cpu_MC68020) or (cs_compilesystem in aktmoduleswitches) then
+                     if (current_settings.cputype = cpu_MC68020) or (cs_compilesystem in current_settings.moduleswitches) then
                      begin
                      begin
                        Consume(AS_COLON);
                        Consume(AS_COLON);
                        if (actasmtoken = AS_REGISTER) then
                        if (actasmtoken = AS_REGISTER) then

+ 24 - 24
compiler/nadd.pas

@@ -208,8 +208,8 @@ implementation
             ((rt = realconstn) and
             ((rt = realconstn) and
              (trealconstnode(right).value_real = 0.0))) then
              (trealconstnode(right).value_real = 0.0))) then
           begin
           begin
-            if (cs_check_range in aktlocalswitches) or
-               (cs_check_overflow in aktlocalswitches) then
+            if (cs_check_range in current_settings.localswitches) or
+               (cs_check_overflow in current_settings.localswitches) then
                begin
                begin
                  result:=crealconstnode.create(1,pbestrealtype^);
                  result:=crealconstnode.create(1,pbestrealtype^);
                  Message(parser_e_division_by_zero);
                  Message(parser_e_division_by_zero);
@@ -250,7 +250,7 @@ implementation
              { of the same  type (JM)                                    }
              { of the same  type (JM)                                    }
              if (lt = pointerconstn) and (rt = pointerconstn) then
              if (lt = pointerconstn) and (rt = pointerconstn) then
               begin
               begin
-                if not(cs_extsyntax in aktmoduleswitches) and
+                if not(cs_extsyntax in current_settings.moduleswitches) and
                    not(nodetype in [equaln,unequaln]) then
                    not(nodetype in [equaln,unequaln]) then
                   CGMessage3(type_e_operator_not_supported_for_types,node2opstr(nodetype),ld.typename,rd.typename)
                   CGMessage3(type_e_operator_not_supported_for_types,node2opstr(nodetype),ld.typename,rd.typename)
                 else
                 else
@@ -729,7 +729,7 @@ implementation
          { Kylix allows enum+ordconstn in an enum declaration (blocktype
          { Kylix allows enum+ordconstn in an enum declaration (blocktype
            is bt_type), we need to do the conversion here before the
            is bt_type), we need to do the conversion here before the
            constant folding }
            constant folding }
-         if (m_delphi in aktmodeswitches) and
+         if (m_delphi in current_settings.modeswitches) and
             (blocktype=bt_type) then
             (blocktype=bt_type) then
           begin
           begin
             if (left.resultdef.deftype=enumdef) and
             if (left.resultdef.deftype=enumdef) and
@@ -790,7 +790,7 @@ implementation
          else if (ld.deftype=orddef) and (rd.deftype=orddef) then
          else if (ld.deftype=orddef) and (rd.deftype=orddef) then
            begin
            begin
              { optimize multiplacation by a power of 2 }
              { optimize multiplacation by a power of 2 }
-             if not(cs_check_overflow in aktlocalswitches) and
+             if not(cs_check_overflow in current_settings.localswitches) and
                 (nodetype = muln) and
                 (nodetype = muln) and
                 (((left.nodetype = ordconstn) and
                 (((left.nodetype = ordconstn) and
                   ispowerof2(tordconstnode(left).value,i)) or
                   ispowerof2(tordconstnode(left).value,i)) or
@@ -857,7 +857,7 @@ implementation
                   unequaln,
                   unequaln,
                   equaln:
                   equaln:
                     begin
                     begin
-                      if not(cs_full_boolean_eval in aktlocalswitches) or
+                      if not(cs_full_boolean_eval in current_settings.localswitches) or
                          (nf_short_bool in flags) then
                          (nf_short_bool in flags) then
                        begin
                        begin
                          { Remove any compares with constants }
                          { Remove any compares with constants }
@@ -1166,7 +1166,7 @@ implementation
                  end;
                  end;
                ltn,lten,gtn,gten:
                ltn,lten,gtn,gten:
                  begin
                  begin
-                    if (cs_extsyntax in aktmoduleswitches) then
+                    if (cs_extsyntax in current_settings.moduleswitches) then
                      begin
                      begin
                        if is_voidpointer(right.resultdef) then
                        if is_voidpointer(right.resultdef) then
                         inserttypeconv(right,left.resultdef)
                         inserttypeconv(right,left.resultdef)
@@ -1180,7 +1180,7 @@ implementation
                  end;
                  end;
                subn:
                subn:
                  begin
                  begin
-                    if (cs_extsyntax in aktmoduleswitches) then
+                    if (cs_extsyntax in current_settings.moduleswitches) then
                       begin
                       begin
                         if is_voidpointer(right.resultdef) then
                         if is_voidpointer(right.resultdef) then
                         begin
                         begin
@@ -1232,7 +1232,7 @@ implementation
                   strtype:= st_widestring
                   strtype:= st_widestring
                 else
                 else
                   if is_ansistring(rd) or is_ansistring(ld) or
                   if is_ansistring(rd) or is_ansistring(ld) or
-                     ((cs_ansistrings in aktlocalswitches) and
+                     ((cs_ansistrings in current_settings.localswitches) and
                      //todo: Move some of this to longstring's then they are implemented?
                      //todo: Move some of this to longstring's then they are implemented?
                       (
                       (
                        is_pchar(rd) or (is_chararray(rd) and (rd.size > 255)) or is_open_chararray(rd) or
                        is_pchar(rd) or (is_chararray(rd) and (rd.size > 255)) or is_open_chararray(rd) or
@@ -1385,7 +1385,7 @@ implementation
 {$ifdef SUPPORT_MMX}
 {$ifdef SUPPORT_MMX}
        { mmx support, this must be before the zero based array
        { mmx support, this must be before the zero based array
          check }
          check }
-         else if (cs_mmx in aktlocalswitches) and
+         else if (cs_mmx in current_settings.localswitches) and
                  is_mmx_able_array(ld) and
                  is_mmx_able_array(ld) and
                  is_mmx_able_array(rd) and
                  is_mmx_able_array(rd) and
                  equal_defs(ld,rd) then
                  equal_defs(ld,rd) then
@@ -1404,7 +1404,7 @@ implementation
 {$endif SUPPORT_MMX}
 {$endif SUPPORT_MMX}
          { vector support, this must be before the zero based array
          { vector support, this must be before the zero based array
            check }
            check }
-         else if (cs_support_vectors in aktglobalswitches) and
+         else if (cs_support_vectors in current_settings.globalswitches) and
                  is_vector(ld) and
                  is_vector(ld) and
                  is_vector(rd) and
                  is_vector(rd) and
                  equal_defs(ld,rd) then
                  equal_defs(ld,rd) then
@@ -1430,8 +1430,8 @@ implementation
             inserttypeconv(left,sinttype);
             inserttypeconv(left,sinttype);
             if nodetype=addn then
             if nodetype=addn then
               begin
               begin
-                if not(cs_extsyntax in aktmoduleswitches) or
-                   (not(is_pchar(ld)) and not(m_add_pointer in aktmodeswitches)) then
+                if not(cs_extsyntax in current_settings.moduleswitches) or
+                   (not(is_pchar(ld)) and not(m_add_pointer in current_settings.modeswitches)) then
                   CGMessage3(type_e_operator_not_supported_for_types,node2opstr(nodetype),ld.typename,rd.typename);
                   CGMessage3(type_e_operator_not_supported_for_types,node2opstr(nodetype),ld.typename,rd.typename);
                 if (rd.deftype=pointerdef) and
                 if (rd.deftype=pointerdef) and
                    (tpointerdef(rd).pointeddef.size>1) then
                    (tpointerdef(rd).pointeddef.size>1) then
@@ -1459,8 +1459,8 @@ implementation
              inserttypeconv(right,sinttype);
              inserttypeconv(right,sinttype);
              if nodetype in [addn,subn] then
              if nodetype in [addn,subn] then
                begin
                begin
-                 if not(cs_extsyntax in aktmoduleswitches) or
-                    (not(is_pchar(ld)) and not(m_add_pointer in aktmodeswitches)) then
+                 if not(cs_extsyntax in current_settings.moduleswitches) or
+                    (not(is_pchar(ld)) and not(m_add_pointer in current_settings.modeswitches)) then
                    CGMessage3(type_e_operator_not_supported_for_types,node2opstr(nodetype),ld.typename,rd.typename);
                    CGMessage3(type_e_operator_not_supported_for_types,node2opstr(nodetype),ld.typename,rd.typename);
                  if (ld.deftype=pointerdef) then
                  if (ld.deftype=pointerdef) then
                  begin
                  begin
@@ -2062,7 +2062,7 @@ implementation
           end;
           end;
 
 
         { can we use a shift instead of a mul? }
         { can we use a shift instead of a mul? }
-        if not (cs_check_overflow in aktlocalswitches) and
+        if not (cs_check_overflow in current_settings.localswitches) and
            (right.nodetype = ordconstn) and
            (right.nodetype = ordconstn) and
            ispowerof2(tordconstnode(right).value,power) then
            ispowerof2(tordconstnode(right).value,power) then
           begin
           begin
@@ -2089,7 +2089,7 @@ implementation
 
 
         { otherwise, create the parameters for the helper }
         { otherwise, create the parameters for the helper }
         right := ccallparanode.create(
         right := ccallparanode.create(
-          cordconstnode.create(ord(cs_check_overflow in aktlocalswitches),booltype,true),
+          cordconstnode.create(ord(cs_check_overflow in current_settings.localswitches),booltype,true),
           ccallparanode.create(right,ccallparanode.create(left,nil)));
           ccallparanode.create(right,ccallparanode.create(left,nil)));
         left := nil;
         left := nil;
         { only qword needs the unsigned code, the
         { only qword needs the unsigned code, the
@@ -2115,7 +2115,7 @@ implementation
         { In non-emulation mode, real opcodes are
         { In non-emulation mode, real opcodes are
           emitted for floating point values.
           emitted for floating point values.
         }
         }
-        if not (cs_fp_emulation in aktmoduleswitches) then
+        if not (cs_fp_emulation in current_settings.moduleswitches) then
           exit;
           exit;
 
 
         if not(target_info.system in system_wince) then
         if not(target_info.system in system_wince) then
@@ -2269,7 +2269,7 @@ implementation
          if nodetype=slashn then
          if nodetype=slashn then
            begin
            begin
 {$ifdef cpufpemu}
 {$ifdef cpufpemu}
-             if (aktfputype=fpu_soft) or (cs_fp_emulation in aktmoduleswitches) then
+             if (current_settings.fputype=fpu_soft) or (cs_fp_emulation in current_settings.moduleswitches) then
                begin
                begin
                  result:=first_addfloat;
                  result:=first_addfloat;
                  if assigned(result) then
                  if assigned(result) then
@@ -2302,7 +2302,7 @@ implementation
            { 2 booleans ? }
            { 2 booleans ? }
              if is_boolean(ld) and is_boolean(rd) then
              if is_boolean(ld) and is_boolean(rd) then
               begin
               begin
-                if (not(cs_full_boolean_eval in aktlocalswitches) or
+                if (not(cs_full_boolean_eval in current_settings.localswitches) or
                     (nf_short_bool in flags)) and
                     (nf_short_bool in flags)) and
                    (nodetype in [andn,orn]) then
                    (nodetype in [andn,orn]) then
                  begin
                  begin
@@ -2392,7 +2392,7 @@ implementation
              else
              else
 {$ifdef MMXSET}
 {$ifdef MMXSET}
 {$ifdef i386}
 {$ifdef i386}
-               if cs_mmx in aktlocalswitches then
+               if cs_mmx in current_settings.localswitches then
                  begin
                  begin
                    expectloc:=LOC_MMXREGISTER;
                    expectloc:=LOC_MMXREGISTER;
                    calcregisters(self,0,0,4);
                    calcregisters(self,0,0,4);
@@ -2478,7 +2478,7 @@ implementation
          else if (rd.deftype=floatdef) or (ld.deftype=floatdef) then
          else if (rd.deftype=floatdef) or (ld.deftype=floatdef) then
             begin
             begin
 {$ifdef cpufpemu}
 {$ifdef cpufpemu}
-             if (aktfputype=fpu_soft) or (cs_fp_emulation in aktmoduleswitches) then
+             if (current_settings.fputype=fpu_soft) or (cs_fp_emulation in current_settings.moduleswitches) then
                begin
                begin
                  result:=first_addfloat;
                  result:=first_addfloat;
                  if assigned(result) then
                  if assigned(result) then
@@ -2534,7 +2534,7 @@ implementation
 {$ifdef SUPPORT_MMX}
 {$ifdef SUPPORT_MMX}
        { mmx support, this must be before the zero based array
        { mmx support, this must be before the zero based array
          check }
          check }
-         else if (cs_mmx in aktlocalswitches) and is_mmx_able_array(ld) and
+         else if (cs_mmx in current_settings.localswitches) and is_mmx_able_array(ld) and
                  is_mmx_able_array(rd) then
                  is_mmx_able_array(rd) then
             begin
             begin
               expectloc:=LOC_MMXREGISTER;
               expectloc:=LOC_MMXREGISTER;
@@ -2563,7 +2563,7 @@ implementation
            end
            end
 
 
 {$ifdef SUPPORT_MMX}
 {$ifdef SUPPORT_MMX}
-         else if (cs_mmx in aktlocalswitches) and
+         else if (cs_mmx in current_settings.localswitches) and
                  is_mmx_able_array(ld) and
                  is_mmx_able_array(ld) and
                  is_mmx_able_array(rd) then
                  is_mmx_able_array(rd) then
             begin
             begin

+ 2 - 2
compiler/nbas.pas

@@ -308,7 +308,7 @@ implementation
 
 
          { left is the statement itself calln assignn or a complex one }
          { left is the statement itself calln assignn or a complex one }
          typecheckpass(left);
          typecheckpass(left);
-         if (not (cs_extsyntax in aktmoduleswitches)) and
+         if (not (cs_extsyntax in current_settings.moduleswitches)) and
             assigned(left.resultdef) and
             assigned(left.resultdef) and
             not((left.nodetype=calln) and
             not((left.nodetype=calln) and
                 { don't complain when funcretrefnode is set, because then the
                 { don't complain when funcretrefnode is set, because then the
@@ -396,7 +396,7 @@ implementation
                    codegenerror:=false;
                    codegenerror:=false;
                    typecheckpass(hp.left);
                    typecheckpass(hp.left);
                    if not(codegenerror) and
                    if not(codegenerror) and
-                      not(cs_extsyntax in aktmoduleswitches) and
+                      not(cs_extsyntax in current_settings.moduleswitches) and
                       (hp.left.nodetype=calln) and
                       (hp.left.nodetype=calln) and
                       not(is_void(hp.left.resultdef)) and
                       not(is_void(hp.left.resultdef)) and
                       not(cnf_return_value_used in tcallnode(hp.left).callnodeflags) and
                       not(cnf_return_value_used in tcallnode(hp.left).callnodeflags) and

+ 11 - 11
compiler/ncal.pas

@@ -580,7 +580,7 @@ type
 
 
              { Remove implicitly inserted typecast to pointer for
              { Remove implicitly inserted typecast to pointer for
                @procvar in macpas }
                @procvar in macpas }
-             if (m_mac_procvar in aktmodeswitches) and
+             if (m_mac_procvar in current_settings.modeswitches) and
                 (parasym.vardef.deftype=procvardef) and
                 (parasym.vardef.deftype=procvardef) and
                 (left.nodetype=typeconvn) and
                 (left.nodetype=typeconvn) and
                 is_voidpointer(left.resultdef) and
                 is_voidpointer(left.resultdef) and
@@ -673,7 +673,7 @@ type
                    end;
                    end;
 
 
                  { check var strings }
                  { check var strings }
-                 if (cs_strict_var_strings in aktlocalswitches) and
+                 if (cs_strict_var_strings in current_settings.localswitches) and
                     is_shortstring(left.resultdef) and
                     is_shortstring(left.resultdef) and
                     is_shortstring(parasym.vardef) and
                     is_shortstring(parasym.vardef) and
                     (parasym.varspez in [vs_out,vs_var]) and
                     (parasym.varspez in [vs_out,vs_var]) and
@@ -688,8 +688,8 @@ type
                  if (parasym.vardef.deftype=formaldef) then
                  if (parasym.vardef.deftype=formaldef) then
                    begin
                    begin
                      { load procvar if a procedure is passed }
                      { load procvar if a procedure is passed }
-                     if ((m_tp_procvar in aktmodeswitches) or
-                         (m_mac_procvar in aktmodeswitches)) and
+                     if ((m_tp_procvar in current_settings.modeswitches) or
+                         (m_mac_procvar in current_settings.modeswitches)) and
                         (left.nodetype=calln) and
                         (left.nodetype=calln) and
                         (is_void(left.resultdef)) then
                         (is_void(left.resultdef)) then
                        load_procvar_from_calln(left);
                        load_procvar_from_calln(left);
@@ -854,7 +854,7 @@ type
        begin
        begin
          srsym := tsym(systemunit.search(name));
          srsym := tsym(systemunit.search(name));
          if not assigned(srsym) and
          if not assigned(srsym) and
-            (cs_compilesystem in aktmoduleswitches) then
+            (cs_compilesystem in current_settings.moduleswitches) then
            srsym := tsym(systemunit.search(upper(name)));
            srsym := tsym(systemunit.search(upper(name)));
          if not assigned(srsym) or
          if not assigned(srsym) or
             (srsym.typ<>procsym) then
             (srsym.typ<>procsym) then
@@ -1654,7 +1654,7 @@ type
                 begin
                 begin
                    candidates:=tcallcandidates.create(symtableprocentry,symtableproc,left,(nf_isproperty in flags),
                    candidates:=tcallcandidates.create(symtableprocentry,symtableproc,left,(nf_isproperty in flags),
                      { ignore possible private in delphi mode for anon. inherited (FK) }
                      { ignore possible private in delphi mode for anon. inherited (FK) }
-                     (m_delphi in aktmodeswitches) and (cnf_anon_inherited in callnodeflags));
+                     (m_delphi in current_settings.modeswitches) and (cnf_anon_inherited in callnodeflags));
 
 
                    { no procedures found? then there is something wrong
                    { no procedures found? then there is something wrong
                      with the parameter size or the procedures are
                      with the parameter size or the procedures are
@@ -1668,7 +1668,7 @@ type
                         this inherited by inserting a nothingn. Only
                         this inherited by inserting a nothingn. Only
                         do this ugly hack in Delphi mode as it looks more
                         do this ugly hack in Delphi mode as it looks more
                         like a bug. It's also not documented }
                         like a bug. It's also not documented }
-                      if (m_delphi in aktmodeswitches) and
+                      if (m_delphi in current_settings.modeswitches) and
                          (cnf_anon_inherited in callnodeflags) and
                          (cnf_anon_inherited in callnodeflags) and
                          (symtableprocentry.owner.symtabletype=objectsymtable) and
                          (symtableprocentry.owner.symtabletype=objectsymtable) and
                          (po_overload in symtableprocentry.first_procdef.procoptions) and
                          (po_overload in symtableprocentry.first_procdef.procoptions) and
@@ -1680,8 +1680,8 @@ type
                             there are no parameters specified }
                             there are no parameters specified }
                           if not(assigned(left)) and
                           if not(assigned(left)) and
                              not(cnf_inherited in callnodeflags) and
                              not(cnf_inherited in callnodeflags) and
-                             ((m_tp_procvar in aktmodeswitches) or
-                              (m_mac_procvar in aktmodeswitches)) and
+                             ((m_tp_procvar in current_settings.modeswitches) or
+                              (m_mac_procvar in current_settings.modeswitches)) and
                              (not assigned(methodpointer) or
                              (not assigned(methodpointer) or
                               (methodpointer.nodetype <> typen)) then
                               (methodpointer.nodetype <> typen)) then
                             begin
                             begin
@@ -2453,7 +2453,7 @@ type
            begin
            begin
              tcallparanode(left).det_registers;
              tcallparanode(left).det_registers;
 
 
-             if cs_opt_level1 in aktoptimizerswitches then
+             if cs_opt_level1 in current_settings.optimizerswitches then
                begin
                begin
                  { check for stacked parameters }
                  { check for stacked parameters }
                  check_stack_parameters;
                  check_stack_parameters;
@@ -2528,7 +2528,7 @@ type
                      begin
                      begin
                        expectloc:=LOC_FPUREGISTER;
                        expectloc:=LOC_FPUREGISTER;
 {$ifdef cpufpemu}
 {$ifdef cpufpemu}
-                       if (cs_fp_emulation in aktmoduleswitches) then
+                       if (cs_fp_emulation in current_settings.moduleswitches) then
                          registersint:=1
                          registersint:=1
                        else
                        else
 {$endif cpufpemu}
 {$endif cpufpemu}

+ 16 - 16
compiler/ncgadd.pas

@@ -381,7 +381,7 @@ interface
         { And,Or will only evaluate from left to right only the
         { And,Or will only evaluate from left to right only the
           needed nodes unless full boolean evaluation is enabled }
           needed nodes unless full boolean evaluation is enabled }
         if (nodetype in [orn,andn]) and
         if (nodetype in [orn,andn]) and
-           (not(cs_full_boolean_eval in aktlocalswitches) or
+           (not(cs_full_boolean_eval in current_settings.localswitches) or
             (nf_short_bool in flags)) then
             (nf_short_bool in flags)) then
           begin
           begin
             location_reset(location,LOC_JUMP,OS_NO);
             location_reset(location,LOC_JUMP,OS_NO);
@@ -520,12 +520,12 @@ interface
                     // reg64 - reg64
                     // reg64 - reg64
                     cg.a_op_reg_reg_reg_checkoverflow(current_asmdata.CurrAsmList,OP_SUB,location.size,
                     cg.a_op_reg_reg_reg_checkoverflow(current_asmdata.CurrAsmList,OP_SUB,location.size,
                       right.location.register,left.location.register,location.register,
                       right.location.register,left.location.register,location.register,
-                      checkoverflow and (cs_check_overflow in aktlocalswitches),ovloc)
+                      checkoverflow and (cs_check_overflow in current_settings.localswitches),ovloc)
                   else
                   else
                     // reg64 - const64
                     // reg64 - const64
                     cg.a_op_const_reg_reg_checkoverflow(current_asmdata.CurrAsmList,OP_SUB,location.size,
                     cg.a_op_const_reg_reg_checkoverflow(current_asmdata.CurrAsmList,OP_SUB,location.size,
                       right.location.value,left.location.register,location.register,
                       right.location.value,left.location.register,location.register,
-                      checkoverflow and (cs_check_overflow in aktlocalswitches),ovloc);
+                      checkoverflow and (cs_check_overflow in current_settings.localswitches),ovloc);
                 end
                 end
               else
               else
                 begin
                 begin
@@ -533,7 +533,7 @@ interface
                   location_force_reg(current_asmdata.CurrAsmList,left.location,left.location.size,true);
                   location_force_reg(current_asmdata.CurrAsmList,left.location,left.location.size,true);
                   cg.a_op_reg_reg_reg_checkoverflow(current_asmdata.CurrAsmList,OP_SUB,location.size,
                   cg.a_op_reg_reg_reg_checkoverflow(current_asmdata.CurrAsmList,OP_SUB,location.size,
                     right.location.register,left.location.register,location.register,
                     right.location.register,left.location.register,location.register,
-                    checkoverflow and (cs_check_overflow in aktlocalswitches),ovloc);
+                    checkoverflow and (cs_check_overflow in current_settings.localswitches),ovloc);
                 end;
                 end;
             end;
             end;
           else
           else
@@ -546,11 +546,11 @@ interface
               if (right.location.loc = LOC_CONSTANT) then
               if (right.location.loc = LOC_CONSTANT) then
                 cg64.a_op64_const_reg_reg_checkoverflow(current_asmdata.CurrAsmList,op,location.size,right.location.value64,
                 cg64.a_op64_const_reg_reg_checkoverflow(current_asmdata.CurrAsmList,op,location.size,right.location.value64,
                   left.location.register64,location.register64,
                   left.location.register64,location.register64,
-                  checkoverflow and (cs_check_overflow in aktlocalswitches),ovloc)
+                  checkoverflow and (cs_check_overflow in current_settings.localswitches),ovloc)
               else
               else
                 cg64.a_op64_reg_reg_reg_checkoverflow(current_asmdata.CurrAsmList,op,location.size,right.location.register64,
                 cg64.a_op64_reg_reg_reg_checkoverflow(current_asmdata.CurrAsmList,op,location.size,right.location.register64,
                   left.location.register64,location.register64,
                   left.location.register64,location.register64,
-                  checkoverflow and (cs_check_overflow in aktlocalswitches),ovloc);
+                  checkoverflow and (cs_check_overflow in current_settings.localswitches),ovloc);
             end;
             end;
           subn:
           subn:
             begin
             begin
@@ -564,13 +564,13 @@ interface
                     cg64.a_op64_reg_reg_reg_checkoverflow(current_asmdata.CurrAsmList,OP_SUB,location.size,
                     cg64.a_op64_reg_reg_reg_checkoverflow(current_asmdata.CurrAsmList,OP_SUB,location.size,
                       right.location.register64,left.location.register64,
                       right.location.register64,left.location.register64,
                       location.register64,
                       location.register64,
-                      checkoverflow and (cs_check_overflow in aktlocalswitches),ovloc)
+                      checkoverflow and (cs_check_overflow in current_settings.localswitches),ovloc)
                   else
                   else
                     // reg64 - const64
                     // reg64 - const64
                     cg64.a_op64_const_reg_reg_checkoverflow(current_asmdata.CurrAsmList,OP_SUB,location.size,
                     cg64.a_op64_const_reg_reg_checkoverflow(current_asmdata.CurrAsmList,OP_SUB,location.size,
                       right.location.value64,left.location.register64,
                       right.location.value64,left.location.register64,
                       location.register64,
                       location.register64,
-                      checkoverflow and (cs_check_overflow in aktlocalswitches),ovloc)
+                      checkoverflow and (cs_check_overflow in current_settings.localswitches),ovloc)
                 end
                 end
               else
               else
                 begin
                 begin
@@ -579,7 +579,7 @@ interface
                   cg64.a_op64_reg_reg_reg_checkoverflow(current_asmdata.CurrAsmList,OP_SUB,location.size,
                   cg64.a_op64_reg_reg_reg_checkoverflow(current_asmdata.CurrAsmList,OP_SUB,location.size,
                     right.location.register64,left.location.register64,
                     right.location.register64,left.location.register64,
                     location.register64,
                     location.register64,
-                    checkoverflow and (cs_check_overflow in aktlocalswitches),ovloc);
+                    checkoverflow and (cs_check_overflow in current_settings.localswitches),ovloc);
                 end;
                 end;
             end;
             end;
           else
           else
@@ -689,11 +689,11 @@ interface
           if (right.location.loc<>LOC_CONSTANT) then
           if (right.location.loc<>LOC_CONSTANT) then
             cg.a_op_reg_reg_reg_checkoverflow(current_asmdata.CurrAsmList,cgop,location.size,
             cg.a_op_reg_reg_reg_checkoverflow(current_asmdata.CurrAsmList,cgop,location.size,
                left.location.register,right.location.register,
                left.location.register,right.location.register,
-               location.register,checkoverflow and (cs_check_overflow in aktlocalswitches),ovloc)
+               location.register,checkoverflow and (cs_check_overflow in current_settings.localswitches),ovloc)
           else
           else
             cg.a_op_const_reg_reg_checkoverflow(current_asmdata.CurrAsmList,cgop,location.size,
             cg.a_op_const_reg_reg_checkoverflow(current_asmdata.CurrAsmList,cgop,location.size,
                right.location.value,left.location.register,
                right.location.value,left.location.register,
-               location.register,checkoverflow and (cs_check_overflow in aktlocalswitches),ovloc);
+               location.register,checkoverflow and (cs_check_overflow in current_settings.localswitches),ovloc);
         end
         end
       else  { subtract is a special case since its not commutative }
       else  { subtract is a special case since its not commutative }
         begin
         begin
@@ -704,11 +704,11 @@ interface
               if right.location.loc<>LOC_CONSTANT then
               if right.location.loc<>LOC_CONSTANT then
                 cg.a_op_reg_reg_reg_checkoverflow(current_asmdata.CurrAsmList,OP_SUB,location.size,
                 cg.a_op_reg_reg_reg_checkoverflow(current_asmdata.CurrAsmList,OP_SUB,location.size,
                     right.location.register,left.location.register,
                     right.location.register,left.location.register,
-                    location.register,checkoverflow and (cs_check_overflow in aktlocalswitches),ovloc)
+                    location.register,checkoverflow and (cs_check_overflow in current_settings.localswitches),ovloc)
               else
               else
                 cg.a_op_const_reg_reg_checkoverflow(current_asmdata.CurrAsmList,OP_SUB,location.size,
                 cg.a_op_const_reg_reg_checkoverflow(current_asmdata.CurrAsmList,OP_SUB,location.size,
                   aword(right.location.value),left.location.register,
                   aword(right.location.value),left.location.register,
-                  location.register,checkoverflow and (cs_check_overflow in aktlocalswitches),ovloc);
+                  location.register,checkoverflow and (cs_check_overflow in current_settings.localswitches),ovloc);
             end
             end
           else
           else
             begin
             begin
@@ -716,7 +716,7 @@ interface
               cg.a_load_const_reg(current_asmdata.CurrAsmList,location.size,
               cg.a_load_const_reg(current_asmdata.CurrAsmList,location.size,
                 left.location.value,tmpreg);
                 left.location.value,tmpreg);
               cg.a_op_reg_reg_reg_checkoverflow(current_asmdata.CurrAsmList,OP_SUB,location.size,
               cg.a_op_reg_reg_reg_checkoverflow(current_asmdata.CurrAsmList,OP_SUB,location.size,
-                right.location.register,tmpreg,location.register,checkoverflow and (cs_check_overflow in aktlocalswitches),ovloc);
+                right.location.register,tmpreg,location.register,checkoverflow and (cs_check_overflow in current_settings.localswitches),ovloc);
             end;
             end;
         end;
         end;
 
 
@@ -763,7 +763,7 @@ interface
                 begin
                 begin
 {$ifdef SUPPORT_MMX}
 {$ifdef SUPPORT_MMX}
                 {$ifdef i386}
                 {$ifdef i386}
-                  if cs_mmx in aktlocalswitches then
+                  if cs_mmx in current_settings.localswitches then
                     second_opmmxset
                     second_opmmxset
                   else
                   else
                 {$endif}
                 {$endif}
@@ -779,7 +779,7 @@ interface
               if is_dynamic_array(left.resultdef) then
               if is_dynamic_array(left.resultdef) then
                 second_opordinal
                 second_opordinal
               else
               else
-                if (cs_support_vectors in aktglobalswitches) and
+                if (cs_support_vectors in current_settings.globalswitches) and
                    is_vector(left.resultdef) then
                    is_vector(left.resultdef) then
                   second_opvector
                   second_opvector
 {$ifdef SUPPORT_MMX}
 {$ifdef SUPPORT_MMX}

+ 3 - 3
compiler/ncgbas.pas

@@ -493,7 +493,7 @@ interface
           LOC_CREGISTER,
           LOC_CREGISTER,
           LOC_REGISTER:
           LOC_REGISTER:
             begin
             begin
-              if not(cs_opt_regvar in aktoptimizerswitches) or
+              if not(cs_opt_regvar in current_settings.optimizerswitches) or
                  (pi_has_goto in current_procinfo.flags) then
                  (pi_has_goto in current_procinfo.flags) then
                 begin
                 begin
                   { make sure the register allocator doesn't reuse the }
                   { make sure the register allocator doesn't reuse the }
@@ -516,7 +516,7 @@ interface
           LOC_CFPUREGISTER,
           LOC_CFPUREGISTER,
           LOC_FPUREGISTER:
           LOC_FPUREGISTER:
             begin
             begin
-              if not(cs_opt_regvar in aktoptimizerswitches) or
+              if not(cs_opt_regvar in current_settings.optimizerswitches) or
                  (pi_has_goto in current_procinfo.flags) then
                  (pi_has_goto in current_procinfo.flags) then
                 begin
                 begin
                   { make sure the register allocator doesn't reuse the }
                   { make sure the register allocator doesn't reuse the }
@@ -531,7 +531,7 @@ interface
           LOC_CMMREGISTER,
           LOC_CMMREGISTER,
           LOC_MMREGISTER:
           LOC_MMREGISTER:
             begin
             begin
-              if not(cs_opt_regvar in aktoptimizerswitches) or
+              if not(cs_opt_regvar in current_settings.optimizerswitches) or
                  (pi_has_goto in current_procinfo.flags) then
                  (pi_has_goto in current_procinfo.flags) then
                 begin
                 begin
                   { make sure the register allocator doesn't reuse the }
                   { make sure the register allocator doesn't reuse the }

+ 3 - 3
compiler/ncgcal.pas

@@ -131,7 +131,7 @@ implementation
           location_force_reg(current_asmdata.CurrAsmList,left.location,def_cgsize(left.resultdef),false);
           location_force_reg(current_asmdata.CurrAsmList,left.location,def_cgsize(left.resultdef),false);
 
 
         { Handle Floating point types differently }
         { Handle Floating point types differently }
-        if (left.resultdef.deftype=floatdef) and not(cs_fp_emulation in aktmoduleswitches) then
+        if (left.resultdef.deftype=floatdef) and not(cs_fp_emulation in current_settings.moduleswitches) then
          begin
          begin
 {$ifdef i386}
 {$ifdef i386}
            if tempcgpara.location^.loc<>LOC_REFERENCE then
            if tempcgpara.location^.loc<>LOC_REFERENCE then
@@ -603,7 +603,7 @@ implementation
                               cg.a_load_reg_reg(current_asmdata.CurrAsmList,cgsize,def_cgsize(resultdef),procdefinition.funcretloc[callerside].register,location.register);
                               cg.a_load_reg_reg(current_asmdata.CurrAsmList,cgsize,def_cgsize(resultdef),procdefinition.funcretloc[callerside].register,location.register);
                             end;
                             end;
 {$ifdef arm}
 {$ifdef arm}
-                          if (resultdef.deftype=floatdef) and (aktfputype in [fpu_fpa,fpu_fpa10,fpu_fpa11]) then
+                          if (resultdef.deftype=floatdef) and (current_settings.fputype in [fpu_fpa,fpu_fpa10,fpu_fpa11]) then
                             begin
                             begin
                               location_force_mem(current_asmdata.CurrAsmList,location);
                               location_force_mem(current_asmdata.CurrAsmList,location);
                             end;
                             end;
@@ -1087,7 +1087,7 @@ implementation
            location_reset(location,LOC_VOID,OS_NO);
            location_reset(location,LOC_VOID,OS_NO);
 
 
          { perhaps i/o check ? }
          { perhaps i/o check ? }
-         if (cs_check_io in aktlocalswitches) and
+         if (cs_check_io in current_settings.localswitches) and
             (po_iocheck in procdefinition.procoptions) and
             (po_iocheck in procdefinition.procoptions) and
             not(po_iocheck in current_procinfo.procdef.procoptions) and
             not(po_iocheck in current_procinfo.procdef.procoptions) and
             { no IO check for methods and procedure variables }
             { no IO check for methods and procedure variables }

+ 1 - 1
compiler/ncgcnv.pas

@@ -552,7 +552,7 @@ interface
             (tpointerdef(p^.resultdef).definition.deftype=objectdef) and not
             (tpointerdef(p^.resultdef).definition.deftype=objectdef) and not
             (tobjectdef(tpointerdef(p^.resultdef).definition).isclass) and
             (tobjectdef(tpointerdef(p^.resultdef).definition).isclass) and
             ((tobjectdef(tpointerdef(p^.resultdef).definition).options and oo_hasvmt)<>0) and
             ((tobjectdef(tpointerdef(p^.resultdef).definition).options and oo_hasvmt)<>0) and
-            (cs_check_range in aktlocalswitches) then
+            (cs_check_range in current_settings.localswitches) then
            checkobject;
            checkobject;
 {$endif TESTOBJEXT2}
 {$endif TESTOBJEXT2}
       end;
       end;

+ 9 - 9
compiler/ncgcon.pas

@@ -94,7 +94,7 @@ implementation
         lastlabel:=nil;
         lastlabel:=nil;
         realait:=floattype2ait[tfloatdef(resultdef).typ];
         realait:=floattype2ait[tfloatdef(resultdef).typ];
 {$ifdef ARM}
 {$ifdef ARM}
-        hiloswapped:=aktfputype in [fpu_fpa,fpu_fpa10,fpu_fpa11];
+        hiloswapped:=current_settings.fputype in [fpu_fpa,fpu_fpa10,fpu_fpa11];
 {$endif ARM}
 {$endif ARM}
         { const already used ? }
         { const already used ? }
         if not assigned(lab_real) then
         if not assigned(lab_real) then
@@ -146,8 +146,8 @@ implementation
                       begin
                       begin
                         current_asmdata.asmlists[al_typedconsts].concat(Tai_real_32bit.Create(ts32real(value_real)));
                         current_asmdata.asmlists[al_typedconsts].concat(Tai_real_32bit.Create(ts32real(value_real)));
                         { range checking? }
                         { range checking? }
-                        if ((cs_check_range in aktlocalswitches) or
-                          (cs_check_overflow in aktlocalswitches)) and
+                        if ((cs_check_range in current_settings.localswitches) or
+                          (cs_check_overflow in current_settings.localswitches)) and
                           (tai_real_32bit(current_asmdata.asmlists[al_typedconsts].last).value=MathInf.Value) then
                           (tai_real_32bit(current_asmdata.asmlists[al_typedconsts].last).value=MathInf.Value) then
                           Message(parser_e_range_check_error);
                           Message(parser_e_range_check_error);
                       end;
                       end;
@@ -162,8 +162,8 @@ implementation
                           current_asmdata.asmlists[al_typedconsts].concat(Tai_real_64bit.Create(ts64real(value_real)));
                           current_asmdata.asmlists[al_typedconsts].concat(Tai_real_64bit.Create(ts64real(value_real)));
 
 
                         { range checking? }
                         { range checking? }
-                        if ((cs_check_range in aktlocalswitches) or
-                          (cs_check_overflow in aktlocalswitches)) and
+                        if ((cs_check_range in current_settings.localswitches) or
+                          (cs_check_overflow in current_settings.localswitches)) and
                           (tai_real_64bit(current_asmdata.asmlists[al_typedconsts].last).value=MathInf.Value) then
                           (tai_real_64bit(current_asmdata.asmlists[al_typedconsts].last).value=MathInf.Value) then
                           Message(parser_e_range_check_error);
                           Message(parser_e_range_check_error);
                      end;
                      end;
@@ -173,8 +173,8 @@ implementation
                         current_asmdata.asmlists[al_typedconsts].concat(Tai_real_80bit.Create(value_real));
                         current_asmdata.asmlists[al_typedconsts].concat(Tai_real_80bit.Create(value_real));
 
 
                         { range checking? }
                         { range checking? }
-                        if ((cs_check_range in aktlocalswitches) or
-                          (cs_check_overflow in aktlocalswitches)) and
+                        if ((cs_check_range in current_settings.localswitches) or
+                          (cs_check_overflow in current_settings.localswitches)) and
                           (tai_real_80bit(current_asmdata.asmlists[al_typedconsts].last).value=MathInf.Value) then
                           (tai_real_80bit(current_asmdata.asmlists[al_typedconsts].last).value=MathInf.Value) then
                           Message(parser_e_range_check_error);
                           Message(parser_e_range_check_error);
                       end;
                       end;
@@ -184,8 +184,8 @@ implementation
                         current_asmdata.asmlists[al_typedconsts].concat(Tai_real_128bit.Create(value_real));
                         current_asmdata.asmlists[al_typedconsts].concat(Tai_real_128bit.Create(value_real));
 
 
                         { range checking? }
                         { range checking? }
-                        if ((cs_check_range in aktlocalswitches) or
-                          (cs_check_overflow in aktlocalswitches)) and
+                        if ((cs_check_range in current_settings.localswitches) or
+                          (cs_check_overflow in current_settings.localswitches)) and
                           (tai_real_128bit(current_asmdata.asmlists[al_typedconsts].last).value=MathInf.Value) then
                           (tai_real_128bit(current_asmdata.asmlists[al_typedconsts].last).value=MathInf.Value) then
                           Message(parser_e_range_check_error);
                           Message(parser_e_range_check_error);
                       end;
                       end;

+ 13 - 13
compiler/ncgflw.pas

@@ -107,7 +107,7 @@ implementation
 
 
     procedure tcgwhilerepeatnode.sync_regvars(checkusedregvars: boolean);
     procedure tcgwhilerepeatnode.sync_regvars(checkusedregvars: boolean);
       begin
       begin
-         if (cs_opt_regvar in aktoptimizerswitches) and
+         if (cs_opt_regvar in current_settings.optimizerswitches) and
             not(pi_has_goto in current_procinfo.flags) then
             not(pi_has_goto in current_procinfo.flags) then
            begin
            begin
              if checkusedregvars then
              if checkusedregvars then
@@ -159,9 +159,9 @@ implementation
          if lnf_testatbegin in loopflags then
          if lnf_testatbegin in loopflags then
            cg.a_jmp_always(current_asmdata.CurrAsmList,lcont);
            cg.a_jmp_always(current_asmdata.CurrAsmList,lcont);
 
 
-         if not(cs_opt_size in aktoptimizerswitches) then
+         if not(cs_opt_size in current_settings.optimizerswitches) then
             { align loop target }
             { align loop target }
-            current_asmdata.CurrAsmList.concat(Tai_align.Create(aktalignment.loopalign));
+            current_asmdata.CurrAsmList.concat(Tai_align.Create(current_settings.alignment.loopalign));
 
 
          cg.a_label(current_asmdata.CurrAsmList,lloop);
          cg.a_label(current_asmdata.CurrAsmList,lloop);
 
 
@@ -239,7 +239,7 @@ implementation
 (*
 (*
          { save regvars loaded in the beginning so that we can restore them }
          { save regvars loaded in the beginning so that we can restore them }
          { when processing the else-block                                   }
          { when processing the else-block                                   }
-         if cs_opt_regvar in aktoptimizerswitches then
+         if cs_opt_regvar in current_settings.optimizerswitches then
            begin
            begin
              org_list := current_asmdata.CurrAsmList;
              org_list := current_asmdata.CurrAsmList;
              current_asmdata.CurrAsmList := TAsmList.create;
              current_asmdata.CurrAsmList := TAsmList.create;
@@ -248,7 +248,7 @@ implementation
          maketojumpbool(current_asmdata.CurrAsmList,left,lr_dont_load_regvars);
          maketojumpbool(current_asmdata.CurrAsmList,left,lr_dont_load_regvars);
 
 
 (*
 (*
-         if cs_opt_regvar in aktoptimizerswitches then
+         if cs_opt_regvar in current_settings.optimizerswitches then
            begin
            begin
              org_regvar_loaded_int := rg.regvar_loaded_int;
              org_regvar_loaded_int := rg.regvar_loaded_int;
              org_regvar_loaded_other := rg.regvar_loaded_other;
              org_regvar_loaded_other := rg.regvar_loaded_other;
@@ -264,7 +264,7 @@ implementation
          { save current asmlist (previous instructions + then-block) and }
          { save current asmlist (previous instructions + then-block) and }
          { loaded regvar state and create new clean ones                 }
          { loaded regvar state and create new clean ones                 }
 {
 {
-         if cs_opt_regvar in aktoptimizerswitches then
+         if cs_opt_regvar in current_settings.optimizerswitches then
            begin
            begin
              then_regvar_loaded_int := rg.regvar_loaded_int;
              then_regvar_loaded_int := rg.regvar_loaded_int;
              then_regvar_loaded_other := rg.regvar_loaded_other;
              then_regvar_loaded_other := rg.regvar_loaded_other;
@@ -282,7 +282,7 @@ implementation
                    current_asmdata.getjumplabel(hl);
                    current_asmdata.getjumplabel(hl);
                    { do go back to if line !! }
                    { do go back to if line !! }
 (*
 (*
-                   if not(cs_opt_regvar in aktoptimizerswitches) then
+                   if not(cs_opt_regvar in current_settings.optimizerswitches) then
 *)
 *)
                      aktfilepos:=current_asmdata.CurrAsmList.getlasttaifilepos^
                      aktfilepos:=current_asmdata.CurrAsmList.getlasttaifilepos^
 (*
 (*
@@ -297,7 +297,7 @@ implementation
 (*
 (*
               { save current asmlist (previous instructions + else-block) }
               { save current asmlist (previous instructions + else-block) }
               { and loaded regvar state and create a new clean list       }
               { and loaded regvar state and create a new clean list       }
-              if cs_opt_regvar in aktoptimizerswitches then
+              if cs_opt_regvar in current_settings.optimizerswitches then
                 begin
                 begin
 {                  else_regvar_loaded_int := rg.regvar_loaded_int;
 {                  else_regvar_loaded_int := rg.regvar_loaded_int;
                   else_regvar_loaded_other := rg.regvar_loaded_other;}
                   else_regvar_loaded_other := rg.regvar_loaded_other;}
@@ -311,7 +311,7 @@ implementation
          else
          else
            begin
            begin
 (*
 (*
-              if cs_opt_regvar in aktoptimizerswitches then
+              if cs_opt_regvar in current_settings.optimizerswitches then
                 begin
                 begin
 {                  else_regvar_loaded_int := rg.regvar_loaded_int;
 {                  else_regvar_loaded_int := rg.regvar_loaded_int;
                   else_regvar_loaded_other := rg.regvar_loaded_other;}
                   else_regvar_loaded_other := rg.regvar_loaded_other;}
@@ -327,7 +327,7 @@ implementation
            end;
            end;
 
 
 (*
 (*
-         if cs_opt_regvar in aktoptimizerswitches then
+         if cs_opt_regvar in current_settings.optimizerswitches then
            begin
            begin
              { add loads of regvars at the end of the then- and else-blocks  }
              { add loads of regvars at the end of the then- and else-blocks  }
              { so that at the end of both blocks the same regvars are loaded }
              { so that at the end of both blocks the same regvars are loaded }
@@ -373,7 +373,7 @@ implementation
 
 
     procedure tcgfornode.sync_regvars(checkusedregvars: boolean);
     procedure tcgfornode.sync_regvars(checkusedregvars: boolean);
       begin
       begin
-         if (cs_opt_regvar in aktoptimizerswitches) and
+         if (cs_opt_regvar in current_settings.optimizerswitches) and
             not(pi_has_goto in current_procinfo.flags) then
             not(pi_has_goto in current_procinfo.flags) then
            begin
            begin
              if checkusedregvars then
              if checkusedregvars then
@@ -517,8 +517,8 @@ implementation
            cg.a_jmp_always(current_asmdata.CurrAsmList,tcglabelnode(entrylabel).getasmlabel);
            cg.a_jmp_always(current_asmdata.CurrAsmList,tcglabelnode(entrylabel).getasmlabel);
 
 
          { align loop target }
          { align loop target }
-         if not(cs_opt_size in aktoptimizerswitches) then
-            current_asmdata.CurrAsmList.concat(Tai_align.Create(aktalignment.loopalign));
+         if not(cs_opt_size in current_settings.optimizerswitches) then
+            current_asmdata.CurrAsmList.concat(Tai_align.Create(current_settings.alignment.loopalign));
          cg.a_label(current_asmdata.CurrAsmList,l3);
          cg.a_label(current_asmdata.CurrAsmList,l3);
 
 
          {If the loopvar doesn't mind on exit, we avoid the loopvar inc/dec
          {If the loopvar doesn't mind on exit, we avoid the loopvar inc/dec

+ 1 - 1
compiler/ncginl.pas

@@ -168,7 +168,7 @@ implementation
        paraloc3,paraloc4 : tcgpara;
        paraloc3,paraloc4 : tcgpara;
      begin
      begin
        { the node should be removed in the firstpass }
        { the node should be removed in the firstpass }
-       if not (cs_do_assertion in aktlocalswitches) then
+       if not (cs_do_assertion in current_settings.localswitches) then
           internalerror(7123458);
           internalerror(7123458);
        paraloc1.init;
        paraloc1.init;
        paraloc2.init;
        paraloc2.init;

+ 2 - 2
compiler/ncgmat.pas

@@ -232,7 +232,7 @@ implementation
          else
          else
 {$endif cpu64bit}
 {$endif cpu64bit}
 {$ifdef SUPPORT_MMX}
 {$ifdef SUPPORT_MMX}
-           if (cs_mmx in aktlocalswitches) and is_mmx_able_array(left.resultdef) then
+           if (cs_mmx in current_settings.localswitches) and is_mmx_able_array(left.resultdef) then
              second_mmx
              second_mmx
          else
          else
 {$endif SUPPORT_MMX}
 {$endif SUPPORT_MMX}
@@ -469,7 +469,7 @@ implementation
         if is_boolean(resultdef) then
         if is_boolean(resultdef) then
           second_boolean
           second_boolean
 {$ifdef SUPPORT_MMX}
 {$ifdef SUPPORT_MMX}
-        else if (cs_mmx in aktlocalswitches) and is_mmx_able_array(left.resultdef) then
+        else if (cs_mmx in current_settings.localswitches) and is_mmx_able_array(left.resultdef) then
           second_mmx
           second_mmx
 {$endif SUPPORT_MMX}
 {$endif SUPPORT_MMX}
 {$ifndef cpu64bit}
 {$ifndef cpu64bit}

+ 17 - 17
compiler/ncgmem.pas

@@ -215,9 +215,9 @@ implementation
             else
             else
               internalerror(200507031);
               internalerror(200507031);
          end;
          end;
-         if (cs_use_heaptrc in aktglobalswitches) and
-            (cs_checkpointer in aktlocalswitches) and
-            not(cs_compilesystem in aktmoduleswitches) and
+         if (cs_use_heaptrc in current_settings.globalswitches) and
+            (cs_checkpointer in current_settings.localswitches) and
+            not(cs_compilesystem in current_settings.moduleswitches) and
             not(tpointerdef(left.resultdef).is_far) and
             not(tpointerdef(left.resultdef).is_far) and
             not(nf_no_checkpointer in flags) then
             not(nf_no_checkpointer in flags) then
           begin
           begin
@@ -274,9 +274,9 @@ implementation
                   end;
                   end;
              end;
              end;
              { implicit deferencing }
              { implicit deferencing }
-             if (cs_use_heaptrc in aktglobalswitches) and
-                (cs_checkpointer in aktlocalswitches) and
-                not(cs_compilesystem in aktmoduleswitches) then
+             if (cs_use_heaptrc in current_settings.globalswitches) and
+                (cs_checkpointer in current_settings.localswitches) and
+                not(cs_compilesystem in current_settings.moduleswitches) then
               begin
               begin
                 paramanager.getintparaloc(pocall_default,1,paraloc1);
                 paramanager.getintparaloc(pocall_default,1,paraloc1);
                 paramanager.allocparaloc(current_asmdata.CurrAsmList,paraloc1);
                 paramanager.allocparaloc(current_asmdata.CurrAsmList,paraloc1);
@@ -293,9 +293,9 @@ implementation
              tg.GetTempTyped(current_asmdata.CurrAsmList,left.resultdef,tt_normal,location.reference);
              tg.GetTempTyped(current_asmdata.CurrAsmList,left.resultdef,tt_normal,location.reference);
              cg.a_load_loc_ref(current_asmdata.CurrAsmList,OS_ADDR,left.location,location.reference);
              cg.a_load_loc_ref(current_asmdata.CurrAsmList,OS_ADDR,left.location,location.reference);
              { implicit deferencing also for interfaces }
              { implicit deferencing also for interfaces }
-             if (cs_use_heaptrc in aktglobalswitches) and
-                (cs_checkpointer in aktlocalswitches) and
-                not(cs_compilesystem in aktmoduleswitches) then
+             if (cs_use_heaptrc in current_settings.globalswitches) and
+                (cs_checkpointer in current_settings.localswitches) and
+                not(cs_compilesystem in current_settings.moduleswitches) then
               begin
               begin
                 paramanager.getintparaloc(pocall_default,1,paraloc1);
                 paramanager.getintparaloc(pocall_default,1,paraloc1);
                 paramanager.allocparaloc(current_asmdata.CurrAsmList,paraloc1);
                 paramanager.allocparaloc(current_asmdata.CurrAsmList,paraloc1);
@@ -648,7 +648,7 @@ implementation
 
 
               { check for a zero length string,
               { check for a zero length string,
                 we can use the ansistring routine here }
                 we can use the ansistring routine here }
-              if (cs_check_range in aktlocalswitches) then
+              if (cs_check_range in current_settings.localswitches) then
                 begin
                 begin
                    paramanager.getintparaloc(pocall_default,1,paraloc1);
                    paramanager.getintparaloc(pocall_default,1,paraloc1);
                    paramanager.allocparaloc(current_asmdata.CurrAsmList,paraloc1);
                    paramanager.allocparaloc(current_asmdata.CurrAsmList,paraloc1);
@@ -712,7 +712,7 @@ implementation
                              (tordconstnode(right).value<tarraydef(left.resultdef).lowrange) then
                              (tordconstnode(right).value<tarraydef(left.resultdef).lowrange) then
                             begin
                             begin
                               { this should be caught in the typecheckpass! (JM) }
                               { this should be caught in the typecheckpass! (JM) }
-                              if (cs_check_range in aktlocalswitches) then
+                              if (cs_check_range in current_settings.localswitches) then
                                 CGMessage(parser_e_range_check_error)
                                 CGMessage(parser_e_range_check_error)
                               else
                               else
                                 CGMessage(parser_w_range_check_error);
                                 CGMessage(parser_w_range_check_error);
@@ -723,13 +723,13 @@ implementation
                           { range checking for open and dynamic arrays needs
                           { range checking for open and dynamic arrays needs
                             runtime code }
                             runtime code }
                           secondpass(right);
                           secondpass(right);
-                          if (cs_check_range in aktlocalswitches) then
+                          if (cs_check_range in current_settings.localswitches) then
                             rangecheck_array;
                             rangecheck_array;
                        end;
                        end;
                   end;
                   end;
                 stringdef :
                 stringdef :
                   begin
                   begin
-                    if (cs_check_range in aktlocalswitches) then
+                    if (cs_check_range in current_settings.localswitches) then
                      begin
                      begin
                        case tstringdef(left.resultdef).string_typ of
                        case tstringdef(left.resultdef).string_typ of
                          { it's the same for ansi- and wide strings }
                          { it's the same for ansi- and wide strings }
@@ -800,11 +800,11 @@ implementation
          else
          else
          { not nodetype=ordconstn }
          { not nodetype=ordconstn }
            begin
            begin
-              if (cs_opt_level1 in aktoptimizerswitches) and
+              if (cs_opt_level1 in current_settings.optimizerswitches) and
                  { if we do range checking, we don't }
                  { if we do range checking, we don't }
                  { need that fancy code (it would be }
                  { need that fancy code (it would be }
                  { buggy)                            }
                  { buggy)                            }
-                 not(cs_check_range in aktlocalswitches) and
+                 not(cs_check_range in current_settings.localswitches) and
                  (left.resultdef.deftype=arraydef) and
                  (left.resultdef.deftype=arraydef) and
                  not is_packed_array(left.resultdef) then
                  not is_packed_array(left.resultdef) then
                 begin
                 begin
@@ -884,14 +884,14 @@ implementation
                 internalerror(2006010801);
                 internalerror(2006010801);
 
 
               { only range check now, we can't range check loc_flags/loc_jump }
               { only range check now, we can't range check loc_flags/loc_jump }
-              if cs_check_range in aktlocalswitches then
+              if cs_check_range in current_settings.localswitches then
                begin
                begin
                  if left.resultdef.deftype=arraydef then
                  if left.resultdef.deftype=arraydef then
                    rangecheck_array;
                    rangecheck_array;
                end;
                end;
 
 
             { produce possible range check code: }
             { produce possible range check code: }
-              if cs_check_range in aktlocalswitches then
+              if cs_check_range in current_settings.localswitches then
                begin
                begin
                  if left.resultdef.deftype=arraydef then
                  if left.resultdef.deftype=arraydef then
                    begin
                    begin

+ 3 - 3
compiler/ncgset.pas

@@ -182,7 +182,7 @@ implementation
       { Lots of comparisions take a lot of time, so do not allow
       { Lots of comparisions take a lot of time, so do not allow
         too much comparisions. 8 comparisions are, however, still
         too much comparisions. 8 comparisions are, however, still
         smalller than emitting the set }
         smalller than emitting the set }
-      if cs_opt_size in aktoptimizerswitches then
+      if cs_opt_size in current_settings.optimizerswitches then
         maxcompares:=8
         maxcompares:=8
       else
       else
         maxcompares:=5;
         maxcompares:=5;
@@ -765,7 +765,7 @@ implementation
          else
          else
 {$endif cpu64bit}
 {$endif cpu64bit}
            begin
            begin
-              if cs_opt_level1 in aktoptimizerswitches then
+              if cs_opt_level1 in current_settings.optimizerswitches then
                 begin
                 begin
                    { procedures are empirically passed on }
                    { procedures are empirically passed on }
                    { consumption can also be calculated   }
                    { consumption can also be calculated   }
@@ -793,7 +793,7 @@ implementation
                      dist:=max_label-min_label;
                      dist:=max_label-min_label;
 
 
                    { optimize for size ? }
                    { optimize for size ? }
-                   if cs_opt_size in aktoptimizerswitches  then
+                   if cs_opt_size in current_settings.optimizerswitches  then
                      begin
                      begin
                        if has_jumptable and
                        if has_jumptable and
                           not((labelcnt<=2) or
                           not((labelcnt<=2) or

+ 13 - 13
compiler/ncgutil.pas

@@ -344,10 +344,10 @@ implementation
             end;
             end;
           LOC_CREFERENCE,LOC_REFERENCE:
           LOC_CREFERENCE,LOC_REFERENCE:
             begin
             begin
-              if not(cs_opt_regvar in aktoptimizerswitches) or
+              if not(cs_opt_regvar in current_settings.optimizerswitches) or
                  (getsupreg(t.reference.base) in cg.rgint.usableregs) then
                  (getsupreg(t.reference.base) in cg.rgint.usableregs) then
                 exclude(regs,getsupreg(t.reference.base));
                 exclude(regs,getsupreg(t.reference.base));
-              if not(cs_opt_regvar in aktoptimizerswitches) or
+              if not(cs_opt_regvar in current_settings.optimizerswitches) or
                  (getsupreg(t.reference.index) in cg.rgint.usableregs) then
                  (getsupreg(t.reference.index) in cg.rgint.usableregs) then
                 exclude(regs,getsupreg(t.reference.index));
                 exclude(regs,getsupreg(t.reference.index));
             end;
             end;
@@ -1860,7 +1860,7 @@ implementation
           therefore if the context must be saved, do it before
           therefore if the context must be saved, do it before
           the actual call to the profile code
           the actual call to the profile code
         }
         }
-        if (cs_profile in aktmoduleswitches) and
+        if (cs_profile in current_settings.moduleswitches) and
            not(po_assembler in current_procinfo.procdef.procoptions) then
            not(po_assembler in current_procinfo.procdef.procoptions) then
           begin
           begin
             { non-win32 can call mcout even in main }
             { non-win32 can call mcout even in main }
@@ -1925,7 +1925,7 @@ implementation
           hs:=current_procinfo.procdef.aliasnames.getfirst;
           hs:=current_procinfo.procdef.aliasnames.getfirst;
           if hs='' then
           if hs='' then
             break;
             break;
-          if (cs_profile in aktmoduleswitches) or
+          if (cs_profile in current_settings.moduleswitches) or
              (po_global in current_procinfo.procdef.procoptions) then
              (po_global in current_procinfo.procdef.procoptions) then
             list.concat(Tai_symbol.createname_global(hs,AT_FUNCTION,0))
             list.concat(Tai_symbol.createname_global(hs,AT_FUNCTION,0))
           else
           else
@@ -1983,7 +1983,7 @@ implementation
         current_asmdata.asmcfi.start_frame(list);
         current_asmdata.asmcfi.start_frame(list);
 
 
         { All temps are know, write offsets used for information }
         { All temps are know, write offsets used for information }
-        if (cs_asm_source in aktglobalswitches) then
+        if (cs_asm_source in current_settings.globalswitches) then
           begin
           begin
             if tg.direction>0 then
             if tg.direction>0 then
               begin
               begin
@@ -2091,7 +2091,7 @@ implementation
           to the cg }
           to the cg }
 {$ifdef i386}
 {$ifdef i386}
         { allocate PIC register }
         { allocate PIC register }
-        if (cs_create_pic in aktmoduleswitches) and
+        if (cs_create_pic in current_settings.moduleswitches) and
            (tf_pic_uses_got in target_info.flags) and
            (tf_pic_uses_got in target_info.flags) and
            (pi_needs_got in current_procinfo.flags) and
            (pi_needs_got in current_procinfo.flags) and
            not(po_kylixlocal in current_procinfo.procdef.procoptions) then
            not(po_kylixlocal in current_procinfo.procdef.procoptions) then
@@ -2117,8 +2117,8 @@ implementation
       begin
       begin
         { add the procedure to the al_procedures }
         { add the procedure to the al_procedures }
         maybe_new_object_file(list);
         maybe_new_object_file(list);
-        new_section(list,sec_code,lower(pd.mangledname),aktalignment.procalign);
-        list.concat(Tai_align.create(aktalignment.procalign));
+        new_section(list,sec_code,lower(pd.mangledname),current_settings.alignment.procalign);
+        list.concat(Tai_align.create(current_settings.alignment.procalign));
         if (po_global in pd.procoptions) then
         if (po_global in pd.procoptions) then
           list.concat(Tai_symbol.createname_global(pd.mangledname,AT_FUNCTION,0))
           list.concat(Tai_symbol.createname_global(pd.mangledname,AT_FUNCTION,0))
         else
         else
@@ -2131,7 +2131,7 @@ implementation
 
 
 
 
         { create pic'ed? }
         { create pic'ed? }
-        if cs_create_pic in aktmoduleswitches then
+        if cs_create_pic in current_settings.moduleswitches then
           begin
           begin
             { it could be that we're called from a procedure not having the
             { it could be that we're called from a procedure not having the
               got loaded
               got loaded
@@ -2303,7 +2303,7 @@ implementation
                             end;
                             end;
                           end;
                           end;
                       end;
                       end;
-                    if cs_asm_source in aktglobalswitches then
+                    if cs_asm_source in current_settings.globalswitches then
                       begin
                       begin
                         case initialloc.loc of
                         case initialloc.loc of
                           LOC_REFERENCE :
                           LOC_REFERENCE :
@@ -2367,7 +2367,7 @@ implementation
               add_regvars(rv^,tabstractnormalvarsym(tloadnode(n).symtableentry).localloc);
               add_regvars(rv^,tabstractnormalvarsym(tloadnode(n).symtableentry).localloc);
           vecn:
           vecn:
             { range checks sometimes need the high parameter }
             { range checks sometimes need the high parameter }
-            if (cs_check_range in aktlocalswitches) and
+            if (cs_check_range in current_settings.localswitches) and
                (is_open_array(tvecnode(n).left.resultdef) or
                (is_open_array(tvecnode(n).left.resultdef) or
                 is_array_of_const(tvecnode(n).left.resultdef)) and
                 is_array_of_const(tvecnode(n).left.resultdef)) and
                not(current_procinfo.procdef.proccalloption in [pocall_cdecl,pocall_cppdecl]) then
                not(current_procinfo.procdef.proccalloption in [pocall_cdecl,pocall_cppdecl]) then
@@ -2819,10 +2819,10 @@ implementation
     function getprocalign : shortint;
     function getprocalign : shortint;
       begin
       begin
         { gprof uses 16 byte granularity }
         { gprof uses 16 byte granularity }
-        if (cs_profile in aktmoduleswitches) then
+        if (cs_profile in current_settings.moduleswitches) then
           result:=16
           result:=16
         else
         else
-         result:=aktalignment.procalign;
+         result:=current_settings.alignment.procalign;
       end;
       end;
 
 
 
 

+ 8 - 8
compiler/ncnv.pas

@@ -447,7 +447,7 @@ implementation
                               begin
                               begin
                                 { for constant set elements, delphi allows the usage of elements of enumerations which
                                 { for constant set elements, delphi allows the usage of elements of enumerations which
                                   have value>255 if there is no element with a value > 255 used }
                                   have value>255 if there is no element with a value > 255 used }
-                                if (m_delphi in aktmodeswitches) and (p2.resultdef.deftype=enumdef) then
+                                if (m_delphi in current_settings.modeswitches) and (p2.resultdef.deftype=enumdef) then
                                   begin
                                   begin
                                     if tordconstnode(p2).value>constsethi then
                                     if tordconstnode(p2).value>constsethi then
                                       constsethi:=tordconstnode(p2).value;
                                       constsethi:=tordconstnode(p2).value;
@@ -602,7 +602,7 @@ implementation
         newblock: tblocknode;
         newblock: tblocknode;
         newstatement: tstatementnode;
         newstatement: tstatementnode;
       begin
       begin
-         if (m_mac in aktmodeswitches) and
+         if (m_mac in current_settings.modeswitches) and
             is_integer(p.resultdef) and
             is_integer(p.resultdef) and
             (p.resultdef.size = 4) then
             (p.resultdef.size = 4) then
            begin
            begin
@@ -1138,7 +1138,7 @@ implementation
 
 
     function ttypeconvnode.typecheck_int_to_string : tnode;
     function ttypeconvnode.typecheck_int_to_string : tnode;
        begin
        begin
-         if (m_mac in aktmodeswitches) and
+         if (m_mac in current_settings.modeswitches) and
             is_integer(left.resultdef) and
             is_integer(left.resultdef) and
             (left.resultdef.size = 4) then
             (left.resultdef.size = 4) then
            begin
            begin
@@ -1649,8 +1649,8 @@ implementation
                      (tcallnode(left).para_count=0) and
                      (tcallnode(left).para_count=0) and
                      (resultdef.deftype=procvardef) and
                      (resultdef.deftype=procvardef) and
                      (
                      (
-                      (m_tp_procvar in aktmodeswitches) or
-                      (m_mac_procvar in aktmodeswitches)
+                      (m_tp_procvar in current_settings.modeswitches) or
+                      (m_mac_procvar in current_settings.modeswitches)
                      ) then
                      ) then
                    begin
                    begin
                      if assigned(tcallnode(left).right) then
                      if assigned(tcallnode(left).right) then
@@ -1745,7 +1745,7 @@ implementation
                            end;
                            end;
 
 
                          { Add runtime check? }
                          { Add runtime check? }
-                         if (cs_check_object in aktlocalswitches) then
+                         if (cs_check_object in current_settings.localswitches) then
                            begin
                            begin
                              { we can translate the typeconvnode to 'as' when
                              { we can translate the typeconvnode to 'as' when
                                typecasting to a class or interface }
                                typecasting to a class or interface }
@@ -2062,7 +2062,7 @@ implementation
     function ttypeconvnode.first_real_to_real : tnode;
     function ttypeconvnode.first_real_to_real : tnode;
       begin
       begin
 {$ifdef cpufpemu}
 {$ifdef cpufpemu}
-        if cs_fp_emulation in aktmoduleswitches then
+        if cs_fp_emulation in current_settings.moduleswitches then
           begin
           begin
             if target_info.system in system_wince then
             if target_info.system in system_wince then
               begin
               begin
@@ -2499,7 +2499,7 @@ implementation
                  (convtype=tc_int_2_int) and
                  (convtype=tc_int_2_int) and
                  (
                  (
                   (resultdef.size=left.resultdef.size) or
                   (resultdef.size=left.resultdef.size) or
-                  ((m_tp7 in aktmodeswitches) and
+                  ((m_tp7 in current_settings.modeswitches) and
                    (resultdef.size<left.resultdef.size))
                    (resultdef.size<left.resultdef.size))
                  )
                  )
                 ) or
                 ) or

+ 5 - 5
compiler/nflw.pas

@@ -497,7 +497,7 @@ implementation
          old_t_times:=cg.t_times;
          old_t_times:=cg.t_times;
 
 
          { calc register weight }
          { calc register weight }
-         if not(cs_opt_size in aktoptimizerswitches) then
+         if not(cs_opt_size in current_settings.optimizerswitches) then
            cg.t_times:=cg.t_times*8;
            cg.t_times:=cg.t_times*8;
 
 
          firstpass(left);
          firstpass(left);
@@ -530,7 +530,7 @@ implementation
 {$ifdef prefetchnext}
 {$ifdef prefetchnext}
          { do at the end so all complex typeconversions are already }
          { do at the end so all complex typeconversions are already }
          { converted to calln's                                     }
          { converted to calln's                                     }
-         if (cs_opt_level1 in aktoptimizerswitches) and
+         if (cs_opt_level1 in current_settings.optimizerswitches) and
             (lnf_testatbegin in loopflags) then
             (lnf_testatbegin in loopflags) then
            begin
            begin
              { get first component of the while check }
              { get first component of the while check }
@@ -734,7 +734,7 @@ implementation
 {$endif SUPPORT_MMX}
 {$endif SUPPORT_MMX}
 
 
          { determines registers weigths }
          { determines registers weigths }
-         if not(cs_opt_size in aktoptimizerswitches) then
+         if not(cs_opt_size in current_settings.optimizerswitches) then
            cg.t_times:=cg.t_times div 2;
            cg.t_times:=cg.t_times div 2;
          if cg.t_times=0 then
          if cg.t_times=0 then
            cg.t_times:=1;
            cg.t_times:=1;
@@ -818,7 +818,7 @@ implementation
          resultdef:=voidtype;
          resultdef:=voidtype;
 
 
          { loop unrolling }
          { loop unrolling }
-         if cs_opt_loopunroll in aktoptimizerswitches then
+         if cs_opt_loopunroll in current_settings.optimizerswitches then
            begin
            begin
              unrollres:=unroll_loop(self);
              unrollres:=unroll_loop(self);
              if assigned(unrollres) then
              if assigned(unrollres) then
@@ -903,7 +903,7 @@ implementation
           begin
           begin
             { Calc register weight }
             { Calc register weight }
             old_t_times:=cg.t_times;
             old_t_times:=cg.t_times;
-            if not(cs_opt_size in aktoptimizerswitches) then
+            if not(cs_opt_size in current_settings.optimizerswitches) then
               cg.t_times:=cg.t_times*8;
               cg.t_times:=cg.t_times*8;
             firstpass(t2);
             firstpass(t2);
             if codegenerror then
             if codegenerror then

+ 13 - 13
compiler/ninl.pas

@@ -1181,8 +1181,8 @@ implementation
         function handle_ln_const(r : bestreal) : tnode;
         function handle_ln_const(r : bestreal) : tnode;
           begin
           begin
             if r<=0.0 then
             if r<=0.0 then
-              if (cs_check_range in aktlocalswitches) or
-                 (cs_check_overflow in aktlocalswitches) then
+              if (cs_check_range in current_settings.localswitches) or
+                 (cs_check_overflow in current_settings.localswitches) then
                  begin
                  begin
                    result:=crealconstnode.create(0,pbestrealtype^);
                    result:=crealconstnode.create(0,pbestrealtype^);
                    CGMessage(type_e_wrong_math_argument)
                    CGMessage(type_e_wrong_math_argument)
@@ -1202,8 +1202,8 @@ implementation
         function handle_sqrt_const(r : bestreal) : tnode;
         function handle_sqrt_const(r : bestreal) : tnode;
           begin
           begin
             if r<0.0 then
             if r<0.0 then
-              if (cs_check_range in aktlocalswitches) or
-                 (cs_check_overflow in aktlocalswitches) then
+              if (cs_check_range in current_settings.localswitches) or
+                 (cs_check_overflow in current_settings.localswitches) then
                  begin
                  begin
                    result:=crealconstnode.create(0,pbestrealtype^);
                    result:=crealconstnode.create(0,pbestrealtype^);
                    CGMessage(type_e_wrong_math_argument)
                    CGMessage(type_e_wrong_math_argument)
@@ -1384,8 +1384,8 @@ implementation
                 begin
                 begin
                   { give warning for incompatibility with tp and delphi }
                   { give warning for incompatibility with tp and delphi }
                   if (inlinenumber in [in_lo_long,in_hi_long,in_lo_qword,in_hi_qword]) and
                   if (inlinenumber in [in_lo_long,in_hi_long,in_lo_qword,in_hi_qword]) and
-                     ((m_tp7 in aktmodeswitches) or
-                      (m_delphi in aktmodeswitches)) then
+                     ((m_tp7 in current_settings.modeswitches) or
+                      (m_delphi in current_settings.modeswitches)) then
                     CGMessage(type_w_maybe_wrong_hi_lo);
                     CGMessage(type_w_maybe_wrong_hi_lo);
                   { constant folding }
                   { constant folding }
                   if left.nodetype=ordconstn then
                   if left.nodetype=ordconstn then
@@ -1536,7 +1536,7 @@ implementation
                        end;
                        end;
                      pointerdef :
                      pointerdef :
                        begin
                        begin
-                         if m_mac in aktmodeswitches then
+                         if m_mac in current_settings.modeswitches then
                            begin
                            begin
                              hp:=ctypeconvnode.create_internal(left,ptrinttype);
                              hp:=ctypeconvnode.create_internal(left,ptrinttype);
                              left:=nil;
                              left:=nil;
@@ -1722,7 +1722,7 @@ implementation
                      begin
                      begin
                        if (resultdef.deftype=enumdef) and
                        if (resultdef.deftype=enumdef) and
                           (tenumdef(resultdef).has_jumps) and
                           (tenumdef(resultdef).has_jumps) and
-                          not(m_delphi in aktmodeswitches) then
+                          not(m_delphi in current_settings.modeswitches) then
                          CGMessage(type_e_succ_and_pred_enums_with_assign_not_possible);
                          CGMessage(type_e_succ_and_pred_enums_with_assign_not_possible);
                      end;
                      end;
 
 
@@ -1939,8 +1939,8 @@ implementation
                     begin
                     begin
                       result:=crealconstnode.create(exp(getconstrealvalue),pbestrealtype^);
                       result:=crealconstnode.create(exp(getconstrealvalue),pbestrealtype^);
                       if (trealconstnode(result).value_real=MathInf.Value) and
                       if (trealconstnode(result).value_real=MathInf.Value) and
-                         ((cs_check_range in aktlocalswitches) or
-                          (cs_check_overflow in aktlocalswitches)) then
+                         ((cs_check_range in current_settings.localswitches) or
+                          (cs_check_overflow in current_settings.localswitches)) then
                         begin
                         begin
                           result:=crealconstnode.create(0,pbestrealtype^);
                           result:=crealconstnode.create(0,pbestrealtype^);
                           CGMessage(parser_e_range_check_error);
                           CGMessage(parser_e_range_check_error);
@@ -2158,7 +2158,7 @@ implementation
 
 
                   { We've checked the whole statement for correctness, now we
                   { We've checked the whole statement for correctness, now we
                     can remove it if assertions are off }
                     can remove it if assertions are off }
-                  if not(cs_do_assertion in aktlocalswitches) then
+                  if not(cs_do_assertion in current_settings.localswitches) then
                     begin
                     begin
                       { we need a valid node, so insert a nothingn }
                       { we need a valid node, so insert a nothingn }
                       result:=cnothingnode.create;
                       result:=cnothingnode.create;
@@ -2318,7 +2318,7 @@ implementation
                      not(is_char(left.resultdef)) and
                      not(is_char(left.resultdef)) and
                      not(is_boolean(left.resultdef))) or
                      not(is_boolean(left.resultdef))) or
                     (left.resultdef.deftype = pointerdef)) and
                     (left.resultdef.deftype = pointerdef)) and
-                   (aktlocalswitches * [cs_check_overflow,cs_check_range] <> [])
+                   (current_settings.localswitches * [cs_check_overflow,cs_check_range] <> [])
                   ) then
                   ) then
                  { convert to simple add (JM) }
                  { convert to simple add (JM) }
                  begin
                  begin
@@ -2347,7 +2347,7 @@ implementation
                      trigger an overflow. For uint32 it works because then the operation is done
                      trigger an overflow. For uint32 it works because then the operation is done
                      in 64bit }
                      in 64bit }
                    if (tcallparanode(left).left.resultdef.deftype=pointerdef) then
                    if (tcallparanode(left).left.resultdef.deftype=pointerdef) then
-                     exclude(aktlocalswitches,cs_check_overflow);
+                     exclude(current_settings.localswitches,cs_check_overflow);
                    { make sure we don't call functions part of the left node twice (and generally }
                    { make sure we don't call functions part of the left node twice (and generally }
                    { optimize the code generation)                                                }
                    { optimize the code generation)                                                }
                    if node_complexity(tcallparanode(left).left) > 1 then
                    if node_complexity(tcallparanode(left).left) > 1 then

+ 3 - 3
compiler/nld.pas

@@ -351,7 +351,7 @@ implementation
 {$ifdef SUPPORT_MMX}
 {$ifdef SUPPORT_MMX}
          registersmmx:=0;
          registersmmx:=0;
 {$endif SUPPORT_MMX}
 {$endif SUPPORT_MMX}
-         if (cs_create_pic in aktmoduleswitches) and
+         if (cs_create_pic in current_settings.moduleswitches) and
            not(symtableentry.typ in [paravarsym,localvarsym]) then
            not(symtableentry.typ in [paravarsym,localvarsym]) then
            include(current_procinfo.flags,pi_needs_got);
            include(current_procinfo.flags,pi_needs_got);
 
 
@@ -747,7 +747,7 @@ implementation
          if codegenerror then
          if codegenerror then
            exit;
            exit;
 
 
-         if (cs_opt_level1 in aktoptimizerswitches) and
+         if (cs_opt_level1 in current_settings.optimizerswitches) and
             (right.nodetype = calln) and
             (right.nodetype = calln) and
             (right.resultdef=left.resultdef) and
             (right.resultdef=left.resultdef) and
             { left must be a temp, since otherwise as soon as you modify the }
             { left must be a temp, since otherwise as soon as you modify the }
@@ -786,7 +786,7 @@ implementation
                  (tstringconstnode(right).len<>0) then
                  (tstringconstnode(right).len<>0) then
                begin
                begin
 {$ifdef old_append_str}
 {$ifdef old_append_str}
-                 if (cs_opt_level1 in aktoptimizerswitches) and
+                 if (cs_opt_level1 in current_settings.optimizerswitches) and
                     (right.nodetype in [calln,blockn]) and
                     (right.nodetype in [calln,blockn]) and
                     (left.nodetype = temprefn) and
                     (left.nodetype = temprefn) and
                     is_shortstring(right.resultdef) and
                     is_shortstring(right.resultdef) and

+ 8 - 8
compiler/nmat.pas

@@ -367,7 +367,7 @@ implementation
       begin
       begin
         result := nil;
         result := nil;
         { divide/mod a number by a constant which is a power of 2? }
         { divide/mod a number by a constant which is a power of 2? }
-        if (cs_opt_peephole in aktoptimizerswitches) and
+        if (cs_opt_peephole in current_settings.optimizerswitches) and
            (right.nodetype = ordconstn) and
            (right.nodetype = ordconstn) and
 {           ((nodetype = divn) or
 {           ((nodetype = divn) or
             not is_signed(resultdef)) and}
             not is_signed(resultdef)) and}
@@ -380,7 +380,7 @@ implementation
                 if is_signed(resultdef) then
                 if is_signed(resultdef) then
                   begin
                   begin
                     if is_64bitint(left.resultdef) then
                     if is_64bitint(left.resultdef) then
-                      if not (cs_opt_size in aktoptimizerswitches) then
+                      if not (cs_opt_size in current_settings.optimizerswitches) then
                         shiftval := 63
                         shiftval := 63
                       else
                       else
                         { the shift code is a lot bigger than the call to }
                         { the shift code is a lot bigger than the call to }
@@ -622,12 +622,12 @@ implementation
            begin
            begin
            end
            end
 {$ifdef SUPPORT_MMX}
 {$ifdef SUPPORT_MMX}
-         else if (cs_mmx in aktlocalswitches) and
+         else if (cs_mmx in current_settings.localswitches) and
            is_mmx_able_array(left.resultdef) then
            is_mmx_able_array(left.resultdef) then
              begin
              begin
                { if saturation is on, left.resultdef isn't
                { if saturation is on, left.resultdef isn't
                  "mmx able" (FK)
                  "mmx able" (FK)
-               if (cs_mmx_saturation in aktlocalswitches^) and
+               if (cs_mmx_saturation in current_settings.localswitches^) and
                  (torddef(tarraydef(resultdef).definition).typ in
                  (torddef(tarraydef(resultdef).definition).typ in
                  [s32bit,u32bit]) then
                  [s32bit,u32bit]) then
                  CGMessage(type_e_mismatch);
                  CGMessage(type_e_mismatch);
@@ -671,7 +671,7 @@ implementation
         if codegenerror then
         if codegenerror then
           exit;
           exit;
 
 
-        if (cs_fp_emulation in aktmoduleswitches) and (left.resultdef.deftype=floatdef) then
+        if (cs_fp_emulation in current_settings.moduleswitches) and (left.resultdef.deftype=floatdef) then
           begin
           begin
             if not(target_info.system in system_wince) then
             if not(target_info.system in system_wince) then
               begin
               begin
@@ -730,7 +730,7 @@ implementation
                 expectloc:=LOC_FPUREGISTER;
                 expectloc:=LOC_FPUREGISTER;
               end
               end
 {$ifdef SUPPORT_MMX}
 {$ifdef SUPPORT_MMX}
-             else if (cs_mmx in aktlocalswitches) and
+             else if (cs_mmx in current_settings.localswitches) and
                is_mmx_able_array(left.resultdef) then
                is_mmx_able_array(left.resultdef) then
                  begin
                  begin
                    if (left.expectloc<>LOC_MMXREGISTER) and
                    if (left.expectloc<>LOC_MMXREGISTER) and
@@ -864,7 +864,7 @@ implementation
            end
            end
          else
          else
 {$ifdef SUPPORT_MMX}
 {$ifdef SUPPORT_MMX}
-           if (cs_mmx in aktlocalswitches) and
+           if (cs_mmx in current_settings.localswitches) and
              is_mmx_able_array(left.resultdef) then
              is_mmx_able_array(left.resultdef) then
              begin
              begin
              end
              end
@@ -923,7 +923,7 @@ implementation
            end
            end
          else
          else
 {$ifdef SUPPORT_MMX}
 {$ifdef SUPPORT_MMX}
-           if (cs_mmx in aktlocalswitches) and
+           if (cs_mmx in current_settings.localswitches) and
              is_mmx_able_array(left.resultdef) then
              is_mmx_able_array(left.resultdef) then
              begin
              begin
                if (left.expectloc<>LOC_MMXREGISTER) and
                if (left.expectloc<>LOC_MMXREGISTER) and

+ 5 - 5
compiler/nmem.pas

@@ -362,8 +362,8 @@ implementation
         if (left.resultdef.deftype=procdef) or
         if (left.resultdef.deftype=procdef) or
            (
            (
             (left.resultdef.deftype=procvardef) and
             (left.resultdef.deftype=procvardef) and
-            ((m_tp_procvar in aktmodeswitches) or
-             (m_mac_procvar in aktmodeswitches))
+            ((m_tp_procvar in current_settings.modeswitches) or
+             (m_mac_procvar in current_settings.modeswitches))
            ) then
            ) then
           begin
           begin
             isprocvar:=(left.resultdef.deftype=procvardef);
             isprocvar:=(left.resultdef.deftype=procvardef);
@@ -377,8 +377,8 @@ implementation
             { In tp procvar mode the result is always a voidpointer. Insert
             { In tp procvar mode the result is always a voidpointer. Insert
               a typeconversion to voidpointer. For methodpointers we need
               a typeconversion to voidpointer. For methodpointers we need
               to load the proc field }
               to load the proc field }
-            if (m_tp_procvar in aktmodeswitches) or
-               (m_mac_procvar in aktmodeswitches) then
+            if (m_tp_procvar in current_settings.modeswitches) or
+               (m_mac_procvar in current_settings.modeswitches) then
               begin
               begin
                 if tabstractprocdef(left.resultdef).is_addressonly then
                 if tabstractprocdef(left.resultdef).is_addressonly then
                   begin
                   begin
@@ -730,7 +730,7 @@ implementation
                  (except voidpointer) in delphi/tp7 it's only allowed for pchars. }
                  (except voidpointer) in delphi/tp7 it's only allowed for pchars. }
                if not is_voidpointer(left.resultdef) and
                if not is_voidpointer(left.resultdef) and
                   (
                   (
-                   (m_fpc in aktmodeswitches) or
+                   (m_fpc in current_settings.modeswitches) or
                    is_pchar(left.resultdef) or
                    is_pchar(left.resultdef) or
                    is_pwidechar(left.resultdef)
                    is_pwidechar(left.resultdef)
                   ) then
                   ) then

+ 2 - 2
compiler/nobj.pas

@@ -531,7 +531,7 @@ implementation
               MessagePos1(pd.fileinfo,parser_e_nothing_to_be_overridden,pd.fullprocname(false));
               MessagePos1(pd.fileinfo,parser_e_nothing_to_be_overridden,pd.fullprocname(false));
 
 
             { check that all methods have overload directive }
             { check that all methods have overload directive }
-            if not(m_fpc in aktmodeswitches) then
+            if not(m_fpc in current_settings.modeswitches) then
               begin
               begin
                 procdefcoll:=vmtentry^.firstprocdef;
                 procdefcoll:=vmtentry^.firstprocdef;
                 while assigned(procdefcoll) do
                 while assigned(procdefcoll) do
@@ -712,7 +712,7 @@ implementation
                                          (tobjectdef(pd.returndef).is_related(
                                          (tobjectdef(pd.returndef).is_related(
                                              tobjectdef(procdefcoll^.data.returndef)))) then
                                              tobjectdef(procdefcoll^.data.returndef)))) then
                                        begin
                                        begin
-                                         if not((m_delphi in aktmodeswitches) and
+                                         if not((m_delphi in current_settings.modeswitches) and
                                                 is_interface(_class)) then
                                                 is_interface(_class)) then
                                            Message2(parser_e_overridden_methods_not_same_ret,pd.fullprocname(false),
                                            Message2(parser_e_overridden_methods_not_same_ret,pd.fullprocname(false),
                                                     procdefcoll^.data.fullprocname(false))
                                                     procdefcoll^.data.fullprocname(false))

+ 1 - 1
compiler/node.pas

@@ -653,7 +653,7 @@ implementation
          location.loc:=LOC_INVALID;
          location.loc:=LOC_INVALID;
          { save local info }
          { save local info }
          fileinfo:=aktfilepos;
          fileinfo:=aktfilepos;
-         localswitches:=aktlocalswitches;
+         localswitches:=current_settings.localswitches;
          resultdef:=nil;
          resultdef:=nil;
          registersint:=0;
          registersint:=0;
          registersfpu:=0;
          registersfpu:=0;

+ 2 - 2
compiler/nopt.pas

@@ -244,7 +244,7 @@ end;
 function canbeaddsstringcharoptnode(p: taddnode): boolean;
 function canbeaddsstringcharoptnode(p: taddnode): boolean;
 begin
 begin
   canbeaddsstringcharoptnode :=
   canbeaddsstringcharoptnode :=
-    (cs_opt_level1 in aktoptimizerswitches) and
+    (cs_opt_level1 in current_settings.optimizerswitches) and
 
 
 {   the shortstring will be gotten through conversion if necessary (JM)
 {   the shortstring will be gotten through conversion if necessary (JM)
     is_shortstring(p.left.resultdef) and }
     is_shortstring(p.left.resultdef) and }
@@ -266,7 +266,7 @@ end;
 function canbeaddsstringcsstringoptnode(p: taddnode): boolean;
 function canbeaddsstringcsstringoptnode(p: taddnode): boolean;
 begin
 begin
   canbeaddsstringcsstringoptnode :=
   canbeaddsstringcsstringoptnode :=
-    (cs_opt_level1 in aktoptimizerswitches) and
+    (cs_opt_level1 in current_settings.optimizerswitches) and
 
 
 {   the shortstring will be gotten through conversion if necessary (JM)
 {   the shortstring will be gotten through conversion if necessary (JM)
     is_shortstring(p.left.resultdef) and }
     is_shortstring(p.left.resultdef) and }

+ 2 - 2
compiler/nset.pas

@@ -237,7 +237,7 @@ implementation
          if not assigned(left.resultdef) then
          if not assigned(left.resultdef) then
            internalerror(20021126);
            internalerror(20021126);
 
 
-         if (m_fpc in aktmodeswitches) then
+         if (m_fpc in current_settings.modeswitches) then
            begin
            begin
              { insert a hint that a range check error might occur on non-byte
              { insert a hint that a range check error might occur on non-byte
                elements with the in operator.
                elements with the in operator.
@@ -593,7 +593,7 @@ implementation
 
 
          { estimates the repeat of each instruction }
          { estimates the repeat of each instruction }
          old_t_times:=cg.t_times;
          old_t_times:=cg.t_times;
-         if not(cs_opt_size in aktoptimizerswitches) then
+         if not(cs_opt_size in current_settings.optimizerswitches) then
            begin
            begin
               cg.t_times:=cg.t_times div case_count_labels(labels);
               cg.t_times:=cg.t_times div case_count_labels(labels);
               if cg.t_times<1 then
               if cg.t_times<1 then

+ 1 - 1
compiler/nutils.pas

@@ -281,7 +281,7 @@ implementation
         result:=false;
         result:=false;
         if (p1.resultdef.deftype<>procvardef) or
         if (p1.resultdef.deftype<>procvardef) or
            (tponly and
            (tponly and
-            not(m_tp_procvar in aktmodeswitches)) then
+            not(m_tp_procvar in current_settings.modeswitches)) then
           exit;
           exit;
         { ignore vecn,subscriptn }
         { ignore vecn,subscriptn }
         hp:=p1;
         hp:=p1;

+ 6 - 6
compiler/ogbase.pas

@@ -1100,8 +1100,8 @@ implementation
     function TObjOutput.newObjData(const n:string):TObjData;
     function TObjOutput.newObjData(const n:string):TObjData;
       begin
       begin
         result:=CObjData.create(n);
         result:=CObjData.create(n);
-        if (cs_use_lineinfo in aktglobalswitches) or
-           (cs_debuginfo in aktmoduleswitches) then
+        if (cs_use_lineinfo in current_settings.globalswitches) or
+           (cs_debuginfo in current_settings.moduleswitches) then
           result.CreateDebugSections;
           result.CreateDebugSections;
       end;
       end;
 
 
@@ -1738,7 +1738,7 @@ implementation
                 VTENTRY and VTINHERIT symbols }
                 VTENTRY and VTINHERIT symbols }
               if objsym.bind=AB_LOCAL then
               if objsym.bind=AB_LOCAL then
                 begin
                 begin
-                  if cs_link_opt_vtable in aktglobalswitches then
+                  if cs_link_opt_vtable in current_settings.globalswitches then
                     begin
                     begin
                       hs:=objsym.name;
                       hs:=objsym.name;
                       if (hs[1]='V') then
                       if (hs[1]='V') then
@@ -1906,7 +1906,7 @@ implementation
           Comment(V_Error,'Entrypoint '+EntryName+' not defined');
           Comment(V_Error,'Entrypoint '+EntryName+' not defined');
 
 
         { Generate VTable tree }
         { Generate VTable tree }
-        if cs_link_opt_vtable in aktglobalswitches then
+        if cs_link_opt_vtable in current_settings.globalswitches then
           BuildVTableTree(VTInheritList,VTEntryList);
           BuildVTableTree(VTInheritList,VTEntryList);
         VTInheritList.Free;
         VTInheritList.Free;
         VTEntryList.Free;
         VTEntryList.Free;
@@ -2169,7 +2169,7 @@ implementation
                (
                (
                 (exesec.ObjSectionlist.count=0) or
                 (exesec.ObjSectionlist.count=0) or
                 (
                 (
-                 (cs_link_strip in aktglobalswitches) and
+                 (cs_link_strip in current_settings.globalswitches) and
                  (oso_debug in exesec.SecOptions)
                  (oso_debug in exesec.SecOptions)
                 )
                 )
                ) then
                ) then
@@ -2297,7 +2297,7 @@ implementation
               DoReloc(TObjRelocation(objsec.ObjRelocations[i]));
               DoReloc(TObjRelocation(objsec.ObjRelocations[i]));
 
 
             { Process Virtual Entry calls }
             { Process Virtual Entry calls }
-            if cs_link_opt_vtable in aktglobalswitches then
+            if cs_link_opt_vtable in current_settings.globalswitches then
               begin
               begin
                 for i:=0 to objsec.VTRefList.count-1 do
                 for i:=0 to objsec.VTRefList.count-1 do
                   begin
                   begin

+ 5 - 5
compiler/ogcoff.pas

@@ -1736,7 +1736,7 @@ const pemagic : array[0..3] of byte = (
         with TCoffObjSection(p) do
         with TCoffObjSection(p) do
           begin
           begin
             { Skip debug sections }
             { Skip debug sections }
-            if (cs_link_strip in aktglobalswitches) and
+            if (cs_link_strip in current_settings.globalswitches) and
                (oso_debug in secoptions) then
                (oso_debug in secoptions) then
               exit;
               exit;
 
 
@@ -1758,7 +1758,7 @@ const pemagic : array[0..3] of byte = (
         with TCoffObjSection(p) do
         with TCoffObjSection(p) do
           begin
           begin
             { Skip debug sections }
             { Skip debug sections }
-            if (cs_link_strip in aktglobalswitches) and
+            if (cs_link_strip in current_settings.globalswitches) and
                (oso_debug in secoptions) then
                (oso_debug in secoptions) then
               exit;
               exit;
 
 
@@ -2097,7 +2097,7 @@ const pemagic : array[0..3] of byte = (
       begin
       begin
         nsyms:=0;
         nsyms:=0;
         sympos:=0;
         sympos:=0;
-        if not(cs_link_strip in aktglobalswitches) then
+        if not(cs_link_strip in current_settings.globalswitches) then
          begin
          begin
            nsyms:=ExeSymbolList.Count;
            nsyms:=ExeSymbolList.Count;
            sympos:=CurrDataPos;
            sympos:=CurrDataPos;
@@ -2166,7 +2166,7 @@ const pemagic : array[0..3] of byte = (
               header.flag:=header.flag or PE_FILE_RELOCS_STRIPPED;
               header.flag:=header.flag or PE_FILE_RELOCS_STRIPPED;
             if FindExeSection('.stab')=nil then
             if FindExeSection('.stab')=nil then
               header.flag:=header.flag or PE_FILE_DEBUG_STRIPPED;
               header.flag:=header.flag or PE_FILE_DEBUG_STRIPPED;
-            if (cs_link_strip in aktglobalswitches) then
+            if (cs_link_strip in current_settings.globalswitches) then
               header.flag:=header.flag or PE_FILE_LOCAL_SYMS_STRIPPED;
               header.flag:=header.flag or PE_FILE_LOCAL_SYMS_STRIPPED;
           end
           end
         else
         else
@@ -2245,7 +2245,7 @@ const pemagic : array[0..3] of byte = (
         { Section data }
         { Section data }
         ExeSections.ForEachCall(@ExeSections_write_data,nil);
         ExeSections.ForEachCall(@ExeSections_write_data,nil);
         { Optional ObjSymbols }
         { Optional ObjSymbols }
-        if not(cs_link_strip in aktglobalswitches) then
+        if not(cs_link_strip in current_settings.globalswitches) then
          begin
          begin
            if SymPos<>FWriter.Size then
            if SymPos<>FWriter.Size then
              internalerror(200602252);
              internalerror(200602252);

+ 1 - 1
compiler/oglx.pas

@@ -290,7 +290,7 @@ uses
         { symbols }
         { symbols }
         nsyms:=0;
         nsyms:=0;
         sympos:=0;
         sympos:=0;
-        if not(cs_link_strip in aktglobalswitches) then
+        if not(cs_link_strip in current_settings.globalswitches) then
          begin
          begin
            sympos:=datapos;
            sympos:=datapos;
            objdata:=TObjData(objdatalist.first);
            objdata:=TObjData(objdatalist.first);

+ 140 - 140
compiler/options.pas

@@ -104,8 +104,8 @@ begin
   undef_system_macro('FPC_LINK_SMART');
   undef_system_macro('FPC_LINK_SMART');
   def_system_macro('FPC_LINK_STATIC');
   def_system_macro('FPC_LINK_STATIC');
   undef_system_macro('FPC_LINK_DYNAMIC');
   undef_system_macro('FPC_LINK_DYNAMIC');
-  initglobalswitches:=initglobalswitches+[cs_link_static];
-  initglobalswitches:=initglobalswitches-[cs_link_shared,cs_link_smart];
+  init_settings.globalswitches:=init_settings.globalswitches+[cs_link_static];
+  init_settings.globalswitches:=init_settings.globalswitches-[cs_link_shared,cs_link_smart];
 end;
 end;
 
 
 {****************************************************************************
 {****************************************************************************
@@ -409,29 +409,29 @@ begin
 
 
            'a' :
            'a' :
              begin
              begin
-               include(initglobalswitches,cs_asm_leave);
+               include(init_settings.globalswitches,cs_asm_leave);
                j:=1;
                j:=1;
                while j<=length(more) do
                while j<=length(more) do
                 begin
                 begin
                   case more[j] of
                   case more[j] of
                     'l' :
                     'l' :
-                      include(initglobalswitches,cs_asm_source);
+                      include(init_settings.globalswitches,cs_asm_source);
                     'r' :
                     'r' :
-                      include(initglobalswitches,cs_asm_regalloc);
+                      include(init_settings.globalswitches,cs_asm_regalloc);
                     't' :
                     't' :
-                      include(initglobalswitches,cs_asm_tempalloc);
+                      include(init_settings.globalswitches,cs_asm_tempalloc);
                     'n' :
                     'n' :
-                      include(initglobalswitches,cs_asm_nodes);
+                      include(init_settings.globalswitches,cs_asm_nodes);
                     'p' :
                     'p' :
                       begin
                       begin
-                        exclude(initglobalswitches,cs_asm_leave);
+                        exclude(init_settings.globalswitches,cs_asm_leave);
                         if UnsetBool(More, 0) then
                         if UnsetBool(More, 0) then
-                          exclude(initglobalswitches,cs_asm_pipe)
+                          exclude(init_settings.globalswitches,cs_asm_pipe)
                         else
                         else
-                          include(initglobalswitches,cs_asm_pipe);
+                          include(init_settings.globalswitches,cs_asm_pipe);
                       end;
                       end;
                     '-' :
                     '-' :
-                      initglobalswitches:=initglobalswitches -
+                      init_settings.globalswitches:=init_settings.globalswitches -
                           [cs_asm_leave, cs_asm_source,cs_asm_regalloc, cs_asm_tempalloc,
                           [cs_asm_leave, cs_asm_source,cs_asm_regalloc, cs_asm_tempalloc,
                            cs_asm_nodes, cs_asm_pipe];
                            cs_asm_nodes, cs_asm_pipe];
                     else
                     else
@@ -453,25 +453,25 @@ begin
 {$ifdef supportbrowser}
 {$ifdef supportbrowser}
                if UnsetBool(More,0) then
                if UnsetBool(More,0) then
                 begin
                 begin
-                  exclude(initmoduleswitches,cs_browser);
-                  exclude(initmoduleswitches,cs_local_browser);
+                  exclude(init_settings.moduleswitches,cs_browser);
+                  exclude(init_settings.moduleswitches,cs_local_browser);
 {$ifdef BrowserLog}
 {$ifdef BrowserLog}
-                  exclude(initglobalswitches,cs_browser_log);
+                  exclude(init_settings.globalswitches,cs_browser_log);
 {$endif}
 {$endif}
                 end
                 end
                else
                else
                 begin
                 begin
-                  include(initmoduleswitches,cs_browser);
+                  include(init_settings.moduleswitches,cs_browser);
 {$ifdef BrowserLog}
 {$ifdef BrowserLog}
-                  include(initglobalswitches,cs_browser_log);
+                  include(init_settings.globalswitches,cs_browser_log);
 {$endif}
 {$endif}
                 end;
                 end;
                if More<>'' then
                if More<>'' then
                  if (More='l') or (More='l+') then
                  if (More='l') or (More='l+') then
-                   include(initmoduleswitches,cs_local_browser)
+                   include(init_settings.moduleswitches,cs_local_browser)
                  else
                  else
                   if More='l-' then
                   if More='l-' then
-                   exclude(initmoduleswitches,cs_local_browser)
+                   exclude(init_settings.moduleswitches,cs_local_browser)
                  else
                  else
 {$ifdef BrowserLog}
 {$ifdef BrowserLog}
                    browserlog.elements_to_list.insert(more);
                    browserlog.elements_to_list.insert(more);
@@ -492,7 +492,7 @@ begin
                   case more[j] of
                   case more[j] of
                     'c' :
                     'c' :
                        begin
                        begin
-                         if not SetAktProcCall(upper(copy(more,j+1,length(more)-j)),initdefproccall) then
+                         if not SetAktProcCall(upper(copy(more,j+1,length(more)-j)),init_settings.defproccall) then
                           IllegalPara(opt);
                           IllegalPara(opt);
                          break;
                          break;
                        end;
                        end;
@@ -500,20 +500,20 @@ begin
                     'e' :
                     'e' :
                        begin
                        begin
                          If UnsetBool(More, j) then
                          If UnsetBool(More, j) then
-                           exclude(initmoduleswitches,cs_fp_emulation)
+                           exclude(init_settings.moduleswitches,cs_fp_emulation)
                          Else
                          Else
-                           include(initmoduleswitches,cs_fp_emulation);
+                           include(init_settings.moduleswitches,cs_fp_emulation);
                        end;
                        end;
 {$endif cpufpemu}
 {$endif cpufpemu}
                    'f' :
                    'f' :
                      begin
                      begin
                        s:=upper(copy(more,j+1,length(more)-j));
                        s:=upper(copy(more,j+1,length(more)-j));
-                       if not(SetFpuType(s,initfputype)) then
+                       if not(SetFpuType(s,init_settings.fputype)) then
                          IllegalPara(opt);
                          IllegalPara(opt);
                        break;
                        break;
                      end;
                      end;
                     'g' :
                     'g' :
-                      include(initmoduleswitches,cs_create_pic);
+                      include(init_settings.moduleswitches,cs_create_pic);
                     'h' :
                     'h' :
                       begin
                       begin
                          val(copy(more,j+1,length(more)-j),heapsize,code);
                          val(copy(more,j+1,length(more)-j),heapsize,code);
@@ -523,41 +523,41 @@ begin
                       end;
                       end;
                     'i' :
                     'i' :
                       If UnsetBool(More, j) then
                       If UnsetBool(More, j) then
-                        exclude(initlocalswitches,cs_check_io)
+                        exclude(init_settings.localswitches,cs_check_io)
                       else
                       else
-                        include(initlocalswitches,cs_check_io);
+                        include(init_settings.localswitches,cs_check_io);
                     'n' :
                     'n' :
                       If UnsetBool(More, j) then
                       If UnsetBool(More, j) then
-                        exclude(initglobalswitches,cs_link_nolink)
+                        exclude(init_settings.globalswitches,cs_link_nolink)
                       Else
                       Else
-                        include(initglobalswitches,cs_link_nolink);
+                        include(init_settings.globalswitches,cs_link_nolink);
                     'o' :
                     'o' :
                       If UnsetBool(More, j) then
                       If UnsetBool(More, j) then
-                        exclude(initlocalswitches,cs_check_overflow)
+                        exclude(init_settings.localswitches,cs_check_overflow)
                       Else
                       Else
-                        include(initlocalswitches,cs_check_overflow);
+                        include(init_settings.localswitches,cs_check_overflow);
                     'p' :
                     'p' :
                       begin
                       begin
                         s:=upper(copy(more,j+1,length(more)-j));
                         s:=upper(copy(more,j+1,length(more)-j));
-                        if not(Setcputype(s,initcputype)) then
+                        if not(Setcputype(s,init_settings.cputype)) then
                           IllegalPara(opt);
                           IllegalPara(opt);
                         break;
                         break;
                       end;
                       end;
                     'r' :
                     'r' :
                       If UnsetBool(More, j) then
                       If UnsetBool(More, j) then
-                        exclude(initlocalswitches,cs_check_range)
+                        exclude(init_settings.localswitches,cs_check_range)
                       Else
                       Else
-                        include(initlocalswitches,cs_check_range);
+                        include(init_settings.localswitches,cs_check_range);
                     'R' :
                     'R' :
                       If UnsetBool(More, j) then
                       If UnsetBool(More, j) then
                         begin
                         begin
-                          exclude(initlocalswitches,cs_check_range);
-                          exclude(initlocalswitches,cs_check_object);
+                          exclude(init_settings.localswitches,cs_check_range);
+                          exclude(init_settings.localswitches,cs_check_object);
                         end
                         end
                       Else
                       Else
                         begin
                         begin
-                          include(initlocalswitches,cs_check_range);
-                          include(initlocalswitches,cs_check_object);
+                          include(init_settings.localswitches,cs_check_range);
+                          include(init_settings.localswitches,cs_check_object);
                         end;
                         end;
                     's' :
                     's' :
                       begin
                       begin
@@ -568,19 +568,19 @@ begin
                       end;
                       end;
                     't' :
                     't' :
                        If UnsetBool(More, j) then
                        If UnsetBool(More, j) then
-                         exclude(initlocalswitches,cs_check_stack)
+                         exclude(init_settings.localswitches,cs_check_stack)
                        Else
                        Else
-                         include(initlocalswitches,cs_check_stack);
+                         include(init_settings.localswitches,cs_check_stack);
                     'D' :
                     'D' :
                        If UnsetBool(More, j) then
                        If UnsetBool(More, j) then
-                         exclude(initmoduleswitches,cs_create_dynamic)
+                         exclude(init_settings.moduleswitches,cs_create_dynamic)
                        Else
                        Else
-                         include(initmoduleswitches,cs_create_dynamic);
+                         include(init_settings.moduleswitches,cs_create_dynamic);
                     'X' :
                     'X' :
                        If UnsetBool(More, j) then
                        If UnsetBool(More, j) then
-                         exclude(initmoduleswitches,cs_create_smart)
+                         exclude(init_settings.moduleswitches,cs_create_smart)
                        Else
                        Else
-                         include(initmoduleswitches,cs_create_smart);
+                         include(init_settings.moduleswitches,cs_create_smart);
                     else
                     else
                        IllegalPara(opt);
                        IllegalPara(opt);
                   end;
                   end;
@@ -599,7 +599,7 @@ begin
                end;
                end;
            'D' :
            'D' :
              begin
              begin
-               include(initglobalswitches,cs_link_deffile);
+               include(init_settings.globalswitches,cs_link_deffile);
                j:=1;
                j:=1;
                while j<=length(more) do
                while j<=length(more) do
                 begin
                 begin
@@ -643,7 +643,7 @@ begin
                       usewindowapi:=true;
                       usewindowapi:=true;
                     '-' :
                     '-' :
                       begin
                       begin
-                        exclude(initglobalswitches,cs_link_deffile);
+                        exclude(init_settings.globalswitches,cs_link_deffile);
                         usewindowapi:=false;
                         usewindowapi:=false;
                       end;
                       end;
                     else
                     else
@@ -659,9 +659,9 @@ begin
            'E' :
            'E' :
              begin
              begin
                if UnsetBool(More, 0) then
                if UnsetBool(More, 0) then
-                 exclude(initglobalswitches,cs_link_nolink)
+                 exclude(init_settings.globalswitches,cs_link_nolink)
                else
                else
-                 include(initglobalswitches,cs_link_nolink);
+                 include(init_settings.globalswitches,cs_link_nolink);
              end;
              end;
 
 
            'F' :
            'F' :
@@ -675,11 +675,11 @@ begin
                  'c' :
                  'c' :
                    begin
                    begin
                      if (upper(more)='UTF8') or (upper(more)='UTF-8') then
                      if (upper(more)='UTF8') or (upper(more)='UTF-8') then
-                        initsourcecodepage:='utf8'
+                        init_settings.sourcecodepage:='utf8'
                      else if not(cpavailable(more)) then
                      else if not(cpavailable(more)) then
                        Message1(option_code_page_not_available,more)
                        Message1(option_code_page_not_available,more)
                      else
                      else
-                       initsourcecodepage:=more;
+                       init_settings.sourcecodepage:=more;
                    end;
                    end;
                  'D' :
                  'D' :
                    utilsdirectory:=FixPath(More,true);
                    utilsdirectory:=FixPath(More,true);
@@ -737,15 +737,15 @@ begin
              begin
              begin
                if UnsetBool(More, 0) then
                if UnsetBool(More, 0) then
                 begin
                 begin
-                  exclude(initmoduleswitches,cs_debuginfo);
-                  exclude(initglobalswitches,cs_use_heaptrc);
-                  exclude(initglobalswitches,cs_use_lineinfo);
-                  exclude(initlocalswitches,cs_checkpointer);
+                  exclude(init_settings.moduleswitches,cs_debuginfo);
+                  exclude(init_settings.globalswitches,cs_use_heaptrc);
+                  exclude(init_settings.globalswitches,cs_use_lineinfo);
+                  exclude(init_settings.localswitches,cs_checkpointer);
                   localvartrashing := -1;
                   localvartrashing := -1;
                 end
                 end
                else
                else
                 begin
                 begin
-                  include(initmoduleswitches,cs_debuginfo);
+                  include(init_settings.moduleswitches,cs_debuginfo);
                 end;
                 end;
                if not RelocSectionSetExplicitly then
                if not RelocSectionSetExplicitly then
                  RelocSection:=false;
                  RelocSection:=false;
@@ -756,9 +756,9 @@ begin
                      'c' :
                      'c' :
                        begin
                        begin
                          if UnsetBool(More, j) then
                          if UnsetBool(More, j) then
-                           exclude(initlocalswitches,cs_checkpointer)
+                           exclude(init_settings.localswitches,cs_checkpointer)
                          else
                          else
-                           include(initlocalswitches,cs_checkpointer);
+                           include(init_settings.localswitches,cs_checkpointer);
                        end;
                        end;
                      'd' :
                      'd' :
                        begin
                        begin
@@ -767,16 +767,16 @@ begin
                      'h' :
                      'h' :
                        begin
                        begin
                          if UnsetBool(More, j) then
                          if UnsetBool(More, j) then
-                           exclude(initglobalswitches,cs_use_heaptrc)
+                           exclude(init_settings.globalswitches,cs_use_heaptrc)
                          else
                          else
-                           include(initglobalswitches,cs_use_heaptrc);
+                           include(init_settings.globalswitches,cs_use_heaptrc);
                        end;
                        end;
                      'l' :
                      'l' :
                        begin
                        begin
                          if UnsetBool(More, j) then
                          if UnsetBool(More, j) then
-                           exclude(initglobalswitches,cs_use_lineinfo)
+                           exclude(init_settings.globalswitches,cs_use_lineinfo)
                          else
                          else
-                           include(initglobalswitches,cs_use_lineinfo);
+                           include(init_settings.globalswitches,cs_use_lineinfo);
                        end;
                        end;
                      's' :
                      's' :
                        begin
                        begin
@@ -792,9 +792,9 @@ begin
                      'v' :
                      'v' :
                        begin
                        begin
                          if UnsetBool(More, j) then
                          if UnsetBool(More, j) then
-                           exclude(initglobalswitches,cs_gdb_valgrind)
+                           exclude(init_settings.globalswitches,cs_gdb_valgrind)
                          else
                          else
-                           include(initglobalswitches,cs_gdb_valgrind);
+                           include(init_settings.globalswitches,cs_gdb_valgrind);
                        end;
                        end;
                      'w' :
                      'w' :
                        begin
                        begin
@@ -894,11 +894,11 @@ begin
                 begin
                 begin
                   case more[j] of
                   case more[j] of
                     '1' :
                     '1' :
-                      initoptimizerswitches:=initoptimizerswitches+level1optimizerswitches;
+                      init_settings.optimizerswitches:=init_settings.optimizerswitches+level1optimizerswitches;
                     '2' :
                     '2' :
-                      initoptimizerswitches:=initoptimizerswitches+level2optimizerswitches;
+                      init_settings.optimizerswitches:=init_settings.optimizerswitches+level2optimizerswitches;
                     '3' :
                     '3' :
-                      initoptimizerswitches:=initoptimizerswitches+level3optimizerswitches;
+                      init_settings.optimizerswitches:=init_settings.optimizerswitches+level3optimizerswitches;
                     'a' :
                     'a' :
                       begin
                       begin
                         if not(UpdateAlignmentStr(Copy(Opt,j+3,255),ParaAlignment)) then
                         if not(UpdateAlignmentStr(Copy(Opt,j+3,255),ParaAlignment)) then
@@ -906,10 +906,10 @@ begin
                         break;
                         break;
                       end;
                       end;
                     's' :
                     's' :
-                      include(initoptimizerswitches,cs_opt_size);
+                      include(init_settings.optimizerswitches,cs_opt_size);
                     'p' :
                     'p' :
                       begin
                       begin
-                        if not Setcputype(copy(more,j+1,length(more)),initoptimizecputype) then
+                        if not Setcputype(copy(more,j+1,length(more)),init_settings.optimizecputype) then
                           begin
                           begin
                             { Give warning for old i386 switches }
                             { Give warning for old i386 switches }
                             if (Length(More)-j=1) and
                             if (Length(More)-j=1) and
@@ -922,13 +922,13 @@ begin
                       end;
                       end;
                     'o' :
                     'o' :
                       begin
                       begin
-                        if not UpdateOptimizerStr(copy(more,j+1,length(more)),initoptimizerswitches) then
+                        if not UpdateOptimizerStr(copy(more,j+1,length(more)),init_settings.optimizerswitches) then
                          IllegalPara(opt);
                          IllegalPara(opt);
                         break;
                         break;
                       end;
                       end;
                     '-' :
                     '-' :
                       begin
                       begin
-                        initoptimizerswitches:=[];
+                        init_settings.optimizerswitches:=[];
                         FillChar(ParaAlignment,sizeof(ParaAlignment),0);
                         FillChar(ParaAlignment,sizeof(ParaAlignment),0);
                       end;
                       end;
                     { Obsolete switches }
                     { Obsolete switches }
@@ -951,7 +951,7 @@ begin
              begin
              begin
                if UnsetBool(More, 0) then
                if UnsetBool(More, 0) then
                  begin
                  begin
-                   initmoduleswitches:=initmoduleswitches-[cs_profile];
+                   init_settings.moduleswitches:=init_settings.moduleswitches-[cs_profile];
                    undef_system_macro('FPC_PROFILE');
                    undef_system_macro('FPC_PROFILE');
                  end
                  end
                else
                else
@@ -961,12 +961,12 @@ begin
                  case more[1] of
                  case more[1] of
                   'g' : if UnsetBool(more, 1) then
                   'g' : if UnsetBool(more, 1) then
                          begin
                          begin
-                           exclude(initmoduleswitches,cs_profile);
+                           exclude(init_settings.moduleswitches,cs_profile);
                            undef_system_macro('FPC_PROFILE');
                            undef_system_macro('FPC_PROFILE');
                          end
                          end
                         else
                         else
                          begin
                          begin
-                           include(initmoduleswitches,cs_profile);
+                           include(init_settings.moduleswitches,cs_profile);
                            def_system_macro('FPC_PROFILE');
                            def_system_macro('FPC_PROFILE');
                         end;
                         end;
                  else
                  else
@@ -978,7 +978,7 @@ begin
 
 
            'R' :
            'R' :
              begin
              begin
-               if not SetAsmReadMode(More,initasmmode) then
+               if not SetAsmReadMode(More,init_settings.asmmode) then
                  IllegalPara(opt);
                  IllegalPara(opt);
              end;
              end;
 
 
@@ -986,19 +986,19 @@ begin
              begin
              begin
                if UnsetBool(More, 0) then
                if UnsetBool(More, 0) then
                  begin
                  begin
-                   initglobalswitches:=initglobalswitches-[cs_asm_extern,cs_link_extern,cs_link_nolink];
+                   init_settings.globalswitches:=init_settings.globalswitches-[cs_asm_extern,cs_link_extern,cs_link_nolink];
                    if more<>'' then
                    if more<>'' then
                      IllegalPara(opt);
                      IllegalPara(opt);
                  end
                  end
                else
                else
                  begin
                  begin
-                   initglobalswitches:=initglobalswitches+[cs_asm_extern,cs_link_extern,cs_link_nolink];
+                   init_settings.globalswitches:=init_settings.globalswitches+[cs_asm_extern,cs_link_extern,cs_link_nolink];
                    if more='h' then
                    if more='h' then
-                     initglobalswitches:=initglobalswitches-[cs_link_on_target]
+                     init_settings.globalswitches:=init_settings.globalswitches-[cs_link_on_target]
                    else if more='t' then
                    else if more='t' then
-                     initglobalswitches:=initglobalswitches+[cs_link_on_target]
+                     init_settings.globalswitches:=init_settings.globalswitches+[cs_link_on_target]
                    else if more='r' then
                    else if more='r' then
-                     initglobalswitches:=initglobalswitches+[cs_asm_leave,cs_no_regalloc]
+                     init_settings.globalswitches:=init_settings.globalswitches+[cs_asm_leave,cs_no_regalloc]
                    else if more<>'' then
                    else if more<>'' then
                      IllegalPara(opt);
                      IllegalPara(opt);
                  end;
                  end;
@@ -1009,9 +1009,9 @@ begin
                if more[1]='I' then
                if more[1]='I' then
                  begin
                  begin
                    if upper(more)='ICOM' then
                    if upper(more)='ICOM' then
-                     initinterfacetype:=it_interfacecom
+                     init_settings.interfacetype:=it_interfacecom
                    else if upper(more)='ICORBA' then
                    else if upper(more)='ICORBA' then
-                     initinterfacetype:=it_interfacecorba
+                     init_settings.interfacetype:=it_interfacecorba
                    else
                    else
                      IllegalPara(opt);
                      IllegalPara(opt);
                  end
                  end
@@ -1024,9 +1024,9 @@ begin
                        '2' : //an alternative to -Mobjfpc
                        '2' : //an alternative to -Mobjfpc
                          SetCompileMode('OBJFPC',true);
                          SetCompileMode('OBJFPC',true);
                        'a' :
                        'a' :
-                         include(initlocalswitches,cs_do_assertion);
+                         include(init_settings.localswitches,cs_do_assertion);
                        'c' :
                        'c' :
-                         include(initmoduleswitches,cs_support_c_operators);
+                         include(init_settings.moduleswitches,cs_support_c_operators);
                        'd' : //an alternative to -Mdelphi
                        'd' : //an alternative to -Mdelphi
                          SetCompileMode('DELPHI',true);
                          SetCompileMode('DELPHI',true);
                        'e' :
                        'e' :
@@ -1035,32 +1035,32 @@ begin
                            break;
                            break;
                          end;
                          end;
                        'g' :
                        'g' :
-                         include(initmoduleswitches,cs_support_goto);
+                         include(init_settings.moduleswitches,cs_support_goto);
                        'h' :
                        'h' :
-                         include(initlocalswitches,cs_ansistrings);
+                         include(init_settings.localswitches,cs_ansistrings);
                        'i' :
                        'i' :
-                         include(initlocalswitches,cs_do_inline);
+                         include(init_settings.localswitches,cs_do_inline);
                        'k' :
                        'k' :
-                         include(initglobalswitches,cs_load_fpcylix_unit);
+                         include(init_settings.globalswitches,cs_load_fpcylix_unit);
                        'm' :
                        'm' :
-                         include(initmoduleswitches,cs_support_macro);
+                         include(init_settings.moduleswitches,cs_support_macro);
                        'o' : //an alternative to -Mtp
                        'o' : //an alternative to -Mtp
                          SetCompileMode('TP',true);
                          SetCompileMode('TP',true);
                        'p' : //an alternative to -Mgpc
                        'p' : //an alternative to -Mgpc
                          SetCompileMode('GPC',true);
                          SetCompileMode('GPC',true);
                        's' :
                        's' :
-                         include(initglobalswitches,cs_constructor_name);
+                         include(init_settings.globalswitches,cs_constructor_name);
                        't' :
                        't' :
-                         include(initmoduleswitches,cs_static_keyword);
+                         include(init_settings.moduleswitches,cs_static_keyword);
                        'v' :
                        'v' :
-                         include(initglobalswitches,cs_support_vectors);
+                         include(init_settings.globalswitches,cs_support_vectors);
                        'x' :
                        'x' :
-                         include(initglobalswitches,cs_support_exceptions);
+                         include(init_settings.globalswitches,cs_support_exceptions);
                        '-' :
                        '-' :
                          begin
                          begin
-                           initglobalswitches:=initglobalswitches - [cs_constructor_name,cs_support_exceptions];
-                           initlocalswitches:=InitLocalswitches - [cs_do_assertion, cs_do_inline, cs_ansistrings];
-                           initmoduleswitches:=initmoduleswitches - [cs_support_c_operators, cs_support_goto,
+                           init_settings.globalswitches:=init_settings.globalswitches - [cs_constructor_name,cs_support_exceptions];
+                           init_settings.localswitches:=init_settings.localswitches - [cs_do_assertion, cs_do_inline, cs_ansistrings];
+                           init_settings.moduleswitches:=init_settings.moduleswitches - [cs_support_c_operators, cs_support_goto,
                                                                      cs_support_macro,
                                                                      cs_support_macro,
                                                                      cs_static_keyword];
                                                                      cs_static_keyword];
                          end;
                          end;
@@ -1110,7 +1110,7 @@ begin
                        end;
                        end;
 {$endif UNITALIASES}
 {$endif UNITALIASES}
                     'n' :
                     'n' :
-                      exclude(initglobalswitches,cs_check_unit_name);
+                      exclude(init_settings.globalswitches,cs_check_unit_name);
                     'p' :
                     'p' :
                        begin
                        begin
                          Message2(option_obsolete_switch_use_new,'-Up','-Fu');
                          Message2(option_obsolete_switch_use_new,'-Up','-Fu');
@@ -1119,11 +1119,11 @@ begin
                     'r' :
                     'r' :
                       do_release:=true;
                       do_release:=true;
                     's' :
                     's' :
-                      include(initmoduleswitches,cs_compilesystem);
+                      include(init_settings.moduleswitches,cs_compilesystem);
                     '-' :
                     '-' :
                       begin
                       begin
-                        exclude(initmoduleswitches,cs_compilesystem);
-                        exclude(initglobalswitches,cs_check_unit_name);
+                        exclude(init_settings.moduleswitches,cs_compilesystem);
+                        exclude(init_settings.globalswitches,cs_check_unit_name);
                       end;
                       end;
                     else
                     else
                       IllegalPara(opt);
                       IllegalPara(opt);
@@ -1238,25 +1238,25 @@ begin
                     'e' :
                     'e' :
                       begin
                       begin
                         If UnsetBool(More, j) then
                         If UnsetBool(More, j) then
-                          exclude(initglobalswitches,cs_link_extern)
+                          exclude(init_settings.globalswitches,cs_link_extern)
                         else
                         else
-                          include(initglobalswitches,cs_link_extern);
+                          include(init_settings.globalswitches,cs_link_extern);
                       end;
                       end;
                     'f' :
                     'f' :
-                      include(initglobalswitches,cs_link_pthread);
+                      include(init_settings.globalswitches,cs_link_pthread);
                     'i' :
                     'i' :
                       begin
                       begin
                         If UnsetBool(More, j) then
                         If UnsetBool(More, j) then
-                          include(initglobalswitches,cs_link_extern)
+                          include(init_settings.globalswitches,cs_link_extern)
                         else
                         else
-                          exclude(initglobalswitches,cs_link_extern);
+                          exclude(init_settings.globalswitches,cs_link_extern);
                       end;
                       end;
                     'm' :
                     'm' :
                       begin
                       begin
                         If UnsetBool(More, j) then
                         If UnsetBool(More, j) then
-                          exclude(initglobalswitches,cs_link_map)
+                          exclude(init_settings.globalswitches,cs_link_map)
                         else
                         else
-                          include(initglobalswitches,cs_link_map);
+                          include(init_settings.globalswitches,cs_link_map);
                       end;
                       end;
                     'p' : ; { Ignore used by fpc.pp }
                     'p' : ; { Ignore used by fpc.pp }
                     'r' :
                     'r' :
@@ -1268,27 +1268,27 @@ begin
                     's' :
                     's' :
                       begin
                       begin
                         If UnsetBool(More, j) then
                         If UnsetBool(More, j) then
-                          exclude(initglobalswitches,cs_link_strip)
+                          exclude(init_settings.globalswitches,cs_link_strip)
                         else
                         else
-                          include(initglobalswitches,cs_link_strip);
+                          include(init_settings.globalswitches,cs_link_strip);
                       end;
                       end;
                     't' :
                     't' :
-                      include(initglobalswitches,cs_link_staticflag);
+                      include(init_settings.globalswitches,cs_link_staticflag);
                     'v' :
                     'v' :
                       begin
                       begin
                         If UnsetBool(More, j) then
                         If UnsetBool(More, j) then
-                          exclude(initglobalswitches,cs_link_opt_vtable)
+                          exclude(init_settings.globalswitches,cs_link_opt_vtable)
                         else
                         else
-                          include(initglobalswitches,cs_link_opt_vtable);
+                          include(init_settings.globalswitches,cs_link_opt_vtable);
                       end;
                       end;
                     'D' :
                     'D' :
                       begin
                       begin
                         def_system_macro('FPC_LINK_DYNAMIC');
                         def_system_macro('FPC_LINK_DYNAMIC');
                         undef_system_macro('FPC_LINK_SMART');
                         undef_system_macro('FPC_LINK_SMART');
                         undef_system_macro('FPC_LINK_STATIC');
                         undef_system_macro('FPC_LINK_STATIC');
-                        exclude(initglobalswitches,cs_link_static);
-                        exclude(initglobalswitches,cs_link_smart);
-                        include(initglobalswitches,cs_link_shared);
+                        exclude(init_settings.globalswitches,cs_link_static);
+                        exclude(init_settings.globalswitches,cs_link_smart);
+                        include(init_settings.globalswitches,cs_link_shared);
                         LinkTypeSetExplicitly:=true;
                         LinkTypeSetExplicitly:=true;
                       end;
                       end;
                     'M' :
                     'M' :
@@ -1319,7 +1319,7 @@ begin
                                         if not LinkLibraryOrder.AddWeight(s) Then
                                         if not LinkLibraryOrder.AddWeight(s) Then
                                            IllegalPara(opt);
                                            IllegalPara(opt);
                                        end;
                                        end;
-                                 'D' : include(initglobalswitches,cs_link_no_default_lib_order)
+                                 'D' : include(init_settings.globalswitches,cs_link_no_default_lib_order)
                                 else
                                 else
                                   IllegalPara(opt);
                                   IllegalPara(opt);
                                  end; {case}
                                  end; {case}
@@ -1331,9 +1331,9 @@ begin
                         def_system_macro('FPC_LINK_STATIC');
                         def_system_macro('FPC_LINK_STATIC');
                         undef_system_macro('FPC_LINK_SMART');
                         undef_system_macro('FPC_LINK_SMART');
                         undef_system_macro('FPC_LINK_DYNAMIC');
                         undef_system_macro('FPC_LINK_DYNAMIC');
-                        include(initglobalswitches,cs_link_static);
-                        exclude(initglobalswitches,cs_link_smart);
-                        exclude(initglobalswitches,cs_link_shared);
+                        include(init_settings.globalswitches,cs_link_static);
+                        exclude(init_settings.globalswitches,cs_link_smart);
+                        exclude(init_settings.globalswitches,cs_link_shared);
                         LinkTypeSetExplicitly:=true;
                         LinkTypeSetExplicitly:=true;
                       end;
                       end;
                     'X' :
                     'X' :
@@ -1341,16 +1341,16 @@ begin
                         def_system_macro('FPC_LINK_SMART');
                         def_system_macro('FPC_LINK_SMART');
                         undef_system_macro('FPC_LINK_STATIC');
                         undef_system_macro('FPC_LINK_STATIC');
                         undef_system_macro('FPC_LINK_DYNAMIC');
                         undef_system_macro('FPC_LINK_DYNAMIC');
-                        exclude(initglobalswitches,cs_link_static);
-                        include(initglobalswitches,cs_link_smart);
-                        exclude(initglobalswitches,cs_link_shared);
+                        exclude(init_settings.globalswitches,cs_link_static);
+                        include(init_settings.globalswitches,cs_link_smart);
+                        exclude(init_settings.globalswitches,cs_link_shared);
                         LinkTypeSetExplicitly:=true;
                         LinkTypeSetExplicitly:=true;
                       end;
                       end;
                     '-' :
                     '-' :
                       begin
                       begin
-                        exclude(initglobalswitches,cs_link_staticflag);
-                        exclude(initglobalswitches,cs_link_strip);
-                        exclude(initglobalswitches,cs_link_map);
+                        exclude(init_settings.globalswitches,cs_link_staticflag);
+                        exclude(init_settings.globalswitches,cs_link_strip);
+                        exclude(init_settings.globalswitches,cs_link_map);
                         set_default_link_type;
                         set_default_link_type;
                       end;
                       end;
                     else
                     else
@@ -2109,7 +2109,7 @@ begin
   end;
   end;
 
 
   { CPU Define }
   { CPU Define }
-  def_system_macro('CPU'+Cputypestr[initcputype]);
+  def_system_macro('CPU'+Cputypestr[init_settings.cputype]);
 
 
 { Check file to compile }
 { Check file to compile }
   if param_file='' then
   if param_file='' then
@@ -2133,7 +2133,7 @@ begin
       inputextension:=sourceext
       inputextension:=sourceext
      else if FileExists(inputdir+inputfile+pasext) then
      else if FileExists(inputdir+inputfile+pasext) then
        inputextension:=pasext
        inputextension:=pasext
-     else if ((m_mac in aktmodeswitches) or
+     else if ((m_mac in current_settings.modeswitches) or
               (tf_p_ext_support in target_info.flags))
               (tf_p_ext_support in target_info.flags))
              and FileExists(inputdir+inputfile+pext) then
              and FileExists(inputdir+inputfile+pext) then
        inputextension:=pext;
        inputextension:=pext;
@@ -2210,7 +2210,7 @@ begin
     Do not add it when linking on the target because then we can maybe already find
     Do not add it when linking on the target because then we can maybe already find
     .o files that are not for the target }
     .o files that are not for the target }
   if (ExePath<>GetCurrentDir) and
   if (ExePath<>GetCurrentDir) and
-     not(cs_link_on_target in initglobalswitches) then
+     not(cs_link_on_target in init_settings.globalswitches) then
    UnitSearchPath.AddPath(ExePath,false);
    UnitSearchPath.AddPath(ExePath,false);
   { Add unit dir to the object and library path }
   { Add unit dir to the object and library path }
   objectsearchpath.AddList(unitsearchpath,false);
   objectsearchpath.AddList(unitsearchpath,false);
@@ -2232,7 +2232,7 @@ begin
     end;
     end;
 
 
   { switch assembler if it's binary and we got -a on the cmdline }
   { switch assembler if it's binary and we got -a on the cmdline }
-  if (cs_asm_leave in initglobalswitches) and
+  if (cs_asm_leave in init_settings.globalswitches) and
      (af_outputbinary in target_asm.flags) then
      (af_outputbinary in target_asm.flags) then
    begin
    begin
      Message(option_switch_bin_to_src_assembler);
      Message(option_switch_bin_to_src_assembler);
@@ -2241,19 +2241,19 @@ begin
 
 
   { Force use of external linker if there is no
   { Force use of external linker if there is no
     internal linker or the linking is skipped }
     internal linker or the linking is skipped }
-  if not(cs_link_extern in initglobalswitches) and
+  if not(cs_link_extern in init_settings.globalswitches) and
      (not assigned(target_info.link) or
      (not assigned(target_info.link) or
-      (cs_link_nolink in initglobalswitches)) then
-    include(initglobalswitches,cs_link_extern);
+      (cs_link_nolink in init_settings.globalswitches)) then
+    include(init_settings.globalswitches,cs_link_extern);
 
 
   { turn off stripping if compiling with debuginfo or profile }
   { turn off stripping if compiling with debuginfo or profile }
-  if (cs_debuginfo in initmoduleswitches) or
-     (cs_profile in initmoduleswitches) then
-    exclude(initglobalswitches,cs_link_strip);
+  if (cs_debuginfo in init_settings.moduleswitches) or
+     (cs_profile in init_settings.moduleswitches) then
+    exclude(init_settings.globalswitches,cs_link_strip);
 
 
   { force fpu emulation on arm/wince and arm/gba }
   { force fpu emulation on arm/wince and arm/gba }
   if target_info.system in [system_arm_wince,system_arm_gba] then
   if target_info.system in [system_arm_wince,system_arm_gba] then
-    include(initmoduleswitches,cs_fp_emulation);
+    include(init_settings.moduleswitches,cs_fp_emulation);
 
 
   { Section smartlinking conflicts with import sections on Windows }
   { Section smartlinking conflicts with import sections on Windows }
   if GenerateImportSection and
   if GenerateImportSection and
@@ -2262,7 +2262,7 @@ begin
 
 
 {$ifdef x86_64}
 {$ifdef x86_64}
   {$warning HACK: turn off smartlinking}
   {$warning HACK: turn off smartlinking}
-  exclude(initmoduleswitches,cs_create_smart);
+  exclude(init_settings.moduleswitches,cs_create_smart);
 {$endif}
 {$endif}
 
 
   if not LinkTypeSetExplicitly then
   if not LinkTypeSetExplicitly then
@@ -2272,15 +2272,15 @@ begin
     1. load the defaults for the target
     1. load the defaults for the target
     2. override with generic optimizer setting (little size)
     2. override with generic optimizer setting (little size)
     3. override with the user specified -Oa }
     3. override with the user specified -Oa }
-  UpdateAlignment(initalignment,target_info.alignment);
-  if (cs_opt_size in aktoptimizerswitches) then
+  UpdateAlignment(init_settings.alignment,target_info.alignment);
+  if (cs_opt_size in current_settings.optimizerswitches) then
    begin
    begin
-     initalignment.procalign:=1;
-     initalignment.jumpalign:=1;
-     initalignment.loopalign:=1;
+     init_settings.alignment.procalign:=1;
+     init_settings.alignment.jumpalign:=1;
+     init_settings.alignment.loopalign:=1;
    end;
    end;
 
 
-  UpdateAlignment(initalignment,option.paraalignment);
+  UpdateAlignment(init_settings.alignment,option.paraalignment);
 
 
   set_system_macro('FPC_VERSION',version_nr);
   set_system_macro('FPC_VERSION',version_nr);
   set_system_macro('FPC_RELEASE',release_nr);
   set_system_macro('FPC_RELEASE',release_nr);

+ 2 - 2
compiler/optunrol.pas

@@ -61,7 +61,7 @@ unit optunrol;
       begin
       begin
 {$ifdef i386}
 {$ifdef i386}
         { multiply by 2 for CPUs with a long pipeline }
         { multiply by 2 for CPUs with a long pipeline }
-        if aktcputype in [cpu_Pentium4] then
+        if current_settings.cputype in [cpu_Pentium4] then
           number_unrolls:=60 div countnodes(node)
           number_unrolls:=60 div countnodes(node)
         else
         else
 {$endif i386}
 {$endif i386}
@@ -80,7 +80,7 @@ unit optunrol;
         unrollblock : tblocknode;
         unrollblock : tblocknode;
       begin
       begin
         result:=nil;
         result:=nil;
-        if (cs_opt_size in aktoptimizerswitches) then
+        if (cs_opt_size in current_settings.optimizerswitches) then
           exit;
           exit;
         if not(node.nodetype in [forn]) then
         if not(node.nodetype in [forn]) then
           exit;
           exit;

+ 12 - 65
compiler/parser.pas

@@ -81,9 +81,9 @@ implementation
          usedunits:=TLinkedList.Create;
          usedunits:=TLinkedList.Create;
 
 
          { global switches }
          { global switches }
-         aktglobalswitches:=initglobalswitches;
+         current_settings.globalswitches:=init_settings.globalswitches;
 
 
-         aktsourcecodepage:=initsourcecodepage;
+         current_settings.sourcecodepage:=init_settings.sourcecodepage;
 
 
          { initialize scanner }
          { initialize scanner }
          InitScanner;
          InitScanner;
@@ -104,7 +104,7 @@ implementation
            stacksize:=target_info.stacksize;
            stacksize:=target_info.stacksize;
 
 
          { open assembler response }
          { open assembler response }
-         if cs_link_on_target in aktglobalswitches then
+         if cs_link_on_target in current_settings.globalswitches then
            GenerateAsmRes(outputexedir+inputfile+'_ppas')
            GenerateAsmRes(outputexedir+inputfile+'_ppas')
          else
          else
            GenerateAsmRes(outputexedir+'ppas');
            GenerateAsmRes(outputexedir+'ppas');
@@ -273,23 +273,10 @@ implementation
         { cg }
         { cg }
           oldparse_only  : boolean;
           oldparse_only  : boolean;
         { akt.. things }
         { akt.. things }
-          oldaktlocalswitches  : tlocalswitches;
-          oldaktmoduleswitches : tmoduleswitches;
           oldaktfilepos      : tfileposinfo;
           oldaktfilepos      : tfileposinfo;
-          oldaktpackrecords,
-          oldaktpackenum       : shortint;
-          oldaktmaxfpuregisters : longint;
-          oldaktalignment    : talignmentinfo;
-          oldaktoptimizecputype,
-          oldaktcputype      : tcputype;
-          oldaktfputype      : tfputype;
-          oldaktasmmode      : tasmmode;
-          oldaktinterfacetype: tinterfacetypes;
-          oldaktmodeswitches : tmodeswitches;
-          oldaktoptimizerswitches : toptimizerswitches;
           old_compiled_module : tmodule;
           old_compiled_module : tmodule;
           oldcurrent_procinfo : tprocinfo;
           oldcurrent_procinfo : tprocinfo;
-          oldaktdefproccall : tproccalloption;
+          old_settings : tsettings;
           oldsourcecodepage : tcodepagestring;
           oldsourcecodepage : tcodepagestring;
         end;
         end;
 
 
@@ -309,7 +296,6 @@ implementation
             oldsymtablestack:=symtablestack;
             oldsymtablestack:=symtablestack;
             oldmacrosymtablestack:=macrosymtablestack;
             oldmacrosymtablestack:=macrosymtablestack;
             oldcurrent_procinfo:=current_procinfo;
             oldcurrent_procinfo:=current_procinfo;
-            oldaktdefproccall:=aktdefproccall;
           { save scanner state }
           { save scanner state }
             oldc:=c;
             oldc:=c;
             oldpattern:=pattern;
             oldpattern:=pattern;
@@ -318,30 +304,17 @@ implementation
             oldidtoken:=idtoken;
             oldidtoken:=idtoken;
             old_block_type:=block_type;
             old_block_type:=block_type;
             oldtokenpos:=akttokenpos;
             oldtokenpos:=akttokenpos;
-            oldsourcecodepage:=aktsourcecodepage;
           { save cg }
           { save cg }
             oldparse_only:=parse_only;
             oldparse_only:=parse_only;
           { save akt... state }
           { save akt... state }
           { handle the postponed case first }
           { handle the postponed case first }
            if localswitcheschanged then
            if localswitcheschanged then
              begin
              begin
-               aktlocalswitches:=nextaktlocalswitches;
+               current_settings.localswitches:=nextlocalswitches;
                localswitcheschanged:=false;
                localswitcheschanged:=false;
              end;
              end;
-            oldaktlocalswitches:=aktlocalswitches;
-            oldaktmoduleswitches:=aktmoduleswitches;
-            oldaktalignment:=aktalignment;
-            oldaktpackenum:=aktpackenum;
-            oldaktpackrecords:=aktpackrecords;
-            oldaktfputype:=aktfputype;
-            oldaktmaxfpuregisters:=aktmaxfpuregisters;
-            oldaktcputype:=aktcputype;
-            oldaktoptimizecputype:=aktoptimizecputype;
-            oldaktasmmode:=aktasmmode;
-            oldaktinterfacetype:=aktinterfacetype;
             oldaktfilepos:=aktfilepos;
             oldaktfilepos:=aktfilepos;
-            oldaktmodeswitches:=aktmodeswitches;
-            oldaktoptimizerswitches:=aktoptimizerswitches;
+            old_settings:=current_settings;
           end;
           end;
        { reset parser, a previous fatal error could have left these variables in an unreliable state, this is
        { reset parser, a previous fatal error could have left these variables in an unreliable state, this is
          important for the IDE }
          important for the IDE }
@@ -357,10 +330,10 @@ implementation
          symtablestack:=tsymtablestack.create;
          symtablestack:=tsymtablestack.create;
          macrosymtablestack:=tsymtablestack.create;
          macrosymtablestack:=tsymtablestack.create;
          systemunit:=nil;
          systemunit:=nil;
-         aktdefproccall:=initdefproccall;
+         current_settings.defproccall:=init_settings.defproccall;
          aktexceptblock:=0;
          aktexceptblock:=0;
          exceptblockcounter:=0;
          exceptblockcounter:=0;
-         aktmaxfpuregisters:=-1;
+         current_settings.maxfpuregisters:=-1;
        { reset the unit or create a new program }
        { reset the unit or create a new program }
          { a unit compiled at command line must be inside the loaded_unit list }
          { a unit compiled at command line must be inside the loaded_unit list }
          if (compile_level=1) then
          if (compile_level=1) then
@@ -382,19 +355,7 @@ implementation
          Fillchar(aktfilepos,0,sizeof(aktfilepos));
          Fillchar(aktfilepos,0,sizeof(aktfilepos));
 
 
          { Load current state from the init values }
          { Load current state from the init values }
-         aktlocalswitches:=initlocalswitches;
-         aktmoduleswitches:=initmoduleswitches;
-         aktmodeswitches:=initmodeswitches;
-         aktoptimizerswitches:=initoptimizerswitches;
-         aktsetalloc:=initsetalloc;
-         aktalignment:=initalignment;
-         aktfputype:=initfputype;
-         aktpackenum:=initpackenum;
-         aktpackrecords:=0;
-         aktcputype:=initcputype;
-         aktoptimizecputype:=initoptimizecputype;
-         aktasmmode:=initasmmode;
-         aktinterfacetype:=initinterfacetype;
+         current_settings:=init_settings;
 
 
          { load current asmdata from current_module }
          { load current asmdata from current_module }
          current_asmdata:=TAsmData(current_module.asmdata);
          current_asmdata:=TAsmData(current_module.asmdata);
@@ -503,23 +464,9 @@ implementation
                 { restore symtable state }
                 { restore symtable state }
                 symtablestack:=oldsymtablestack;
                 symtablestack:=oldsymtablestack;
                 macrosymtablestack:=oldmacrosymtablestack;
                 macrosymtablestack:=oldmacrosymtablestack;
-                aktdefproccall:=oldaktdefproccall;
                 current_procinfo:=oldcurrent_procinfo;
                 current_procinfo:=oldcurrent_procinfo;
-                aktsourcecodepage:=oldsourcecodepage;
-                aktlocalswitches:=oldaktlocalswitches;
-                aktmoduleswitches:=oldaktmoduleswitches;
-                aktalignment:=oldaktalignment;
-                aktpackenum:=oldaktpackenum;
-                aktpackrecords:=oldaktpackrecords;
-                aktmaxfpuregisters:=oldaktmaxfpuregisters;
-                aktcputype:=oldaktcputype;
-                aktoptimizecputype:=oldaktoptimizecputype;
-                aktfputype:=oldaktfputype;
-                aktasmmode:=oldaktasmmode;
-                aktinterfacetype:=oldaktinterfacetype;
                 aktfilepos:=oldaktfilepos;
                 aktfilepos:=oldaktfilepos;
-                aktmodeswitches:=oldaktmodeswitches;
-                aktoptimizerswitches:=oldaktoptimizerswitches;
+                current_settings:=old_settings;
                 aktexceptblock:=0;
                 aktexceptblock:=0;
                 exceptblockcounter:=0;
                 exceptblockcounter:=0;
               end;
               end;
@@ -540,8 +487,8 @@ implementation
                 begin
                 begin
 {$ifdef BrowserLog}
 {$ifdef BrowserLog}
                   { Write Browser Log }
                   { Write Browser Log }
-                  if (cs_browser_log in aktglobalswitches) and
-                      (cs_browser in aktmoduleswitches) then
+                  if (cs_browser_log in current_settings.globalswitches) and
+                      (cs_browser in current_settings.moduleswitches) then
                     begin
                     begin
                       if browserlog.elements_to_list.empty then
                       if browserlog.elements_to_list.empty then
                       begin
                       begin

+ 10 - 10
compiler/pass_1.pas

@@ -68,10 +68,10 @@ implementation
          begin
          begin
            oldcodegenerror:=codegenerror;
            oldcodegenerror:=codegenerror;
            oldpos:=aktfilepos;
            oldpos:=aktfilepos;
-           oldlocalswitches:=aktlocalswitches;
+           oldlocalswitches:=current_settings.localswitches;
            codegenerror:=false;
            codegenerror:=false;
            aktfilepos:=p.fileinfo;
            aktfilepos:=p.fileinfo;
-           aktlocalswitches:=p.localswitches;
+           current_settings.localswitches:=p.localswitches;
            hp:=p.pass_typecheck;
            hp:=p.pass_typecheck;
            { should the node be replaced? }
            { should the node be replaced? }
            if assigned(hp) then
            if assigned(hp) then
@@ -82,7 +82,7 @@ implementation
                { switch to new node }
                { switch to new node }
                p:=hp;
                p:=hp;
             end;
             end;
-           aktlocalswitches:=oldlocalswitches;
+           current_settings.localswitches:=oldlocalswitches;
            aktfilepos:=oldpos;
            aktfilepos:=oldpos;
            if codegenerror then
            if codegenerror then
             begin
             begin
@@ -123,18 +123,18 @@ implementation
            begin
            begin
               oldcodegenerror:=codegenerror;
               oldcodegenerror:=codegenerror;
               oldpos:=aktfilepos;
               oldpos:=aktfilepos;
-              oldlocalswitches:=aktlocalswitches;
+              oldlocalswitches:=current_settings.localswitches;
               codegenerror:=false;
               codegenerror:=false;
               aktfilepos:=p.fileinfo;
               aktfilepos:=p.fileinfo;
-              aktlocalswitches:=p.localswitches;
+              current_settings.localswitches:=p.localswitches;
               { checks make always a call }
               { checks make always a call }
-              if ([cs_check_range,cs_check_overflow,cs_check_stack] * aktlocalswitches <> []) then
+              if ([cs_check_range,cs_check_overflow,cs_check_stack] * current_settings.localswitches <> []) then
                 include(current_procinfo.flags,pi_do_call);
                 include(current_procinfo.flags,pi_do_call);
               { determine the resultdef if not done }
               { determine the resultdef if not done }
               if (p.resultdef=nil) then
               if (p.resultdef=nil) then
                begin
                begin
                  aktfilepos:=p.fileinfo;
                  aktfilepos:=p.fileinfo;
-                 aktlocalswitches:=p.localswitches;
+                 current_settings.localswitches:=p.localswitches;
                  hp:=p.pass_typecheck;
                  hp:=p.pass_typecheck;
                  { should the node be replaced? }
                  { should the node be replaced? }
                  if assigned(hp) then
                  if assigned(hp) then
@@ -152,7 +152,7 @@ implementation
                     if p.resultdef=nil then
                     if p.resultdef=nil then
                      p.resultdef:=generrordef;
                      p.resultdef:=generrordef;
                   end;
                   end;
-                 aktlocalswitches:=oldlocalswitches;
+                 current_settings.localswitches:=oldlocalswitches;
                  aktfilepos:=oldpos;
                  aktfilepos:=oldpos;
                  codegenerror:=codegenerror or oldcodegenerror;
                  codegenerror:=codegenerror or oldcodegenerror;
                end;
                end;
@@ -160,7 +160,7 @@ implementation
                begin
                begin
                  { first pass }
                  { first pass }
                  aktfilepos:=p.fileinfo;
                  aktfilepos:=p.fileinfo;
-                 aktlocalswitches:=p.localswitches;
+                 current_settings.localswitches:=p.localswitches;
                  hp:=p.pass_1;
                  hp:=p.pass_1;
                  { should the node be replaced? }
                  { should the node be replaced? }
                  if assigned(hp) then
                  if assigned(hp) then
@@ -183,7 +183,7 @@ implementation
                end;
                end;
               include(p.flags,nf_pass1_done);
               include(p.flags,nf_pass1_done);
               codegenerror:=codegenerror or oldcodegenerror;
               codegenerror:=codegenerror or oldcodegenerror;
-              aktlocalswitches:=oldlocalswitches;
+              current_settings.localswitches:=oldlocalswitches;
               aktfilepos:=oldpos;
               aktfilepos:=oldpos;
            end
            end
          else
          else

+ 5 - 5
compiler/pass_2.pas

@@ -158,23 +158,23 @@ implementation
          if not(nf_error in p.flags) then
          if not(nf_error in p.flags) then
           begin
           begin
             oldcodegenerror:=codegenerror;
             oldcodegenerror:=codegenerror;
-            oldlocalswitches:=aktlocalswitches;
+            oldlocalswitches:=current_settings.localswitches;
             oldpos:=aktfilepos;
             oldpos:=aktfilepos;
             if not inlining_procedure then
             if not inlining_procedure then
               aktfilepos:=p.fileinfo;
               aktfilepos:=p.fileinfo;
-            aktlocalswitches:=p.localswitches;
+            current_settings.localswitches:=p.localswitches;
             codegenerror:=false;
             codegenerror:=false;
 {$ifdef EXTDEBUG}
 {$ifdef EXTDEBUG}
             if (p.expectloc=LOC_INVALID) then
             if (p.expectloc=LOC_INVALID) then
               Comment(V_Warning,'ExpectLoc is not set before secondpass: '+nodetype2str[p.nodetype]);
               Comment(V_Warning,'ExpectLoc is not set before secondpass: '+nodetype2str[p.nodetype]);
             if (p.location.loc<>LOC_INVALID) then
             if (p.location.loc<>LOC_INVALID) then
               Comment(V_Warning,'Location.Loc is already set before secondpass: '+nodetype2str[p.nodetype]);
               Comment(V_Warning,'Location.Loc is already set before secondpass: '+nodetype2str[p.nodetype]);
-            if (cs_asm_nodes in aktglobalswitches) then
+            if (cs_asm_nodes in current_settings.globalswitches) then
               logsecond(p.nodetype,true);
               logsecond(p.nodetype,true);
 {$endif EXTDEBUG}
 {$endif EXTDEBUG}
             p.pass_generate_code;
             p.pass_generate_code;
 {$ifdef EXTDEBUG}
 {$ifdef EXTDEBUG}
-            if (cs_asm_nodes in aktglobalswitches) then
+            if (cs_asm_nodes in current_settings.globalswitches) then
               logsecond(p.nodetype,false);
               logsecond(p.nodetype,false);
             if (not codegenerror) then
             if (not codegenerror) then
              begin
              begin
@@ -185,7 +185,7 @@ implementation
             if codegenerror then
             if codegenerror then
               include(p.flags,nf_error);
               include(p.flags,nf_error);
             codegenerror:=codegenerror or oldcodegenerror;
             codegenerror:=codegenerror or oldcodegenerror;
-            aktlocalswitches:=oldlocalswitches;
+            current_settings.localswitches:=oldlocalswitches;
             aktfilepos:=oldpos;
             aktfilepos:=oldpos;
           end
           end
          else
          else

+ 2 - 2
compiler/pbase.pas

@@ -106,7 +106,7 @@ implementation
          Message1(sym_e_id_not_found,s);
          Message1(sym_e_id_not_found,s);
          { show a fatal that you need -S2 or -Sd, but only
          { show a fatal that you need -S2 or -Sd, but only
            if we just parsed the a token that has m_class }
            if we just parsed the a token that has m_class }
-         if not(m_class in aktmodeswitches) and
+         if not(m_class in current_settings.modeswitches) and
             (Upper(s)=pattern) and
             (Upper(s)=pattern) and
             (tokeninfo^[idtoken].keyword=m_class) then
             (tokeninfo^[idtoken].keyword=m_class) then
            Message(parser_f_need_objfpc_or_delphi_mode);
            Message(parser_f_need_objfpc_or_delphi_mode);
@@ -266,7 +266,7 @@ implementation
     function try_consume_hintdirective(var symopt:tsymoptions):boolean;
     function try_consume_hintdirective(var symopt:tsymoptions):boolean;
       begin
       begin
         try_consume_hintdirective:=false;
         try_consume_hintdirective:=false;
-        if not(m_hintdirective in aktmodeswitches) then
+        if not(m_hintdirective in current_settings.modeswitches) then
          exit;
          exit;
         repeat
         repeat
           case idtoken of
           case idtoken of

+ 7 - 7
compiler/pdecl.pas

@@ -203,7 +203,7 @@ implementation
                    { create symbol }
                    { create symbol }
                    storetokenpos:=akttokenpos;
                    storetokenpos:=akttokenpos;
                    akttokenpos:=filepos;
                    akttokenpos:=filepos;
-                   sym:=ttypedconstsym.create(orgname,hdef,(cs_typed_const_writable in aktlocalswitches));
+                   sym:=ttypedconstsym.create(orgname,hdef,(cs_typed_const_writable in current_settings.localswitches));
                    akttokenpos:=storetokenpos;
                    akttokenpos:=storetokenpos;
                    symtablestack.top.insert(sym);
                    symtablestack.top.insert(sym);
                    { procvar can have proc directives, but not type references }
                    { procvar can have proc directives, but not type references }
@@ -234,11 +234,11 @@ implementation
                     begin
                     begin
                       { get init value }
                       { get init value }
                       consume(_EQUAL);
                       consume(_EQUAL);
-                      if (cs_typed_const_writable in aktlocalswitches) then
+                      if (cs_typed_const_writable in current_settings.localswitches) then
                         tclist:=current_asmdata.asmlists[al_rotypedconsts]
                         tclist:=current_asmdata.asmlists[al_rotypedconsts]
                       else
                       else
                         tclist:=current_asmdata.asmlists[al_typedconsts];
                         tclist:=current_asmdata.asmlists[al_typedconsts];
-                      readtypedconst(tclist,hdef,ttypedconstsym(sym),(cs_typed_const_writable in aktlocalswitches));
+                      readtypedconst(tclist,hdef,ttypedconstsym(sym),(cs_typed_const_writable in current_settings.localswitches));
                       consume(_SEMICOLON);
                       consume(_SEMICOLON);
                     end;
                     end;
                 end;
                 end;
@@ -255,7 +255,7 @@ implementation
     procedure label_dec;
     procedure label_dec;
       begin
       begin
          consume(_LABEL);
          consume(_LABEL);
-         if not(cs_support_goto in aktmoduleswitches) then
+         if not(cs_support_goto in current_settings.moduleswitches) then
            Message(sym_e_goto_and_label_not_supported);
            Message(sym_e_goto_and_label_not_supported);
          repeat
          repeat
            if not(token in [_ID,_INTCONST]) then
            if not(token in [_ID,_INTCONST]) then
@@ -349,7 +349,7 @@ implementation
                trecorddef(pd).symtable.foreach_static(@resolve_type_forward,nil);
                trecorddef(pd).symtable.foreach_static(@resolve_type_forward,nil);
              objectdef :
              objectdef :
                begin
                begin
-                 if not(m_fpc in aktmodeswitches) and
+                 if not(m_fpc in current_settings.modeswitches) and
                     (oo_is_forward in tobjectdef(pd).objectoptions) then
                     (oo_is_forward in tobjectdef(pd).objectoptions) then
                   begin
                   begin
                     { only give an error as the implementation may follow in an
                     { only give an error as the implementation may follow in an
@@ -434,7 +434,7 @@ implementation
 
 
            { MacPas object model is more like Delphi's than like TP's, but }
            { MacPas object model is more like Delphi's than like TP's, but }
            { uses the object keyword instead of class                      }
            { uses the object keyword instead of class                      }
-           if (m_mac in aktmodeswitches) and
+           if (m_mac in current_settings.modeswitches) and
               (token = _OBJECT) then
               (token = _OBJECT) then
              token := _CLASS;
              token := _CLASS;
 
 
@@ -499,7 +499,7 @@ implementation
                 end;
                 end;
               newtype.typedef:=hdef;
               newtype.typedef:=hdef;
               { KAZ: handle TGUID declaration in system unit }
               { KAZ: handle TGUID declaration in system unit }
-              if (cs_compilesystem in aktmoduleswitches) and not assigned(rec_tguid) and
+              if (cs_compilesystem in current_settings.moduleswitches) and not assigned(rec_tguid) and
                  (typename='TGUID') and { name: TGUID and size=16 bytes that is 128 bits }
                  (typename='TGUID') and { name: TGUID and size=16 bytes that is 128 bits }
                  assigned(hdef) and (hdef.deftype=recorddef) and (hdef.size=16) then
                  assigned(hdef) and (hdef.deftype=recorddef) and (hdef.size=16) then
                 rec_tguid:=trecorddef(hdef);
                 rec_tguid:=trecorddef(hdef);

+ 15 - 15
compiler/pdecobj.pas

@@ -74,7 +74,7 @@ implementation
                consume(_SEMICOLON);
                consume(_SEMICOLON);
                exit;
                exit;
              end;
              end;
-           if (cs_constructor_name in aktglobalswitches) and
+           if (cs_constructor_name in current_settings.globalswitches) and
               (pd.procsym.name<>'INIT') then
               (pd.procsym.name<>'INIT') then
              Message(parser_e_constructorname_must_be_init);
              Message(parser_e_constructorname_must_be_init);
            consume(_SEMICOLON);
            consume(_SEMICOLON);
@@ -99,7 +99,7 @@ implementation
         begin
         begin
            { check for a class }
            { check for a class }
            if not((is_class_or_interface_or_dispinterface(aktobjectdef)) or
            if not((is_class_or_interface_or_dispinterface(aktobjectdef)) or
-              (not(m_tp7 in aktmodeswitches) and (is_object(aktobjectdef)))) then
+              (not(m_tp7 in current_settings.modeswitches) and (is_object(aktobjectdef)))) then
              Message(parser_e_syntax_error);
              Message(parser_e_syntax_error);
            consume(_PROPERTY);
            consume(_PROPERTY);
            p:=read_property_dec(aktobjectdef);
            p:=read_property_dec(aktobjectdef);
@@ -132,11 +132,11 @@ implementation
                consume(_SEMICOLON);
                consume(_SEMICOLON);
                exit;
                exit;
              end;
              end;
-           if (cs_constructor_name in aktglobalswitches) and
+           if (cs_constructor_name in current_settings.globalswitches) and
               (pd.procsym.name<>'DONE') then
               (pd.procsym.name<>'DONE') then
              Message(parser_e_destructorname_must_be_done);
              Message(parser_e_destructorname_must_be_done);
            if not(pd.maxparacount=0) and
            if not(pd.maxparacount=0) and
-              (m_fpc in aktmodeswitches) then
+              (m_fpc in current_settings.modeswitches) then
              Message(parser_e_no_paras_for_destructor);
              Message(parser_e_no_paras_for_destructor);
            consume(_SEMICOLON);
            consume(_SEMICOLON);
            include(aktobjectdef.objectoptions,oo_has_destructor);
            include(aktobjectdef.objectoptions,oo_has_destructor);
@@ -153,7 +153,7 @@ implementation
              begin
              begin
                 aktobjectdef.objecttype:=classtype;
                 aktobjectdef.objecttype:=classtype;
                 { set published flag in $M+ mode or it is inherited }
                 { set published flag in $M+ mode or it is inherited }
-                if (cs_generate_rtti in aktlocalswitches) or
+                if (cs_generate_rtti in current_settings.localswitches) or
                     (assigned(aktobjectdef.childof) and
                     (assigned(aktobjectdef.childof) and
                      (oo_can_have_published in aktobjectdef.childof.objectoptions)) then
                      (oo_can_have_published in aktobjectdef.childof.objectoptions)) then
                   include(aktobjectdef.objectoptions,oo_can_have_published);
                   include(aktobjectdef.objectoptions,oo_can_have_published);
@@ -209,7 +209,7 @@ implementation
                 begin
                 begin
                    { need extra check here since interface is a keyword
                    { need extra check here since interface is a keyword
                      in all pascal modes }
                      in all pascal modes }
-                   if not(m_class in aktmodeswitches) then
+                   if not(m_class in current_settings.modeswitches) then
                      Message(parser_f_need_objfpc_or_delphi_mode);
                      Message(parser_f_need_objfpc_or_delphi_mode);
                    classtype:=odt_dispinterface;
                    classtype:=odt_dispinterface;
                    consume(_DISPINTERFACE);
                    consume(_DISPINTERFACE);
@@ -231,9 +231,9 @@ implementation
                 begin
                 begin
                    { need extra check here since interface is a keyword
                    { need extra check here since interface is a keyword
                      in all pascal modes }
                      in all pascal modes }
-                   if not(m_class in aktmodeswitches) then
+                   if not(m_class in current_settings.modeswitches) then
                      Message(parser_f_need_objfpc_or_delphi_mode);
                      Message(parser_f_need_objfpc_or_delphi_mode);
-                   if aktinterfacetype=it_interfacecom then
+                   if current_settings.interfacetype=it_interfacecom then
                      classtype:=odt_interfacecom
                      classtype:=odt_interfacecom
                    else {it_interfacecorba}
                    else {it_interfacecorba}
                      classtype:=odt_interfacecorba;
                      classtype:=odt_interfacecorba;
@@ -245,11 +245,11 @@ implementation
                        if n='' then
                        if n='' then
                          Message(parser_f_no_anonym_objects);
                          Message(parser_f_no_anonym_objects);
                        aktobjectdef:=tobjectdef.create(classtype,n,nil);
                        aktobjectdef:=tobjectdef.create(classtype,n,nil);
-                       if (cs_compilesystem in aktmoduleswitches) and
+                       if (cs_compilesystem in current_settings.moduleswitches) and
                           (classtype=odt_interfacecom) and (upper(n)='IUNKNOWN') then
                           (classtype=odt_interfacecom) and (upper(n)='IUNKNOWN') then
                          interface_iunknown:=aktobjectdef;
                          interface_iunknown:=aktobjectdef;
                        include(aktobjectdef.objectoptions,oo_is_forward);
                        include(aktobjectdef.objectoptions,oo_is_forward);
-                       if (cs_generate_rtti in aktlocalswitches) and
+                       if (cs_generate_rtti in current_settings.localswitches) and
                           (classtype=odt_interfacecom) then
                           (classtype=odt_interfacecom) then
                          include(aktobjectdef.objectoptions,oo_can_have_published);
                          include(aktobjectdef.objectoptions,oo_can_have_published);
                        object_dec:=aktobjectdef;
                        object_dec:=aktobjectdef;
@@ -269,7 +269,7 @@ implementation
                         the blocktype is bt_type so the check for typecanbeforward
                         the blocktype is bt_type so the check for typecanbeforward
                         is also necessary (PFV) }
                         is also necessary (PFV) }
                       (((block_type=bt_type) and typecanbeforward) or
                       (((block_type=bt_type) and typecanbeforward) or
-                       not(m_delphi in aktmodeswitches)) then
+                       not(m_delphi in current_settings.modeswitches)) then
                      begin
                      begin
                         { a hack, but it's easy to handle }
                         { a hack, but it's easy to handle }
                         { class reference type }
                         { class reference type }
@@ -299,11 +299,11 @@ implementation
                         if n='' then
                         if n='' then
                           Message(parser_f_no_anonym_objects);
                           Message(parser_f_no_anonym_objects);
                         aktobjectdef:=tobjectdef.create(odt_class,n,nil);
                         aktobjectdef:=tobjectdef.create(odt_class,n,nil);
-                        if (cs_compilesystem in aktmoduleswitches) and (upper(n)='TOBJECT') then
+                        if (cs_compilesystem in current_settings.moduleswitches) and (upper(n)='TOBJECT') then
                           class_tobject:=aktobjectdef;
                           class_tobject:=aktobjectdef;
                         aktobjectdef.objecttype:=odt_class;
                         aktobjectdef.objecttype:=odt_class;
                         include(aktobjectdef.objectoptions,oo_is_forward);
                         include(aktobjectdef.objectoptions,oo_is_forward);
-                        if (cs_generate_rtti in aktlocalswitches) then
+                        if (cs_generate_rtti in current_settings.localswitches) then
                           include(aktobjectdef.objectoptions,oo_can_have_published);
                           include(aktobjectdef.objectoptions,oo_can_have_published);
                         { all classes must have a vmt !!  at offset zero }
                         { all classes must have a vmt !!  at offset zero }
                         if not(oo_has_vmt in aktobjectdef.objectoptions) then
                         if not(oo_has_vmt in aktobjectdef.objectoptions) then
@@ -514,7 +514,7 @@ implementation
 
 
          storetypecanbeforward:=typecanbeforward;
          storetypecanbeforward:=typecanbeforward;
          { for tp7 don't allow forward types }
          { for tp7 don't allow forward types }
-         if (m_tp7 in aktmodeswitches) then
+         if (m_tp7 in current_settings.modeswitches) then
            typecanbeforward:=false;
            typecanbeforward:=false;
 
 
          if not(readobjecttype) then
          if not(readobjecttype) then
@@ -683,7 +683,7 @@ implementation
                        { all Macintosh Object Pascal methods are virtual.  }
                        { all Macintosh Object Pascal methods are virtual.  }
                        { this can't be a class method, because macpas mode }
                        { this can't be a class method, because macpas mode }
                        { has no m_class                                    }
                        { has no m_class                                    }
-                       if (m_mac in aktmodeswitches) then
+                       if (m_mac in current_settings.modeswitches) then
                          include(pd.procoptions,po_virtualmethod);
                          include(pd.procoptions,po_virtualmethod);
 
 
                        handle_calling_convention(pd);
                        handle_calling_convention(pd);

+ 30 - 30
compiler/pdecsub.pas

@@ -233,7 +233,7 @@ implementation
            tlocalsymtable(pd.localst).insert(aliasvs);
            tlocalsymtable(pd.localst).insert(aliasvs);
 
 
            { insert result also if support is on }
            { insert result also if support is on }
-           if (m_result in aktmodeswitches) then
+           if (m_result in current_settings.modeswitches) then
             begin
             begin
               sl:=tpropaccesslist.create;
               sl:=tpropaccesslist.create;
               sl.addsym(sl_load,pd.funcretsym);
               sl.addsym(sl_load,pd.funcretsym);
@@ -400,7 +400,7 @@ implementation
         { Delphi/Kylix supports nonsense like }
         { Delphi/Kylix supports nonsense like }
         { procedure p();                      }
         { procedure p();                      }
         if try_to_consume(_RKLAMMER) and
         if try_to_consume(_RKLAMMER) and
-          not(m_tp7 in aktmodeswitches) then
+          not(m_tp7 in current_settings.modeswitches) then
           exit;
           exit;
         { parsing a proc or procvar ? }
         { parsing a proc or procvar ? }
         currparast:=tparasymtable(pd.parast);
         currparast:=tparasymtable(pd.parast);
@@ -420,25 +420,25 @@ implementation
             if try_to_consume(_CONST) then
             if try_to_consume(_CONST) then
               varspez:=vs_const
               varspez:=vs_const
           else
           else
-            if (m_out in aktmodeswitches) and
+            if (m_out in current_settings.modeswitches) and
                try_to_consume(_OUT) then
                try_to_consume(_OUT) then
               varspez:=vs_out
               varspez:=vs_out
           else
           else
-            if (m_mac in aktmodeswitches) and
+            if (m_mac in current_settings.modeswitches) and
                try_to_consume(_POINTPOINTPOINT) then
                try_to_consume(_POINTPOINTPOINT) then
               begin
               begin
                 include(pd.procoptions,po_varargs);
                 include(pd.procoptions,po_varargs);
                 break;
                 break;
               end
               end
           else
           else
-            if (m_mac in aktmodeswitches) and
+            if (m_mac in current_settings.modeswitches) and
                try_to_consume(_PROCEDURE) then
                try_to_consume(_PROCEDURE) then
               begin
               begin
                 parseprocvar:=pv_proc;
                 parseprocvar:=pv_proc;
                 varspez:=vs_const;
                 varspez:=vs_const;
               end
               end
           else
           else
-            if (m_mac in aktmodeswitches) and
+            if (m_mac in current_settings.modeswitches) and
                try_to_consume(_FUNCTION) then
                try_to_consume(_FUNCTION) then
               begin
               begin
                 parseprocvar:=pv_func;
                 parseprocvar:=pv_func;
@@ -498,7 +498,7 @@ implementation
                 { define range and type of range }
                 { define range and type of range }
                 hdef:=tarraydef.create(0,-1,s32inttype);
                 hdef:=tarraydef.create(0,-1,s32inttype);
                 { array of const ? }
                 { array of const ? }
-                if (token=_CONST) and (m_objpas in aktmodeswitches) then
+                if (token=_CONST) and (m_objpas in current_settings.modeswitches) then
                  begin
                  begin
                    consume(_CONST);
                    consume(_CONST);
                    srsym:=search_system_type('TVARREC');
                    srsym:=search_system_type('TVARREC');
@@ -514,13 +514,13 @@ implementation
               end
               end
              else
              else
               begin
               begin
-                if (m_mac in aktmodeswitches) then
+                if (m_mac in current_settings.modeswitches) then
                   try_to_consume(_UNIV); {currently does nothing}
                   try_to_consume(_UNIV); {currently does nothing}
                 single_type(hdef,false);
                 single_type(hdef,false);
 
 
                 { open string ? }
                 { open string ? }
                 if (varspez in [vs_out,vs_var]) and
                 if (varspez in [vs_out,vs_var]) and
-                   (cs_openstring in aktmoduleswitches) and
+                   (cs_openstring in current_settings.moduleswitches) and
                    is_shortstring(hdef) then
                    is_shortstring(hdef) then
                   hdef:=openshortstringtype;
                   hdef:=openshortstringtype;
 
 
@@ -543,7 +543,7 @@ implementation
                   locationstr:='';
                   locationstr:='';
 
 
                 { default parameter }
                 { default parameter }
-                if (m_default_para in aktmodeswitches) then
+                if (m_default_para in current_settings.modeswitches) then
                  begin
                  begin
                    if try_to_consume(_EQUAL) then
                    if try_to_consume(_EQUAL) then
                     begin
                     begin
@@ -719,7 +719,7 @@ implementation
                  if aprocsym.typ<>procsym then
                  if aprocsym.typ<>procsym then
                   begin
                   begin
                     {  we use a different error message for tp7 so it looks more compatible }
                     {  we use a different error message for tp7 so it looks more compatible }
-                    if (m_fpc in aktmodeswitches) then
+                    if (m_fpc in current_settings.modeswitches) then
                       Message1(parser_e_overloaded_no_procedure,aprocsym.realname)
                       Message1(parser_e_overloaded_no_procedure,aprocsym.realname)
                     else
                     else
                       Message(parser_e_methode_id_expected);
                       Message(parser_e_methode_id_expected);
@@ -778,7 +778,7 @@ implementation
                      else
                      else
                       begin
                       begin
                         {  we use a different error message for tp7 so it looks more compatible }
                         {  we use a different error message for tp7 so it looks more compatible }
-                        if (m_fpc in aktmodeswitches) then
+                        if (m_fpc in current_settings.modeswitches) then
                          Message1(parser_e_overloaded_no_procedure,srsym.realname)
                          Message1(parser_e_overloaded_no_procedure,srsym.realname)
                         else
                         else
                          DuplicateSym(nil,srsym);
                          DuplicateSym(nil,srsym);
@@ -965,7 +965,7 @@ implementation
                               parse_only and
                               parse_only and
                               not(is_interface(pd._class))
                               not(is_interface(pd._class))
                              ) or
                              ) or
-                             (m_repeat_forward in aktmodeswitches) then
+                             (m_repeat_forward in current_settings.modeswitches) then
                           begin
                           begin
                             consume(_COLON);
                             consume(_COLON);
                             consume_all_until(_SEMICOLON);
                             consume_all_until(_SEMICOLON);
@@ -1048,7 +1048,7 @@ implementation
                     Message(parser_e_no_local_operator);
                     Message(parser_e_no_local_operator);
                   if token<>_ID then
                   if token<>_ID then
                     begin
                     begin
-                       if not(m_result in aktmodeswitches) then
+                       if not(m_result in current_settings.modeswitches) then
                          consume(_ID);
                          consume(_ID);
                     end
                     end
                   else
                   else
@@ -1258,7 +1258,7 @@ end;
 
 
 procedure pd_static(pd:tabstractprocdef);
 procedure pd_static(pd:tabstractprocdef);
 begin
 begin
-  if (cs_static_keyword in aktmoduleswitches) then
+  if (cs_static_keyword in current_settings.moduleswitches) then
     begin
     begin
       if pd.deftype=procdef then
       if pd.deftype=procdef then
         include(tprocdef(pd).procsym.symoptions,sp_static);
         include(tprocdef(pd).procsym.symoptions,sp_static);
@@ -1960,7 +1960,7 @@ const
         found:=false;
         found:=false;
 
 
       { Hint directive? Then exit immediatly }
       { Hint directive? Then exit immediatly }
-        if (m_hintdirective in aktmodeswitches) then
+        if (m_hintdirective in current_settings.modeswitches) then
          begin
          begin
            case idtoken of
            case idtoken of
              _LIBRARY,
              _LIBRARY,
@@ -1974,7 +1974,7 @@ const
         { C directive is MAC only, because it breaks too much existing code
         { C directive is MAC only, because it breaks too much existing code
           on other platforms (PFV) }
           on other platforms (PFV) }
         if (idtoken=_C) and
         if (idtoken=_C) and
-           not(m_mac in aktmodeswitches) then
+           not(m_mac in current_settings.modeswitches) then
           exit;
           exit;
 
 
       { retrieve data for directive if found }
       { retrieve data for directive if found }
@@ -1997,7 +1997,7 @@ const
          end;
          end;
 
 
         { static needs a special treatment }
         { static needs a special treatment }
-        if (idtoken=_STATIC) and not (cs_static_keyword in aktmoduleswitches) then
+        if (idtoken=_STATIC) and not (cs_static_keyword in current_settings.moduleswitches) then
           exit;
           exit;
 
 
         { check if method and directive not for object, like public.
         { check if method and directive not for object, like public.
@@ -2153,7 +2153,7 @@ const
               else
               else
                 begin
                 begin
                   {In MacPas a single "external" has the same effect as "external name 'xxx'" }
                   {In MacPas a single "external" has the same effect as "external name 'xxx'" }
-                  if (m_mac in aktmodeswitches) then
+                  if (m_mac in current_settings.modeswitches) then
                     result:=tprocdef(pd).procsym.realname;
                     result:=tprocdef(pd).procsym.realname;
                 end;
                 end;
             end;
             end;
@@ -2217,7 +2217,7 @@ const
       begin
       begin
         { set the default calling convention if none provided }
         { set the default calling convention if none provided }
         if not(po_hascallingconvention in pd.procoptions) then
         if not(po_hascallingconvention in pd.procoptions) then
-          pd.proccalloption:=aktdefproccall
+          pd.proccalloption:=current_settings.defproccall
         else
         else
           begin
           begin
             if pd.proccalloption=pocall_none then
             if pd.proccalloption=pocall_none then
@@ -2241,11 +2241,11 @@ const
 
 
         { Inlining is enabled and supported? }
         { Inlining is enabled and supported? }
         if (po_inline in pd.procoptions) and
         if (po_inline in pd.procoptions) and
-           not(cs_do_inline in aktlocalswitches) then
+           not(cs_do_inline in current_settings.localswitches) then
           begin
           begin
             { Give an error if inline is not supported by the compiler mode,
             { Give an error if inline is not supported by the compiler mode,
               otherwise only give a warning that this procedure will not be inlined }
               otherwise only give a warning that this procedure will not be inlined }
-            if not(m_default_inline in aktmodeswitches) then
+            if not(m_default_inline in current_settings.modeswitches) then
               Message(parser_e_proc_inline_not_supported)
               Message(parser_e_proc_inline_not_supported)
             else
             else
               Message(parser_w_inlining_disabled);
               Message(parser_w_inlining_disabled);
@@ -2309,7 +2309,7 @@ const
       var
       var
         res : boolean;
         res : boolean;
       begin
       begin
-        if (m_mac in aktmodeswitches) and (cs_externally_visible in aktlocalswitches) then
+        if (m_mac in current_settings.modeswitches) and (cs_externally_visible in current_settings.localswitches) then
           begin
           begin
             tprocdef(pd).aliasnames.insert(tprocdef(pd).procsym.realname);
             tprocdef(pd).aliasnames.insert(tprocdef(pd).procsym.realname);
             include(pd.procoptions,po_public);
             include(pd.procoptions,po_public);
@@ -2425,7 +2425,7 @@ const
              But for an overload declared function this is not allowed }
              But for an overload declared function this is not allowed }
            if { check if empty implementation arguments match is allowed }
            if { check if empty implementation arguments match is allowed }
               (
               (
-               not(m_repeat_forward in aktmodeswitches) and
+               not(m_repeat_forward in current_settings.modeswitches) and
                not(pd.forwarddef) and
                not(pd.forwarddef) and
                (pd.maxparacount=0) and
                (pd.maxparacount=0) and
                not(po_overload in hd.procoptions)
                not(po_overload in hd.procoptions)
@@ -2455,12 +2455,12 @@ const
                      also the parameters must match also with the type }
                      also the parameters must match also with the type }
                    if (hd.proctypeoption<>pd.proctypeoption) or
                    if (hd.proctypeoption<>pd.proctypeoption) or
                       (
                       (
-                       (m_repeat_forward in aktmodeswitches) and
+                       (m_repeat_forward in current_settings.modeswitches) and
                        (not((pd.maxparacount=0) or
                        (not((pd.maxparacount=0) or
                             (compare_paras(pd.paras,hd.paras,cp_all,[cpo_comparedefaultvalue])>=te_equal)))
                             (compare_paras(pd.paras,hd.paras,cp_all,[cpo_comparedefaultvalue])>=te_equal)))
                       ) or
                       ) or
                       (
                       (
-                       ((m_repeat_forward in aktmodeswitches) or
+                       ((m_repeat_forward in current_settings.modeswitches) or
                         not(is_void(pd.returndef))) and
                         not(is_void(pd.returndef))) and
                        (not equal_defs(hd.returndef,pd.returndef))) then
                        (not equal_defs(hd.returndef,pd.returndef))) then
                      begin
                      begin
@@ -2491,7 +2491,7 @@ const
                         convention in the interface or implementation if
                         convention in the interface or implementation if
                         there was no convention specified in the other
                         there was no convention specified in the other
                         part }
                         part }
-                      if (m_delphi in aktmodeswitches) then
+                      if (m_delphi in current_settings.modeswitches) then
                        begin
                        begin
                          if not(po_hascallingconvention in pd.procoptions) then
                          if not(po_hascallingconvention in pd.procoptions) then
                           pd.proccalloption:=hd.proccalloption
                           pd.proccalloption:=hd.proccalloption
@@ -2517,7 +2517,7 @@ const
 
 
                    { Check procedure options, Delphi requires that class is
                    { Check procedure options, Delphi requires that class is
                      repeated in the implementation for class methods }
                      repeated in the implementation for class methods }
-                   if (m_fpc in aktmodeswitches) then
+                   if (m_fpc in current_settings.modeswitches) then
                      po_comp:=[po_classmethod,po_varargs,po_methodpointer,po_interrupt]
                      po_comp:=[po_classmethod,po_varargs,po_methodpointer,po_interrupt]
                    else
                    else
                      po_comp:=[po_classmethod,po_methodpointer];
                      po_comp:=[po_classmethod,po_methodpointer];
@@ -2535,7 +2535,7 @@ const
                      MessagePos(pd.fileinfo,parser_e_proc_already_external);
                      MessagePos(pd.fileinfo,parser_e_proc_already_external);
 
 
                    { Check parameters }
                    { Check parameters }
-                   if (m_repeat_forward in aktmodeswitches) or
+                   if (m_repeat_forward in current_settings.modeswitches) or
                       (pd.minparacount>0) then
                       (pd.minparacount>0) then
                     begin
                     begin
                       { If mangled names are equal then they have the same amount of arguments }
                       { If mangled names are equal then they have the same amount of arguments }
@@ -2640,7 +2640,7 @@ const
              end;
              end;
 
 
            { check for allowing overload directive }
            { check for allowing overload directive }
-           if not(m_fpc in aktmodeswitches) then
+           if not(m_fpc in current_settings.modeswitches) then
             begin
             begin
               { overload directive turns on overloading }
               { overload directive turns on overloading }
               if ((po_overload in pd.procoptions) or
               if ((po_overload in pd.procoptions) or

+ 17 - 17
compiler/pdecvar.pas

@@ -260,7 +260,7 @@ implementation
          if try_to_consume(_LECKKLAMMER) then
          if try_to_consume(_LECKKLAMMER) then
            begin
            begin
               if (sp_published in current_object_option) and
               if (sp_published in current_object_option) and
-                not (m_delphi in aktmodeswitches) then
+                not (m_delphi in current_settings.modeswitches) then
                 Message(parser_e_cant_publish_that_property);
                 Message(parser_e_cant_publish_that_property);
               { create a list of the parameters }
               { create a list of the parameters }
               symtablestack.push(readprocdef.parast);
               symtablestack.push(readprocdef.parast);
@@ -271,7 +271,7 @@ implementation
                   varspez:=vs_var
                   varspez:=vs_var
                 else if try_to_consume(_CONST) then
                 else if try_to_consume(_CONST) then
                   varspez:=vs_const
                   varspez:=vs_const
-                else if (m_out in aktmodeswitches) and try_to_consume(_OUT) then
+                else if (m_out in current_settings.modeswitches) and try_to_consume(_OUT) then
                   varspez:=vs_out
                   varspez:=vs_out
                 else
                 else
                   varspez:=vs_value;
                   varspez:=vs_value;
@@ -763,7 +763,7 @@ implementation
              until not try_to_consume(_COMMA);
              until not try_to_consume(_COMMA);
              consume(_COLON);
              consume(_COLON);
 
 
-             if (m_gpc in aktmodeswitches) and
+             if (m_gpc in current_settings.modeswitches) and
                 (token=_ID) and
                 (token=_ID) and
                 (orgpattern='__asmname__') then
                 (orgpattern='__asmname__') then
                begin
                begin
@@ -833,8 +833,8 @@ implementation
                                                  system_i386_wdosx,system_i386_win32,
                                                  system_i386_wdosx,system_i386_win32,
                                                  system_arm_wince,system_i386_wince,
                                                  system_arm_wince,system_i386_wince,
                                                  system_arm_gba]) or
                                                  system_arm_gba]) or
-                         (m_objfpc in aktmodeswitches) or
-                         (m_delphi in aktmodeswitches)) then
+                         (m_objfpc in current_settings.modeswitches) or
+                         (m_delphi in current_settings.modeswitches)) then
                  begin
                  begin
                    abssym:=tabsolutevarsym.create(vs.realname,hdef);
                    abssym:=tabsolutevarsym.create(vs.realname,hdef);
                    abssym.fileinfo:=vs.fileinfo;
                    abssym.fileinfo:=vs.fileinfo;
@@ -899,7 +899,7 @@ implementation
 
 
              { Handling of Delphi typed const = initialized vars }
              { Handling of Delphi typed const = initialized vars }
              if (token=_EQUAL) and
              if (token=_EQUAL) and
-                not(m_tp7 in aktmodeswitches) and
+                not(m_tp7 in current_settings.modeswitches) and
                 (symtablestack.top.symtabletype<>parasymtable) then
                 (symtablestack.top.symtabletype<>parasymtable) then
                begin
                begin
                  { Add calling convention for procvar }
                  { Add calling convention for procvar }
@@ -930,7 +930,7 @@ implementation
                  handle_calling_convention(tprocvardef(hdef));
                  handle_calling_convention(tprocvardef(hdef));
                  { Handling of Delphi typed const = initialized vars }
                  { Handling of Delphi typed const = initialized vars }
                  if (token=_EQUAL) and
                  if (token=_EQUAL) and
-                    not(m_tp7 in aktmodeswitches) and
+                    not(m_tp7 in current_settings.modeswitches) and
                     (symtablestack.top.symtabletype<>parasymtable) then
                     (symtablestack.top.symtabletype<>parasymtable) then
                    begin
                    begin
                      read_default_value(sc,hdef,vd_threadvar in options);
                      read_default_value(sc,hdef,vd_threadvar in options);
@@ -945,12 +945,12 @@ implementation
               begin
               begin
                 if (
                 if (
                      (token=_ID) and
                      (token=_ID) and
-                     (m_cvar_support in aktmodeswitches) and
+                     (m_cvar_support in current_settings.modeswitches) and
                      (idtoken in [_EXPORT,_EXTERNAL,_PUBLIC,_CVAR])
                      (idtoken in [_EXPORT,_EXTERNAL,_PUBLIC,_CVAR])
                    ) or
                    ) or
                    (
                    (
-                     (m_mac in aktmodeswitches) and
-                     ((cs_external_var in aktlocalswitches) or (cs_externally_visible in aktlocalswitches))
+                     (m_mac in current_settings.modeswitches) and
+                     ((cs_external_var in current_settings.localswitches) or (cs_externally_visible in current_settings.localswitches))
                    ) then
                    ) then
                  begin
                  begin
                    { only allowed for one var }
                    { only allowed for one var }
@@ -981,15 +981,15 @@ implementation
                       semicolonatend:= true;
                       semicolonatend:= true;
                     end;
                     end;
                    { macpas specific handling due to some switches}
                    { macpas specific handling due to some switches}
-                   if (m_mac in aktmodeswitches) then
+                   if (m_mac in current_settings.modeswitches) then
                      begin
                      begin
-                       if (cs_external_var in aktlocalswitches) then
+                       if (cs_external_var in current_settings.localswitches) then
                          begin {The effect of this is the same as if cvar; external; has been given as directives.}
                          begin {The effect of this is the same as if cvar; external; has been given as directives.}
                            is_cdecl:=true;
                            is_cdecl:=true;
                            C_name:=target_info.Cprefix+sorg;
                            C_name:=target_info.Cprefix+sorg;
                            extern_var:=true;
                            extern_var:=true;
                          end
                          end
-                       else if (cs_externally_visible in aktlocalswitches) then
+                       else if (cs_externally_visible in current_settings.localswitches) then
                          begin {The effect of this is the same as if cvar has been given as directives.}
                          begin {The effect of this is the same as if cvar has been given as directives.}
                            is_cdecl:=true;
                            is_cdecl:=true;
                            C_name:=target_info.Cprefix+sorg;
                            C_name:=target_info.Cprefix+sorg;
@@ -1231,7 +1231,7 @@ implementation
 
 
              { Check for STATIC directive }
              { Check for STATIC directive }
              if (vd_object in options) and
              if (vd_object in options) and
-                (cs_static_keyword in aktmoduleswitches) and
+                (cs_static_keyword in current_settings.moduleswitches) and
                 (try_to_consume(_STATIC)) then
                 (try_to_consume(_STATIC)) then
                begin
                begin
                  include(current_object_option,sp_static);
                  include(current_object_option,sp_static);
@@ -1317,7 +1317,7 @@ implementation
                 Message(type_e_ordinal_expr_expected);
                 Message(type_e_ordinal_expr_expected);
               consume(_OF);
               consume(_OF);
 
 
-              UnionSymtable:=trecordsymtable.create(aktpackrecords);
+              UnionSymtable:=trecordsymtable.create(current_settings.packrecords);
               UnionDef:=trecorddef.create(unionsymtable);
               UnionDef:=trecorddef.create(unionsymtable);
               uniondef.isunion:=true;
               uniondef.isunion:=true;
               startvarrecsize:=UnionSymtable.datasize;
               startvarrecsize:=UnionSymtable.datasize;
@@ -1374,9 +1374,9 @@ implementation
 {$endif powerpc}
 {$endif powerpc}
               { Align the offset where the union symtable is added }
               { Align the offset where the union symtable is added }
               if (recst.usefieldalignment=-1) then
               if (recst.usefieldalignment=-1) then
-                usedalign:=used_align(unionsymtable.recordalignment,aktalignment.recordalignmin,aktalignment.maxCrecordalign)
+                usedalign:=used_align(unionsymtable.recordalignment,current_settings.alignment.recordalignmin,current_settings.alignment.maxCrecordalign)
               else
               else
-                usedalign:=used_align(unionsymtable.recordalignment,aktalignment.recordalignmin,aktalignment.recordalignmax);
+                usedalign:=used_align(unionsymtable.recordalignment,current_settings.alignment.recordalignmin,current_settings.alignment.recordalignmax);
 
 
               offset:=align(recst.datasize,usedalign);
               offset:=align(recst.datasize,usedalign);
               recst.datasize:=offset+unionsymtable.datasize;
               recst.datasize:=offset+unionsymtable.datasize;

+ 21 - 21
compiler/pexpr.pas

@@ -133,7 +133,7 @@ implementation
            end
            end
           else
           else
             begin
             begin
-               if cs_ansistrings in aktlocalswitches then
+               if cs_ansistrings in current_settings.localswitches then
                  def:=cansistringtype
                  def:=cansistringtype
                else
                else
                  def:=cshortstringtype;
                  def:=cshortstringtype;
@@ -363,7 +363,7 @@ implementation
             begin
             begin
               if try_to_consume(_LKLAMMER) then
               if try_to_consume(_LKLAMMER) then
                 begin
                 begin
-                  if not (m_mac in aktmodeswitches) then
+                  if not (m_mac in current_settings.modeswitches) then
                     begin
                     begin
                       if not(try_to_consume(_RKLAMMER)) then
                       if not(try_to_consume(_RKLAMMER)) then
                         begin
                         begin
@@ -404,7 +404,7 @@ implementation
 
 
           in_break :
           in_break :
             begin
             begin
-              if not (m_mac in aktmodeswitches) then
+              if not (m_mac in current_settings.modeswitches) then
                statement_syssym:=cbreaknode.create
                statement_syssym:=cbreaknode.create
               else
               else
                 begin
                 begin
@@ -415,7 +415,7 @@ implementation
 
 
           in_continue :
           in_continue :
             begin
             begin
-              if not (m_mac in aktmodeswitches) then
+              if not (m_mac in current_settings.modeswitches) then
                 statement_syssym:=ccontinuenode.create
                 statement_syssym:=ccontinuenode.create
               else
               else
                 begin
                 begin
@@ -426,7 +426,7 @@ implementation
 
 
           in_leave :
           in_leave :
             begin
             begin
-              if m_mac in aktmodeswitches then
+              if m_mac in current_settings.modeswitches then
                 statement_syssym:=cbreaknode.create
                 statement_syssym:=cbreaknode.create
               else
               else
                 begin
                 begin
@@ -437,7 +437,7 @@ implementation
 
 
           in_cycle :
           in_cycle :
             begin
             begin
-              if m_mac in aktmodeswitches then
+              if m_mac in current_settings.modeswitches then
                 statement_syssym:=ccontinuenode.create
                 statement_syssym:=ccontinuenode.create
               else
               else
                 begin
                 begin
@@ -614,7 +614,7 @@ implementation
               in_args:=true;
               in_args:=true;
               p1:=comp_expr(true);
               p1:=comp_expr(true);
               p1:=caddrnode.create(p1);
               p1:=caddrnode.create(p1);
-              if cs_typed_addresses in aktlocalswitches then
+              if cs_typed_addresses in current_settings.localswitches then
                 include(p1.flags,nf_typedaddr);
                 include(p1.flags,nf_typedaddr);
               consume(_RKLAMMER);
               consume(_RKLAMMER);
               statement_syssym:=p1;
               statement_syssym:=p1;
@@ -938,8 +938,8 @@ implementation
                getaddr:=true;
                getaddr:=true;
              end
              end
             else
             else
-             if (m_tp_procvar in aktmodeswitches) or
-                (m_mac_procvar in aktmodeswitches) then
+             if (m_tp_procvar in current_settings.modeswitches) or
+                (m_mac_procvar in current_settings.modeswitches) then
               begin
               begin
                 aprocdef:=Tprocsym(sym).search_procdef_byprocvardef(getprocvardef);
                 aprocdef:=Tprocsym(sym).search_procdef_byprocvardef(getprocvardef);
                 if assigned(aprocdef) then
                 if assigned(aprocdef) then
@@ -1038,8 +1038,8 @@ implementation
       begin
       begin
         if not assigned(pv) then
         if not assigned(pv) then
          internalerror(200301121);
          internalerror(200301121);
-        if (m_tp_procvar in aktmodeswitches) or
-           (m_mac_procvar in aktmodeswitches) then
+        if (m_tp_procvar in current_settings.modeswitches) or
+           (m_mac_procvar in current_settings.modeswitches) then
          begin
          begin
            hp:=p2;
            hp:=p2;
            hpp:=@p2;
            hpp:=@p2;
@@ -1317,8 +1317,8 @@ implementation
                (token=_LKLAMMER) or
                (token=_LKLAMMER) or
                (
                (
                 (
                 (
-                 (m_tp7 in aktmodeswitches) or
-                 (m_delphi in aktmodeswitches)
+                 (m_tp7 in current_settings.modeswitches) or
+                 (m_delphi in current_settings.modeswitches)
                 ) and
                 ) and
                 (afterassignment or in_args) and
                 (afterassignment or in_args) and
                 not(vo_is_result in tabstractvarsym(srsym).varoptions)
                 not(vo_is_result in tabstractvarsym(srsym).varoptions)
@@ -1413,7 +1413,7 @@ implementation
                      begin
                      begin
                        { We need to know if this unit uses Variants }
                        { We need to know if this unit uses Variants }
                        if (hdef=cvarianttype) and
                        if (hdef=cvarianttype) and
-                          not(cs_compilesystem in aktmoduleswitches) then
+                          not(cs_compilesystem in current_settings.moduleswitches) then
                          current_module.flags:=current_module.flags or uf_uses_variants;
                          current_module.flags:=current_module.flags or uf_uses_variants;
                        if (block_type<>bt_specialize) and
                        if (block_type<>bt_specialize) and
                           try_to_consume(_LKLAMMER) then
                           try_to_consume(_LKLAMMER) then
@@ -1529,7 +1529,7 @@ implementation
                       conststring :
                       conststring :
                         begin
                         begin
                           len:=tconstsym(srsym).value.len;
                           len:=tconstsym(srsym).value.len;
-                          if not(cs_ansistrings in aktlocalswitches) and (len>255) then
+                          if not(cs_ansistrings in current_settings.localswitches) and (len>255) then
                            len:=255;
                            len:=255;
                           getmem(pc,len+1);
                           getmem(pc,len+1);
                           move(pchar(tconstsym(srsym).value.valueptr)^,pc^,len);
                           move(pchar(tconstsym(srsym).value.valueptr)^,pc^,len);
@@ -1807,8 +1807,8 @@ implementation
 
 
                     { support tp/mac procvar^ if the procvar returns a
                     { support tp/mac procvar^ if the procvar returns a
                       pointer type }
                       pointer type }
-                    if ((m_tp_procvar in aktmodeswitches) or
-                        (m_mac_procvar in aktmodeswitches)) and
+                    if ((m_tp_procvar in current_settings.modeswitches) or
+                        (m_mac_procvar in current_settings.modeswitches)) and
                        (p1.resultdef.deftype=procvardef) and
                        (p1.resultdef.deftype=procvardef) and
                        (tprocvardef(p1.resultdef).returndef.deftype=pointerdef) then
                        (tprocvardef(p1.resultdef).returndef.deftype=pointerdef) then
                       begin
                       begin
@@ -1859,7 +1859,7 @@ implementation
                               begin
                               begin
                                  { support delphi autoderef }
                                  { support delphi autoderef }
                                  if (tpointerdef(p1.resultdef).pointeddef.deftype=arraydef) and
                                  if (tpointerdef(p1.resultdef).pointeddef.deftype=arraydef) and
-                                    (m_autoderef in aktmodeswitches) then
+                                    (m_autoderef in current_settings.modeswitches) then
                                    p1:=cderefnode.create(p1);
                                    p1:=cderefnode.create(p1);
                                  p2:=comp_expr(true);
                                  p2:=comp_expr(true);
                                  { Support Pbytevar[0..9] which returns array [0..9].}
                                  { Support Pbytevar[0..9] which returns array [0..9].}
@@ -1890,7 +1890,7 @@ implementation
                                 { the macpas unit                              }
                                 { the macpas unit                              }
                                 if (p1.resultdef.deftype = orddef) then
                                 if (p1.resultdef.deftype = orddef) then
                                   begin
                                   begin
-                                    if (m_mac in aktmodeswitches) and
+                                    if (m_mac in current_settings.modeswitches) and
                                        is_integer(p1.resultdef) and
                                        is_integer(p1.resultdef) and
                                        (p1.resultdef.size = 4) then
                                        (p1.resultdef.size = 4) then
                                       int_to_4cc(p1)
                                       int_to_4cc(p1)
@@ -1963,7 +1963,7 @@ implementation
                   begin
                   begin
                     consume(_POINT);
                     consume(_POINT);
                     if (p1.resultdef.deftype=pointerdef) and
                     if (p1.resultdef.deftype=pointerdef) and
-                       (m_autoderef in aktmodeswitches) then
+                       (m_autoderef in current_settings.modeswitches) then
                       begin
                       begin
                         p1:=cderefnode.create(p1);
                         p1:=cderefnode.create(p1);
                         do_typecheckpass(p1);
                         do_typecheckpass(p1);
@@ -2445,7 +2445,7 @@ implementation
                 end;
                 end;
                got_addrn:=false;
                got_addrn:=false;
                p1:=caddrnode.create(p1);
                p1:=caddrnode.create(p1);
-               if cs_typed_addresses in aktlocalswitches then
+               if cs_typed_addresses in current_settings.localswitches then
                  include(p1.flags,nf_typedaddr);
                  include(p1.flags,nf_typedaddr);
                { Store the procvar that we are expecting, the
                { Store the procvar that we are expecting, the
                  addrn will use the information to find the correct
                  addrn will use the information to find the correct

+ 6 - 6
compiler/pinline.pas

@@ -82,7 +82,7 @@ implementation
           set_varstate(p,vs_written,[])
           set_varstate(p,vs_written,[])
         else
         else
           set_varstate(p,vs_readwritten,[vsf_must_be_valid]);
           set_varstate(p,vs_readwritten,[vsf_must_be_valid]);
-        if (m_mac in aktmodeswitches) and
+        if (m_mac in current_settings.modeswitches) and
            is_class(p.resultdef) then
            is_class(p.resultdef) then
           begin
           begin
             classh:=tobjectdef(p.resultdef);
             classh:=tobjectdef(p.resultdef);
@@ -138,7 +138,7 @@ implementation
             new_dispose_statement := p2;
             new_dispose_statement := p2;
           end
           end
         { constructor,destructor specified }
         { constructor,destructor specified }
-        else if not(m_mac in aktmodeswitches) and
+        else if not(m_mac in current_settings.modeswitches) and
                 try_to_consume(_COMMA) then
                 try_to_consume(_COMMA) then
           begin
           begin
             { extended syntax of new and dispose }
             { extended syntax of new and dispose }
@@ -212,7 +212,7 @@ implementation
                   do_member_read(classh,false,sym,p2,again,[callflag])
                   do_member_read(classh,false,sym,p2,again,[callflag])
                 else
                 else
                   begin
                   begin
-                    if not(m_fpc in aktmodeswitches) then
+                    if not(m_fpc in current_settings.modeswitches) then
                       do_member_read(classh,false,sym,p2,again,[callflag])
                       do_member_read(classh,false,sym,p2,again,[callflag])
                     else
                     else
                       begin
                       begin
@@ -275,8 +275,8 @@ implementation
                   if (tpointerdef(p.resultdef).pointeddef.deftype=orddef) and
                   if (tpointerdef(p.resultdef).pointeddef.deftype=orddef) and
                      (torddef(tpointerdef(p.resultdef).pointeddef).typ=uvoid) then
                      (torddef(tpointerdef(p.resultdef).pointeddef).typ=uvoid) then
                     begin
                     begin
-                      if (m_tp7 in aktmodeswitches) or
-                         (m_delphi in aktmodeswitches) then
+                      if (m_tp7 in current_settings.modeswitches) or
+                         (m_delphi in current_settings.modeswitches) then
                        Message(parser_w_no_new_dispose_on_void_pointers)
                        Message(parser_w_no_new_dispose_on_void_pointers)
                       else
                       else
                        Message(parser_e_no_new_dispose_on_void_pointers);
                        Message(parser_e_no_new_dispose_on_void_pointers);
@@ -705,7 +705,7 @@ implementation
         if is_ansistring(paradef) or
         if is_ansistring(paradef) or
            (is_chararray(paradef) and
            (is_chararray(paradef) and
             (paradef.size>255)) or
             (paradef.size>255)) or
-           ((cs_ansistrings in aktlocalswitches) and
+           ((cs_ansistrings in current_settings.localswitches) and
             is_pchar(paradef)) then
             is_pchar(paradef)) then
           copynode:=ccallnode.createintern('fpc_ansistr_copy',paras)
           copynode:=ccallnode.createintern('fpc_ansistr_copy',paras)
         else
         else

+ 41 - 41
compiler/pmodules.pas

@@ -89,15 +89,15 @@ implementation
 
 
         { Start and end module debuginfo, at least required for stabs
         { Start and end module debuginfo, at least required for stabs
           to insert n_sourcefile lines }
           to insert n_sourcefile lines }
-        if (cs_debuginfo in aktmoduleswitches) or
-           (cs_use_lineinfo in aktglobalswitches) then
+        if (cs_debuginfo in current_settings.moduleswitches) or
+           (cs_use_lineinfo in current_settings.globalswitches) then
           debuginfo.insertmoduleinfo;
           debuginfo.insertmoduleinfo;
 
 
         { create the .s file and assemble it }
         { create the .s file and assemble it }
         GenerateAsm(false);
         GenerateAsm(false);
 
 
         { Also create a smartlinked version ? }
         { Also create a smartlinked version ? }
-        if (cs_create_smart in aktmoduleswitches) and
+        if (cs_create_smart in current_settings.moduleswitches) and
            (not use_smartlink_section) then
            (not use_smartlink_section) then
          begin
          begin
            GenerateAsm(true);
            GenerateAsm(true);
@@ -116,7 +116,7 @@ implementation
         current_module.linkunitofiles.add(current_module.objfilename^,link_static);
         current_module.linkunitofiles.add(current_module.objfilename^,link_static);
         current_module.flags:=current_module.flags or uf_static_linked;
         current_module.flags:=current_module.flags or uf_static_linked;
 
 
-        if (cs_create_smart in aktmoduleswitches) and
+        if (cs_create_smart in current_settings.moduleswitches) and
            not use_smartlink_section then
            not use_smartlink_section then
          begin
          begin
            current_module.linkunitstaticlibs.add(current_module.staticlibfilename^,link_smart);
            current_module.linkunitstaticlibs.add(current_module.staticlibfilename^,link_smart);
@@ -128,7 +128,7 @@ implementation
     procedure create_dwarf;
     procedure create_dwarf;
       begin
       begin
         { Dwarf conflicts with smartlinking in separate .a files }
         { Dwarf conflicts with smartlinking in separate .a files }
-        if (cs_create_smart in aktmoduleswitches) and
+        if (cs_create_smart in current_settings.moduleswitches) and
            not use_smartlink_section then
            not use_smartlink_section then
           exit;
           exit;
         { Call frame information }
         { Call frame information }
@@ -416,7 +416,7 @@ implementation
         hp.adddependency(current_module);
         hp.adddependency(current_module);
         { add to symtable stack }
         { add to symtable stack }
         symtablestack.push(hp.globalsymtable);
         symtablestack.push(hp.globalsymtable);
-        if (m_mac in aktmodeswitches) and
+        if (m_mac in current_settings.modeswitches) and
            assigned(hp.globalmacrosymtable) then
            assigned(hp.globalmacrosymtable) then
           macrosymtablestack.push(hp.globalmacrosymtable);
           macrosymtablestack.push(hp.globalmacrosymtable);
         { insert unitsym }
         { insert unitsym }
@@ -461,7 +461,7 @@ implementation
         macrosymtablestack.push(initialmacrosymtable);
         macrosymtablestack.push(initialmacrosymtable);
 
 
         { are we compiling the system unit? }
         { are we compiling the system unit? }
-        if (cs_compilesystem in aktmoduleswitches) then
+        if (cs_compilesystem in current_settings.moduleswitches) then
          begin
          begin
            systemunit:=tglobalsymtable(current_module.localsymtable);
            systemunit:=tglobalsymtable(current_module.localsymtable);
            { create system defines }
            { create system defines }
@@ -485,33 +485,33 @@ implementation
         if not(current_module.is_unit) then
         if not(current_module.is_unit) then
          begin
          begin
            { Heaptrc unit, load heaptrace before any other units especially objpas }
            { Heaptrc unit, load heaptrace before any other units especially objpas }
-           if (cs_use_heaptrc in aktglobalswitches) then
+           if (cs_use_heaptrc in current_settings.globalswitches) then
              AddUnit('HeapTrc');
              AddUnit('HeapTrc');
            { Lineinfo unit }
            { Lineinfo unit }
-           if (cs_use_lineinfo in aktglobalswitches) then
+           if (cs_use_lineinfo in current_settings.globalswitches) then
              AddUnit('LineInfo');
              AddUnit('LineInfo');
            { Lineinfo unit }
            { Lineinfo unit }
-           if (cs_gdb_valgrind in aktglobalswitches) then
+           if (cs_gdb_valgrind in current_settings.globalswitches) then
              AddUnit('CMem');
              AddUnit('CMem');
 {$ifdef cpufpemu}
 {$ifdef cpufpemu}
            { Floating point emulation unit?
            { Floating point emulation unit?
              softfpu must be in the system unit anyways (FK)
              softfpu must be in the system unit anyways (FK)
-           if (cs_fp_emulation in aktmoduleswitches) and not(target_info.system in system_wince) then
+           if (cs_fp_emulation in current_settings.moduleswitches) and not(target_info.system in system_wince) then
              AddUnit('SoftFpu');
              AddUnit('SoftFpu');
            }
            }
 {$endif cpufpemu}
 {$endif cpufpemu}
          end;
          end;
         { Objpas unit? }
         { Objpas unit? }
-        if m_objpas in aktmodeswitches then
+        if m_objpas in current_settings.modeswitches then
           AddUnit('ObjPas');
           AddUnit('ObjPas');
         { Macpas unit? }
         { Macpas unit? }
-        if m_mac in aktmodeswitches then
+        if m_mac in current_settings.modeswitches then
           AddUnit('MacPas');
           AddUnit('MacPas');
         { Profile unit? Needed for go32v2 only }
         { Profile unit? Needed for go32v2 only }
-        if (cs_profile in aktmoduleswitches) and
+        if (cs_profile in current_settings.moduleswitches) and
            (target_info.system in [system_i386_go32v2,system_i386_watcom]) then
            (target_info.system in [system_i386_go32v2,system_i386_watcom]) then
           AddUnit('Profile');
           AddUnit('Profile');
-        if (cs_load_fpcylix_unit in aktglobalswitches) then
+        if (cs_load_fpcylix_unit in current_settings.globalswitches) then
           begin
           begin
             AddUnit('FPCylix');
             AddUnit('FPCylix');
             AddUnit('DynLibs');
             AddUnit('DynLibs');
@@ -548,7 +548,7 @@ implementation
            consume(_ID);
            consume(_ID);
            { support "<unit> in '<file>'" construct, but not for tp7 }
            { support "<unit> in '<file>'" construct, but not for tp7 }
            fn:='';
            fn:='';
-           if not(m_tp7 in aktmodeswitches) and
+           if not(m_tp7 in current_settings.modeswitches) and
               try_to_consume(_OP_IN) then
               try_to_consume(_OP_IN) then
              fn:=FixFileName(get_stringconst);
              fn:=FixFileName(get_stringconst);
            { Give a warning if objpas is loaded }
            { Give a warning if objpas is loaded }
@@ -614,7 +614,7 @@ implementation
                pu.unitsym.module:=pu.u;
                pu.unitsym.module:=pu.u;
                { add to symtable stack }
                { add to symtable stack }
                symtablestack.push(pu.u.globalsymtable);
                symtablestack.push(pu.u.globalsymtable);
-               if (m_mac in aktmodeswitches) and
+               if (m_mac in current_settings.modeswitches) and
                   assigned(pu.u.globalmacrosymtable) then
                   assigned(pu.u.globalmacrosymtable) then
                  macrosymtablestack.push(pu.u.globalmacrosymtable);
                  macrosymtablestack.push(pu.u.globalmacrosymtable);
              end;
              end;
@@ -697,10 +697,10 @@ implementation
     procedure setupglobalswitches;
     procedure setupglobalswitches;
       begin
       begin
         { can't have local browser when no global browser }
         { can't have local browser when no global browser }
-        if (cs_local_browser in aktmoduleswitches) and
-           not(cs_browser in aktmoduleswitches) then
-          exclude(aktmoduleswitches,cs_local_browser);
-        if (cs_create_pic in aktmoduleswitches) then
+        if (cs_local_browser in current_settings.moduleswitches) and
+           not(cs_browser in current_settings.moduleswitches) then
+          exclude(current_settings.moduleswitches,cs_local_browser);
+        if (cs_create_pic in current_settings.moduleswitches) then
           begin
           begin
             def_system_macro('FPC_PIC');
             def_system_macro('FPC_PIC');
             def_system_macro('PIC');
             def_system_macro('PIC');
@@ -829,7 +829,7 @@ implementation
          globalvarsym : tglobalvarsym;
          globalvarsym : tglobalvarsym;
 {$endif i386}
 {$endif i386}
       begin
       begin
-         if m_mac in aktmodeswitches then
+         if m_mac in current_settings.modeswitches then
            current_module.mode_switch_allowed:= false;
            current_module.mode_switch_allowed:= false;
 
 
          consume(_UNIT);
          consume(_UNIT);
@@ -852,7 +852,7 @@ implementation
              new(s2);
              new(s2);
              s2^:=upper(SplitName(main_file.name^));
              s2^:=upper(SplitName(main_file.name^));
              unitname8:=copy(current_module.modulename^,1,8);
              unitname8:=copy(current_module.modulename^,1,8);
-             if (cs_check_unit_name in aktglobalswitches) and
+             if (cs_check_unit_name in current_settings.globalswitches) and
                 (
                 (
                  not(
                  not(
                      (current_module.modulename^=s2^) or
                      (current_module.modulename^=s2^) or
@@ -869,7 +869,7 @@ implementation
                 ) then
                 ) then
               Message1(unit_e_illegal_unit_name,current_module.realmodulename^);
               Message1(unit_e_illegal_unit_name,current_module.realmodulename^);
              if (current_module.modulename^='SYSTEM') then
              if (current_module.modulename^='SYSTEM') then
-              include(aktmoduleswitches,cs_compilesystem);
+              include(current_settings.moduleswitches,cs_compilesystem);
              dispose(s2);
              dispose(s2);
              dispose(s1);
              dispose(s1);
           end;
           end;
@@ -893,11 +893,11 @@ implementation
 
 
          { maybe turn off m_objpas if we are compiling objpas }
          { maybe turn off m_objpas if we are compiling objpas }
          if (current_module.modulename^='OBJPAS') then
          if (current_module.modulename^='OBJPAS') then
-           exclude(aktmodeswitches,m_objpas);
+           exclude(current_settings.modeswitches,m_objpas);
 
 
          { maybe turn off m_mac if we are compiling macpas }
          { maybe turn off m_mac if we are compiling macpas }
          if (current_module.modulename^='MACPAS') then
          if (current_module.modulename^='MACPAS') then
-           exclude(aktmodeswitches,m_mac);
+           exclude(current_settings.modeswitches,m_mac);
 
 
          parse_only:=true;
          parse_only:=true;
 
 
@@ -916,7 +916,7 @@ implementation
          make_ref:=true;
          make_ref:=true;
 
 
          { insert qualifier for the system unit (allows system.writeln) }
          { insert qualifier for the system unit (allows system.writeln) }
-         if not(cs_compilesystem in aktmoduleswitches) and
+         if not(cs_compilesystem in current_settings.moduleswitches) and
             (token=_USES) then
             (token=_USES) then
            begin
            begin
              loadunits;
              loadunits;
@@ -944,7 +944,7 @@ implementation
          { Export macros defined in the interface for macpas. The macros
          { Export macros defined in the interface for macpas. The macros
            are put in the globalmacrosymtable that will only be used by other
            are put in the globalmacrosymtable that will only be used by other
            units. The current unit continues to use the localmacrosymtable }
            units. The current unit continues to use the localmacrosymtable }
-         if (m_mac in aktmodeswitches) then
+         if (m_mac in current_settings.modeswitches) then
           begin
           begin
             current_module.globalmacrosymtable:=tmacrosymtable.create(true);
             current_module.globalmacrosymtable:=tmacrosymtable.create(true);
             current_module.localmacrosymtable.foreach_static(@copy_macro,nil);
             current_module.localmacrosymtable.foreach_static(@copy_macro,nil);
@@ -959,7 +959,7 @@ implementation
           end;
           end;
 
 
          { Our interface is compiled, generate CRC and switch to implementation }
          { Our interface is compiled, generate CRC and switch to implementation }
-         if not(cs_compilesystem in aktmoduleswitches) and
+         if not(cs_compilesystem in current_settings.moduleswitches) and
             (Errorcount=0) then
             (Errorcount=0) then
            tppumodule(current_module).getppucrc;
            tppumodule(current_module).getppucrc;
          current_module.in_interface:=false;
          current_module.in_interface:=false;
@@ -970,7 +970,7 @@ implementation
          reload_flagged_units;
          reload_flagged_units;
 
 
          { Parse the implementation section }
          { Parse the implementation section }
-         if (m_mac in aktmodeswitches) and try_to_consume(_END) then
+         if (m_mac in current_settings.modeswitches) and try_to_consume(_END) then
            has_impl:= false
            has_impl:= false
          else
          else
            has_impl:= true;
            has_impl:= true;
@@ -981,7 +981,7 @@ implementation
          current_module.localsymtable:=tstaticsymtable.create(current_module.modulename^,current_module.moduleid);
          current_module.localsymtable:=tstaticsymtable.create(current_module.modulename^,current_module.moduleid);
 
 
 {$ifdef i386}
 {$ifdef i386}
-         if cs_create_pic in aktmoduleswitches then
+         if cs_create_pic in current_settings.moduleswitches then
            begin
            begin
              { insert symbol for got access in assembler code}
              { insert symbol for got access in assembler code}
              globalvarsym:=tglobalvarsym.create('_GLOBAL_OFFSET_TABLE_',vs_value,voidpointertype,[vo_is_external,vo_is_C_var]);
              globalvarsym:=tglobalvarsym.create('_GLOBAL_OFFSET_TABLE_',vs_value,voidpointertype,[vo_is_external,vo_is_C_var]);
@@ -1097,7 +1097,7 @@ implementation
          maybeloadvariantsunit;
          maybeloadvariantsunit;
 
 
          { generate debuginfo }
          { generate debuginfo }
-         if (cs_debuginfo in aktmoduleswitches) then
+         if (cs_debuginfo in current_settings.moduleswitches) then
            debuginfo.inserttypeinfo;
            debuginfo.inserttypeinfo;
 
 
          { generate wrappers for interfaces }
          { generate wrappers for interfaces }
@@ -1144,11 +1144,11 @@ implementation
          if (Errorcount=0) then
          if (Errorcount=0) then
            tppumodule(current_module).writeppu;
            tppumodule(current_module).writeppu;
 
 
-         if not(cs_compilesystem in aktmoduleswitches) then
+         if not(cs_compilesystem in current_settings.moduleswitches) then
            if store_interface_crc<>current_module.interface_crc then
            if store_interface_crc<>current_module.interface_crc then
              Message1(unit_u_interface_crc_changed,current_module.ppufilename^);
              Message1(unit_u_interface_crc_changed,current_module.ppufilename^);
 {$ifdef EXTDEBUG}
 {$ifdef EXTDEBUG}
-         if not(cs_compilesystem in aktmoduleswitches) then
+         if not(cs_compilesystem in current_settings.moduleswitches) then
            if (store_crc<>current_module.crc) and simplify_ppu then
            if (store_crc<>current_module.crc) and simplify_ppu then
              Message1(unit_u_implementation_crc_changed,current_module.ppufilename^);
              Message1(unit_u_implementation_crc_changed,current_module.ppufilename^);
 {$endif EXTDEBUG}
 {$endif EXTDEBUG}
@@ -1197,13 +1197,13 @@ implementation
             (target_info.system in [system_i386_win32,system_i386_wdosx]) and
             (target_info.system in [system_i386_win32,system_i386_wdosx]) and
             (target_info.assem<>as_i386_pecoff) then
             (target_info.assem<>as_i386_pecoff) then
            begin
            begin
-              include(aktglobalswitches,cs_link_strip);
+              include(current_settings.globalswitches,cs_link_strip);
               { Warning stabs info does not work with reloc section !! }
               { Warning stabs info does not work with reloc section !! }
-              if cs_debuginfo in aktmoduleswitches then
+              if cs_debuginfo in current_settings.moduleswitches then
                 begin
                 begin
                   Message1(parser_w_parser_reloc_no_debug,current_module.mainsource^);
                   Message1(parser_w_parser_reloc_no_debug,current_module.mainsource^);
                   Message(parser_w_parser_win32_debug_needs_WN);
                   Message(parser_w_parser_win32_debug_needs_WN);
-                  exclude(aktmoduleswitches,cs_debuginfo);
+                  exclude(current_settings.moduleswitches,cs_debuginfo);
                 end;
                 end;
            end;
            end;
 
 
@@ -1225,7 +1225,7 @@ implementation
               exportlib.preparelib(orgpattern);
               exportlib.preparelib(orgpattern);
 
 
               if tf_library_needs_pic in target_info.flags then
               if tf_library_needs_pic in target_info.flags then
-                include(aktmoduleswitches,cs_create_pic);
+                include(current_settings.moduleswitches,cs_create_pic);
 
 
               consume(_ID);
               consume(_ID);
               consume(_SEMICOLON);
               consume(_SEMICOLON);
@@ -1402,7 +1402,7 @@ implementation
 {$endif arm}
 {$endif arm}
 
 
          { generate debuginfo }
          { generate debuginfo }
-         if (cs_debuginfo in aktmoduleswitches) then
+         if (cs_debuginfo in current_settings.moduleswitches) then
            debuginfo.inserttypeinfo;
            debuginfo.inserttypeinfo;
 
 
          InsertThreadvars;
          InsertThreadvars;
@@ -1421,7 +1421,7 @@ implementation
            exportlib.generatelib;
            exportlib.generatelib;
 
 
          { Reference all DEBUGINFO sections from the main .text section }
          { Reference all DEBUGINFO sections from the main .text section }
-         if (cs_debuginfo in aktmoduleswitches) then
+         if (cs_debuginfo in current_settings.moduleswitches) then
            debuginfo.referencesections(current_asmdata.asmlists[al_procedures]);
            debuginfo.referencesections(current_asmdata.asmlists[al_procedures]);
 
 
          { Resource strings }
          { Resource strings }
@@ -1462,7 +1462,7 @@ implementation
              if (compile_level=1) then
              if (compile_level=1) then
                begin
                begin
                  { write .def file }
                  { write .def file }
-                 if (cs_link_deffile in aktglobalswitches) then
+                 if (cs_link_deffile in current_settings.globalswitches) then
                   deffile.writefile;
                   deffile.writefile;
                  { insert all .o files from all loaded units and
                  { insert all .o files from all loaded units and
                    unload the units, we don't need them anymore.
                    unload the units, we don't need them anymore.

+ 5 - 5
compiler/powerpc/agppcmpw.pas

@@ -698,8 +698,8 @@ interface
        exit;
        exit;
       InlineLevel:=0;
       InlineLevel:=0;
       { lineinfo is only needed for al_procedures (PFV) }
       { lineinfo is only needed for al_procedures (PFV) }
-      do_line:=((cs_asm_source in aktglobalswitches) or
-                (cs_lineinfo in aktmoduleswitches))
+      do_line:=((cs_asm_source in current_settings.globalswitches) or
+                (cs_lineinfo in current_settings.moduleswitches))
                  and (p=current_asmdata.asmlists[al_procedures]);
                  and (p=current_asmdata.asmlists[al_procedures]);
       DoNotSplitLine:=false;
       DoNotSplitLine:=false;
       hp:=tai(p.first);
       hp:=tai(p.first);
@@ -719,7 +719,7 @@ interface
                 if assigned(infile) then
                 if assigned(infile) then
                  begin
                  begin
                    { open only if needed !! }
                    { open only if needed !! }
-                   if (cs_asm_source in aktglobalswitches) then
+                   if (cs_asm_source in current_settings.globalswitches) then
                     infile.open;
                     infile.open;
                  end;
                  end;
                 { avoid unnecessary reopens of the same file !! }
                 { avoid unnecessary reopens of the same file !! }
@@ -728,7 +728,7 @@ interface
                 lastfileinfo.line:=-1;
                 lastfileinfo.line:=-1;
               end;
               end;
            { write source }
            { write source }
-             if (cs_asm_source in aktglobalswitches) and
+             if (cs_asm_source in current_settings.globalswitches) and
                 assigned(infile) then
                 assigned(infile) then
               begin
               begin
                 if (infile<>lastinfile) then
                 if (infile<>lastinfile) then
@@ -1216,7 +1216,7 @@ interface
       { masm does not seem to recognize specific extensions and uses .obj allways PM }
       { masm does not seem to recognize specific extensions and uses .obj allways PM }
       if (target_asm.id = as_i386_masm) then
       if (target_asm.id = as_i386_masm) then
         begin
         begin
-          if not(cs_asm_extern in aktglobalswitches) then
+          if not(cs_asm_extern in current_settings.globalswitches) then
             begin
             begin
               if Not FileExists(objfile) and
               if Not FileExists(objfile) and
                  FileExists(ForceExtension(objfile,'.obj')) then
                  FileExists(ForceExtension(objfile,'.obj')) then

+ 7 - 7
compiler/powerpc/cgcpu.pas

@@ -1132,7 +1132,7 @@ const
           begin
           begin
             { save link register? }
             { save link register? }
             if (pi_do_call in current_procinfo.flags) or
             if (pi_do_call in current_procinfo.flags) or
-               ([cs_lineinfo,cs_debuginfo] * aktmoduleswitches <> []) then
+               ([cs_lineinfo,cs_debuginfo] * current_settings.moduleswitches <> []) then
               begin
               begin
                 a_reg_alloc(list,NR_R0);
                 a_reg_alloc(list,NR_R0);
                 { save return address... }
                 { save return address... }
@@ -1178,7 +1178,7 @@ const
         if usesfpr then
         if usesfpr then
           begin
           begin
 {            save floating-point registers
 {            save floating-point registers
-             if (cs_create_pic in aktmoduleswitches) and not(usesgpr) then
+             if (cs_create_pic in current_settings.moduleswitches) and not(usesgpr) then
                begin
                begin
                   a_call_name(current_asmdata.RefAsmSymbol('_savefpr_'+tostr(ord(firstregfpu)-ord(R_F14)+14)+'_g'));
                   a_call_name(current_asmdata.RefAsmSymbol('_savefpr_'+tostr(ord(firstregfpu)-ord(R_F14)+14)+'_g'));
                   gotgot:=true;
                   gotgot:=true;
@@ -1204,7 +1204,7 @@ const
         if usesgpr then
         if usesgpr then
           begin
           begin
              {
              {
-             if cs_create_pic in aktmoduleswitches then
+             if cs_create_pic in current_settings.moduleswitches then
                begin
                begin
                   a_call_name(current_asmdata.RefAsmSymbol('_savegpr_'+tostr(ord(firstreggpr)-ord(R_14)+14)+'_g'));
                   a_call_name(current_asmdata.RefAsmSymbol('_savegpr_'+tostr(ord(firstreggpr)-ord(R_14)+14)+'_g'));
                   gotgot:=true;
                   gotgot:=true;
@@ -1213,7 +1213,7 @@ const
                a_call_name(current_asmdata.RefAsmSymbol('_savegpr_'+tostr(ord(firstreggpr)-ord(R_14)+14)))
                a_call_name(current_asmdata.RefAsmSymbol('_savegpr_'+tostr(ord(firstreggpr)-ord(R_14)+14)))
              }
              }
             if (firstregint <= RS_R22) or
             if (firstregint <= RS_R22) or
-               ((cs_opt_size in aktoptimizerswitches) and
+               ((cs_opt_size in current_settings.optimizerswitches) and
                { with RS_R30 it's also already smaller, but too big a speed trade-off to make }
                { with RS_R30 it's also already smaller, but too big a speed trade-off to make }
                 (firstregint <= RS_R29)) then
                 (firstregint <= RS_R29)) then
               begin
               begin
@@ -1346,7 +1346,7 @@ const
         if (usesgpr) then
         if (usesgpr) then
           begin
           begin
             if (firstregint <= RS_R22) or
             if (firstregint <= RS_R22) or
-               ((cs_opt_size in aktoptimizerswitches) and
+               ((cs_opt_size in current_settings.optimizerswitches) and
                 { with RS_R30 it's also already smaller, but too big a speed trade-off to make }
                 { with RS_R30 it's also already smaller, but too big a speed trade-off to make }
                 (firstregint <= RS_R29)) then
                 (firstregint <= RS_R29)) then
               begin
               begin
@@ -1987,7 +1987,7 @@ const
       var
       var
          hl : tasmlabel;
          hl : tasmlabel;
       begin
       begin
-         if not(cs_check_overflow in aktlocalswitches) then
+         if not(cs_check_overflow in current_settings.localswitches) then
           exit;
           exit;
          current_asmdata.getjumplabel(hl);
          current_asmdata.getjumplabel(hl);
          if not ((def.deftype=pointerdef) or
          if not ((def.deftype=pointerdef) or
@@ -2049,7 +2049,7 @@ const
 
 
         make_global:=false;
         make_global:=false;
         if (not current_module.is_unit) or
         if (not current_module.is_unit) or
-           (cs_create_smart in aktmoduleswitches) or
+           (cs_create_smart in current_settings.moduleswitches) or
            (procdef.owner.defowner.owner.symtabletype=globalsymtable) then
            (procdef.owner.defowner.owner.symtabletype=globalsymtable) then
           make_global:=true;
           make_global:=true;
 
 

+ 3 - 3
compiler/powerpc/cpupi.pas

@@ -106,13 +106,13 @@ unit cpupi;
       begin
       begin
          if not(po_assembler in procdef.procoptions) then
          if not(po_assembler in procdef.procoptions) then
            begin
            begin
-             if cs_asm_source in aktglobalswitches then
+             if cs_asm_source in current_settings.globalswitches then
                aktproccode.insert(Tai_comment.Create(strpnew('Parameter copies start at: r1+'+tostr(procdef.parast.address_fixup))));
                aktproccode.insert(Tai_comment.Create(strpnew('Parameter copies start at: r1+'+tostr(procdef.parast.address_fixup))));
 
 
-             if cs_asm_source in aktglobalswitches then
+             if cs_asm_source in current_settings.globalswitches then
                aktproccode.insert(Tai_comment.Create(strpnew('Locals start at: r1+'+tostr(procdef.localst.address_fixup))));
                aktproccode.insert(Tai_comment.Create(strpnew('Locals start at: r1+'+tostr(procdef.localst.address_fixup))));
              firsttemp_offset:=align(procdef.localst.address_fixup+procdef.localst.datasize,16);
              firsttemp_offset:=align(procdef.localst.address_fixup+procdef.localst.datasize,16);
-             if cs_asm_source in aktglobalswitches then
+             if cs_asm_source in current_settings.globalswitches then
                aktproccode.insert(Tai_comment.Create(strpnew('Temp. space start: r1+'+tostr(firsttemp_offset))));
                aktproccode.insert(Tai_comment.Create(strpnew('Temp. space start: r1+'+tostr(firsttemp_offset))));
 
 
              //!!!! tg.setfirsttemp(firsttemp_offset);
              //!!!! tg.setfirsttemp(firsttemp_offset);

+ 1 - 1
compiler/powerpc/itcpugas.pas

@@ -138,7 +138,7 @@ implementation
            However, we do not do this for smart linked files since that would cause a lot of (mostly useless)
            However, we do not do this for smart linked files since that would cause a lot of (mostly useless)
            overhead. In theory, we could also not do it if "-a" is not used. The Mac OS X assembler (which is
            overhead. In theory, we could also not do it if "-a" is not used. The Mac OS X assembler (which is
            based on GNU as) "natively" supports full register names.}
            based on GNU as) "natively" supports full register names.}
-          if (cs_create_smart in aktmoduleswitches) and
+          if (cs_create_smart in current_settings.moduleswitches) and
              (target_info.system <> system_powerpc_darwin) then
              (target_info.system <> system_powerpc_darwin) then
             result:=gas_regname_short_table[p]
             result:=gas_regname_short_table[p]
           else
           else

+ 6 - 6
compiler/powerpc/nppcadd.pas

@@ -308,11 +308,11 @@ interface
         if not cmpop then
         if not cmpop then
           location_reset(location,LOC_REGISTER,def_cgsize(resultdef));
           location_reset(location,LOC_REGISTER,def_cgsize(resultdef));
 
 
-        load_left_right(cmpop,((cs_check_overflow in aktlocalswitches) and
+        load_left_right(cmpop,((cs_check_overflow in current_settings.localswitches) and
             (nodetype in [addn,subn])) or (nodetype = muln));
             (nodetype in [addn,subn])) or (nodetype = muln));
 
 
         if (nodetype <> muln) and
         if (nodetype <> muln) and
-           (not(cs_check_overflow in aktlocalswitches) or
+           (not(cs_check_overflow in current_settings.localswitches) or
             not(nodetype in [addn,subn])) then
             not(nodetype in [addn,subn])) then
           begin
           begin
             case nodetype of
             case nodetype of
@@ -564,7 +564,7 @@ interface
         case nodetype of
         case nodetype of
           addn :
           addn :
             begin
             begin
-              if (cs_mmx_saturation in aktlocalswitches) then
+              if (cs_mmx_saturation in current_settings.localswitches) then
                 begin
                 begin
                    case mmxbase of
                    case mmxbase of
                       mmxs8bit:
                       mmxs8bit:
@@ -600,7 +600,7 @@ interface
             end;
             end;
           subn :
           subn :
             begin
             begin
-              if (cs_mmx_saturation in aktlocalswitches) then
+              if (cs_mmx_saturation in current_settings.localswitches) then
                 begin
                 begin
                    case mmxbase of
                    case mmxbase of
                       mmxs8bit:
                       mmxs8bit:
@@ -819,13 +819,13 @@ interface
           else
           else
            location_reset(location,LOC_FLAGS,OS_NO);
            location_reset(location,LOC_FLAGS,OS_NO);
 
 
-         load_left_right(cmpop, (cs_check_overflow in aktlocalswitches) and
+         load_left_right(cmpop, (cs_check_overflow in current_settings.localswitches) and
             (nodetype in [addn,subn,muln]));
             (nodetype in [addn,subn,muln]));
 
 
          if not(cmpop) then
          if not(cmpop) then
            location.register := cg.getintregister(current_asmdata.CurrAsmList,OS_INT);
            location.register := cg.getintregister(current_asmdata.CurrAsmList,OS_INT);
 
 
-         if not(cs_check_overflow in aktlocalswitches) or
+         if not(cs_check_overflow in current_settings.localswitches) or
             (cmpop) or
             (cmpop) or
             (nodetype in [orn,andn,xorn]) then
             (nodetype in [orn,andn,xorn]) then
            begin
            begin

+ 4 - 4
compiler/powerpc/nppcmat.pas

@@ -207,7 +207,7 @@ end;
                 cg.a_load_reg_reg(current_asmdata.CurrAsmList, OS_INT, OS_INT, numerator, resultreg);
                 cg.a_load_reg_reg(current_asmdata.CurrAsmList, OS_INT, OS_INT, numerator, resultreg);
              end else if (tordconstnode(right).value = -1) then begin
              end else if (tordconstnode(right).value = -1) then begin
                 // note: only in the signed case possible..., may overflow
                 // note: only in the signed case possible..., may overflow
-                current_asmdata.CurrAsmList.concat(taicpu.op_reg_reg(negops[cs_check_overflow in aktlocalswitches], resultreg, numerator));
+                current_asmdata.CurrAsmList.concat(taicpu.op_reg_reg(negops[cs_check_overflow in current_settings.localswitches], resultreg, numerator));
              end else if (ispowerof2(tordconstnode(right).value, power)) then begin
              end else if (ispowerof2(tordconstnode(right).value, power)) then begin
                 if (is_signed(right.resultdef)) then begin
                 if (is_signed(right.resultdef)) then begin
                     { From "The PowerPC Compiler Writer's Guide", pg. 52ff          }
                     { From "The PowerPC Compiler Writer's Guide", pg. 52ff          }
@@ -338,7 +338,7 @@ end;
 
 
              { needs overflow checking, (-maxlongint-1) div (-1) overflows! }
              { needs overflow checking, (-maxlongint-1) div (-1) overflows! }
              op := divops[is_signed(right.resultdef),
              op := divops[is_signed(right.resultdef),
-                          cs_check_overflow in aktlocalswitches];
+                          cs_check_overflow in current_settings.localswitches];
              current_asmdata.CurrAsmList.concat(taicpu.op_reg_reg_reg(op,resultreg,numerator,
              current_asmdata.CurrAsmList.concat(taicpu.op_reg_reg_reg(op,resultreg,numerator,
                divider));
                divider));
 
 
@@ -567,7 +567,7 @@ end;
                end;
                end;
              current_asmdata.CurrAsmList.concat(taicpu.op_reg_reg_const(A_SUBFIC,
              current_asmdata.CurrAsmList.concat(taicpu.op_reg_reg_const(A_SUBFIC,
                location.register64.reglo,left.location.register64.reglo,0));
                location.register64.reglo,left.location.register64.reglo,0));
-             if not(cs_check_overflow in aktlocalswitches) then
+             if not(cs_check_overflow in current_settings.localswitches) then
                current_asmdata.CurrAsmList.concat(taicpu.op_reg_reg(A_SUBFZE,
                current_asmdata.CurrAsmList.concat(taicpu.op_reg_reg(A_SUBFZE,
                  location.register64.reghi,left.location.register64.reghi))
                  location.register64.reghi,left.location.register64.reghi))
              else
              else
@@ -614,7 +614,7 @@ end;
               { choose appropriate operand }
               { choose appropriate operand }
               if left.resultdef.deftype <> floatdef then
               if left.resultdef.deftype <> floatdef then
                 begin
                 begin
-                  if not(cs_check_overflow in aktlocalswitches) then
+                  if not(cs_check_overflow in current_settings.localswitches) then
                     op := A_NEG
                     op := A_NEG
                   else
                   else
                     op := A_NEGO_;
                     op := A_NEGO_;

+ 16 - 16
compiler/powerpc64/cgcpu.pas

@@ -616,7 +616,7 @@ var
   tmpref: treference;
   tmpref: treference;
   tempreg : TRegister;
   tempreg : TRegister;
 begin
 begin
-  if (not (cs_opt_size in aktoptimizerswitches)) then begin
+  if (not (cs_opt_size in current_settings.optimizerswitches)) then begin
     tempreg := cg.getintregister(current_asmdata.CurrAsmList, OS_INT);
     tempreg := cg.getintregister(current_asmdata.CurrAsmList, OS_INT);
     { load actual function entry (reg contains the reference to the function descriptor)
     { load actual function entry (reg contains the reference to the function descriptor)
     into tempreg }
     into tempreg }
@@ -756,7 +756,7 @@ begin
     internalerror(2002090902);
     internalerror(2002090902);
   { if PIC or basic optimizations are enabled, and the number of instructions which would be
   { if PIC or basic optimizations are enabled, and the number of instructions which would be
    required to load the value is greater than 2, store (and later load) the value from there }
    required to load the value is greater than 2, store (and later load) the value from there }
-  if (((cs_opt_peephole in aktoptimizerswitches) or (cs_create_pic in aktmoduleswitches)) and
+  if (((cs_opt_peephole in current_settings.optimizerswitches) or (cs_create_pic in current_settings.moduleswitches)) and
     (getInstructionLength(a) > 2)) then
     (getInstructionLength(a) > 2)) then
     loadConstantPIC(list, size, a, reg)
     loadConstantPIC(list, size, a, reg)
   else
   else
@@ -1049,7 +1049,7 @@ var
       cg.a_load_reg_reg(current_asmdata.CurrAsmList, OS_INT, OS_INT, src, dst);
       cg.a_load_reg_reg(current_asmdata.CurrAsmList, OS_INT, OS_INT, src, dst);
     end else if (a = -1) and (signed) then begin
     end else if (a = -1) and (signed) then begin
       { note: only in the signed case possible..., may overflow }
       { note: only in the signed case possible..., may overflow }
-      current_asmdata.CurrAsmList.concat(taicpu.op_reg_reg(negops[cs_check_overflow in aktlocalswitches], dst, src));
+      current_asmdata.CurrAsmList.concat(taicpu.op_reg_reg(negops[cs_check_overflow in current_settings.localswitches], dst, src));
     end else if (ispowerof2(a, power, isNegPower)) then begin
     end else if (ispowerof2(a, power, isNegPower)) then begin
       if (signed) then begin
       if (signed) then begin
         { From "The PowerPC Compiler Writer's Guide", pg. 52ff          }
         { From "The PowerPC Compiler Writer's Guide", pg. 52ff          }
@@ -1127,7 +1127,7 @@ begin
   useReg := false;
   useReg := false;
   case (op) of
   case (op) of
     OP_DIV, OP_IDIV:
     OP_DIV, OP_IDIV:
-      if (cs_opt_level1 in aktoptimizerswitches) then
+      if (cs_opt_level1 in current_settings.optimizerswitches) then
         do_constant_div(list, size, a, src, dst, op = OP_IDIV)
         do_constant_div(list, size, a, src, dst, op = OP_IDIV)
       else
       else
         usereg := true;
         usereg := true;
@@ -1504,7 +1504,7 @@ var
     { there are two ways to do this: manually, by generating a few "std" instructions,
     { there are two ways to do this: manually, by generating a few "std" instructions,
      or via the restore helper functions. The latter are selected by the -Og switch,
      or via the restore helper functions. The latter are selected by the -Og switch,
      i.e. "optimize for size" }
      i.e. "optimize for size" }
-    if (cs_opt_size in aktoptimizerswitches) then begin
+    if (cs_opt_size in current_settings.optimizerswitches) then begin
       mayNeedLRStore := false;
       mayNeedLRStore := false;
       if ((fprcount > 0) and (gprcount > 0)) then begin
       if ((fprcount > 0) and (gprcount > 0)) then begin
         a_op_const_reg_reg(list, OP_SUB, OS_INT, 8 * fprcount, NR_R1, NR_R12);
         a_op_const_reg_reg(list, OP_SUB, OS_INT, 8 * fprcount, NR_R1, NR_R12);
@@ -1538,7 +1538,7 @@ var
     end;
     end;
 
 
     { we may need to store R0 (=LR) ourselves }
     { we may need to store R0 (=LR) ourselves }
-    if ((cs_profile in initmoduleswitches) or (mayNeedLRStore)) and (needslinkreg) then begin
+    if ((cs_profile in init_settings.moduleswitches) or (mayNeedLRStore)) and (needslinkreg) then begin
       reference_reset_base(href, NR_STACK_POINTER_REG, LA_LR_ELF);
       reference_reset_base(href, NR_STACK_POINTER_REG, LA_LR_ELF);
       list.concat(taicpu.op_reg_ref(A_STD, NR_R0, href));
       list.concat(taicpu.op_reg_ref(A_STD, NR_R0, href));
     end;
     end;
@@ -1557,9 +1557,9 @@ begin
   { determine whether we need to save the link register }
   { determine whether we need to save the link register }
   needslinkreg :=
   needslinkreg :=
     ((not (po_assembler in current_procinfo.procdef.procoptions)) and 
     ((not (po_assembler in current_procinfo.procdef.procoptions)) and 
-      ((pi_do_call in current_procinfo.flags) or (cs_profile in initmoduleswitches))) or
-    ((cs_opt_size in aktoptimizerswitches) and ((fprcount > 0) or (gprcount > 0))) or
-    ([cs_lineinfo, cs_debuginfo] * aktmoduleswitches <> []);
+      ((pi_do_call in current_procinfo.flags) or (cs_profile in init_settings.moduleswitches))) or
+    ((cs_opt_size in current_settings.optimizerswitches) and ((fprcount > 0) or (gprcount > 0))) or
+    ([cs_lineinfo, cs_debuginfo] * current_settings.moduleswitches <> []);
 
 
   a_reg_alloc(list, NR_STACK_POINTER_REG);
   a_reg_alloc(list, NR_STACK_POINTER_REG);
   a_reg_alloc(list, NR_R0);
   a_reg_alloc(list, NR_R0);
@@ -1639,7 +1639,7 @@ var
     { there are two ways to do this: manually, by generating a few "ld" instructions,
     { there are two ways to do this: manually, by generating a few "ld" instructions,
      or via the restore helper functions. The latter are selected by the -Og switch,
      or via the restore helper functions. The latter are selected by the -Og switch,
      i.e. "optimize for size" }
      i.e. "optimize for size" }
-    if (cs_opt_size in aktoptimizerswitches) then begin
+    if (cs_opt_size in current_settings.optimizerswitches) then begin
       needsExitCode := false;
       needsExitCode := false;
       if ((fprcount > 0) and (gprcount > 0)) then begin
       if ((fprcount > 0) and (gprcount > 0)) then begin
         a_op_const_reg_reg(list, OP_SUB, OS_INT, 8 * fprcount, NR_R1, NR_R12);
         a_op_const_reg_reg(list, OP_SUB, OS_INT, 8 * fprcount, NR_R1, NR_R12);
@@ -1696,9 +1696,9 @@ begin
   { determine whether we need to restore the link register }
   { determine whether we need to restore the link register }
   needslinkreg :=
   needslinkreg :=
     ((not (po_assembler in current_procinfo.procdef.procoptions)) and 
     ((not (po_assembler in current_procinfo.procdef.procoptions)) and 
-      ((pi_do_call in current_procinfo.flags) or (cs_profile in initmoduleswitches))) or
-    ((cs_opt_size in aktoptimizerswitches) and ((fprcount > 0) or (gprcount > 0))) or
-    ([cs_lineinfo, cs_debuginfo] * aktmoduleswitches <> []);
+      ((pi_do_call in current_procinfo.flags) or (cs_profile in init_settings.moduleswitches))) or
+    ((cs_opt_size in current_settings.optimizerswitches) and ((fprcount > 0) or (gprcount > 0))) or
+    ([cs_lineinfo, cs_debuginfo] * current_settings.moduleswitches <> []);
 
 
   { calculate stack frame }
   { calculate stack frame }
   localsize := tppcprocinfo(current_procinfo).calc_stackframe_size(
   localsize := tppcprocinfo(current_procinfo).calc_stackframe_size(
@@ -1973,7 +1973,7 @@ var
   hl: tasmlabel;
   hl: tasmlabel;
   flags : TResFlags;
   flags : TResFlags;
 begin
 begin
-  if not (cs_check_overflow in aktlocalswitches) then
+  if not (cs_check_overflow in current_settings.localswitches) then
     exit;
     exit;
   current_asmdata.getjumplabel(hl);
   current_asmdata.getjumplabel(hl);
   if not ((def.deftype = pointerdef) or
   if not ((def.deftype = pointerdef) or
@@ -2051,7 +2051,7 @@ begin
 
 
   make_global := false;
   make_global := false;
   if (not current_module.is_unit) or
   if (not current_module.is_unit) or
-    (cs_create_smart in aktmoduleswitches) or
+    (cs_create_smart in current_settings.moduleswitches) or
     (procdef.owner.defowner.owner.symtabletype = globalsymtable) then
     (procdef.owner.defowner.owner.symtabletype = globalsymtable) then
     make_global := true;
     make_global := true;
 
 
@@ -2148,7 +2148,7 @@ begin
 
 
   { if we have to create PIC, add the symbol to the TOC/GOT }
   { if we have to create PIC, add the symbol to the TOC/GOT }
   {$WARNING Hack for avoiding too long manglednames enabled!!}
   {$WARNING Hack for avoiding too long manglednames enabled!!}
-  if (cs_create_pic in aktmoduleswitches) and (assigned(ref.symbol) and
+  if (cs_create_pic in current_settings.moduleswitches) and (assigned(ref.symbol) and
     (length(ref.symbol.name) < MAX_GOT_SYMBOL_NAME_LENGTH_HACK)) then begin
     (length(ref.symbol.name) < MAX_GOT_SYMBOL_NAME_LENGTH_HACK)) then begin
     tmpreg := load_got_symbol(list, ref.symbol.name);
     tmpreg := load_got_symbol(list, ref.symbol.name);
     if (ref.base = NR_NO) then
     if (ref.base = NR_NO) then

+ 2 - 2
compiler/powerpc64/cpupi.pas

@@ -73,7 +73,7 @@ begin
     { the ABI specification says that it is required to always allocate space for 8 * 8 bytes
     { the ABI specification says that it is required to always allocate space for 8 * 8 bytes
       for registers R3-R10 and stack header if there's a stack frame, but GCC doesn't do that,
       for registers R3-R10 and stack header if there's a stack frame, but GCC doesn't do that,
       so we don't that too. Uncomment the next three lines if this is required }
       so we don't that too. Uncomment the next three lines if this is required }
-    if (cs_profile in initmoduleswitches) and (ofs < 112) then begin
+    if (cs_profile in init_settings.moduleswitches) and (ofs < 112) then begin
       ofs := 112;
       ofs := 112;
     end;
     end;
     tg.setfirsttemp(ofs);
     tg.setfirsttemp(ofs);
@@ -100,7 +100,7 @@ begin
         numfpr * tcgsize2size[OS_FLOAT], ELF_STACK_ALIGN);
         numfpr * tcgsize2size[OS_FLOAT], ELF_STACK_ALIGN);
 
 
     if (pi_do_call in flags) or (tg.lasttemp <> tg.firsttemp) or
     if (pi_do_call in flags) or (tg.lasttemp <> tg.firsttemp) or
-      (result > RED_ZONE_SIZE) {or (cs_profile in initmoduleswitches)} then begin
+      (result > RED_ZONE_SIZE) {or (cs_profile in init_settings.moduleswitches)} then begin
       result := align(result + tg.lasttemp, ELF_STACK_ALIGN);
       result := align(result + tg.lasttemp, ELF_STACK_ALIGN);
     end;
     end;
   end else
   end else

+ 1 - 1
compiler/powerpc64/itcpugas.pas

@@ -146,7 +146,7 @@ var
 begin
 begin
   p := findreg_by_number(r);
   p := findreg_by_number(r);
   if p <> 0 then
   if p <> 0 then
-    if (cs_create_smart in aktmoduleswitches) and
+    if (cs_create_smart in current_settings.moduleswitches) and
       (target_info.system <> system_powerpc_darwin) then
       (target_info.system <> system_powerpc_darwin) then
       result := gas_regname_short_table[p]
       result := gas_regname_short_table[p]
     else
     else

+ 2 - 2
compiler/powerpc64/nppcadd.pas

@@ -214,13 +214,13 @@ begin
   else
   else
     location_reset(location, LOC_FLAGS, OS_NO);
     location_reset(location, LOC_FLAGS, OS_NO);
 
 
-  load_left_right(cmpop, (cs_check_overflow in aktlocalswitches) and
+  load_left_right(cmpop, (cs_check_overflow in current_settings.localswitches) and
     (nodetype in [addn, subn, muln]));
     (nodetype in [addn, subn, muln]));
 
 
   if not (cmpop) then
   if not (cmpop) then
     location.register := cg.getintregister(current_asmdata.CurrAsmList, OS_INT);
     location.register := cg.getintregister(current_asmdata.CurrAsmList, OS_INT);
 
 
-  if not (cs_check_overflow in aktlocalswitches) or (cmpop) or
+  if not (cs_check_overflow in current_settings.localswitches) or (cmpop) or
     (nodetype in [orn, andn, xorn]) then begin
     (nodetype in [orn, andn, xorn]) then begin
     case nodetype of
     case nodetype of
       addn, muln, xorn, orn, andn:
       addn, muln, xorn, orn, andn:

+ 3 - 3
compiler/powerpc64/nppcmat.pas

@@ -151,7 +151,7 @@ begin
     resultreg := cg.getintregister(current_asmdata.CurrAsmList,size);
     resultreg := cg.getintregister(current_asmdata.CurrAsmList,size);
   end;
   end;
   done := false;
   done := false;
-  if (cs_opt_level1 in aktoptimizerswitches) and (right.nodetype = ordconstn) then begin
+  if (cs_opt_level1 in current_settings.optimizerswitches) and (right.nodetype = ordconstn) then begin
     if (nodetype = divn) then
     if (nodetype = divn) then
       cg.a_op_const_reg_reg(current_asmdata.CurrAsmList, divCgOps[is_signed(right.resultdef)], 
       cg.a_op_const_reg_reg(current_asmdata.CurrAsmList, divCgOps[is_signed(right.resultdef)], 
         size, tordconstnode(right).value, numerator, resultreg)
         size, tordconstnode(right).value, numerator, resultreg)
@@ -174,7 +174,7 @@ begin
 
 
     { select the correct opcode according to the sign of the result, whether we need
     { select the correct opcode according to the sign of the result, whether we need
      overflow checking }
      overflow checking }
-    op := divops[is_signed(right.resultdef), cs_check_overflow in aktlocalswitches];
+    op := divops[is_signed(right.resultdef), cs_check_overflow in current_settings.localswitches];
     current_asmdata.CurrAsmList.concat(taicpu.op_reg_reg_reg(op, resultreg, numerator,
     current_asmdata.CurrAsmList.concat(taicpu.op_reg_reg_reg(op, resultreg, numerator,
       divider));
       divider));
 
 
@@ -303,7 +303,7 @@ begin
     end;
     end;
     { choose appropriate operand }
     { choose appropriate operand }
     if left.resultdef.deftype <> floatdef then begin
     if left.resultdef.deftype <> floatdef then begin
-      if not (cs_check_overflow in aktlocalswitches) then
+      if not (cs_check_overflow in current_settings.localswitches) then
         op := A_NEG
         op := A_NEG
       else
       else
         op := A_NEGO_;
         op := A_NEGO_;

+ 1 - 1
compiler/ppcgen/ngppcadd.pas

@@ -188,7 +188,7 @@ implementation
         else
         else
            cgsize:=OS_32;
            cgsize:=OS_32;
 
 
-        if ((cs_full_boolean_eval in aktlocalswitches) and
+        if ((cs_full_boolean_eval in current_settings.localswitches) and
             not(nf_short_bool in flags)) or
             not(nf_short_bool in flags)) or
            (nodetype in [unequaln,ltn,lten,gtn,gten,equaln,xorn]) then
            (nodetype in [unequaln,ltn,lten,gtn,gten,equaln,xorn]) then
           begin
           begin

+ 1 - 1
compiler/procinfo.pas

@@ -176,7 +176,7 @@ implementation
 
 
     function tprocinfo.calc_stackframe_size:longint;
     function tprocinfo.calc_stackframe_size:longint;
       begin
       begin
-        result:=Align(tg.direction*tg.lasttemp,aktalignment.localalignmin);
+        result:=Align(tg.direction*tg.lasttemp,current_settings.alignment.localalignmin);
       end;
       end;
 
 
 
 

+ 7 - 7
compiler/pstatmnt.pas

@@ -327,7 +327,7 @@ implementation
                (
                (
                 { record/object fields are allowed in tp7 mode only }
                 { record/object fields are allowed in tp7 mode only }
                 (
                 (
-                 (m_tp7 in aktmodeswitches) and
+                 (m_tp7 in current_settings.modeswitches) and
                  (hp.nodetype=subscriptn) and
                  (hp.nodetype=subscriptn) and
                  ((tsubscriptnode(hp).left.resultdef.deftype=recorddef) or
                  ((tsubscriptnode(hp).left.resultdef.deftype=recorddef) or
                   is_object(tsubscriptnode(hp).left.resultdef))
                   is_object(tsubscriptnode(hp).left.resultdef))
@@ -371,7 +371,7 @@ implementation
                          ) then
                          ) then
                      begin
                      begin
                        { Assigning for-loop variable is only allowed in tp7 and macpas }
                        { Assigning for-loop variable is only allowed in tp7 and macpas }
-                       if ([m_tp7,m_mac] * aktmodeswitches = []) then
+                       if ([m_tp7,m_mac] * current_settings.modeswitches = []) then
                          begin
                          begin
                            if not assigned(loopvarsym) then
                            if not assigned(loopvarsym) then
                              loopvarsym:=tabstractvarsym(tloadnode(hp).symtableentry);
                              loopvarsym:=tabstractvarsym(tloadnode(hp).symtableentry);
@@ -384,7 +384,7 @@ implementation
                typedconstsym :
                typedconstsym :
                  begin
                  begin
                    { Bad programming, only allowed in tp7 mode }
                    { Bad programming, only allowed in tp7 mode }
-                   if not(m_tp7 in aktmodeswitches) then
+                   if not(m_tp7 in current_settings.modeswitches) then
                      MessagePos(hp.fileinfo,type_e_illegal_count_var);
                      MessagePos(hp.fileinfo,type_e_illegal_count_var);
                  end;
                  end;
                else
                else
@@ -856,9 +856,9 @@ implementation
         asmreader : tbaseasmreader;
         asmreader : tbaseasmreader;
       begin
       begin
          Inside_asm_statement:=true;
          Inside_asm_statement:=true;
-         if assigned(asmmodeinfos[aktasmmode]) then
+         if assigned(asmmodeinfos[current_settings.asmmode]) then
            begin
            begin
-             asmreader:=asmmodeinfos[aktasmmode]^.casmreader.create;
+             asmreader:=asmmodeinfos[current_settings.asmmode]^.casmreader.create;
              asmstat:=casmnode.create(asmreader.assemble as TAsmList);
              asmstat:=casmnode.create(asmreader.assemble as TAsmList);
              asmreader.free;
              asmreader.free;
            end
            end
@@ -927,7 +927,7 @@ implementation
          case token of
          case token of
            _GOTO :
            _GOTO :
              begin
              begin
-                if not(cs_support_goto in aktmoduleswitches)then
+                if not(cs_support_goto in current_settings.moduleswitches)then
                  Message(sym_e_goto_and_label_not_supported);
                  Message(sym_e_goto_and_label_not_supported);
                 consume(_GOTO);
                 consume(_GOTO);
                 if (token<>_INTCONST) and (token<>_ID) then
                 if (token<>_INTCONST) and (token<>_ID) then
@@ -1140,7 +1140,7 @@ implementation
            current_procinfo.procdef.localst.rename(current_procinfo.procdef.resultname,'$hiddenresult');
            current_procinfo.procdef.localst.rename(current_procinfo.procdef.resultname,'$hiddenresult');
 
 
          { delphi uses register calling for assembler methods }
          { delphi uses register calling for assembler methods }
-         if (m_delphi in aktmodeswitches) and
+         if (m_delphi in current_settings.modeswitches) and
             (po_assembler in current_procinfo.procdef.procoptions) and
             (po_assembler in current_procinfo.procdef.procoptions) and
             not(po_hascallingconvention in current_procinfo.procdef.procoptions) then
             not(po_hascallingconvention in current_procinfo.procdef.procoptions) then
            current_procinfo.procdef.proccalloption:=pocall_register;
            current_procinfo.procdef.proccalloption:=pocall_register;

+ 27 - 27
compiler/psub.pas

@@ -167,7 +167,7 @@ implementation
 
 
          { do we have an assembler block without the po_assembler?
          { do we have an assembler block without the po_assembler?
            we should allow this for Delphi compatibility (PFV) }
            we should allow this for Delphi compatibility (PFV) }
-         if (token=_ASM) and (m_delphi in aktmodeswitches) then
+         if (token=_ASM) and (m_delphi in current_settings.modeswitches) then
           include(current_procinfo.procdef.procoptions,po_assembler);
           include(current_procinfo.procdef.procoptions,po_assembler);
 
 
          { Handle assembler block different }
          { Handle assembler block different }
@@ -554,7 +554,7 @@ implementation
           depending on the implicit finally we need to add
           depending on the implicit finally we need to add
           an try...finally...end wrapper }
           an try...finally...end wrapper }
         newblock:=internalstatements(newstatement);
         newblock:=internalstatements(newstatement);
-        if (cs_implicit_exceptions in aktmoduleswitches) and
+        if (cs_implicit_exceptions in current_settings.moduleswitches) and
            (pi_needs_implicit_finally in flags) and
            (pi_needs_implicit_finally in flags) and
            { but it's useless in init/final code of units }
            { but it's useless in init/final code of units }
            not(procdef.proctypeoption in [potype_unitfinalize,potype_unitinit]) then
            not(procdef.proctypeoption in [potype_unitfinalize,potype_unitinit]) then
@@ -614,9 +614,9 @@ implementation
             (tabstractnormalvarsym(p).localloc.loc in [LOC_REGISTER,LOC_CREGISTER,LOC_MMREGISTER,
             (tabstractnormalvarsym(p).localloc.loc in [LOC_REGISTER,LOC_CREGISTER,LOC_MMREGISTER,
               LOC_CMMREGISTER,LOC_FPUREGISTER,LOC_CFPUREGISTER]) then
               LOC_CMMREGISTER,LOC_FPUREGISTER,LOC_CFPUREGISTER]) then
            begin
            begin
-             if not(cs_no_regalloc in aktglobalswitches) then
+             if not(cs_no_regalloc in current_settings.globalswitches) then
                cg.translate_register(tabstractnormalvarsym(p).localloc.register);
                cg.translate_register(tabstractnormalvarsym(p).localloc.register);
-             if cs_asm_source in aktglobalswitches then
+             if cs_asm_source in current_settings.globalswitches then
                TAsmList(list).concat(Tai_comment.Create(strpnew('Var '+tabstractnormalvarsym(p).realname+' located in register '+
                TAsmList(list).concat(Tai_comment.Create(strpnew('Var '+tabstractnormalvarsym(p).realname+' located in register '+
                  std_regname(tabstractnormalvarsym(p).localloc.register))))
                  std_regname(tabstractnormalvarsym(p).localloc.register))))
            end;
            end;
@@ -667,7 +667,7 @@ implementation
     procedure tcgprocinfo.generate_code;
     procedure tcgprocinfo.generate_code;
       var
       var
         oldprocinfo : tprocinfo;
         oldprocinfo : tprocinfo;
-        oldaktmaxfpuregisters : longint;
+        oldmaxfpuregisters : longint;
         oldfilepos : tfileposinfo;
         oldfilepos : tfileposinfo;
         templist : TAsmList;
         templist : TAsmList;
         headertai : tai;
         headertai : tai;
@@ -692,7 +692,7 @@ implementation
 
 
         oldprocinfo:=current_procinfo;
         oldprocinfo:=current_procinfo;
         oldfilepos:=aktfilepos;
         oldfilepos:=aktfilepos;
-        oldaktmaxfpuregisters:=aktmaxfpuregisters;
+        oldmaxfpuregisters:=current_settings.maxfpuregisters;
 
 
         current_procinfo:=self;
         current_procinfo:=self;
         aktfilepos:=entrypos;
         aktfilepos:=entrypos;
@@ -703,7 +703,7 @@ implementation
         add_to_symtablestack;
         add_to_symtablestack;
 
 
         { when size optimization only count occurrence }
         { when size optimization only count occurrence }
-        if cs_opt_size in aktoptimizerswitches then
+        if cs_opt_size in current_settings.optimizerswitches then
           cg.t_times:=1
           cg.t_times:=1
         else
         else
           { reference for repetition is 100 }
           { reference for repetition is 100 }
@@ -731,7 +731,7 @@ implementation
         { do this before adding the entry code else the tail recursion recognition won't work,
         { do this before adding the entry code else the tail recursion recognition won't work,
           if this causes troubles, it must be if'ed
           if this causes troubles, it must be if'ed
         }
         }
-        if (cs_opt_tailrecursion in aktoptimizerswitches) and
+        if (cs_opt_tailrecursion in current_settings.optimizerswitches) and
           (pi_is_recursive in flags) then
           (pi_is_recursive in flags) then
           do_opttail(code,procdef);
           do_opttail(code,procdef);
 
 
@@ -756,7 +756,7 @@ implementation
                 * open arrays
                 * open arrays
               - no inline assembler
               - no inline assembler
             }
             }
-            if (cs_opt_stackframe in aktoptimizerswitches) and
+            if (cs_opt_stackframe in current_settings.optimizerswitches) and
                not(po_assembler in procdef.procoptions) and
                not(po_assembler in procdef.procoptions) and
                ((flags*[pi_has_assembler_block,pi_uses_exceptions,pi_is_assembler,
                ((flags*[pi_has_assembler_block,pi_uses_exceptions,pi_is_assembler,
                        pi_needs_implicit_finally,pi_has_implicit_finally,pi_has_stackparameter])=[]) then
                        pi_needs_implicit_finally,pi_has_implicit_finally,pi_has_stackparameter])=[]) then
@@ -827,7 +827,7 @@ implementation
             { first generate entry and initialize code with the correct
             { first generate entry and initialize code with the correct
               position and switches }
               position and switches }
             aktfilepos:=entrypos;
             aktfilepos:=entrypos;
-            aktlocalswitches:=entryswitches;
+            current_settings.localswitches:=entryswitches;
 
 
             cg.set_regalloc_extend_backwards(true);
             cg.set_regalloc_extend_backwards(true);
 
 
@@ -839,7 +839,7 @@ implementation
             { now generate finalize and exit code with the correct position
             { now generate finalize and exit code with the correct position
               and switches }
               and switches }
             aktfilepos:=exitpos;
             aktfilepos:=exitpos;
-            aktlocalswitches:=exitswitches;
+            current_settings.localswitches:=exitswitches;
 
 
             cg.set_regalloc_extend_backwards(false);
             cg.set_regalloc_extend_backwards(false);
 
 
@@ -950,16 +950,16 @@ implementation
 
 
             { check if the implicit finally has been generated. The flag
             { check if the implicit finally has been generated. The flag
               should already be set in pass1 }
               should already be set in pass1 }
-            if (cs_implicit_exceptions in aktmoduleswitches) and
+            if (cs_implicit_exceptions in current_settings.moduleswitches) and
                not(procdef.proctypeoption in [potype_unitfinalize,potype_unitinit]) and
                not(procdef.proctypeoption in [potype_unitfinalize,potype_unitinit]) and
                (pi_needs_implicit_finally in flags) and
                (pi_needs_implicit_finally in flags) and
                not(pi_has_implicit_finally in flags) then
                not(pi_has_implicit_finally in flags) then
              internalerror(200405231);
              internalerror(200405231);
 
 
 {$ifndef NoOpt}
 {$ifndef NoOpt}
-            if not(cs_no_regalloc in aktglobalswitches) then
+            if not(cs_no_regalloc in current_settings.globalswitches) then
               begin
               begin
-                if (cs_opt_level1 in aktoptimizerswitches) and
+                if (cs_opt_level1 in current_settings.optimizerswitches) and
                    { do not optimize pure assembler procedures }
                    { do not optimize pure assembler procedures }
                    not(pi_is_assembler in flags)  then
                    not(pi_is_assembler in flags)  then
                   optimize(aktproccode);
                   optimize(aktproccode);
@@ -987,8 +987,8 @@ implementation
             fixup_jmps(aktproccode);
             fixup_jmps(aktproccode);
 {$endif POWERPC64}
 {$endif POWERPC64}
             { insert line debuginfo }
             { insert line debuginfo }
-            if (cs_debuginfo in aktmoduleswitches) or
-               (cs_use_lineinfo in aktglobalswitches) then
+            if (cs_debuginfo in current_settings.moduleswitches) or
+               (cs_use_lineinfo in current_settings.globalswitches) then
               debuginfo.insertlineinfo(aktproccode);
               debuginfo.insertlineinfo(aktproccode);
 
 
             { add the procedure to the al_procedures }
             { add the procedure to the al_procedures }
@@ -1014,7 +1014,7 @@ implementation
 
 
         { restore }
         { restore }
         templist.free;
         templist.free;
-        aktmaxfpuregisters:=oldaktmaxfpuregisters;
+        current_settings.maxfpuregisters:=oldmaxfpuregisters;
         aktfilepos:=oldfilepos;
         aktfilepos:=oldfilepos;
         current_procinfo:=oldprocinfo;
         current_procinfo:=oldprocinfo;
       end;
       end;
@@ -1154,7 +1154,7 @@ implementation
 
 
          { save entry info }
          { save entry info }
          entrypos:=aktfilepos;
          entrypos:=aktfilepos;
-         entryswitches:=aktlocalswitches;
+         entryswitches:=current_settings.localswitches;
 
 
          if (df_generic in procdef.defoptions) then
          if (df_generic in procdef.defoptions) then
            begin
            begin
@@ -1182,7 +1182,7 @@ implementation
            end;
            end;
 
 
          { save exit info }
          { save exit info }
-         exitswitches:=aktlocalswitches;
+         exitswitches:=current_settings.localswitches;
          exitpos:=last_endtoken_filepos;
          exitpos:=last_endtoken_filepos;
 
 
          { the procedure is now defined }
          { the procedure is now defined }
@@ -1313,7 +1313,7 @@ implementation
            (target_info.system in [system_i386_os2,system_i386_emx]) then
            (target_info.system in [system_i386_os2,system_i386_emx]) then
           begin
           begin
             pd.aliasnames.insert(pd.procsym.realname);
             pd.aliasnames.insert(pd.procsym.realname);
-            if cs_link_deffile in aktglobalswitches then
+            if cs_link_deffile in current_settings.globalswitches then
               deffile.AddExport(pd.mangledname);
               deffile.AddExport(pd.mangledname);
           end;
           end;
 
 
@@ -1443,7 +1443,7 @@ implementation
                 taking addresses of static procedures goes wrong
                 taking addresses of static procedures goes wrong
                 if they aren't global when pic is used (FK)
                 if they aren't global when pic is used (FK)
               }
               }
-              (cs_create_pic in aktmoduleswitches) then
+              (cs_create_pic in current_settings.moduleswitches) then
               include(pd.procoptions,po_global);
               include(pd.procoptions,po_global);
             pd.forwarddef:=false;
             pd.forwarddef:=false;
           end;
           end;
@@ -1534,7 +1534,7 @@ implementation
          if not(po_external in pd.procoptions) then
          if not(po_external in pd.procoptions) then
            begin
            begin
              if (po_global in pd.procoptions) or
              if (po_global in pd.procoptions) or
-                (cs_profile in aktmoduleswitches) then
+                (cs_profile in current_settings.moduleswitches) then
                current_asmdata.DefineAsmSymbol(pd.mangledname,AB_GLOBAL,AT_FUNCTION)
                current_asmdata.DefineAsmSymbol(pd.mangledname,AB_GLOBAL,AT_FUNCTION)
              else
              else
                current_asmdata.DefineAsmSymbol(pd.mangledname,AB_LOCAL,AT_FUNCTION);
                current_asmdata.DefineAsmSymbol(pd.mangledname,AB_LOCAL,AT_FUNCTION);
@@ -1604,14 +1604,14 @@ implementation
                       begin
                       begin
                         { m_class is needed, because the resourcestring
                         { m_class is needed, because the resourcestring
                           loading is in the ObjPas unit }
                           loading is in the ObjPas unit }
-                        if (m_class in aktmodeswitches) then
+                        if (m_class in current_settings.modeswitches) then
                           resourcestring_dec
                           resourcestring_dec
                         else
                         else
                           break;
                           break;
                       end;
                       end;
                     _PROPERTY:
                     _PROPERTY:
                       begin
                       begin
-                        if (m_fpc in aktmodeswitches) then
+                        if (m_fpc in current_settings.modeswitches) then
                           property_dec
                           property_dec
                         else
                         else
                           break;
                           break;
@@ -1625,7 +1625,7 @@ implementation
 
 
          { check for incomplete class definitions, this is only required
          { check for incomplete class definitions, this is only required
            for fpc modes }
            for fpc modes }
-         if (m_fpc in aktmodeswitches) then
+         if (m_fpc in current_settings.modeswitches) then
            current_procinfo.procdef.localst.foreach_static(@check_forward_class,nil);
            current_procinfo.procdef.localst.foreach_static(@check_forward_class,nil);
       end;
       end;
 
 
@@ -1653,7 +1653,7 @@ implementation
                      resourcestring_dec;
                      resourcestring_dec;
                    _PROPERTY:
                    _PROPERTY:
                      begin
                      begin
-                       if (m_fpc in aktmodeswitches) then
+                       if (m_fpc in current_settings.modeswitches) then
                          property_dec
                          property_dec
                        else
                        else
                          break;
                          break;
@@ -1666,7 +1666,7 @@ implementation
          until false;
          until false;
          { check for incomplete class definitions, this is only required
          { check for incomplete class definitions, this is only required
            for fpc modes }
            for fpc modes }
-         if (m_fpc in aktmodeswitches) then
+         if (m_fpc in current_settings.modeswitches) then
           symtablestack.top.foreach_static(@check_forward_class,nil);
           symtablestack.top.foreach_static(@check_forward_class,nil);
       end;
       end;
 
 

+ 2 - 2
compiler/psystem.pas

@@ -212,7 +212,7 @@ implementation
         { Normal types }
         { Normal types }
         (* we use the same types as without emulator, the only
         (* we use the same types as without emulator, the only
           difference is that direct calls to the emulator are generated
           difference is that direct calls to the emulator are generated
-        if (cs_fp_emulation in aktmoduleswitches) then
+        if (cs_fp_emulation in current_settings.moduleswitches) then
           begin
           begin
             addtype('Single',s32floattype);
             addtype('Single',s32floattype);
             { extended size is the best real type for the target }
             { extended size is the best real type for the target }
@@ -301,7 +301,7 @@ implementation
         addtype('$s80real',s80floattype);
         addtype('$s80real',s80floattype);
         addtype('$s64currency',s64currencytype);
         addtype('$s64currency',s64currencytype);
         { Add a type for virtual method tables }
         { Add a type for virtual method tables }
-        hrecst:=trecordsymtable.create(aktpackrecords);
+        hrecst:=trecordsymtable.create(current_settings.packrecords);
         vmttype:=trecorddef.create(hrecst);
         vmttype:=trecorddef.create(hrecst);
         pvmttype:=tpointerdef.create(vmttype);
         pvmttype:=tpointerdef.create(vmttype);
         hrecst.insertfield(tfieldvarsym.create('$parent',vs_value,pvmttype,[]));
         hrecst.insertfield(tfieldvarsym.create('$parent',vs_value,pvmttype,[]));

+ 8 - 8
compiler/ptconst.pas

@@ -91,7 +91,7 @@ implementation
               if ((tordconstnode(p).value>def.high) or
               if ((tordconstnode(p).value>def.high) or
                   (tordconstnode(p).value<def.low)) then
                   (tordconstnode(p).value<def.low)) then
                 begin
                 begin
-                   if (cs_check_range in aktlocalswitches) then
+                   if (cs_check_range in current_settings.localswitches) then
                      Message(parser_e_range_check_error)
                      Message(parser_e_range_check_error)
                    else
                    else
                      Message(parser_w_range_check_error);
                      Message(parser_w_range_check_error);
@@ -226,7 +226,7 @@ implementation
                    datalist.concat(Tai_real_32bit.Create(ts32real(value)));
                    datalist.concat(Tai_real_32bit.Create(ts32real(value)));
                  s64real :
                  s64real :
 {$ifdef ARM}
 {$ifdef ARM}
-                   if aktfputype in [fpu_fpa,fpu_fpa10,fpu_fpa11] then
+                   if current_settings.fputype in [fpu_fpa,fpu_fpa10,fpu_fpa11] then
                      datalist.concat(Tai_real_64bit.Create_hiloswapped(ts64real(value)))
                      datalist.concat(Tai_real_64bit.Create_hiloswapped(ts64real(value)))
                    else
                    else
 {$endif ARM}
 {$endif ARM}
@@ -318,7 +318,7 @@ implementation
                       begin
                       begin
                         len:=tstringconstnode(p).len;
                         len:=tstringconstnode(p).len;
                         { For tp7 the maximum lentgh can be 255 }
                         { For tp7 the maximum lentgh can be 255 }
-                        if (m_tp7 in aktmodeswitches) and
+                        if (m_tp7 in current_settings.modeswitches) and
                            (len>255) then
                            (len>255) then
                          len:=255;
                          len:=255;
                         getmem(ca,len+2);
                         getmem(ca,len+2);
@@ -672,7 +672,7 @@ implementation
                     begin
                     begin
                       len:=tstringconstnode(p).len;
                       len:=tstringconstnode(p).len;
                       { For tp7 the maximum lentgh can be 255 }
                       { For tp7 the maximum lentgh can be 255 }
-                      if (m_tp7 in aktmodeswitches) and
+                      if (m_tp7 in current_settings.modeswitches) and
                          (len>255) then
                          (len>255) then
                        len:=255;
                        len:=255;
                       ca:=tstringconstnode(p).value_str;
                       ca:=tstringconstnode(p).value_str;
@@ -852,7 +852,7 @@ implementation
                                 error := true;
                                 error := true;
                               end
                               end
                             { Delphi allows you to skip fields }
                             { Delphi allows you to skip fields }
-                            else if (m_delphi in aktmodeswitches) then
+                            else if (m_delphi in current_settings.modeswitches) then
                               begin
                               begin
                                 Message1(parser_w_skipped_fields_before,sorg);
                                 Message1(parser_w_skipped_fields_before,sorg);
                                 srsym := recsym;
                                 srsym := recsym;
@@ -925,7 +925,7 @@ implementation
                 end
                 end
               { for objects we allow it only if it doesn't contain a vmt }
               { for objects we allow it only if it doesn't contain a vmt }
               else if (oo_has_vmt in tobjectdef(def).objectoptions) and
               else if (oo_has_vmt in tobjectdef(def).objectoptions) and
-                      (m_fpc in aktmodeswitches) then
+                      (m_fpc in current_settings.modeswitches) then
                  Message(parser_e_type_const_not_possible)
                  Message(parser_e_type_const_not_possible)
               { packed object }
               { packed object }
               else if is_packed_record_or_object(def) then
               else if is_packed_record_or_object(def) then
@@ -968,7 +968,7 @@ implementation
 
 
                                { check in VMT needs to be added for TP mode }
                                { check in VMT needs to be added for TP mode }
                                with Tobjectdef(def) do
                                with Tobjectdef(def) do
-                                 if not(m_fpc in aktmodeswitches) and
+                                 if not(m_fpc in current_settings.modeswitches) and
                                     (oo_has_vmt in objectoptions) and
                                     (oo_has_vmt in objectoptions) and
                                     (vmt_offset<fieldoffset) then
                                     (vmt_offset<fieldoffset) then
                                    begin
                                    begin
@@ -994,7 +994,7 @@ implementation
                                  break;
                                  break;
                           end;
                           end;
                      end;
                      end;
-                   if not(m_fpc in aktmodeswitches) and
+                   if not(m_fpc in current_settings.modeswitches) and
                       (oo_has_vmt in tobjectdef(def).objectoptions) and
                       (oo_has_vmt in tobjectdef(def).objectoptions) and
                       (tobjectdef(def).vmt_offset>=aktpos) then
                       (tobjectdef(def).vmt_offset>=aktpos) then
                      begin
                      begin

Bu fark içinde çok fazla dosya değişikliği olduğu için bazı dosyalar gösterilmiyor