Browse Source

* readded removed changes

florian 23 years ago
parent
commit
c3f4220f3b
5 changed files with 58 additions and 32 deletions
  1. 17 11
      compiler/ncal.pas
  2. 13 7
      compiler/nflw.pas
  3. 10 4
      compiler/nld.pas
  4. 7 5
      compiler/nstate.pas
  5. 11 5
      compiler/psub.pas

+ 17 - 11
compiler/ncal.pas

@@ -129,7 +129,7 @@ implementation
     uses
     uses
       cutils,globtype,systems,
       cutils,globtype,systems,
       verbose,globals,
       verbose,globals,
-      symconst,types,
+      symconst,paramgr,types,
       htypechk,pass_1,cpuinfo,cpubase,
       htypechk,pass_1,cpuinfo,cpubase,
       ncnv,nld,ninl,nadd,ncon,
       ncnv,nld,ninl,nadd,ncon,
       rgobj,cgbase
       rgobj,cgbase
@@ -370,7 +370,7 @@ implementation
          if not(assigned(aktcallprocdef) and
          if not(assigned(aktcallprocdef) and
                 (aktcallprocdef.proccalloption in [pocall_cppdecl,pocall_cdecl]) and
                 (aktcallprocdef.proccalloption in [pocall_cppdecl,pocall_cdecl]) and
                 (po_external in aktcallprocdef.procoptions)) and
                 (po_external in aktcallprocdef.procoptions)) and
-            push_high_param(defcoll.paratype.def) then
+            paramanager.push_high_param(defcoll.paratype.def) then
            gen_high_tree(is_open_string(defcoll.paratype.def));
            gen_high_tree(is_open_string(defcoll.paratype.def));
 
 
          { test conversions }
          { test conversions }
@@ -417,7 +417,7 @@ implementation
                        left.resulttype.def.typename,defcoll.paratype.def.typename);
                        left.resulttype.def.typename,defcoll.paratype.def.typename);
                   end;
                   end;
               { Process open parameters }
               { Process open parameters }
-              if push_high_param(defcoll.paratype.def) then
+              if paramanager.push_high_param(defcoll.paratype.def) then
                begin
                begin
                  { insert type conv but hold the ranges of the array }
                  { insert type conv but hold the ranges of the array }
                  oldtype:=left.resulttype;
                  oldtype:=left.resulttype;
@@ -682,7 +682,7 @@ implementation
         restypeset := true;
         restypeset := true;
         { both the normal and specified resulttype either have to be returned via a }
         { both the normal and specified resulttype either have to be returned via a }
         { parameter or not, but no mixing (JM)                                      }
         { parameter or not, but no mixing (JM)                                      }
-        if ret_in_param(restype.def) xor ret_in_param(symtableprocentry.defs^.def.rettype.def) then
+        if paramanager.ret_in_param(restype.def) xor paramanager.ret_in_param(symtableprocentry.defs^.def.rettype.def) then
           internalerror(200108291);
           internalerror(200108291);
       end;
       end;
 
 
@@ -691,7 +691,7 @@ implementation
       begin
       begin
         self.createintern(name,params);
         self.createintern(name,params);
         funcretrefnode:=returnnode;
         funcretrefnode:=returnnode;
-        if not ret_in_param(symtableprocentry.defs^.def.rettype.def) then
+        if not paramanager.ret_in_param(symtableprocentry.defs^.def.rettype.def) then
           internalerror(200204247);
           internalerror(200204247);
       end;
       end;
 
 
@@ -1509,7 +1509,7 @@ implementation
          { get a register for the return value }
          { get a register for the return value }
          if (not is_void(resulttype.def)) then
          if (not is_void(resulttype.def)) then
           begin
           begin
-            if ret_in_acc(resulttype.def) then
+            if paramanager.ret_in_acc(resulttype.def) then
              begin
              begin
                { wide- and ansistrings are returned in EAX    }
                { wide- and ansistrings are returned in EAX    }
                { but they are imm. moved to a memory location }
                { but they are imm. moved to a memory location }
