瀏覽代碼

Introduce new Delphi compatible switch $IMPORTEDDATA/$G which allows to control locally whether variable locations are loaded indirectly or directly.

globtype.pas:
  + tlocalswitch: add new value cs_imported_data
switches.pas:
  * set G of the Turbo Pascal switch table to cs_imported_data
scandir.pas:
  + new directive dir_importeddata which is equivalent to switch G
  * InitScannerDirectives: register dir_importeddata
globals.pas:
  * default_settings: enable cs_imported_data by default (Delphi compatible)

git-svn-id: branches/svenbarth/packages@28641 -
svenbarth 11 年之前
父節點
當前提交
fe1087d07a
共有 4 個文件被更改,包括 9 次插入3 次删除
  1. 1 1
      compiler/globals.pas
  2. 1 1
      compiler/globtype.pas
  3. 6 0
      compiler/scandir.pas
  4. 1 1
      compiler/switches.pas

+ 1 - 1
compiler/globals.pas

@@ -394,7 +394,7 @@ interface
         globalswitches : [cs_check_unit_name,cs_link_static];
         targetswitches : [];
         moduleswitches : [cs_extsyntax,cs_implicit_exceptions];
-        localswitches : [cs_check_io,cs_typed_const_writable,cs_pointermath{$ifdef i8086},cs_force_far_calls{$endif}];
+        localswitches : [cs_check_io,cs_typed_const_writable,cs_pointermath,cs_imported_data{$ifdef i8086},cs_force_far_calls{$endif}];
         modeswitches : fpcmodeswitches;
         optimizerswitches : [];
         genwpoptimizerswitches : [];

+ 1 - 1
compiler/globtype.pas

@@ -133,7 +133,7 @@ interface
          cs_generate_stackframes,cs_do_assertion,cs_generate_rtti,
          cs_full_boolean_eval,cs_typed_const_writable,cs_allow_enum_calc,
          cs_do_inline,cs_fpu_fwait,cs_ieee_errors,
-         cs_check_low_addr_load,
+         cs_check_low_addr_load,cs_imported_data,
          { mmx }
          cs_mmx,cs_mmx_saturation,
          { parser }

+ 6 - 0
compiler/scandir.pas

@@ -461,6 +461,11 @@ unit scandir;
         do_moduleswitch(cs_implicit_exceptions);
       end;
 
+    procedure dir_importeddata;
+      begin
+        do_delphiswitch('G');
+      end;
+
     procedure dir_includepath;
       begin
         if not current_module.in_global then
@@ -1734,6 +1739,7 @@ unit scandir;
         AddDirective('IOCHECKS',directive_all, @dir_iochecks);
         AddDirective('IMAGEBASE',directive_all, @dir_imagebase);
         AddDirective('IMPLICITEXCEPTIONS',directive_all, @dir_implicitexceptions);
+        AddDirective('IMPORTEDDATA',directive_all, @dir_importeddata);
         AddDirective('INCLUDEPATH',directive_all, @dir_includepath);
         AddDirective('INFO',directive_all, @dir_info);
         AddDirective('INLINE',directive_all, @dir_inline);

+ 1 - 1
compiler/switches.pas

@@ -69,7 +69,7 @@ const
 {$else i8086}
    {F} (typesw:ignoredsw; setsw:ord(cs_localnone)),
 {$endif i8086}
-   {G} (typesw:ignoredsw; setsw:ord(cs_localnone)),
+   {G} (typesw:localsw; setsw:ord(cs_imported_data)),
    {H} (typesw:localsw; setsw:ord(cs_refcountedstrings)),
    {I} (typesw:localsw; setsw:ord(cs_check_io)),
    {J} (typesw:localsw; setsw:ord(cs_typed_const_writable)),