Forráskód Böngészése

* cross unit inlining fixed

peter 22 éve
szülő
commit
f663d2488f

+ 122 - 8
compiler/nbas.pas

@@ -78,7 +78,7 @@ interface
        tstatementnodeclass = class of tstatementnode;
 
        tblocknode = class(tunarynode)
-          constructor create(l : tnode;releasetemp : boolean);virtual;
+          constructor create(l : tnode);virtual;
           function pass_1 : tnode;override;
           function det_resulttype:tnode;override;
 {$ifdef state_tracking}
@@ -87,6 +87,8 @@ interface
        end;
        tblocknodeclass = class of tblocknode;
 
+       ttempcreatenode = class;
+
        { to allow access to the location by temp references even after the temp has }
        { already been disposed and to make sure the coherency between temps and     }
        { temp references is kept after a getcopy                                    }
@@ -100,6 +102,7 @@ interface
          temptype                   : ttemptype;
          valid                      : boolean;
          nextref_set_hookoncopy_nil : boolean;
+         owner                      : ttempcreatenode;
        end;
 
        { a node which will create a (non)persistent temp of a given type with a given  }
@@ -115,6 +118,10 @@ interface
           { freeing it. In this last case, you should use only one reference    }
           { to it and *not* generate a ttempdeletenode                          }
           constructor create(const _restype: ttype; _size: longint; _temptype: ttemptype); virtual;
+          constructor ppuload(t:tnodetype;ppufile:tcompilerppufile);override;
+          procedure ppuwrite(ppufile:tcompilerppufile);override;
+          procedure buildderefimpl;override;
+          procedure derefimpl;override;
           function getcopy: tnode; override;
           function pass_1 : tnode; override;
           function det_resulttype: tnode; override;
@@ -127,7 +134,10 @@ interface
         ttemprefnode = class(tnode)
           constructor create(const temp: ttempcreatenode); virtual;
           constructor create_offset(const temp: ttempcreatenode;aoffset:longint);
+          constructor ppuload(t:tnodetype;ppufile:tcompilerppufile);override;
+          procedure ppuwrite(ppufile:tcompilerppufile);override;
           function getcopy: tnode; override;
+          procedure derefnode;override;
           function pass_1 : tnode; override;
           function det_resulttype : tnode; override;
           procedure mark_write;override;
@@ -135,16 +145,21 @@ interface
          protected
           tempinfo: ptempinfo;
           offset : longint;
+        private
+          tempidx : longint;
         end;
        ttemprefnodeclass = class of ttemprefnode;
 
         { a node which removes a temp }
         ttempdeletenode = class(tnode)
-          constructor create(const temp: ttempcreatenode);
+          constructor create(const temp: ttempcreatenode); virtual;
           { this will convert the persistant temp to a normal temp
             for returning to the other nodes }
           constructor create_normal_temp(const temp: ttempcreatenode);
+          constructor ppuload(t:tnodetype;ppufile:tcompilerppufile);override;
+          procedure ppuwrite(ppufile:tcompilerppufile);override;
           function getcopy: tnode; override;
+          procedure derefnode;override;
           function pass_1: tnode; override;
           function det_resulttype: tnode; override;
           function docompare(p: tnode): boolean; override;
@@ -152,6 +167,8 @@ interface
          protected
           tempinfo: ptempinfo;
           release_to_normal : boolean;
+        private
+          tempidx : longint;
         end;
        ttempdeletenodeclass = class of ttempdeletenode;
 
@@ -167,7 +184,7 @@ interface
 
        { Create a blocknode and statement node for multiple statements
          generated internally by the parser }
-       function  internalstatements(var laststatement:tstatementnode;releasetemp : boolean):tblocknode;
+       function  internalstatements(var laststatement:tstatementnode):tblocknode;
        procedure addstatement(var laststatement:tstatementnode;n:tnode);
 
 
@@ -176,7 +193,7 @@ implementation
     uses
       cutils,
       verbose,globals,globtype,systems,
-      symconst,symdef,symsym,symutil,defutil,defcmp,
+      symconst,symdef,defutil,defcmp,
       pass_1,
       nld,ncal,nflw,
       procinfo
@@ -187,11 +204,11 @@ implementation
                                      Helpers
 *****************************************************************************}
 
-    function internalstatements(var laststatement:tstatementnode;releasetemp : boolean):tblocknode;
+    function internalstatements(var laststatement:tstatementnode):tblocknode;
       begin
         { create dummy initial statement }
         laststatement := cstatementnode.create(cnothingnode.create,nil);
-        internalstatements := cblocknode.create(laststatement,releasetemp);
+        internalstatements := cblocknode.create(laststatement);
       end;
 
 
@@ -327,7 +344,7 @@ implementation
                              TBLOCKNODE
 *****************************************************************************}
 
-    constructor tblocknode.create(l : tnode;releasetemp : boolean);
+    constructor tblocknode.create(l : tnode);
 
       begin
          inherited create(blockn,l);
@@ -633,6 +650,7 @@ implementation
         fillchar(tempinfo^,sizeof(tempinfo^),0);
         tempinfo^.restype := _restype;
         tempinfo^.temptype := _temptype;
+        tempinfo^.owner:=self;
       end;
 
     function ttempcreatenode.getcopy: tnode;
@@ -644,6 +662,7 @@ implementation
 
         new(n.tempinfo);
         fillchar(n.tempinfo^,sizeof(n.tempinfo^),0);
+        n.tempinfo^.owner:=n;
         n.tempinfo^.restype := tempinfo^.restype;
         n.tempinfo^.temptype := tempinfo^.temptype;
 
@@ -661,6 +680,41 @@ implementation
         result := n;
       end;
 
+
+    constructor ttempcreatenode.ppuload(t:tnodetype;ppufile:tcompilerppufile);
+      begin
+        inherited ppuload(t,ppufile);
+
+        size:=ppufile.getlongint;
+        new(tempinfo);
+        fillchar(tempinfo^,sizeof(tempinfo^),0);
+        ppufile.gettype(tempinfo^.restype);
+        tempinfo^.temptype := ttemptype(ppufile.getbyte);
+        tempinfo^.owner:=self;
+      end;
+
+
+    procedure ttempcreatenode.ppuwrite(ppufile:tcompilerppufile);
+      begin
+        inherited ppuwrite(ppufile);
+        ppufile.putlongint(size);
+        ppufile.puttype(tempinfo^.restype);
+        ppufile.putbyte(byte(tempinfo^.temptype));
+      end;
+
+
+    procedure ttempcreatenode.buildderefimpl;
+      begin
+        tempinfo^.restype.buildderef;
+      end;
+
+
+    procedure ttempcreatenode.derefimpl;
+      begin
+        tempinfo^.restype.resolve;
+      end;
+
+
     function ttempcreatenode.pass_1 : tnode;
       begin
          result := nil;
