2
0
Эх сурвалжийг харах

* reload flagged units when interface is loaded

peter 22 жил өмнө
parent
commit
90782badfe
2 өөрчлөгдсөн 34 нэмэгдсэн , 21 устгасан
  1. 24 15
      compiler/fppu.pas
  2. 10 6
      compiler/pmodules.pas

+ 24 - 15
compiler/fppu.pas

@@ -75,6 +75,7 @@ interface
           procedure readasmsymbols;
        end;
 
+    procedure reload_flagged_units;
     function registerunit(callermodule:tmodule;const s : stringid;const fn:string) : tppumodule;
 
 
@@ -87,6 +88,24 @@ uses
   aasmbase,
   parser;
 
+{****************************************************************************
+                                 Helpers
+ ****************************************************************************}
+
+    procedure reload_flagged_units;
+      var
+        hp : tmodule;
+      begin
+        { now reload all dependent units }
+        hp:=tmodule(loaded_units.first);
+        while assigned(hp) do
+         begin
+           if hp.do_reload then
+             tppumodule(hp).loadppu;
+           hp:=tmodule(hp.next);
+         end;
+      end;
+
 
 {****************************************************************************
                                 TPPUMODULE
@@ -1149,7 +1168,6 @@ uses
       var
         do_load,
         second_time : boolean;
-        hp,
         old_current_module : tmodule;
       begin
         old_current_module:=current_module;
@@ -1157,9 +1175,6 @@ uses
                  ImplIntf[old_current_module.in_interface],
                  modulename^);
 
-if modulename^='NCGUTIL' then
- do_load:=do_load;
-
         { check if the globalsymtable is already available, but
           we must reload when the do_reload flag is set }
         if (not do_reload) and
@@ -1306,16 +1321,7 @@ if modulename^='NCGUTIL' then
            { for a second_time recompile reload all dependent units,
              for a first time compile register the unit _once_ }
            if second_time then
-            begin
-              { now reload all dependent units }
-              hp:=tmodule(loaded_units.first);
-              while assigned(hp) do
-               begin
-                 if hp.do_reload then
-                   tppumodule(hp).loadppu;
-                 hp:=tmodule(hp.next);
-               end;
-            end
+            reload_flagged_units
            else
             usedunits.concat(tused_unit.create(self,true,false));
 
@@ -1412,7 +1418,10 @@ if modulename^='NCGUTIL' then
 end.
 {
   $Log$
-  Revision 1.37  2003-06-08 11:40:14  peter
+  Revision 1.38  2003-08-23 22:29:24  peter
+    * reload flagged units when interface is loaded
+
+  Revision 1.37  2003/06/08 11:40:14  peter
     * moved message to msg file
 
   Revision 1.36  2003/06/07 20:26:32  peter

+ 10 - 6
compiler/pmodules.pas

@@ -943,16 +943,17 @@ implementation
             status.skip_error:=true;
             exit;
           end;
-         {else  in inteface its somatimes necessary even if unused
-          st^.allunitsused; }
 
 {$ifdef New_GDB}
          write_gdb_info;
 {$endIf Def New_GDB}
 
-         if not(cs_compilesystem in aktmoduleswitches) then
-           if (Errorcount=0) then
-             tppumodule(current_module).getppucrc;
+         if not(cs_compilesystem in aktmoduleswitches) and
+            (Errorcount=0) then
+           tppumodule(current_module).getppucrc;
+
+         { we have a new interface loaded, reload all flagged units }
+         reload_flagged_units;
 
          { Parse the implementation section }
          consume(_IMPLEMENTATION);
@@ -1464,7 +1465,10 @@ implementation
 end.
 {
   $Log$
-  Revision 1.119  2003-08-21 14:47:41  peter
+  Revision 1.120  2003-08-23 22:29:24  peter
+    * reload flagged units when interface is loaded
+
+  Revision 1.119  2003/08/21 14:47:41  peter
     * remove convert_registers
 
   Revision 1.118  2003/08/20 17:48:49  peter