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

* only small updates to work with the current compiler

florian 26 éve
szülő
commit
134030a529
4 módosított fájl, 80 hozzáadás és 35 törlés
  1. 5 2
      compiler/new/cgobj.pas
  2. 32 15
      compiler/new/convtree.pas
  3. 18 14
      compiler/new/nmem.pas
  4. 25 4
      compiler/new/tree.pas

+ 5 - 2
compiler/new/cgobj.pas

@@ -180,7 +180,7 @@ unit cgobj;
   implementation
 
     uses
-       globals,globtype,options,files,gdb,systems,
+       strings,globals,globtype,options,files,gdb,systems,
        ppu,verbose,types,tgobj,tgcpu;
 
 {*****************************************************************************
@@ -1080,7 +1080,10 @@ unit cgobj;
 end.
 {
   $Log$
-  Revision 1.25  1999-09-03 13:09:09  jonas
+  Revision 1.26  1999-09-14 11:16:09  florian
+    * only small updates to work with the current compiler
+
+  Revision 1.25  1999/09/03 13:09:09  jonas
     * fixed typo regarding scratchregs pointer
 
   Revision 1.24  1999/08/26 14:51:54  jonas

+ 32 - 15
compiler/new/convtree.pas

@@ -38,28 +38,45 @@ unit convtree;
 
     function convtree2node(p : ptree) : pnode;
 
-      var
-         node : pnode;
+      function doconv(p : ptree) : pnode;
+
+        var
+           node : pnode;
+
+        begin
+           if assigned(p) then
+             begin
+                case p^.treetype of
+                  blockn:
+                    node:=new(pblocknode,init(doconv(p^.left)));
+                  assignn:
+                    node:=new(passignmentnode,init(doconv(p^.left),
+                      doconv(p^.right)));
+                  statementn:
+                    node:=new(pstatementnode,init(doconv(p^.left),
+                      doconv(p^.right)));
+                  loadn:
+                    node:=new(ploadnode,init(p^.symtableentry,p^.symtable));
+                  else internalerror(1209993);
+                end;
+                doconv:=node;
+             end
+           else
+             doconv:=nil;
+        end;
 
       begin
-         if assigned(p) then
-           begin
-              case p^.treetype of
-                blockn:
-                  node:=new(pblocknode,init(convtree2node(p^.left)));
-                else internalerror(13751);
-              end;
-              disposetree(p);
-              convtree2node:=node;
-           end
-         else
-           convtree2node:=nil;
+         convtree2node:=doconv(p);
+         disposetree(p);
       end;
 
 end.
 {
   $Log$
-  Revision 1.4  1999-01-24 22:32:35  florian
+  Revision 1.5  1999-09-14 11:16:09  florian
+    * only small updates to work with the current compiler
+
+  Revision 1.4  1999/01/24 22:32:35  florian
     * well, more changes, especially parts of secondload ported
 
   Revision 1.3  1999/01/23 23:29:47  florian

+ 18 - 14
compiler/new/nmem.pas

@@ -33,7 +33,7 @@ unit nmem;
           symtableentry : psym;
           symtable : psymtable;
           is_absolute,is_first,is_methodpointer : boolean;
-          constructor init(v : pvarsym;st : psymtable);
+          constructor init(v : psym;st : psymtable);
           destructor done;virtual;
           procedure det_temp;virtual;
           procedure det_resulttype;virtual;
@@ -70,7 +70,7 @@ unit nmem;
                                  TLOADNODE
  ****************************************************************************}
 
-    constructor tloadnode.init(v : pvarsym;st : psymtable);
+    constructor tloadnode.init(v : psym;st : psymtable);
 
       var
          p : ptree;
@@ -78,7 +78,8 @@ unit nmem;
       begin
          inherited init;
          treetype:=loadn;
-         resulttype:=v^.definition;
+         if v^.typ=varsym then
+           resulttype:=pvarsym(v)^.definition;
          symtableentry:=v;
          symtable:=st;
          is_first := False;
@@ -142,7 +143,7 @@ unit nmem;
                          location.reference.symbol:=newasmsymbol(symtableentry^.mangledname);
                       end
 
-{$ifdef i386}
+{$ifdef dummy}
                     { DLL variable, DLL variables are only available on the win32 target }
                     { maybe we've to add this later for the alpha WinNT                  }
                     else if (pvarsym(symtableentry)^.var_options and vo_is_dll_var)<>0 then
@@ -153,10 +154,10 @@ unit nmem;
                          location.reference.symbol:=nil;
                          location.reference.base:=hregister;
                       end
-{$endif i386}
+{$endif dummy}
                     else
                       begin
-{$ifdef i386}
+{$ifdef dummy}
                          symtabletype:=symtable^.symtabletype;
                          { in case it is a register variable: }
                          if pvarsym(symtableentry)^.reg<>R_NO then
@@ -289,7 +290,7 @@ unit nmem;
                               reset_reference(location.reference);
                               location.reference.base:=hregister;
                           end;
-{$endif i386}
+{$endif dummy}
                       end;
                  end;
               procsym:
@@ -412,6 +413,7 @@ unit nmem;
 
       var
          r : treference;
+         opsize : tcgsize;
 
       begin
          if left^.resulttype^.deftype=stringdef then
@@ -466,12 +468,12 @@ unit nmem;
                             (loc=LOC_CREGISTER) then
                            begin
                               case p^.left^.resulttype^.size of
-                                 1 : opsize:=S_B;
-                                 2 : opsize:=S_W;
-                                 4 : opsize:=S_L;
+                                 1 : opsize:=OS_B;
+                                 2 : opsize:=OS_W;
+                                 4 : opsize:=OS_L;
                                  { S_L is correct, the copy is done }
                                  { with two moves                   }
-                                 8 : opsize:=S_L;
+                                 8 : opsize:=OS_L;
                               end;
                               if loc=LOC_CREGISTER then
                                 begin
@@ -709,7 +711,10 @@ unit nmem;
 end.
 {
   $Log$
-  Revision 1.11  1999-08-25 12:00:12  jonas
+  Revision 1.12  1999-09-14 11:16:09  florian
+    * only small updates to work with the current compiler
+
+  Revision 1.11  1999/08/25 12:00:12  jonas
     * changed pai386, paippc and paiapha (same for tai*) to paicpu (taicpu)
 
   Revision 1.10  1999/08/18 17:05:56  florian
@@ -744,5 +749,4 @@ end.
 
   Revision 1.1  1999/01/24 22:32:36  florian
     * well, more changes, especially parts of secondload ported
-
-}
+}

+ 25 - 4
compiler/new/tree.pas

@@ -218,8 +218,8 @@ unit tree;
        end;
 
        { allows to determine which elementes are to be replaced }
-       tdisposetyp = (dt_nothing,dt_leftright,dt_left,
-                      dt_mbleft,dt_typeconv,dt_inlinen,
+       tdisposetyp = (dt_nothing,dt_leftright,dt_left,dt_leftrighthigh,
+                      dt_mbleft,dt_typeconv,dt_inlinen,dt_leftrightmethod,
                       dt_mbleft_and_method,dt_loop,dt_case,dt_with,dt_onn);
 
        ptree = ^ttree;
@@ -789,6 +789,24 @@ unit tree;
                  if assigned(p^.right) then
                    disposetree(p^.right);
               end;
+            dt_leftrighthigh :
+              begin
+                 if assigned(p^.left) then
+                   disposetree(p^.left);
+                 if assigned(p^.right) then
+                   disposetree(p^.right);
+                 if assigned(p^.hightree) then
+                   disposetree(p^.hightree);
+              end;
+            dt_leftrightmethod :
+              begin
+                 if assigned(p^.left) then
+                   disposetree(p^.left);
+                 if assigned(p^.right) then
+                   disposetree(p^.right);
+                 if assigned(p^.methodpointer) then
+                   disposetree(p^.methodpointer);
+              end;
             dt_case :
               begin
                  if assigned(p^.left) then
@@ -853,7 +871,7 @@ unit tree;
                       symt:=p^.withsymtable;
                    end;
               end;
-            else internalerror(12);
+            else internalerror(1209995);
          end;
          putnode(p);
       end;
@@ -2000,7 +2018,10 @@ unit tree;
 end.
 {
   $Log$
-  Revision 1.13  1999-08-06 18:05:55  florian
+  Revision 1.14  1999-09-14 11:16:09  florian
+    * only small updates to work with the current compiler
+
+  Revision 1.13  1999/08/06 18:05:55  florian
     * implemented some stuff for assignments
 
   Revision 1.12  1999/08/05 14:58:16  florian