@@ -701,12 +755,14 @@ implementation
         offset:=0;
       end;
 
+
     constructor ttemprefnode.create_offset(const temp: ttempcreatenode;aoffset:longint);
       begin
         self.create(temp);
         offset := aoffset;
       end;
 
+
     function ttemprefnode.getcopy: tnode;
       var
         n: ttemprefnode;
@@ -737,6 +793,34 @@ implementation
         result := n;
       end;
 
+
+    constructor ttemprefnode.ppuload(t:tnodetype;ppufile:tcompilerppufile);
+      begin
+        inherited ppuload(t,ppufile);
+        tempidx:=ppufile.getlongint;
+        offset:=ppufile.getlongint;
+      end;
+
+
+    procedure ttemprefnode.ppuwrite(ppufile:tcompilerppufile);
+      begin
+        inherited ppuwrite(ppufile);
+        ppufile.putlongint(tempinfo^.owner.ppuidx);
+        ppufile.putlongint(offset);
+      end;
+
+
+    procedure ttemprefnode.derefnode;
+      var
+        temp : ttempcreatenode;
+      begin
+        temp:=ttempcreatenode(nodeppuidxget(tempidx));
+        if temp.nodetype<>tempcreaten then
+          internalerror(200311075);
+        tempinfo:=temp.tempinfo;
+      end;
+
+
     function ttemprefnode.pass_1 : tnode;
       begin
         expectloc:=LOC_REFERENCE;
@@ -818,6 +902,33 @@ implementation
         result := n;
       end;
 
+    constructor ttempdeletenode.ppuload(t:tnodetype;ppufile:tcompilerppufile);
+      begin
+        inherited ppuload(t,ppufile);
+        tempidx:=ppufile.getlongint;
+        release_to_normal:=(ppufile.getbyte<>0);
+      end;
+
+
+    procedure ttempdeletenode.ppuwrite(ppufile:tcompilerppufile);
+      begin
+        inherited ppuwrite(ppufile);
+        ppufile.putlongint(tempinfo^.owner.ppuidx);
+        ppufile.putbyte(byte(release_to_normal));
+      end;
+
+
+    procedure ttempdeletenode.derefnode;
+      var
+        temp : ttempcreatenode;
+      begin
+        temp:=ttempcreatenode(nodeppuidxget(tempidx));
+        if temp.nodetype<>tempcreaten then
+          internalerror(200311075);
+        tempinfo:=temp.tempinfo;
+      end;
+
+
     function ttempdeletenode.pass_1 : tnode;
       begin
          expectloc:=LOC_VOID;