@@ -1638,13 +1638,13 @@ implementation
 
 
              { It doesn't hurt to calculate it already though :) (JM) }
              { It doesn't hurt to calculate it already though :) (JM) }
              rg.incrementregisterpushed(tprocdef(procdefinition).usedregisters);
              rg.incrementregisterpushed(tprocdef(procdefinition).usedregisters);
-             
+
            end;
            end;
 
 
          { get a register for the return value }
          { get a register for the return value }
          if (not is_void(resulttype.def)) then
          if (not is_void(resulttype.def)) then
            begin
            begin
-             if ret_in_param(resulttype.def) then
+             if paramanager.ret_in_param(resulttype.def) then
               begin
               begin
                 location.loc:=LOC_CREFERENCE;
                 location.loc:=LOC_CREFERENCE;
               end
               end
@@ -1828,7 +1828,7 @@ implementation
          retoffset:=-POINTER_SIZE; { less dangerous as zero (PM) }
          retoffset:=-POINTER_SIZE; { less dangerous as zero (PM) }
          para_offset:=0;
          para_offset:=0;
          para_size:=inlineprocdef.para_size(target_info.alignment.paraalign);
          para_size:=inlineprocdef.para_size(target_info.alignment.paraalign);
-         if ret_in_param(inlineprocdef.rettype.def) then
+         if paramanager.ret_in_param(inlineprocdef.rettype.def) then
            inc(para_size,POINTER_SIZE);
            inc(para_size,POINTER_SIZE);
          { copy args }
          { copy args }
          if assigned(code) then
          if assigned(code) then
@@ -1896,7 +1896,13 @@ begin
 end.
 end.
 {
 {
   $Log$
   $Log$
-  Revision 1.80  2002-07-14 18:00:43  daniel
+  Revision 1.81  2002-07-15 18:03:14  florian
+    * readded removed changes
+
+  Revision 1.79  2002/07/11 14:41:27  florian
+    * start of the new generic parameter handling
+
+  Revision 1.80  2002/07/14 18:00:43  daniel
   + Added the beginning of a state tracker. This will track the values of
   + Added the beginning of a state tracker. This will track the values of
     variables through procedures and optimize things away.
     variables through procedures and optimize things away.
 
 
@@ -2014,4 +2020,4 @@ end.
   Revision 1.62  2002/01/19 11:57:05  peter
   Revision 1.62  2002/01/19 11:57:05  peter
     * fixed path appending for lib
     * fixed path appending for lib
 
 
-}
+}

+ 13 - 7
compiler/nflw.pas

@@ -181,7 +181,7 @@ implementation
     uses
     uses
       globtype,systems,
       globtype,systems,
       cutils,verbose,globals,
       cutils,verbose,globals,
-      symconst,symtable,types,htypechk,pass_1,
+      symconst,symtable,paramgr,types,htypechk,pass_1,
       ncon,nmem,nld,ncnv,nbas,rgobj,
       ncon,nmem,nld,ncnv,nbas,rgobj,
     {$ifdef state_tracking}
     {$ifdef state_tracking}
       nstate,
       nstate,
@@ -338,12 +338,12 @@ implementation
 
 
 {$ifdef state_tracking}
 {$ifdef state_tracking}
     procedure Twhilerepeatnode.track_state_pass(exec_known:boolean);
     procedure Twhilerepeatnode.track_state_pass(exec_known:boolean);
-    
+
     var condition:Tnode;
     var condition:Tnode;
 	code:Tnode;
 	code:Tnode;
 	done:boolean;
 	done:boolean;
 	value:boolean;
 	value:boolean;
-    
+
     begin
     begin
 	done:=false;
 	done:=false;
 	repeat
 	repeat
@@ -372,7 +372,7 @@ implementation
 	    begin
 	    begin
 	        ...
 	        ...
 	    end;
 	    end;
-	 
+
 	 When the loop is done, we do know that i<10 = false.
 	 When the loop is done, we do know that i<10 = false.
 	}
 	}
 	condition:=left.getcopy;
 	condition:=left.getcopy;
@@ -660,7 +660,7 @@ implementation
            if assigned(left) then
            if assigned(left) then
             begin
             begin
               inserttypeconv(left,aktprocdef.rettype);
               inserttypeconv(left,aktprocdef.rettype);
