Quellcode durchsuchen

* insert unitsym with the name as specified in the uses list

peter vor 22 Jahren
Ursprung
Commit
a77c4e01dd
1 geänderte Dateien mit 13 neuen und 8 gelöschten Zeilen
  1. 13 8
      compiler/pmodules.pas

+ 13 - 8
compiler/pmodules.pas

@@ -547,6 +547,8 @@ implementation
           begin
           begin
             if pu.in_uses then
             if pu.in_uses then
              begin
              begin
+               { store the original name to create the unitsym }
+               sorg:=pu.u.realmodulename^;
                tppumodule(pu.u).loadppu;
                tppumodule(pu.u).loadppu;
                { is our module compiled? then we can stop }
                { is our module compiled? then we can stop }
                if current_module.state=ms_compiled then
                if current_module.state=ms_compiled then
@@ -555,6 +557,13 @@ implementation
                pu.u.adddependency(current_module);
                pu.u.adddependency(current_module);
                pu.checksum:=pu.u.crc;
                pu.checksum:=pu.u.crc;
                pu.interface_checksum:=pu.u.interface_crc;
                pu.interface_checksum:=pu.u.interface_crc;
+               { Create unitsym, we need to use the name as specified, we
+                 can not use the modulename because that can be different
+                 when -Un is used }
+               unitsym:=tunitsym.create(sorg,pu.u.globalsymtable);
+               if (pu.u.flags and (uf_init or uf_finalize))<>0 then
+                 inc(unitsym.refs);
+               refsymtable.insert(unitsym);
              end;
              end;
             pu:=tused_unit(pu.next);
             pu:=tused_unit(pu.next);
           end;
           end;
@@ -577,13 +586,6 @@ implementation
 {$EndIf GDB}
 {$EndIf GDB}
               if pu.in_uses then
               if pu.in_uses then
                 begin
                 begin
-                   { Create unitsym }
-                   unitsym:=tunitsym.create(pu.u.realmodulename^,pu.u.globalsymtable);
-                   { never claim about unused unit if
-                     there is init or finalize code  PM }
-                   if (hp2.flags and (uf_init or uf_finalize))<>0 then
-                     inc(unitsym.refs);
-                   refsymtable.insert(unitsym);
                    { Reinsert in symtablestack }
                    { Reinsert in symtablestack }
                    hp3:=symtablestack;
                    hp3:=symtablestack;
                    while assigned(hp3) do
                    while assigned(hp3) do
@@ -1435,7 +1437,10 @@ implementation
 end.
 end.
 {
 {
   $Log$
   $Log$
-  Revision 1.89  2002-12-29 14:57:50  peter
+  Revision 1.90  2002-12-29 18:17:23  peter
+    * insert unitsym with the name as specified in the uses list
+
+  Revision 1.89  2002/12/29 14:57:50  peter
     * unit loading changed to first register units and load them
     * unit loading changed to first register units and load them
       afterwards. This is needed to support uses xxx in yyy correctly
       afterwards. This is needed to support uses xxx in yyy correctly
     * unit dependency check fixed
     * unit dependency check fixed