Browse Source

* UseBrowser a little updated (might still be buggy !!)
* bug in psub.pas in function specifier removed
* stdcall allowed in interface and in implementation
(FPC will not yet complain if it is missing in either part
because stdcall is only a dummy !!)

pierre 27 years ago
parent
commit
3b015ab652
7 changed files with 163 additions and 64 deletions
  1. 14 7
      compiler/browser.pas
  2. 9 1
      compiler/compiler.pas
  3. 9 2
      compiler/parser.pas
  4. 15 11
      compiler/pass_1.pas
  5. 12 1
      compiler/symdef.inc
  6. 17 10
      compiler/symppu.inc
  7. 87 32
      compiler/symsym.inc

+ 14 - 7
compiler/browser.pas

@@ -74,7 +74,7 @@ var
 implementation
 
   uses
-    globals,systems,verbose;
+    comphook,globals,systems,verbose;
 
 {****************************************************************************
                                TRef
@@ -115,14 +115,14 @@ implementation
         get_file_line:='';
         inputfile:=get_source_file(moduleindex,posinfo.fileindex);
         if assigned(inputfile) then
-          if Use_Rhide then
-            get_file_line:=lower(inputfile^.name^+inputfile^.ext^)
+          if status.use_gccoutput then
+            get_file_line:=lower(inputfile^.name^)
               +':'+tostr(posinfo.line)+':'+tostr(posinfo.column)+':'
           else
-            get_file_line:=inputfile^.name^+inputfile^.ext^
+            get_file_line:=inputfile^.name^
               +'('+tostr(posinfo.line)+','+tostr(posinfo.column)+')'
         else
-          if Use_Rhide then
+          if status.use_gccoutput then
             get_file_line:='file_unknown:'
               +tostr(posinfo.line)+':'+tostr(posinfo.column)+':'
           else
@@ -271,7 +271,7 @@ implementation
                    get_source_file:=f;
                    exit;
                 end;
-              f:=pinputfile(f^._next);
+              f:=pinputfile(f^.next);
            end;
       end;
 
@@ -280,7 +280,14 @@ begin
 end.
 {
   $Log$
-  Revision 1.5  1998-06-13 00:10:04  peter
+  Revision 1.6  1998-09-01 07:54:16  pierre
+    * UseBrowser a little updated (might still be buggy !!)
+    * bug in psub.pas in function specifier removed
+    * stdcall allowed in interface and in implementation
+      (FPC will not yet complain if it is missing in either part
+      because stdcall is only a dummy !!)
+
+  Revision 1.5  1998/06/13 00:10:04  peter
     * working browser and newppu
     * some small fixes against crashes which occured in bp7 (but not in
       fpc?!)

+ 9 - 1
compiler/compiler.pas

@@ -250,6 +250,7 @@ begin
 {$endif USEEXCEPT}
 {$ifdef EXTDEBUG}
   Comment(V_Info,'Memory Lost = '+tostr(EntryMemAvail-MemAvail));
+  Comment(V_Info,'Repetitive firstpass = '+tostr(firstpass_several)+'/'+tostr(total_of_firstpass));
 {$endif EXTDEBUG}
 
 { Restore Heap }
@@ -266,7 +267,14 @@ end;
 end.
 {
   $Log$
-  Revision 1.6  1998-08-29 13:51:10  peter
+  Revision 1.7  1998-09-01 07:54:17  pierre
+    * UseBrowser a little updated (might still be buggy !!)
+    * bug in psub.pas in function specifier removed
+    * stdcall allowed in interface and in implementation
+      (FPC will not yet complain if it is missing in either part
+      because stdcall is only a dummy !!)
+
+  Revision 1.6  1998/08/29 13:51:10  peter
     * moved get_exepath to globals
     + date_string const with the current date for 0.99.7+
 

+ 9 - 2
compiler/parser.pas

@@ -354,7 +354,7 @@ unit parser;
              end;
 {$ifdef UseBrowser}
           { Write Browser }
-            if cs_browser in initswitches then
+            if cs_browser in aktmoduleswitches then
              begin
                Message1(parser_i_writing_browser_log,Browse.Fname);
                Browse.CreateLog;
@@ -370,7 +370,14 @@ unit parser;
 end.
 {
   $Log$
-  Revision 1.39  1998-08-26 10:07:09  peter
+  Revision 1.40  1998-09-01 07:54:19  pierre
+    * UseBrowser a little updated (might still be buggy !!)
+    * bug in psub.pas in function specifier removed
+    * stdcall allowed in interface and in implementation
+      (FPC will not yet complain if it is missing in either part
+      because stdcall is only a dummy !!)
+
+  Revision 1.39  1998/08/26 10:07:09  peter
     * dispose trees is now default for all > 0.99.5 compiles
 
   Revision 1.38  1998/08/18 20:52:20  peter

+ 15 - 11
compiler/pass_1.pas

@@ -3047,9 +3047,6 @@ unit pass_1;
          exactmatch,inlined : boolean;
          paralength,l : longint;
          pdc : pdefcoll;
-     {$ifdef UseBrowser}
-         curtokenpos : tfileposinfo;
-     {$endif UseBrowser}
 
          { only Dummy }
          hcvt : tconverttype;
@@ -3487,8 +3484,7 @@ unit pass_1;
      {$ifdef UseBrowser}
                    if make_ref then
                      begin
-                        get_cur_file_pos(curtokenpos);
-                        procs^.data^.lastref:=new(pref,init(procs^.data^.lastref,@curtokenpos));
+                        procs^.data^.lastref:=new(pref,init(procs^.data^.lastref,@p^.fileinfo));
                      end;
      {$endif UseBrowser}
 
@@ -3770,11 +3766,7 @@ unit pass_1;
                 firstcallparan(p^.left,nil)
               else
                 firstpass(p^.left);
-              p^.registers32:=p^.left^.registers32;
-              p^.registersfpu:=p^.left^.registersfpu;
-{$ifdef SUPPORT_MMX}
-              p^.registersmmx:=p^.left^.registersmmx;
-{$endif SUPPORT_MMX}
+              left_right_max(p);
               set_location(p^.location,p^.left^.location);
            end;
            case p^.inlinenumber of
@@ -4051,6 +4043,9 @@ unit pass_1;
                          end;
                        { pass all parameters again }
                        firstcallparan(p^.left,nil);
+                       { this was missing to get the right
+                         registers32 value at first pass PM }
+                       left_right_max(p);
                     end;
                end;
             in_settextbuf_file_x :
@@ -5254,6 +5249,7 @@ unit pass_1;
 
       begin
 {$ifdef extdebug}
+         inc(total_of_firstpass);
          if (p^.firstpasscount>0) and only_one_pass then
            exit;
 {$endif extdebug}
@@ -5268,6 +5264,7 @@ unit pass_1;
               new(oldp);
               oldp^:=p^;
               not_first:=true;
+              inc(firstpass_several);
            end
          else
            not_first:=false;
@@ -5327,7 +5324,14 @@ unit pass_1;
 end.
 {
   $Log$
-  Revision 1.66  1998-08-31 08:52:05  peter
+  Revision 1.67  1998-09-01 07:54:20  pierre
+    * UseBrowser a little updated (might still be buggy !!)
+    * bug in psub.pas in function specifier removed
+    * stdcall allowed in interface and in implementation
+      (FPC will not yet complain if it is missing in either part
+      because stdcall is only a dummy !!)
+
+  Revision 1.66  1998/08/31 08:52:05  peter
     * fixed error 10 with succ() and pref()
 
   Revision 1.65  1998/08/28 12:51:40  florian

+ 12 - 1
compiler/symdef.inc

@@ -1930,6 +1930,10 @@
           begin
             Browse.AddLog('***'+mangledname);
             Browse.AddLogRefs(defref);
+            if assigned(parast) then
+              parast^.writebrowserlog;
+            if assigned(localst) then
+              localst^.writebrowserlog;
           end;
       end;
 
@@ -2579,7 +2583,14 @@
 
 {
   $Log$
-  Revision 1.27  1998-08-28 12:51:43  florian
+  Revision 1.28  1998-09-01 07:54:22  pierre
+    * UseBrowser a little updated (might still be buggy !!)
+    * bug in psub.pas in function specifier removed
+    * stdcall allowed in interface and in implementation
+      (FPC will not yet complain if it is missing in either part
+      because stdcall is only a dummy !!)
+
+  Revision 1.27  1998/08/28 12:51:43  florian
     + ansistring to pchar type cast fixed
 
   Revision 1.26  1998/08/25 12:42:44  pierre

+ 17 - 10
compiler/symppu.inc

@@ -197,7 +197,7 @@
             if target_os.endian=en_big_endian then
              flags:=flags or uf_big_endian;
 {$ifdef UseBrowser}
-            if cs_browser in aktswitches then
+            if cs_browser in aktmoduleswitches then
              flags:=flags or uf_has_browser;
 {$endif UseBrowser}
           end;
@@ -321,12 +321,11 @@
     procedure readsourcefiles;
       var
         temp,hs       : string;
-{        incfile_found : boolean; }
+        incfile_found : boolean;
         ppufiletime,
         source_time   : longint;
 {$ifdef UseBrowser}
-        hp : pextfile;
-        _d,_n,_e : string;
+        hp : pinputfile;
 {$endif UseBrowser}
       begin
         ppufiletime:=getnamedfiletime(current_module^.ppufilename^);
@@ -354,7 +353,9 @@
                 can't be done, becuase a .inc file with the same name as
                 used by a unit will cause the unit to recompile which is
                 not the intention (PFV) }
-            { if Source_Time=-1 then
+              { OK but then only the last filename
+                should not be searched in include files (PM)}
+              if (Source_Time=-1) and not current_ppu^.endofentry  then
                 begin
                   temp:=search(hs,includesearchpath,incfile_found);
                   if incfile_found then
@@ -363,8 +364,8 @@
                      Source_Time:=GetNamedFileTime(hs);
                    end;
                 end
-              else }
-              hs:=current_module^.path^+hs;
+              else
+                hs:=current_module^.path^+hs;
               if Source_Time=-1 then
                begin
                  current_module^.sources_avail:=false;
@@ -382,8 +383,7 @@
             end;
            Message1(unit_t_ppu_source,hs+temp);
 {$ifdef UseBrowser}
-           fsplit(hs,_d,_n,_e);
-           new(hp,init(_d,_n,_e));
+           new(hp,init(hs));
            { the indexing should match what is done in writeasunit }
            current_module^.sourcefiles.register_file(hp);
 {$endif UseBrowser}
@@ -441,7 +441,14 @@
 
 {
   $Log$
-  Revision 1.13  1998-08-17 10:10:11  peter
+  Revision 1.14  1998-09-01 07:54:24  pierre
+    * UseBrowser a little updated (might still be buggy !!)
+    * bug in psub.pas in function specifier removed
+    * stdcall allowed in interface and in implementation
+      (FPC will not yet complain if it is missing in either part
+      because stdcall is only a dummy !!)
+
+  Revision 1.13  1998/08/17 10:10:11  peter
     - removed OLDPPU
 
   Revision 1.12  1998/08/17 09:17:53  peter

+ 87 - 32
compiler/symsym.inc

@@ -109,17 +109,6 @@
          end;
         lastwritten:=lastref;
         current_ppu^.writeentry(ibsymref);
-      { when it's a procsym then write also the refs to the definition
-        due the overloading }
-        if typ=procsym then
-         begin
-           prdef:=pprocsym(@self)^.definition;
-           while assigned(prdef) do
-            begin
-              pprocdef(prdef)^.write_references;
-              prdef:=pprocdef(prdef)^.nextoverloaded;
-            end;
-         end;
       end;
 
 
@@ -132,17 +121,6 @@
            Browse.AddLog('***'+name+'***');
            Browse.AddLogRefs(defref);
          end;
-      { when it's a procsym then write also the refs to the definition
-        due the overloading }
-        if typ=procsym then
-         begin
-           prdef:=pprocsym(@self)^.definition;
-           while assigned(prdef) do
-            begin
-              pprocdef(prdef)^.add_to_browserlog;
-              prdef:=pprocdef(prdef)^.nextoverloaded;
-            end;
-         end;
       end;
 {$endif UseBrowser}
 
@@ -163,15 +141,6 @@
            dispose(right,done);
       end;
 
-
-    destructor tsym.single_done;
-      begin
-{$ifdef tp}
-         if not(use_big) then
-{$endif tp}
-           strdispose(_name);
-      end;
-
     procedure tsym.write;
 
       begin
@@ -424,6 +393,48 @@
          current_ppu^.writeentry(ibprocsym);
       end;
 
+{$ifdef UseBrowser}
+    procedure tprocsym.load_references;
+      var
+        prdef : pprocdef;
+      begin
+         inherited load_references;
+         prdef:=definition;
+         { take care about operators !!  }
+         while assigned(prdef) and (prdef^.owner=definition^.owner) do
+          begin
+            prdef^.load_references;
+            prdef:=prdef^.nextoverloaded;
+          end;
+      end;
+
+    procedure tprocsym.write_references;
+      var
+        prdef : pprocdef;
+      begin
+         inherited write_references;
+         prdef:=definition;
+         while assigned(prdef) and (prdef^.owner=definition^.owner) do
+          begin
+            prdef^.write_references;
+            prdef:=prdef^.nextoverloaded;
+          end;
+      end;
+
+    procedure tprocsym.add_to_browserlog;
+      var
+        prdef : pprocdef;
+      begin
+         inherited add_to_browserlog;
+         prdef:=definition;
+         while assigned(prdef) do
+           begin
+              pprocdef(prdef)^.add_to_browserlog;
+              prdef:=pprocdef(prdef)^.nextoverloaded;
+           end;
+      end;
+{$endif UseBrowser}
+
 {$ifdef GDB}
     function tprocsym.stabstring : pchar;
      Var RetType : Char;
@@ -1490,6 +1501,43 @@
          current_ppu^.writeentry(ibtypesym);
       end;
 
+
+{$ifdef UseBrowser}
+
+    procedure ttypesym.load_references;
+      var
+        prdef : pdef;
+      begin
+         inherited load_references;
+         if (definition^.deftype=recorddef) then
+            precdef(definition)^.symtable^.load_browser;
+         if (definition^.deftype=objectdef) then
+             pobjectdef(definition)^.publicsyms^.load_browser;
+      end;
+
+    procedure ttypesym.write_references;
+      var
+        prdef : pdef;
+      begin
+         inherited write_references;
+         if (definition^.deftype=recorddef) then
+            precdef(definition)^.symtable^.write_browser;
+         if (definition^.deftype=objectdef) then
+             pobjectdef(definition)^.publicsyms^.write_browser;
+      end;
+
+    procedure ttypesym.add_to_browserlog;
+      var
+        aktobjdef : pobjectdef;
+      begin
+         inherited add_to_browserlog;
+         if (definition^.deftype=recorddef) then
+            precdef(definition)^.symtable^.writebrowserlog;
+         if (definition^.deftype=objectdef) then
+             pobjectdef(definition)^.publicsyms^.writebrowserlog;
+      end;
+{$endif UseBrowser}
+
 {$ifdef GDB}
     function ttypesym.stabstring : pchar;
     var stabchar : string[2];
@@ -1558,7 +1606,14 @@
 
 {
   $Log$
-  Revision 1.36  1998-08-25 13:09:26  pierre
+  Revision 1.37  1998-09-01 07:54:25  pierre
+    * UseBrowser a little updated (might still be buggy !!)
+    * bug in psub.pas in function specifier removed
+    * stdcall allowed in interface and in implementation
+      (FPC will not yet complain if it is missing in either part
+      because stdcall is only a dummy !!)
+
+  Revision 1.36  1998/08/25 13:09:26  pierre
     * corrected mangling sheme :
       cvar add Cprefix to the mixed case name whereas
       export or public use direct name