-              if ret_in_param(aktprocdef.rettype.def) or
+              if paramanager.ret_in_param(aktprocdef.rettype.def) or
                  (procinfo^.no_fast_exit) or
                  (procinfo^.no_fast_exit) or
                  ((procinfo^.flags and pi_uses_exceptions)<>0) then
                  ((procinfo^.flags and pi_uses_exceptions)<>0) then
                begin
                begin
@@ -1166,10 +1166,16 @@ begin
 end.
 end.
 {
 {
   $Log$
   $Log$
-  Revision 1.35  2002-07-14 18:00:44  daniel
+  Revision 1.36  2002-07-15 18:03:15  florian
+    * readded removed changes
+
+  Revision 1.35  2002/07/14 18:00:44  daniel
   + Added the beginning of a state tracker. This will track the values of
   + Added the beginning of a state tracker. This will track the values of
     variables through procedures and optimize things away.
     variables through procedures and optimize things away.
 
 
+  Revision 1.34  2002/07/11 14:41:28  florian
+    * start of the new generic parameter handling
+
   Revision 1.33  2002/07/01 18:46:23  peter
   Revision 1.33  2002/07/01 18:46:23  peter
     * internal linker
     * internal linker
     * reorganized aasm layer
     * reorganized aasm layer
@@ -1217,4 +1223,4 @@ end.
     - list field removed of the tnode class because it's not used currently
     - list field removed of the tnode class because it's not used currently
       and can cause hard-to-find bugs
       and can cause hard-to-find bugs
 
 
-}
+}

+ 10 - 4
compiler/nld.pas

@@ -128,7 +128,7 @@ implementation
 
 
     uses
     uses
       cutils,verbose,globtype,globals,systems,
       cutils,verbose,globtype,globals,systems,
-      symtable,types,
+      symtable,paramgr,types,
       htypechk,pass_1,
       htypechk,pass_1,
       ncon,ninl,ncnv,nmem,ncal,cpubase,rgobj,cginfo,cgbase
       ncon,ninl,ncnv,nmem,ncal,cpubase,rgobj,cginfo,cgbase
       ;
       ;
@@ -351,7 +351,7 @@ implementation
                    { we need a register for call by reference parameters }
                    { we need a register for call by reference parameters }
                    if (tvarsym(symtableentry).varspez in [vs_var,vs_out]) or
                    if (tvarsym(symtableentry).varspez in [vs_var,vs_out]) or
                       ((tvarsym(symtableentry).varspez=vs_const) and
                       ((tvarsym(symtableentry).varspez=vs_const) and
-                      push_addr_param(tvarsym(symtableentry).vartype.def)) or
+                      paramanager.push_addr_param(tvarsym(symtableentry).vartype.def)) or
                       { call by value open arrays are also indirect addressed }
                       { call by value open arrays are also indirect addressed }
                       is_open_array(tvarsym(symtableentry).vartype.def) then
                       is_open_array(tvarsym(symtableentry).vartype.def) then
                      registers32:=1;
                      registers32:=1;
@@ -631,7 +631,7 @@ implementation
       begin
       begin
          result:=nil;
          result:=nil;
          location.loc:=LOC_REFERENCE;
          location.loc:=LOC_REFERENCE;
-         if ret_in_param(resulttype.def) or
+         if paramanager.ret_in_param(resulttype.def) or
             (lexlevel<>funcretsym.owner.symtablelevel) then
             (lexlevel<>funcretsym.owner.symtablelevel) then
            registers32:=1;
            registers32:=1;
       end;
       end;
@@ -983,7 +983,13 @@ begin
 end.
 end.
 {
 {
   $Log$
   $Log$
-  Revision 1.44  2002-07-14 18:00:44  daniel
+  Revision 1.45  2002-07-15 18:03:15  florian
+    * readded removed changes
+
+  Revision 1.43  2002/07/11 14:41:28  florian
+    * start of the new generic parameter handling
+
+  Revision 1.44  2002/07/14 18:00:44  daniel
   + Added the beginning of a state tracker. This will track the values of
   + Added the beginning of a state tracker. This will track the values of
     variables through procedures and optimize things away.
     variables through procedures and optimize things away.
 
 

+ 7 - 5
compiler/nstate.pas

@@ -22,7 +22,7 @@
 }
 }
 
 
 unit nstate;
 unit nstate;
