浏览代码

* local browser stuff corrected

pierre 26 年之前
父节点
当前提交
fd9ac6090c
共有 5 个文件被更改,包括 72 次插入62 次删除
  1. 7 36
      compiler/symdef.inc
  2. 5 1
      compiler/symdefh.inc
  3. 24 1
      compiler/symppu.inc
  4. 7 3
      compiler/symsym.inc
  5. 29 21
      compiler/symtable.pas

+ 7 - 36
compiler/symdef.inc

@@ -2304,6 +2304,7 @@
           to check same names in parast and localst }
          localst^.next:=parast;
          defref:=nil;
+         crossref:=nil;
          lastwritten:=nil;
          refcount:=0;
          if (cs_browser in aktmoduleswitches) and make_ref then
@@ -2400,45 +2401,12 @@ Const local_symtable_index : longint = $8001;
           begin
 {$ifndef NOLOCALBROWSER}
              pdo:=_class;
-             if assigned(pdo) and (owner^.symtabletype<>localsymtable) then
-               localsymtablestack:=pdo^.publicsyms;
-             if owner^.symtabletype<>localsymtable then
-               while assigned(pdo) do
-                 begin
-                    if pdo^.publicsyms<>aktrecordsymtable then
-                      begin
-                         pdo^.publicsyms^.unitid:=local_symtable_index;
-                         inc(local_symtable_index);
-                      end;
-                    pdo:=pdo^.childof;
-                 end;
-
              new(parast,loadas(parasymtable));
-             parast^.next:=localsymtablestack;
-             localsymtablestack:=parast;
-             parast^.unitid:=local_symtable_index;
-             inc(local_symtable_index);
+             parast^.next:=owner;
              parast^.load_browser;
              new(localst,loadas(localsymtable));
-             localst^.next:=localsymtablestack;
-             localsymtablestack:=localst;
-             localst^.unitid:=local_symtable_index;
-             inc(local_symtable_index);
+             localst^.next:=parast;
              localst^.load_browser;
-             { decrement for }
-             local_symtable_index:=local_symtable_index-2;
-             localsymtablestack:=localsymtablestack^.next^.next;
-             pdo:=_class;
-             if (owner^.symtabletype<>localsymtable) then
-               localsymtablestack:=nil;
-             if (owner^.symtabletype<>localsymtable) then
-               while assigned(pdo) do
-                 begin
-                    if pdo^.publicsyms<>aktrecordsymtable then
-                      dec(local_symtable_index);
-                    pdo:=pdo^.childof;
-                 end;
-
 {$endif ndef NOLOCALBROWSER}
           end;
       end;
