Selaa lähdekoodia

+ parasym to tparaitem added

florian 24 vuotta sitten
vanhempi
commit
b60666ae1f

+ 5 - 1
compiler/globals.pas

@@ -76,6 +76,7 @@ interface
          line      : longint;
          column    : word;
          fileindex : word;
+         { moduleindex : word; }
        end;
 
        TSearchPathList = class(TStringList)
@@ -1452,7 +1453,10 @@ begin
 end.
 {
   $Log$
-  Revision 1.49  2001-10-25 21:22:32  peter
+  Revision 1.50  2001-12-06 17:57:33  florian
+    + parasym to tparaitem added
+
+  Revision 1.49  2001/10/25 21:22:32  peter
     * calling convention rewrite
 
   Revision 1.48  2001/10/23 21:49:42  peter

+ 35 - 12
compiler/i386/cpubase.pas

@@ -468,23 +468,43 @@ type
            top_symbol : (sym:tasmsymbol;symofs:longint);
         end;
 
+
+
+{*****************************************************************************
+                             Argument Classification
+*****************************************************************************}
+
+type
+  TArgClass = (
+     { the following classes should be defined by all processor implemnations }
+     AC_NOCLASS,
+     AC_MEMORY,
+     AC_INTEGER,
+     AC_FPU,
+     { the following argument classes are i386 specific }
+     AC_FPUUP,
+     AC_SSE,
+     AC_SSEUP);
+
 {*****************************************************************************
                                Generic Location
 *****************************************************************************}
 
 type
   TLoc=(
-    LOC_INVALID,     { added for tracking problems}
-    LOC_FPU,         { FPU stack }
-    LOC_REGISTER,    { in a processor register }
-    LOC_MEM,         { in memory }
-    LOC_REFERENCE,   { like LOC_MEM, but lvalue }
-    LOC_JUMP,        { boolean results only, jump to false or true label }
-    LOC_FLAGS,       { boolean results only, flags are set }
-    LOC_CREGISTER,   { Constant register which shouldn't be modified }
-    LOC_MMXREGISTER, { MMX register }
-    LOC_CMMXREGISTER,{ Constant MMX register }
-    LOC_CFPUREGISTER { if it is a FPU register variable on the fpu stack }
+    LOC_INVALID,      { added for tracking problems}
+    LOC_FPU,          { FPU stack }
+    LOC_REGISTER,     { in a processor register }
+    LOC_MEM,          { in memory }
+    LOC_REFERENCE,    { like LOC_MEM, but lvalue }
+    LOC_JUMP,         { boolean results only, jump to false or true label }
+    LOC_FLAGS,        { boolean results only, flags are set }
+    LOC_CREGISTER,    { Constant register which shouldn't be modified }
+    LOC_MMXREGISTER,  { MMX register }
+    LOC_CMMXREGISTER, { MMX register variable }
+    LOC_CFPUREGISTER, { if it is a FPU register variable on the fpu stack }
+    LOC_SSEREGISTER,
+    LOC_CSSEREGISTER
   );
 
   plocation = ^tlocation;
@@ -925,7 +945,10 @@ end;
 end.
 {
   $Log$
-  Revision 1.6  2001-09-28 20:39:33  jonas
+  Revision 1.7  2001-12-06 17:57:40  florian
+    + parasym to tparaitem added
+
+  Revision 1.6  2001/09/28 20:39:33  jonas
     * changed all flow control structures (except for exception handling
       related things) to processor independent code (in new ncgflw unit)
     + generic cgobj unit which contains lots of code generator helpers with

+ 5 - 2
compiler/ncnv.pas

@@ -1,6 +1,6 @@
 {
     $Id$
-    Copyright (c) 2000 by Florian Klaempfl
+    Copyright (c) 2000-2001 by Florian Klaempfl
 
     Type checking and register allocation for type converting nodes
 
@@ -1618,7 +1618,10 @@ begin
 end.
 {
   $Log$
-  Revision 1.45  2001-12-03 21:48:41  peter
+  Revision 1.46  2001-12-06 17:57:34  florian
+    + parasym to tparaitem added
+
+  Revision 1.45  2001/12/03 21:48:41  peter
     * freemem change to value parameter
     * torddef low/high range changed to int64
 

+ 5 - 2
compiler/nmem.pas

@@ -484,7 +484,7 @@ implementation
                  hp2:=TParaItem(hp3.Para.last);
                  while assigned(hp2) do
                    begin
-                      tprocvardef(resulttype.def).concatpara(hp2.paratype,hp2.paratyp,hp2.defaultvalue);
+                      tprocvardef(resulttype.def).concatpara(hp2.paratype,hp2.parasym,hp2.paratyp,hp2.defaultvalue);
                       hp2:=TParaItem(hp2.previous);
                    end;
               end
@@ -1034,7 +1034,10 @@ begin
 end.
 {
   $Log$
-  Revision 1.24  2001-12-03 21:48:42  peter
+  Revision 1.25  2001-12-06 17:57:34  florian
+    + parasym to tparaitem added
+
+  Revision 1.24  2001/12/03 21:48:42  peter
     * freemem change to value parameter
     * torddef low/high range changed to int64
 

+ 5 - 2
compiler/nset.pas

@@ -1,6 +1,6 @@
 {
     $Id$
-    Copyright (c) 2000 by Florian Klaempfl
+    Copyright (c) 2000-2001 by Florian Klaempfl
 
     Type checking and register allocation for set/case nodes
 
@@ -588,7 +588,10 @@ begin
 end.
 {
   $Log$
-  Revision 1.16  2001-10-12 13:51:51  jonas
+  Revision 1.17  2001-12-06 17:57:35  florian
+    + parasym to tparaitem added
+
+  Revision 1.16  2001/10/12 13:51:51  jonas
     * fixed internalerror(10) due to previous fpu overflow fixes ("merged")
     * fixed bug in n386add (introduced after compilerproc changes for string
       operations) where calcregisters wasn't called for shortstring addnodes

+ 5 - 2
compiler/pdecl.pas

@@ -1,6 +1,6 @@
 {
     $Id$
-    Copyright (c) 1998-2000 by Florian Klaempfl
+    Copyright (c) 1998-2001 by Florian Klaempfl
 
     Does declaration (but not type) parsing for Free Pascal
 
@@ -605,7 +605,10 @@ implementation
 end.
 {
   $Log$
-  Revision 1.39  2001-10-25 21:22:35  peter
+  Revision 1.40  2001-12-06 17:57:35  florian
+    + parasym to tparaitem added
+
+  Revision 1.39  2001/10/25 21:22:35  peter
     * calling convention rewrite
 
   Revision 1.38  2001/10/24 10:26:53  marco

+ 5 - 2
compiler/pdecobj.pas

@@ -1,6 +1,6 @@
 {
     $Id$
-    Copyright (c) 1998-2000 by Florian Klaempfl
+    Copyright (c) 1998-2001 by Florian Klaempfl
 
     Does object types for Free Pascal
 
@@ -1117,7 +1117,10 @@ implementation
 end.
 {
   $Log$
-  Revision 1.33  2001-11-02 22:58:02  peter
+  Revision 1.34  2001-12-06 17:57:35  florian
+    + parasym to tparaitem added
+
+  Revision 1.33  2001/11/02 22:58:02  peter
     * procsym definition rewrite
 
   Revision 1.32  2001/10/25 21:22:35  peter

+ 14 - 6
compiler/pdecsub.pas

@@ -1,6 +1,6 @@
 {
     $Id$
-    Copyright (c) 1998-2000 by Florian Klaempfl, Daniel Mantione
+    Copyright (c) 1998-2001 by Florian Klaempfl, Daniel Mantione
 
     Does the parsing of the procedures/functions
 
@@ -166,7 +166,9 @@ implementation
                { insert the sym in the parasymtable }
                  tprocdef(aktprocdef).parast.insert(vs);
                  inc(procinfo^.selfpointer_offset,vs.address);
-               end;
+               end
+              else
+               vs:=nil;
               { must also be included for procvars to allow the proc2procvar }
               { type conversions (po_containsself is in po_comp) (JM)        }
               include(aktprocdef.procoptions,po_containsself);
@@ -175,7 +177,7 @@ implementation
               single_type(tt,hs1,false);
               { this must be call-by-value, but we generate already an }
               { an error above if that's not the case (JM)             }
-              aktprocdef.concatpara(tt,varspez,nil);
+              aktprocdef.concatpara(tt,vs,varspez,nil);
               { check the types for procedures only }
               if not is_procvar then
                CheckTypes(tt.def,procinfo^._class);
@@ -275,7 +277,6 @@ implementation
                while not sc.empty do
                 begin
                   s:=sc.get(akttokenpos);
-                  aktprocdef.concatpara(tt,varspez,tdefaultvalue);
                   { For proc vars we only need the definitions }
                   if not is_procvar then
                    begin
@@ -312,7 +313,11 @@ implementation
                         tprocdef(aktprocdef).parast.insert(hvs);
                       end;
 
-                   end;
+                   end
+                  else
+                   vs:=nil;
+
+                  aktprocdef.concatpara(tt,vs,varspez,tdefaultvalue);
                 end;
 {$ifdef fixLeaksOnError}
                if PStringContainer(strContStack.pop) <> sc then
@@ -2004,7 +2009,10 @@ const
 end.
 {
   $Log$
-  Revision 1.41  2001-11-02 22:58:03  peter
+  Revision 1.42  2001-12-06 17:57:36  florian
+    + parasym to tparaitem added
+
+  Revision 1.41  2001/11/02 22:58:03  peter
     * procsym definition rewrite
 
   Revision 1.40  2001/10/25 21:22:37  peter

+ 5 - 2
compiler/pexpr.pas

@@ -1,6 +1,6 @@
 {
     $Id$
-    Copyright (c) 1998-2000 by Florian Klaempfl
+    Copyright (c) 1998-2001 by Florian Klaempfl
 
     Does parsing of expression for Free Pascal
 
@@ -2508,7 +2508,10 @@ implementation
 end.
 {
   $Log$
-  Revision 1.51  2001-11-14 01:12:44  florian
+  Revision 1.52  2001-12-06 17:57:36  florian
+    + parasym to tparaitem added
+
+  Revision 1.51  2001/11/14 01:12:44  florian
     * variant paramter passing and functions results fixed
 
   Revision 1.50  2001/11/02 23:16:51  peter

+ 5 - 2
compiler/ppu.pas

@@ -41,7 +41,7 @@ type
 {$endif Test_Double_checksum}
 
 const
-  CurrentPPUVersion=22;
+  CurrentPPUVersion=25;
 
 { buffer sizes }
   maxentrysize = 1024;
@@ -986,7 +986,10 @@ end;
 end.
 {
   $Log$
-  Revision 1.13  2001-09-22 04:51:58  carl
+  Revision 1.14  2001-12-06 17:57:37  florian
+    + parasym to tparaitem added
+
+  Revision 1.13  2001/09/22 04:51:58  carl
   * updated record size
 
   Revision 1.12  2001/08/30 20:13:53  peter

+ 5 - 2
compiler/ptconst.pas

@@ -1,6 +1,6 @@
 {
     $Id$
-    Copyright (c) 1998-2000 by Florian Klaempfl
+    Copyright (c) 1998-2001 by Florian Klaempfl
 
     Reads typed constants
 
@@ -971,7 +971,10 @@ implementation
 end.
 {
   $Log$
-  Revision 1.38  2001-11-02 22:58:06  peter
+  Revision 1.39  2001-12-06 17:57:38  florian
+    + parasym to tparaitem added
+
+  Revision 1.38  2001/11/02 22:58:06  peter
     * procsym definition rewrite
 
   Revision 1.37  2001/10/29 14:59:48  jonas

+ 12 - 7
compiler/symdef.pas

@@ -99,10 +99,10 @@ interface
 
        tparaitem = class(tlinkedlistitem)
           paratype     : ttype;
+          parasym      : tsym;
           paratyp      : tvarspez;
           argconvtyp   : targconvtyp;
           convertlevel : byte;
-          register     : tregister;
           defaultvalue : tsym; { tconstsym }
        end;
 
@@ -422,7 +422,7 @@ interface
           destructor destroy;override;
           procedure  write(ppufile:tcompilerppufile);override;
           procedure deref;override;
-          procedure concatpara(const tt:ttype;vsp : tvarspez;defval:tsym);
+          procedure concatpara(const tt:ttype;sym : tsym;vsp : tvarspez;defval:tsym);
           function  para_size(alignsize:longint) : longint;
           function  demangled_paras : string;
           procedure test_if_fpu_result;
@@ -1238,7 +1238,7 @@ implementation
          else
            ppufile.putlongint(len);
          case string_typ of
-           st_shortstring : ppufile.writeentry(ibshortstringdef);
+            st_shortstring : ppufile.writeentry(ibshortstringdef);
             st_longstring : ppufile.writeentry(iblongstringdef);
             st_ansistring : ppufile.writeentry(ibansistringdef);
             st_widestring : ppufile.writeentry(ibwidestringdef);
@@ -3041,14 +3041,14 @@ implementation
       end;
 
 
-    procedure tabstractprocdef.concatpara(const tt:ttype;vsp : tvarspez;defval:tsym);
+    procedure tabstractprocdef.concatpara(const tt:ttype;sym : tsym;vsp : tvarspez;defval:tsym);
       var
         hp : TParaItem;
       begin
         hp:=TParaItem.Create;
         hp.paratyp:=vsp;
+        hp.parasym:=sym;
         hp.paratype:=tt;
-        hp.register:=R_NO;
         hp.defaultvalue:=defval;
         Para.insert(hp);
         if not assigned(defval) then
@@ -3084,6 +3084,7 @@ implementation
           begin
             hp.paratype.resolve;
             resolvesym(tsym(hp.defaultvalue));
+            resolvesym(tsym(hp.parasym));
             hp:=TParaItem(hp.next);
           end;
       end;
@@ -3110,9 +3111,9 @@ implementation
             hp:=TParaItem.Create;
             hp.paratyp:=tvarspez(ppufile.getbyte);
             { hp.register:=tregister(ppufile.getbyte); }
-            hp.register:=R_NO;
             ppufile.gettype(hp.paratype);
             hp.defaultvalue:=tsym(ppufile.getderef);
+            hp.parasym:=tsym(ppufile.getderef);
             if not assigned(hp.defaultvalue) then
              inc(minparacount);
             inc(maxparacount);
@@ -3145,6 +3146,7 @@ implementation
             { ppufile.putbyte(byte(hp.register)); }
             ppufile.puttype(hp.paratype);
             ppufile.putderef(hp.defaultvalue);
+            ppufile.putderef(hp.parasym);
             hp:=TParaItem(hp.next);
           end;
       end;
@@ -5502,7 +5504,10 @@ implementation
 end.
 {
   $Log$
-  Revision 1.59  2001-12-03 21:48:42  peter
+  Revision 1.60  2001-12-06 17:57:39  florian
+    + parasym to tparaitem added
+
+  Revision 1.59  2001/12/03 21:48:42  peter
     * freemem change to value parameter
     * torddef low/high range changed to int64