Răsfoiți Sursa

* reuse old import entries

peter 26 ani în urmă
părinte
comite
b672781514
2 a modificat fișierele cu 23 adăugiri și 5 ștergeri
  1. 6 2
      compiler/pmodules.pas
  2. 17 3
      compiler/win_targ.pas

+ 6 - 2
compiler/pmodules.pas

@@ -364,6 +364,7 @@ unit pmodules;
         st : punitsymtable;
         second_time : boolean;
         old_current_ppu : pppufile;
+        tempmodule,
         old_current_module,hp,hp2 : pmodule;
         name : string;{ necessary because current_module^.mainsource^ is reset in compile !! }
         scanner : pscannerfile;
@@ -513,7 +514,7 @@ unit pmodules;
                while assigned(hp2) do
                 begin
                   if hp2^.do_reload then
-                   loadunit(hp2^.modulename^,false);
+                   tempmodule:=loadunit(hp2^.modulename^,false);
                   hp2:=pmodule(hp2^.next);
                 end;
              end
@@ -1339,7 +1340,10 @@ unit pmodules;
 end.
 {
   $Log$
-  Revision 1.124.2.2  1999-07-06 00:47:52  peter
+  Revision 1.124.2.3  1999-07-22 16:09:29  peter
+    * reuse old import entries
+
+  Revision 1.124.2.2  1999/07/06 00:47:52  peter
     * killed recompile bug
 
   Revision 1.124.2.1  1999/06/15 13:54:26  peter

+ 17 - 3
compiler/win_targ.pas

@@ -166,8 +166,19 @@ unit win_targ;
               hp1:=new(pimportlist,init(hs));
               current_module^.imports^.concat(hp1);
            end;
-         hp2:=new(pimported_item,init(func,name,index));
-         hp1^.imported_items^.concat(hp2);
+         { search for reuse of old import item }
+         hp2:=pimported_item(hp1^.imported_items^.first);
+         while assigned(hp2) do
+          begin
+            if hp2^.func^=func then
+             break;
+            hp2:=pimported_item(hp2^.next);
+          end;
+         if not assigned(hp2) then
+          begin
+            hp2:=new(pimported_item,init(func,name,index));
+            hp1^.imported_items^.concat(hp2);
+          end;
       end;
 
 
@@ -714,7 +725,10 @@ unit win_targ;
 end.
 {
   $Log$
-  Revision 1.27  1999-05-27 19:45:30  peter
+  Revision 1.27.2.1  1999-07-22 16:09:30  peter
+    * reuse old import entries
+
+  Revision 1.27  1999/05/27 19:45:30  peter
     * removed oldasm
     * plabel -> pasmlabel
     * -a switches to source writing automaticly