@@ -3494,7 +3462,10 @@ Const local_symtable_index : longint = $8001;
 
 {
   $Log$
-  Revision 1.129  1999-06-02 22:44:21  pierre
+  Revision 1.129.2.1  1999-06-22 16:26:41  pierre
+   * local browser stuff corrected
+
+  Revision 1.129  1999/06/02 22:44:21  pierre
    * previous wrong log corrected
 
   Revision 1.128  1999/06/02 22:25:52  pierre

+ 5 - 1
compiler/symdefh.inc

@@ -395,6 +395,7 @@
           { browser info }
           lastref,
           defref,
+          crossref,
           lastwritten : pref;
           refcount : longint;
           _class : pobjectdef;
@@ -520,7 +521,10 @@
 
 {
   $Log$
-  Revision 1.32  1999-06-02 10:11:51  florian
+  Revision 1.32.2.1  1999-06-22 16:26:43  pierre
+   * local browser stuff corrected
+
+  Revision 1.32  1999/06/02 10:11:51  florian
     * make cycle fixed i.e. compilation with 0.99.10
     * some fixes for qword
     * start of register calling conventions

+ 24 - 1
compiler/symppu.inc

@@ -138,6 +138,24 @@
                       current_ppu^.putword(p^.owner^.unitid);
                       break;
                     end;
+                  staticsymtable :
+                    begin
+                      current_ppu^.putbyte(ord(derefaktstaticindex));
+                      current_ppu^.putword(p^.indexnr);
+                      break;
+                    end;
+                  localsymtable :
+                    begin
+                      p:=p^.owner^.defowner;
+                      current_ppu^.putbyte(ord(dereflocal));
+                      current_ppu^.putword(p^.indexnr);
+                    end;
+                  parasymtable :
+                    begin
+                      p:=p^.owner^.defowner;
+                      current_ppu^.putbyte(ord(derefpara));
+                      current_ppu^.putword(p^.indexnr);
+                    end;
                   objectsymtable,
                   recordsymtable :
                     begin
@@ -392,6 +410,8 @@
                 break;
               end;
             derefindex,
+            derefpara,
+            dereflocal,
             derefrecord :
               begin
                 new(p,init(b,current_ppu^.getword));
@@ -560,7 +580,10 @@
 
 {
   $Log$
-  Revision 1.41  1999-05-14 17:52:28  peter
+  Revision 1.41.2.1  1999-06-22 16:26:44  pierre
+   * local browser stuff corrected
+
+  Revision 1.41  1999/05/14 17:52:28  peter
     * new deref code
 
   Revision 1.40  1999/05/13 21:59:44  peter

+ 7 - 3
compiler/symsym.inc

@@ -436,12 +436,13 @@
 
 
     procedure tprocsym.load_references;
-      (* var
+      (*var
         prdef,prdef2 : pprocdef;
         b : byte; *)
       begin
          inherited load_references;
-         (* prdef:=definition;
+         (*prdef:=definition;
+           done in tsymtable.load_browser (PM)
          { take care about operators !!  }
          if (current_module^.flags and uf_has_browser) <>0 then
            while assigned(prdef) and (prdef^.owner=definition^.owner) do
@@ -2014,7 +2015,10 @@
 
 {
   $Log$
-  Revision 1.94  1999-06-03 16:25:05  pierre
+  Revision 1.94.2.1  1999-06-22 16:26:45  pierre
+   * local browser stuff corrected
+
+  Revision 1.94  1999/06/03 16:25:05  pierre
    * local Cvar stabs corrected
 
   Revision 1.93  1999/05/27 19:45:06  peter

+ 29 - 21
compiler/symtable.pas

@@ -91,7 +91,9 @@ unit symtable;
        end;
 
       { Deref entry options }
-      tdereftype = (derefnil,derefaktrecordindex,derefaktstaticindex,derefunit,derefrecord,derefindex);
+      tdereftype = (derefnil,derefaktrecordindex,derefaktstaticindex,
+                    derefunit,derefrecord,derefindex,
+                    dereflocal,derefpara);
 
       pderef = ^tderef;
       tderef = object
@@ -637,25 +639,6 @@ implementation
                         Symbol / Definition Resolving
 *****************************************************************************}
 
-const localsymtablestack : psymtable = nil;
-
-    function find_local_symtable(index : word) : psymtable;
-    var
-       p : psymtable;
-      begin
-         p:=localsymtablestack;
-         while assigned(p) do
-           begin
-              if p^.unitid=index then break
-              else
-                p:=p^.next;
-           end;
-         if (p=nil) then
-           comment(v_fatal,'Error in local browser');
-         find_local_symtable:=p;
-      end;
-
-
     procedure resolvederef(var p:pderef;var st:psymtable;var idx:word);
       var
         hp : pderef;
@@ -696,10 +679,32 @@ const localsymtablestack : psymtable = nil;
                    internalerror(556658);
                  end;
                end;
+             dereflocal :
+               begin
+                  pd:=st^.getdefnr(p^.index);
+                  case pd^.deftype of
+                    procdef :
+                      st:=pprocdef(pd)^.localst;
+                    else
+                   internalerror(556658);
+                 end;
+               end;
+             derefpara :
+               begin
+                  pd:=st^.getdefnr(p^.index);
+                  case pd^.deftype of
+                    procdef :
+                      st:=pprocdef(pd)^.parast;
+                    else
+                   internalerror(556658);
+                 end;
+               end;
              derefindex :
                begin
                  idx:=p^.index;
                end;
+             else
+               internalerror(556658);
            end;
            hp:=p;
            p:=p^.next;
@@ -2301,7 +2306,10 @@ const localsymtablestack : psymtable = nil;
 end.
 {
   $Log$
-  Revision 1.21  1999-06-08 22:23:50  pierre
+  Revision 1.21.2.1  1999-06-22 16:26:46  pierre
+   * local browser stuff corrected
+
+  Revision 1.21  1999/06/08 22:23:50  pierre
    * staticppusymtable was loaded a tsymtable instead of tunitsymtable
 
   Revision 1.20  1999/06/02 22:44:23  pierre