-			 
+
 {$i fpcdefs.inc}
 {$i fpcdefs.inc}
 
 
 interface
 interface
@@ -121,12 +121,14 @@ begin
 	end;
 	end;
 end;
 end;
 
 
+end.
+
 {
 {
   $Log$
   $Log$
-  Revision 1.1  2002-07-14 18:00:44  daniel
+  Revision 1.2  2002-07-15 18:03:15  florian
+    * readded removed changes
+
+  Revision 1.1  2002/07/14 18:00:44  daniel
   + Added the beginning of a state tracker. This will track the values of
   + Added the beginning of a state tracker. This will track the values of
     variables through procedures and optimize things away.
     variables through procedures and optimize things away.
-
 }
 }
-
-end.

+ 11 - 5
compiler/psub.pas

@@ -46,7 +46,7 @@ implementation
        { aasm }
        { aasm }
        cpubase,cpuinfo,aasmbase,aasmtai,
        cpubase,cpuinfo,aasmbase,aasmtai,
        { symtable }
        { symtable }
-       symconst,symbase,symdef,symsym,symtype,symtable,types,
+       symconst,symbase,symdef,symsym,symtype,symtable,types,paramgr,
        ppu,fmodule,
        ppu,fmodule,
        { pass 1 }
        { pass 1 }
        node,
        node,
@@ -106,7 +106,7 @@ implementation
               { insert in local symtable }
               { insert in local symtable }
               symtablestack.insert(aktprocdef.funcretsym);
               symtablestack.insert(aktprocdef.funcretsym);
               akttokenpos:=storepos;
               akttokenpos:=storepos;
-              if ret_in_acc(aktprocdef.rettype.def) or
+              if paramanager.ret_in_acc(aktprocdef.rettype.def) or
                  (aktprocdef.rettype.def.deftype=floatdef) then
                  (aktprocdef.rettype.def.deftype=floatdef) then
                 procinfo^.return_offset:=-tfuncretsym(aktprocdef.funcretsym).address;
                 procinfo^.return_offset:=-tfuncretsym(aktprocdef.funcretsym).address;
               { insert result also if support is on }
               { insert result also if support is on }
@@ -130,7 +130,7 @@ implementation
          { because we don't know yet where the address is }
          { because we don't know yet where the address is }
          if not is_void(aktprocdef.rettype.def) then
          if not is_void(aktprocdef.rettype.def) then
            begin
            begin
-              if ret_in_acc(aktprocdef.rettype.def) or (aktprocdef.rettype.def.deftype=floatdef) then
+              if paramanager.ret_in_acc(aktprocdef.rettype.def) or (aktprocdef.rettype.def.deftype=floatdef) then
                 begin
                 begin
                    { the space has been set in the local symtable }
                    { the space has been set in the local symtable }
                    procinfo^.return_offset:=-tfuncretsym(aktprocdef.funcretsym).address;
                    procinfo^.return_offset:=-tfuncretsym(aktprocdef.funcretsym).address;
@@ -654,7 +654,7 @@ implementation
 {$endif i386}
 {$endif i386}
 
 
          { pointer to the return value ? }
          { pointer to the return value ? }
-         if ret_in_param(aktprocdef.rettype.def) then
+         if paramanager.ret_in_param(aktprocdef.rettype.def) then
           begin
           begin
             procinfo^.return_offset:=procinfo^.para_offset;
             procinfo^.return_offset:=procinfo^.para_offset;
             inc(procinfo^.para_offset,pointer_size);
             inc(procinfo^.para_offset,pointer_size);
@@ -829,7 +829,13 @@ implementation
 end.
 end.
 {
 {
   $Log$
   $Log$
-  Revision 1.58  2002-07-14 18:00:44  daniel
+  Revision 1.59  2002-07-15 18:03:15  florian
+    * readded removed changes
+
+  Revision 1.57  2002/07/11 14:41:28  florian
+    * start of the new generic parameter handling
+
+  Revision 1.58  2002/07/14 18:00:44  daniel
   + Added the beginning of a state tracker. This will track the values of
   + Added the beginning of a state tracker. This will track the values of
     variables through procedures and optimize things away.
     variables through procedures and optimize things away.