@@ -854,7 +965,10 @@ begin
 end.
 {
   $Log$
-  Revision 1.72  2003-11-04 15:35:13  peter
+  Revision 1.73  2003-11-10 22:02:52  peter
+    * cross unit inlining fixed
+
+  Revision 1.72  2003/11/04 15:35:13  peter
     * fix for referencecounted temps
 
   Revision 1.71  2003/10/31 15:51:47  peter

+ 25 - 3
compiler/ncal.pas

@@ -998,6 +998,9 @@ type
 
 
     procedure tcallnode.derefimpl;
+      var
+        pt : tcallparanode;
+        currpara : tparaitem;
       begin
         inherited derefimpl;
         symtableprocentry:=tprocsym(symtableprocentryderef.resolve);
@@ -1009,6 +1012,22 @@ type
           _funcretnode.derefimpl;
         if assigned(inlinecode) then
           inlinecode.derefimpl;
+        { Connect paraitems }
+        pt:=tcallparanode(left);
+        while assigned(pt) and
+              (nf_varargs_para in pt.flags) do
+          pt:=tcallparanode(pt.right);
+        currpara:=tparaitem(procdefinition.Para.last);
+        while assigned(currpara) do
+          begin
+            if not assigned(pt) then
+              internalerror(200311077);
+            pt.paraitem:=currpara;
+            pt:=tcallparanode(pt.right);
+            currpara:=tparaitem(currpara.previous);
+          end;
+        if assigned(currpara) or assigned(pt) then
+          internalerror(200311078);
       end;
 
 
@@ -1862,7 +1881,7 @@ type
                   end
                  else
                   begin
-                    hiddentree:=internalstatements(newstatement,false);
+                    hiddentree:=internalstatements(newstatement);
                     { need to use resulttype instead of procdefinition.rettype,
                       because they can be different }
                     temp:=ctempcreatenode.create(resulttype,resulttype.def.size,tt_persistent);
@@ -2160,7 +2179,7 @@ type
                 currpara:=tparaitem(currpara.next);
               end;
            end;
-           
+
           { handle predefined procedures }
           is_const:=(po_internconst in procdefinition.procoptions) and
                     ((block_type in [bt_const,bt_type]) or
@@ -2589,7 +2608,10 @@ begin
 end.
 {
   $Log$
-  Revision 1.206  2003-11-10 19:09:29  peter
+  Revision 1.207  2003-11-10 22:02:52  peter
+    * cross unit inlining fixed
+
+  Revision 1.206  2003/11/10 19:09:29  peter
     * procvar default value support
 
   Revision 1.205  2003/11/06 15:54:32  peter

+ 51 - 43
compiler/ncgcal.pas

@@ -941,7 +941,6 @@ implementation
       end;
 
 
-
     procedure tcgcallnode.inlined_pass_2;
       var
          oldaktcallnode : tcallnode;
@@ -963,23 +962,52 @@ implementation
          { we're inlining a procedure }
          inlining_procedure:=true;
 
-         { calculate registers to pass the parameters }
-         paramanager.create_inline_paraloc_info(procdefinition);
-
-         { create temp procinfo }
-         current_procinfo:=cprocinfo.create(nil);
-         current_procinfo.procdef:=tprocdef(procdefinition);
-
          { Add inling start }
          exprasmList.concat(Tai_Marker.Create(InlineStart));
 {$ifdef extdebug}
          exprasmList.concat(tai_comment.Create(strpnew('Start of inlined proc')));
 {$endif extdebug}
 
+         { calculate registers to pass the parameters }
+         paramanager.create_inline_paraloc_info(procdefinition);
+
          { Allocate parameters and locals }
-         gen_alloc_inline_parast(exprasmlist,tparasymtable(current_procinfo.procdef.parast));
-         if current_procinfo.procdef.localst.symtabletype=localsymtable then
-           gen_alloc_localst(exprasmlist,tlocalsymtable(current_procinfo.procdef.localst));
+         gen_alloc_inline_parast(exprasmlist,tparasymtable(procdefinition.parast));
+         if tprocdef(procdefinition).localst.symtabletype=localsymtable then
+           gen_alloc_localst(exprasmlist,tlocalsymtable(tprocdef(procdefinition).localst));
+
+         { if we allocate the temp. location for ansi- or widestrings }
+         { already here, we avoid later a push/pop                    }
+         if resulttype.def.needs_inittable and
+            not paramanager.ret_in_param(resulttype.def,procdefinition.proccalloption) then
+           begin
+             tg.gettemptyped(exprasmlist,resulttype.def,tt_normal,refcountedtemp);
+             cg.g_decrrefcount(exprasmlist,resulttype.def,refcountedtemp,false);
+           end;
+
+         { Push parameters, still use the old current_procinfo. This
+           is required that have the correct information available like
+           _class and nested procedure }
+         oldaktcallnode:=aktcallnode;
+         aktcallnode:=self;
+         if assigned(left) then
+           tcallparanode(left).secondcallparan;
+         aktcallnode:=oldaktcallnode;
+
+         { create temp procinfo that will be used for the inlinecode tree }
+         current_procinfo:=cprocinfo.create(nil);
+         current_procinfo.procdef:=tprocdef(procdefinition);
+
+         { when the oldprocinfo is also being inlined reuse the
+           inlining_procinfo }
+         if assigned(oldprocinfo.inlining_procinfo) then
+           current_procinfo.inlining_procinfo:=oldprocinfo.inlining_procinfo
+         else
+           current_procinfo.inlining_procinfo:=oldprocinfo;
+
+         { takes care of local data initialization }
+         inlineentrycode:=TAAsmoutput.Create;
+         inlineexitcode:=TAAsmoutput.Create;
 
 {$ifdef GDB}
          if (cs_debuginfo in aktmoduleswitches) then
@@ -991,38 +1019,18 @@ implementation
              { Here we must include the para and local symtable info }
              procdefinition.concatstabto(withdebuglist);
 
-             mangled_length:=length(oldprocinfo.procdef.mangledname);
+             mangled_length:=length(current_procinfo.inlining_procinfo.procdef.mangledname);
              getmem(pp,mangled_length+50);
              strpcopy(pp,'192,0,0,'+startlabel.name);
              if (target_info.use_function_relative_addresses) then
                begin
                  strpcopy(strend(pp),'-');
-                 strpcopy(strend(pp),oldprocinfo.procdef.mangledname);
+                 strpcopy(strend(pp),current_procinfo.inlining_procinfo.procdef.mangledname);
                end;
              withdebugList.concat(Tai_stabn.Create(strnew(pp)));
            end;
 {$endif GDB}
 
-         { if we allocate the temp. location for ansi- or widestrings }
-         { already here, we avoid later a push/pop                    }
-         if resulttype.def.needs_inittable and
-            not paramanager.ret_in_param(resulttype.def,procdefinition.proccalloption) then
-           begin
-             tg.gettemptyped(exprasmlist,resulttype.def,tt_normal,refcountedtemp);
-             cg.g_decrrefcount(exprasmlist,resulttype.def,refcountedtemp,false);
-           end;
-
-         { Push parameters }
-         oldaktcallnode:=aktcallnode;
-         aktcallnode:=self;
-         if assigned(left) then
-           tcallparanode(left).secondcallparan;
-         aktcallnode:=oldaktcallnode;
-
-         { takes care of local data initialization }
-         inlineentrycode:=TAAsmoutput.Create;
-         inlineexitcode:=TAAsmoutput.Create;
-
          gen_load_para_value(inlineentrycode);
          gen_initialize_code(inlineentrycode,true);
          if po_assembler in current_procinfo.procdef.procoptions then
@@ -1093,26 +1101,23 @@ implementation
          if current_procinfo.procdef.localst.symtabletype=localsymtable then
            gen_free_localst(exprasmlist,tlocalsymtable(current_procinfo.procdef.localst));
 
-         { release procinfo }
-         current_procinfo.free;
-         current_procinfo:=oldprocinfo;
-
 {$ifdef GDB}
          if (cs_debuginfo in aktmoduleswitches) then
            begin
              cg.a_label(exprasmlist,endlabel);
              strpcopy(pp,'224,0,0,'+endlabel.name);
-            if (target_info.use_function_relative_addresses) then
-              begin
-                strpcopy(strend(pp),'-');
-                strpcopy(strend(pp),oldprocinfo.procdef.mangledname);
-              end;
+             if (target_info.use_function_relative_addresses) then
+               begin
+                 strpcopy(strend(pp),'-');
+                 strpcopy(strend(pp),current_procinfo.inlining_procinfo.procdef.mangledname);
+               end;
              withdebugList.concat(Tai_stabn.Create(strnew(pp)));
              freemem(pp,mangled_length+50);
            end;
 {$endif GDB}
 
          { restore }
+         current_procinfo.free;
          current_procinfo:=oldprocinfo;
          inlining_procedure:=oldinlining_procedure;
       end;
@@ -1133,7 +1138,10 @@ begin
 end.
 {
   $Log$
-  Revision 1.138  2003-11-07 15:58:32  florian
+  Revision 1.139  2003-11-10 22:02:52  peter
+    * cross unit inlining fixed
+
+  Revision 1.138  2003/11/07 15:58:32  florian
     * Florian's culmutative nr. 1; contains:
       - invalid calling conventions for a certain cpu are rejected
       - arm softfloat calling conventions

+ 8 - 1
compiler/ncgutil.pas

@@ -1707,6 +1707,8 @@ implementation
 {$endif GDB}
         if (sym.owner.symtabletype=globalsymtable) or
            (cs_create_smart in aktmoduleswitches) or
+           (assigned(current_procinfo) and
+            (current_procinfo.procdef.proccalloption=pocall_inline)) or
            DLLSource then
           curconstSegment.concat(Tai_symbol.Createdataname_global(sym.mangledname,l))
         else
@@ -1741,6 +1743,8 @@ implementation
         if (sym.owner.symtabletype=globalsymtable) or
            (cs_create_smart in aktmoduleswitches) or
            DLLSource or
+           (assigned(current_procinfo) and
+            (current_procinfo.procdef.proccalloption=pocall_inline)) or
            (vo_is_exported in sym.varoptions) or
            (vo_is_C_var in sym.varoptions) then
           bssSegment.concat(Tai_datablock.Create_global(sym.mangledname,l))
@@ -1961,7 +1965,10 @@ implementation
 end.
 {
   $Log$
-  Revision 1.165  2003-11-07 15:58:32  florian
+  Revision 1.166  2003-11-10 22:02:52  peter
+    * cross unit inlining fixed
+
+  Revision 1.165  2003/11/07 15:58:32  florian
     * Florian's culmutative nr. 1; contains:
       - invalid calling conventions for a certain cpu are rejected
       - arm softfloat calling conventions

+ 6 - 3
compiler/ninl.pas

@@ -355,7 +355,7 @@ implementation
         { create a blocknode in which the successive write/read statements will be  }
         { put, since they belong together. Also create a dummy statement already to }
         { make inserting of additional statements easier                            }
-        newblock:=internalstatements(newstatement,true);
+        newblock:=internalstatements(newstatement);
 
         { if we don't have a filepara, create one containing the default }
         if not assigned(filepara) then
@@ -902,7 +902,7 @@ implementation
         { create the blocknode which will hold the generated statements + }
         { an initial dummy statement                                      }
 
-        newblock:=internalstatements(newstatement,true);
+        newblock:=internalstatements(newstatement);
 
         { do we need a temp for code? Yes, if no code specified, or if  }
         { code is not a 32bit parameter (we already checked whether the }
@@ -2358,7 +2358,10 @@ begin
 end.
 {
   $Log$
-  Revision 1.121  2003-10-21 15:15:36  peter
+  Revision 1.122  2003-11-10 22:02:52  peter
+    * cross unit inlining fixed
+
+  Revision 1.121  2003/10/21 15:15:36  peter
     * taicpu_abstract.oper[] changed to pointers
 
   Revision 1.120  2003/10/08 19:19:45  peter

+ 37 - 1
compiler/nmem.pas

@@ -41,7 +41,12 @@ interface
 
        tloadparentfpnode = class(tunarynode)
           parentpd : tprocdef;
+          parentpdderef : tderef;
           constructor create(pd:tprocdef);virtual;
+          constructor ppuload(t:tnodetype;ppufile:tcompilerppufile);override;
+          procedure ppuwrite(ppufile:tcompilerppufile);override;
+          procedure buildderefimpl;override;
+          procedure derefimpl;override;
           function pass_1 : tnode;override;
           function det_resulttype:tnode;override;
           function getcopy : tnode;override;
@@ -186,6 +191,34 @@ implementation
       end;
 
 
+    constructor tloadparentfpnode.ppuload(t:tnodetype;ppufile:tcompilerppufile);
+      begin
+        inherited ppuload(t,ppufile);
+        ppufile.getderef(parentpdderef);
+      end;
+
+
+    procedure tloadparentfpnode.ppuwrite(ppufile:tcompilerppufile);
+      begin
+        inherited ppuwrite(ppufile);
+        ppufile.putderef(parentpdderef);
+      end;
+
+
+    procedure tloadparentfpnode.buildderefimpl;
+      begin
+        inherited buildderefimpl;
+        parentpdderef.build(parentpd);
+      end;
+
+
+    procedure tloadparentfpnode.derefimpl;
+      begin
+        inherited derefimpl;
+        parentpd:=tprocdef(parentpdderef.resolve);
+      end;
+
+
     function tloadparentfpnode.getcopy : tnode;
       var
          p : tloadparentfpnode;
@@ -924,7 +957,10 @@ begin
 end.
 {
   $Log$
-  Revision 1.71  2003-11-05 14:18:03  marco
+  Revision 1.72  2003-11-10 22:02:52  peter
+    * cross unit inlining fixed
+
+  Revision 1.71  2003/11/05 14:18:03  marco
    * fix from Peter arraysize warning (nav Newsgroup msg)
 
   Revision 1.70  2003/10/31 18:44:18  peter

+ 105 - 4
compiler/node.pas

@@ -277,6 +277,7 @@ interface
           parent : tnode;
           { there are some properties about the node stored }
           flags : tnodeflags;
+          ppuidx : longint;
           { the number of registers needed to evalute the node }
           registers32,registersfpu : longint;  { must be longint !!!! }
 {$ifdef SUPPORT_MMX}
@@ -298,6 +299,7 @@ interface
           procedure ppuwrite(ppufile:tcompilerppufile);virtual;
           procedure buildderefimpl;virtual;
           procedure derefimpl;virtual;
+          procedure derefnode;virtual;
 
           { toggles the flag }
           procedure toggleflag(f : tnodeflag);
@@ -359,6 +361,7 @@ interface
           procedure ppuwrite(ppufile:tcompilerppufile);override;
           procedure buildderefimpl;override;
           procedure derefimpl;override;
+          procedure derefnode;override;
           procedure concattolist(l : tlinkedlist);override;
           function ischild(p : tnode) : boolean;override;
           function docompare(p : tnode) : boolean;override;
@@ -377,6 +380,7 @@ interface
           procedure ppuwrite(ppufile:tcompilerppufile);override;
           procedure buildderefimpl;override;
           procedure derefimpl;override;
+          procedure derefnode;override;
           procedure concattolist(l : tlinkedlist);override;
           function ischild(p : tnode) : boolean;override;
           function docompare(p : tnode) : boolean;override;
@@ -397,8 +401,11 @@ interface
       { array with all class types for tnodes }
       nodeclass : tnodeclassarray;
 
+    function nodeppuidxget(i:longint):tnode;
     function ppuloadnode(ppufile:tcompilerppufile):tnode;
     procedure ppuwritenode(ppufile:tcompilerppufile;n:tnode);
+    function ppuloadnodetree(ppufile:tcompilerppufile):tnode;
+    procedure ppuwritenodetree(ppufile:tcompilerppufile;n:tnode);
 
     const
       printnodespacing = '   ';
@@ -415,7 +422,7 @@ interface
 implementation
 
     uses
-       cutils,verbose;
+       cutils,verbose,ppu;
 
     const
       ppunodemarker = 255;
@@ -425,10 +432,51 @@ implementation
                                  Helpers
  ****************************************************************************}
 
+    var
+      nodeppudata : tdynamicarray;
+      nodeppuidx  : longint;
+
+
+    procedure nodeppuidxcreate;
+      begin
+        nodeppudata:=tdynamicarray.create(1024);
+        nodeppuidx:=0;
+      end;
+
+
+    procedure nodeppuidxfree;
+      begin
+        nodeppudata.free;
+        nodeppudata:=nil;
+      end;
+
+
+    procedure nodeppuidxadd(n:tnode);
+      begin
+        if n.ppuidx<0 then
+          internalerror(200311072);
+        nodeppudata.seek(n.ppuidx*sizeof(pointer));
+        nodeppudata.write(n,sizeof(pointer));
+      end;
+
+
+    function nodeppuidxget(i:longint):tnode;
+      var
+        l : longint;
+      begin
+        if i<0 then
+          internalerror(200311072);
+        nodeppudata.seek(i*sizeof(pointer));
+        if nodeppudata.read(result,sizeof(pointer))<>sizeof(pointer) then
+          internalerror(200311073);
+      end;
+
+
     function ppuloadnode(ppufile:tcompilerppufile):tnode;
       var
         b : byte;
         t : tnodetype;
+        hppuidx : longint;
       begin
         { marker }
         b:=ppufile.getbyte;
@@ -442,12 +490,15 @@ implementation
          begin
            if not assigned(nodeclass[t]) then
              internalerror(200208153);
+           hppuidx:=ppufile.getlongint;
            //writeln('load: ',nodetype2str[t]);
            { generate node of the correct class }
-           ppuloadnode:=nodeclass[t].ppuload(t,ppufile);
+           result:=nodeclass[t].ppuload(t,ppufile);
+           result.ppuidx:=hppuidx;
+           nodeppuidxadd(result);
          end
         else
-         ppuloadnode:=nil;
+         result:=nil;
       end;
 
 
@@ -458,7 +509,12 @@ implementation
         { type, read by ppuloadnode }
         if assigned(n) then
          begin
+           if n.ppuidx=-1 then
+             internalerror(200311071);
+           n.ppuidx:=nodeppuidx;
+           inc(nodeppuidx);
            ppufile.putbyte(byte(n.nodetype));
+           ppufile.putlongint(n.ppuidx);
            //writeln('write: ',nodetype2str[n.nodetype]);
            n.ppuwrite(ppufile);
          end
@@ -467,6 +523,25 @@ implementation
       end;
 
 
+    function ppuloadnodetree(ppufile:tcompilerppufile):tnode;
+      begin
+        if ppufile.readentry<>ibnodetree then
+          Message(unit_f_ppu_read_error);
+        nodeppuidxcreate;
+        result:=ppuloadnode(ppufile);
+        result.derefnode;
+        nodeppuidxfree;
+      end;
+
+
+    procedure ppuwritenodetree(ppufile:tcompilerppufile;n:tnode);
+      begin
+        nodeppuidx:=0;
+        ppuwritenode(ppufile,n);
+        ppufile.writeentry(ibnodetree);
+      end;
+
+
     procedure printnodeindent;
       begin
         printnodeindention:=printnodeindention+printnodespacing;
@@ -516,6 +591,7 @@ implementation
          firstpasscount:=0;
 {$endif EXTDEBUG}
          flags:=[];
+         ppuidx:=-1;
       end;
 
     constructor tnode.createforcopy;
@@ -546,6 +622,7 @@ implementation
         maxfirstpasscount:=0;
         firstpasscount:=0;
 {$endif EXTDEBUG}
+        ppuidx:=-1;
       end;
 
 
@@ -571,6 +648,11 @@ implementation
       end;
 
 
+    procedure tnode.derefnode;
+      begin
+      end;
+
+
     procedure tnode.toggleflag(f : tnodeflag);
       begin
          if f in flags then
@@ -760,6 +842,14 @@ implementation
       end;
 
 
+    procedure tunarynode.derefnode;
+      begin
+        inherited derefnode;
+        if assigned(left) then
+          left.derefnode;
+      end;
+
+
     function tunarynode.docompare(p : tnode) : boolean;
       begin
          docompare:=(inherited docompare(p) and
@@ -865,6 +955,14 @@ implementation
       end;
 
 
+    procedure tbinarynode.derefnode;
+      begin
+        inherited derefnode;
+        if assigned(right) then
+          right.derefnode;
+      end;
+
+
     procedure tbinarynode.concattolist(l : tlinkedlist);
       begin
          { we could change that depending on the number of }
@@ -994,7 +1092,10 @@ implementation
 end.
 {
   $Log$
-  Revision 1.73  2003-10-23 14:44:07  peter
+  Revision 1.74  2003-11-10 22:02:52  peter
+    * cross unit inlining fixed
+
+  Revision 1.73  2003/10/23 14:44:07  peter
     * splitted buildderef and buildderefimpl to fix interface crc
       calculation
 

+ 5 - 2
compiler/nutils.pas

@@ -163,7 +163,7 @@ implementation
         newstatement : tstatementnode;
         srsym : tsym;
       begin
-        result:=internalstatements(newstatement,true);
+        result:=internalstatements(newstatement);
 
         { call fail helper and exit normal }
         if is_class(current_procinfo.procdef._class) then
@@ -254,7 +254,10 @@ end.
 
 {
   $Log$
-  Revision 1.7  2003-10-01 20:34:49  peter
+  Revision 1.8  2003-11-10 22:02:52  peter
+    * cross unit inlining fixed
+
+  Revision 1.7  2003/10/01 20:34:49  peter
     * procinfo unit contains tprocinfo
     * cginfo renamed to cgbase
     * moved cgmessage to verbose

+ 9 - 6
compiler/pass_2.pas

@@ -49,11 +49,10 @@ implementation
      cutils,
 {$endif}
      globtype,systems,verbose,
-     cclasses,globals,
-     symconst,symbase,symtype,symsym,paramgr,
+     globals,
+     paramgr,
      aasmtai,
-     pass_1,cgbase,
-     procinfo,
+     cgbase,
      nflw,cgobj;
 
 {*****************************************************************************
@@ -163,7 +162,8 @@ implementation
             oldcodegenerror:=codegenerror;
             oldlocalswitches:=aktlocalswitches;
             oldpos:=aktfilepos;
-            aktfilepos:=p.fileinfo;
+            if not inlining_procedure then
+              aktfilepos:=p.fileinfo;
             aktlocalswitches:=p.localswitches;
             codegenerror:=false;
 {$ifdef EXTDEBUG}
@@ -210,7 +210,10 @@ implementation
 end.
 {
   $Log$
-  Revision 1.73  2003-10-30 16:22:40  peter
+  Revision 1.74  2003-11-10 22:02:52  peter
+    * cross unit inlining fixed
+
+  Revision 1.73  2003/10/30 16:22:40  peter
     * call firstpass before allocation and codegeneration is started
     * move leftover code from pass_2.generatecode() to psub
 

+ 8 - 5
compiler/pinline.pas

@@ -234,7 +234,7 @@ implementation
 
                   { create statements with call to getmem+initialize or
                     finalize+freemem }
-                  new_dispose_statement:=internalstatements(newstatement,true);
+                  new_dispose_statement:=internalstatements(newstatement);
 
                   if is_new then
                    begin
@@ -317,7 +317,7 @@ implementation
               Message(parser_w_use_extended_syntax_for_objects);
 
             { create statements with call to getmem+initialize }
-            newblock:=internalstatements(newstatement,true);
+            newblock:=internalstatements(newstatement);
 
             { create temp for result }
             temp := ctempcreatenode.create(p1.resulttype,p1.resulttype.def.size,tt_persistent);
@@ -477,7 +477,7 @@ implementation
          begin
             { create statements with call initialize the arguments and
               call fpc_dynarr_setlength }
-            newblock:=internalstatements(newstatement,true);
+            newblock:=internalstatements(newstatement);
 
             { get temp for array of lengths }
             temp := ctempcreatenode.create(s32bittype,counter*s32bittype.def.size,tt_persistent);
@@ -640,7 +640,7 @@ implementation
              end;
 
             { create statements with call }
-            copynode:=internalstatements(newstatement,true);
+            copynode:=internalstatements(newstatement);
 
             if (counter=3) then
              begin
@@ -693,7 +693,10 @@ implementation
 end.
 {
   $Log$
-  Revision 1.23  2003-11-04 19:05:03  peter
+  Revision 1.24  2003-11-10 22:02:52  peter
+    * cross unit inlining fixed
+
+  Revision 1.23  2003/11/04 19:05:03  peter
     * fixed initialize call after getmem
 
   Revision 1.22  2003/10/17 14:38:32  peter

+ 5 - 2
compiler/ppu.pas

@@ -112,7 +112,7 @@ const
   ibwidestringdef  = 56;
   ibvariantdef     = 57;
   {implementation/objectdata}
-  ibnode           = 80;
+  ibnodetree       = 80;
   ibasmsymbols     = 81;
 
 { unit flags }
@@ -993,7 +993,10 @@ end;
 end.
 {
   $Log$
-  Revision 1.43  2003-10-22 20:40:00  peter
+  Revision 1.44  2003-11-10 22:02:52  peter
+    * cross unit inlining fixed
+
+  Revision 1.43  2003/10/22 20:40:00  peter
     * write derefdata in a separate ppu entry
 
   Revision 1.42  2003/09/23 17:56:05  peter

+ 7 - 1
compiler/procinfo.pas

@@ -63,6 +63,9 @@ unit procinfo;
           parent : tprocinfo;
           {# the definition of the routine itself }
           procdef : tprocdef;
+          { procinfo of the main procedure that is inlining
+            the current function, only used in tcgcallnode.inlined_pass2 }
+          inlining_procinfo : tprocinfo;
           { file location of begin of procedure }
           entrypos  : tfileposinfo;
           { file location of end of procedure }
@@ -205,7 +208,10 @@ implementation
 end.
 {
   $Log$
-  Revision 1.7  2003-10-17 14:38:32  peter
+  Revision 1.8  2003-11-10 22:02:52  peter
+    * cross unit inlining fixed
+
+  Revision 1.7  2003/10/17 14:38:32  peter
     * 64k registers supported
     * fixed some memory leaks
 

+ 9 - 6
compiler/pstatmnt.pas

@@ -118,7 +118,7 @@ implementation
               consume_emptystats;
            end;
          consume(_END);
-         statements_til_end:=cblocknode.create(first,true);
+         statements_til_end:=cblocknode.create(first);
       end;
 
 
@@ -326,7 +326,7 @@ implementation
            end;
          consume(_UNTIL);
 
-         first:=cblocknode.create(first,true);
+         first:=cblocknode.create(first);
          p_e:=comp_expr(true);
          repeat_statement:=genloopnode(whilerepeatn,p_e,first,nil,true);
       end;
@@ -427,7 +427,7 @@ implementation
              begin
                calltempp:=nil;
                { complex load, load in temp first }
-               newblock:=internalstatements(newstatement,false);
+               newblock:=internalstatements(newstatement);
                { when right is a call then load it first in a temp }
                if p.nodetype=calln then
                  begin
@@ -620,7 +620,7 @@ implementation
                 break;
               consume_emptystats;
            end;
-         p_try_block:=cblocknode.create(first,true);
+         p_try_block:=cblocknode.create(first);
 
          if try_to_consume(_FINALLY) then
            begin
@@ -1042,7 +1042,7 @@ implementation
          if (starttoken<>_INITIALIZATION) or (token<>_FINALIZATION) then
            consume(_END);
 
-         last:=cblocknode.create(first,true);
+         last:=cblocknode.create(first);
          last.set_tree_filepos(filepos);
          statement_block:=last;
       end;
@@ -1130,7 +1130,10 @@ implementation
 end.
 {
   $Log$
-  Revision 1.119  2003-10-29 20:34:20  peter
+  Revision 1.120  2003-11-10 22:02:52  peter
+    * cross unit inlining fixed
+
+  Revision 1.119  2003/10/29 20:34:20  peter
     * move check for unused object constructor result to blocknode
 
   Revision 1.117  2003/10/29 15:40:20  peter

+ 9 - 6
compiler/psub.pas

@@ -262,7 +262,7 @@ implementation
         newstatement : tstatementnode;
         htype        : ttype;
       begin
-        result:=internalstatements(newstatement,true);
+        result:=internalstatements(newstatement);
 
         if assigned(current_procinfo.procdef._class) then
           begin
@@ -361,7 +361,7 @@ implementation
         para : tcallparanode;
         newstatement : tstatementnode;
       begin
-        result:=internalstatements(newstatement,true);
+        result:=internalstatements(newstatement);
 
         if assigned(current_procinfo.procdef._class) then
           begin
@@ -451,7 +451,7 @@ implementation
         pd : tprocdef;
         newstatement : tstatementnode;
       begin
-        generate_except_block:=internalstatements(newstatement,true);
+        generate_except_block:=internalstatements(newstatement);
 
         { a constructor needs call destructor (if available) when it
           is not inherited }
@@ -529,7 +529,7 @@ implementation
         { Generate procedure by combining init+body+final,
           depending on the implicit finally we need to add
           an try...finally...end wrapper }
-        newblock:=internalstatements(newstatement,true);
+        newblock:=internalstatements(newstatement);
         if (pi_needs_implicit_finally in current_procinfo.flags) and
            { but it's useless in init/final code of units }
            not(current_procinfo.procdef.proctypeoption in [potype_unitfinalize,potype_unitinit]) then
@@ -539,7 +539,7 @@ implementation
             aktfilepos:=exitpos;
             exceptcode:=generate_except_block;
             { Generate code that will be in the try...finally }
-            finalcode:=internalstatements(codestatement,true);
+            finalcode:=internalstatements(codestatement);
             addstatement(codestatement,bodyexitcode);
             addstatement(codestatement,final_asmnode);
             { Initialize before try...finally...end frame }
@@ -1312,7 +1312,10 @@ implementation
 end.
 {
   $Log$
-  Revision 1.170  2003-11-07 15:58:32  florian
+  Revision 1.171  2003-11-10 22:02:52  peter
+    * cross unit inlining fixed
+
+  Revision 1.170  2003/11/07 15:58:32  florian
     * Florian's culmutative nr. 1; contains:
       - invalid calling conventions for a certain cpu are rejected
       - arm softfloat calling conventions

+ 30 - 22
compiler/symdef.pas

@@ -3606,6 +3606,8 @@ implementation
 
 
     constructor tprocdef.ppuload(ppufile:tcompilerppufile);
+      var
+        level : byte;
       begin
          inherited ppuload(ppufile);
          deftype:=procdef;
@@ -3617,36 +3619,38 @@ implementation
           _mangledname:=nil;
          overloadnumber:=ppufile.getword;
          extnumber:=ppufile.getword;
+         level:=ppufile.getbyte;
          ppufile.getderef(_classderef);
          ppufile.getderef(procsymderef);
          ppufile.getposinfo(fileinfo);
          ppufile.getsmallset(symoptions);
          { inline stuff }
          if proccalloption=pocall_inline then
-          begin
-            ppufile.getderef(funcretsymderef);
-            code:=ppuloadnode(ppufile);
-          end
+           ppufile.getderef(funcretsymderef)
          else
-          begin
-            code := nil;
-            funcretsym:=nil;
-          end;
+           funcretsym:=nil;
+
          { load para symtable }
-         parast:=tparasymtable.create(unknown_level);
+         parast:=tparasymtable.create(level);
          tparasymtable(parast).ppuload(ppufile);
          parast.defowner:=self;
          { load local symtable }
          if (proccalloption=pocall_inline) or
             ((current_module.flags and uf_local_browser)<>0) then
           begin
-            localst:=tlocalsymtable.create(unknown_level);
+            localst:=tlocalsymtable.create(level);
             tlocalsymtable(localst).ppuload(ppufile);
             localst.defowner:=self;
           end
          else
           localst:=nil;
 
+         { inline stuff }
+         if proccalloption=pocall_inline then
+           code:=ppuloadnodetree(ppufile)
+         else
+           code := nil;
+
          { default values for no persistent data }
          if (cs_link_deffile in aktglobalswitches) and
             (tf_need_export in target_info.flags) and
@@ -3734,21 +3738,17 @@ implementation
           ppufile.putstring(mangledname);
          ppufile.putword(overloadnumber);
          ppufile.putword(extnumber);
+         ppufile.putbyte(parast.symtablelevel);
          ppufile.putderef(_classderef);
          ppufile.putderef(procsymderef);
          ppufile.putposinfo(fileinfo);
          ppufile.putsmallset(symoptions);
 
-         { inline stuff references to localsymtable, no influence
-           on the crc }
+         { inline stuff }
          oldintfcrc:=ppufile.do_crc;
          ppufile.do_crc:=false;
-         { inline stuff }
          if proccalloption=pocall_inline then
-          begin
-            ppufile.putderef(funcretsymderef);
-            ppuwritenode(ppufile,code);
-          end;
+           ppufile.putderef(funcretsymderef);
          ppufile.do_crc:=oldintfcrc;
 
          { write this entry }
@@ -3765,14 +3765,18 @@ implementation
             oldintfcrc:=ppufile.do_crc;
             ppufile.do_crc:=false;
             if not assigned(localst) then
-             begin
-               localst:=tlocalsymtable.create(unknown_level);
-               localst.defowner:=self;
-             end;
+              insert_localst;
             tlocalsymtable(localst).ppuwrite(ppufile);
             ppufile.do_crc:=oldintfcrc;
           end;
 
+         { node tree for inlining }
+         oldintfcrc:=ppufile.do_crc;
+         ppufile.do_crc:=false;
+         if proccalloption=pocall_inline then
+           ppuwritenodetree(ppufile,code);
+         ppufile.do_crc:=oldintfcrc;
+
          aktparasymtable:=oldparasymtable;
          aktlocalsymtable:=oldlocalsymtable;
       end;
@@ -4158,6 +4162,7 @@ implementation
          { locals }
          if assigned(localst) then
           begin
+            tlocalsymtable(localst).buildderef;
             tlocalsymtable(localst).buildderefimpl;
             funcretsymderef.build(funcretsym);
           end;
@@ -6112,7 +6117,10 @@ implementation
 end.
 {
   $Log$
-  Revision 1.189  2003-11-08 23:31:27  florian
+  Revision 1.190  2003-11-10 22:02:52  peter
+    * cross unit inlining fixed
+
+  Revision 1.189  2003/11/08 23:31:27  florian
     * tstoreddef.getcopy returns now an errordef instead of nil; this
       allows easier error recovery
 

+ 6 - 3
compiler/symtable.pas

@@ -499,7 +499,7 @@ implementation
       var
         hp : tdef;
       begin
-        { deref the implementation part of definitions }
+        { definitions }
         hp:=tdef(defindex.first);
         while assigned(hp) do
          begin
@@ -547,7 +547,7 @@ implementation
       var
         hp : tdef;
       begin
-        { deref the implementation part of definitions }
+        { definitions }
         hp:=tdef(defindex.first);
         while assigned(hp) do
          begin
@@ -2298,7 +2298,10 @@ implementation
 end.
 {
   $Log$
-  Revision 1.122  2003-11-08 17:08:44  florian
+  Revision 1.123  2003-11-10 22:02:52  peter
+    * cross unit inlining fixed
+
+  Revision 1.122  2003/11/08 17:08:44  florian
     * fixed strange error message about expecting erroneous types,
       usually this is caused by other errors so it isn't important
 

+ 6 - 1
compiler/symtype.pas

@@ -99,7 +99,9 @@ interface
          destructor destroy;override;
          function  realname:string;
          procedure buildderef;virtual;abstract;
+         procedure buildderefimpl;virtual;abstract;
          procedure deref;virtual;abstract;
+         procedure derefimpl;virtual;abstract;
          function  gettypedef:tdef;virtual;
       end;
 
@@ -941,7 +943,10 @@ finalization
 end.
 {
   $Log$
-  Revision 1.33  2003-10-28 15:36:01  peter
+  Revision 1.34  2003-11-10 22:02:52  peter
+    * cross unit inlining fixed
+
+  Revision 1.33  2003/10/28 15:36:01  peter
     * absolute to object field supported, fixes tb0458
 
   Revision 1.32  2003/10/23 14:44:07  peter

+ 61 - 28
compiler/utils/ppudump.pp

@@ -58,7 +58,6 @@ type
 var
   ppufile     : tppufile;
   space       : string;
-  read_member : boolean;
   unitnumber,
   unitindex   : longint;
   verbose     : longint;
@@ -883,11 +882,37 @@ begin
 end;
 
 
+procedure readnodetree;
+var
+  l : longint;
+  p : pointer;
+begin
+  with ppufile do
+   begin
+     if space<>'' then
+      Writeln(space,'------ nodetree ------');
+     if readentry=ibnodetree then
+      begin
+        l:=entrysize;
+        Writeln(space,'Tree size : ',l);
+        { Read data to prevent error that entry is not completly read }
+        getmem(p,l);
+        getdata(p^,l);
+        freemem(p);
+      end
+     else
+      begin
+        Writeln('!! ibnodetree not found');
+      end;
+   end;
+end;
+
+
 {****************************************************************************
                              Read Symbols Part
 ****************************************************************************}
 
-procedure readsymbols;
+procedure readsymbols(const s:string);
 type
   { options for variables }
   tvaroption=(vo_none,
@@ -931,7 +956,7 @@ begin
   with ppufile do
    begin
      if space<>'' then
-      Writeln(space,'-----------------------------');
+      Writeln(space,'------ ',s,' ------');
      if readentry=ibstartsyms then
       begin
         totalsyms:=getlongint;
@@ -1169,7 +1194,7 @@ end;
                          Read defintions Part
 ****************************************************************************}
 
-procedure readdefinitions(start_read : boolean);
+procedure readdefinitions(const s:string;start_read : boolean);
 type
   tsettype  = (normset,smallset,varset);
   tbasetype = (
@@ -1191,7 +1216,6 @@ type
   );
 var
   b : byte;
-  oldread_member : boolean;
   totaldefs,l,j,
   defcnt : longint;
   calloption : tproccalloption;
@@ -1200,7 +1224,7 @@ begin
   with ppufile do
    begin
      if space<>'' then
-      Writeln(space,'-----------------------------');
+      Writeln(space,'------ ',s,' ------');
      if not start_read then
        if readentry=ibstartdefs then
          begin
@@ -1277,6 +1301,7 @@ begin
                writeln(space,'     Mangled name : ',getstring);
              writeln(space,'  Overload Number : ',getword);
              writeln(space,'           Number : ',getword);
+             writeln(space,'            Level : ',getbyte);
              write  (space,'            Class : ');
              readderef;
              write  (space,'          Procsym : ');
@@ -1290,17 +1315,22 @@ begin
                 write  (space,'       FuncretSym : ');
                 readderef;
               end;
+             if not EndOfEntry then
+              Writeln('!! Entry has more information stored');
              space:='    '+space;
              { parast }
-             readdefinitions(false);
-             readsymbols;
+             readdefinitions('parast',false);
+             readsymbols('parast');
              { localst }
              if (calloption=pocall_inline) or
                 ((ppufile.header.flags and uf_local_browser) <> 0) then
               begin
-                readdefinitions(false);
-                readsymbols;
+                readdefinitions('localst',false);
+                readsymbols('localst');
               end;
+             { code }
+             if (calloption=pocall_inline) then
+               readnodetree;
              delete(space,1,4);
            end;
 
@@ -1308,10 +1338,12 @@ begin
            begin
              readcommondef('Procedural type (ProcVar) definition');
              read_abstract_proc_def;
+             if not EndOfEntry then
+              Writeln('!! Entry has more information stored');
              space:='    '+space;
              { parast }
-             readdefinitions(false);
-             readsymbols;
+             readdefinitions('parast',false);
+             readsymbols('parast');
              delete(space,1,4);
            end;
 
@@ -1343,13 +1375,12 @@ begin
            begin
              readcommondef('Record definition');
              writeln(space,'             Size : ',getlongint);
+             if not EndOfEntry then
+              Writeln('!! Entry has more information stored');
              {read the record definitions and symbols}
              space:='    '+space;
-             oldread_member:=read_member;
-             read_member:=true;
-             readdefinitions(false);
-             readsymbols;
-             read_member:=oldread_member;
+             readdefinitions('fields',false);
+             readsymbols('fields');
              Delete(space,1,4);
            end;
 
@@ -1394,13 +1425,12 @@ begin
                  end;
               end;
 
-           {read the record definitions and symbols}
+             if not EndOfEntry then
+              Writeln('!! Entry has more information stored');
+             {read the record definitions and symbols}
              space:='    '+space;
-             oldread_member:=read_member;
-             read_member:=true;
-             readdefinitions(false);
-             readsymbols;
-             read_member:=oldread_member;
+             readdefinitions('fields',false);
+             readsymbols('fields');
              Delete(space,1,4);
            end;
 
@@ -1744,7 +1774,7 @@ begin
      Writeln;
      Writeln('Interface definitions');
      Writeln('----------------------');
-     readdefinitions(false);
+     readdefinitions('interface',false);
    end
   else
    ppufile.skipuntilentry(ibenddefs);
@@ -1754,7 +1784,7 @@ begin
      Writeln;
      Writeln('Interface Symbols');
      Writeln('------------------');
-     readsymbols;
+     readsymbols('interface');
    end
   else
    ppufile.skipuntilentry(ibendsyms);
@@ -1776,7 +1806,7 @@ begin
         Writeln;
         Writeln('Static definitions');
         Writeln('----------------------');
-        readdefinitions(false);
+        readdefinitions('implementation',false);
       end
      else
       ppufile.skipuntilentry(ibenddefs);
@@ -1786,7 +1816,7 @@ begin
         Writeln;
         Writeln('Static Symbols');
         Writeln('------------------');
-        readsymbols;
+        readsymbols('implementation');
       end;
    end;
 {read the browser units stuff}
@@ -1899,7 +1929,10 @@ begin
 end.
 {
   $Log$
-  Revision 1.47  2003-10-22 20:40:00  peter
+  Revision 1.48  2003-11-10 22:02:52  peter
+    * cross unit inlining fixed
+
+  Revision 1.47  2003/10/22 20:40:00  peter
     * write derefdata in a separate ppu entry
 
   Revision 1.46  2003/07/02 22:18:04  peter