소스 검색

- removed files, already integrated in main compiler dir

Jonas Maebe 24 년 전
부모
커밋
7649deb8c3
3개의 변경된 파일0개의 추가작업 그리고 513개의 파일을 삭제
  1. 0 98
      compiler/new/cgbase.pas
  2. 0 297
      compiler/new/node.inc
  3. 0 118
      compiler/new/nodeh.inc

+ 0 - 98
compiler/new/cgbase.pas

@@ -1,98 +0,0 @@
-{
-    $Id$
-    Copyright (c) 1998-2000 by Florian Klaempfl
-
-    This units implements some code generator helper routines
-
-    This program is free software; you can redistribute it and/or modify
-    it under the terms of the GNU General Public License as published by
-    the Free Software Foundation; either version 2 of the License, or
-    (at your option) any later version.
-
-    This program is distributed in the hope that it will be useful,
-    but WITHOUT ANY WARRANTY; without even the implied warranty of
-    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-    GNU General Public License for more details.
-
-    You should have received a copy of the GNU General Public License
-    along with this program; if not, write to the Free Software
-    Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
-
- ****************************************************************************
-}
-unit cgbase;
-
-  interface
-
-    type
-       TOpCg = (OP_ADD,OP_AND,OP_DIV,OP_IDIV,OP_IMUL,OP_MUL,OP_NEG,OP_NOT,
-                   OP_OR,OP_SAR,OP_SHL,OP_SHR,OP_SUB,OP_XOR);
-
-       TOpCmp = (OC_NONE,OC_EQ,OC_GT,OC_LT,OC_GTE,OC_LTE,OC_NE,OC_BE,OC_B,
-                 OC_AE,OC_A);
-
-       TCgSize = (OS_NO,OS_8,OS_16,OS_32,OS_64);
-
-    const
-       { defines the default address size for a processor }
-       { and defines the natural int size for a processor }
-{$ifdef i386}
-       OS_ADDR = OS_32;
-       OS_INT = OS_32;
-{$endif i386}
-{$ifdef alpha}
-       OS_ADDR = OS_64;
-       OS_INT = OS_64;
-{$endif alpha}
-{$ifdef powerpc}
-       OS_ADDR = OS_32;
-       OS_INT = OS_32;
-{$endif powercc}
-{$ifdef ia64}
-       OS_ADDR = OS_64;
-       OS_INT = OS_64;
-{$endif ia64}
-
-    function inverse_opcmp(opcmp: topcmp): topcmp;
-
-    function commutativeop(op: topcg): boolean;
-
-  implementation
-
-    function inverse_opcmp(opcmp: topcmp): topcmp;
-      const
-        list: array[TOpCg] of TOpCmp =
-          (OC_NONE,OC_NE,OC_LE,OC_GTE,OC_LT,OC_GT,OC_EQ,OC_A,OC_AE,
-           OC_B,OC_BE);
-      begin
-        inverse_opcmp := list[opcmp];
-      end;
-
-
-    function commutativeop(op: topcg): boolean;
-      const
-        list: array[topcg] of boolean =
-          (true,true,false,false,true,true,false,false,
-           true,false,false,false,false,true);
-      begin
-        commutativeop := list[op];
-      end;
-end.
-{
-  $Log$
-  Revision 1.3  2001-09-06 15:25:55  jonas
-    * changed type of tcg from object to class ->  abstract methods are now
-      a lot cleaner :)
-    + more updates: load_*_loc methods, op_*_* methods, g_flags2reg method
-      (if possible with geenric implementation and necessary ppc
-       implementations)
-    * worked a bit further on cgflw, now working on exitnode
-
-  Revision 1.2  2000/11/29 00:30:51  florian
-    * unused units removed from uses clause
-    * some changes for widestrings
-
-  Revision 1.1  2000/07/13 06:30:07  michael
-  + Initial import
-
-}

+ 0 - 297
compiler/new/node.inc

@@ -1,297 +0,0 @@
-{
-    $Id$
-    Copyright (c) 1999-2000 by Florian Klaempfl
-
-    The declarations of the nodes for the new code generator
-
-    This program is free software; you can redistribute it and/or modify
-    it under the terms of the GNU General Public License as published by
-    the Free Software Foundation; either version 2 of the License, or
-    (at your option) any later version.
-
-    This program is distributed in the hope that it will be useful,
-    but WITHOUT ANY WARRANTY; without even the implied warranty of
-    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-    GNU General Public License for more details.
-
-    You should have received a copy of the GNU General Public License
-    along with this program; if not, write to the Free Software
-    Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
-
- ****************************************************************************
-}
-
-{****************************************************************************
-                                 TNODE
- ****************************************************************************}
-
-    constructor tnode.init;
-
-      begin
-         inherited init;
-         treetype:=nothingn;
-         { this allows easier error tracing }
-         location.loc:=LOC_INVALID;
-         { save local info }
-         fileinfo:=aktfilepos;
-         localswitches:=aktlocalswitches;
-         resulttype:=nil;
-         registersint:=0;
-         registersfpu:=0;
-{$ifdef SUPPORT_MMX}
-         registersmmx:=0;
-{$endif SUPPORT_MMX}
-         flags:=[];
-      end;
-
-    destructor tnode.done;
-
-      begin
-         { reference info }
-         if (location.loc in [LOC_MEM,LOC_REFERENCE]) and
-            assigned(location.reference.symbol) then
-           dispose(location.reference.symbol,done);
-{$ifdef EXTDEBUG}
-         if firstpasscount>maxfirstpasscount then
-            maxfirstpasscount:=firstpasscount;
-{$endif EXTDEBUG}
-      end;
-
-    procedure tnode.pass_1;
-
-      begin
-         if not(assigned(resulttype)) then
-           det_resulttype;
-
-         det_temp;
-      end;
-
-    procedure tnode.det_resulttype;
-
-      begin
-         abstract;
-      end;
-
-    procedure tnode.det_temp;
-
-      begin
-         abstract;
-      end;
-
-    procedure tnode.secondpass;
-
-      begin
-         abstract;
-      end;
-
-    procedure tnode.concattolist(l : plinkedlist);
-
-      begin
-         l^.concat(@self);
-      end;
-
-    function tnode.ischild(p : pnode) : boolean;
-
-      begin
-         ischild:=false;
-      end;
-
-{$ifdef EXTDEBUG}
-    procedure tnode.dowrite;
-
-      const treetype2str : array[ttreetyp] of string[20] = (
-          'addn',
-          'muln',
-          'subn',
-          'divn',
-          'symdifn',
-          'modn',
-          'assignn',
-          'loadn',
-          'rangen',
-          'ltn',
-          'lten',
-          'gtn',
-          'gten',
-          'equaln',
-          'unequaln',
-          'inn',
-          'orn',
-          'xorn',
-          'shrn',
-          'shln',
-          'slashn',
-          'andn',
-          'subscriptn',
-          'derefn',
-          'addrn',
-          'doubleaddrn',
-          'ordconstn',
-          'typeconvn',
-          'calln',
-          'callparan',
-          'realconstn',
-          'fixconstn',
-          'umminusn',
-          'asmn',
-          'vecn',
-          'stringconstn',
-          'funcretn',
-          'selfn',
-          'notn',
-          'inlinen',
-          'niln',
-          'errorn',
-          'typen',
-          'hnewn',
-          'hdisposen',
-          'newn',
-          'simpledisposen',
-          'setelementn',
-          'setconstn',
-          'blockn',
-          'statementn',
-          'loopn',
-          'ifn',
-          'breakn',
-          'continuen',
-          'repeatn',
-          'whilen',
-          'forn',
-          'exitn',
-          'withn',
-          'casen',
-          'labeln',
-          'goton',
-          'simplenewn',
-          'tryexceptn',
-          'raisen',
-          'switchesn',
-          'tryfinallyn',
-          'onn',
-          'isn',
-          'asn',
-          'caretn',
-          'failn',
-          'starstarn',
-          'procinlinen',
-          'arrayconstructn',
-          'arrayconstructrangen',
-          'nothingn',
-          'loadvmtn',
-          'pointerconstn');
-
-      begin
-         write(indention,'(',treetype2str[treetype]);
-      end;
-{$endif EXTDEBUG}
-
-{****************************************************************************
-                                 TUNARYNODE
- ****************************************************************************}
-
-    constructor tunarynode.init(l : pnode);
-
-      begin
-         inherited init;
-         left:=l;
-      end;
-
-{$ifdef extdebug}
-    procedure tunarynode.dowrite;
-
-      begin
-         inherited dowrite;
-         writeln(',');
-         writenode(left);
-         writeln(')');
-         dec(byte(indention[0]),2);
-      end;
-{$endif}
-
-    procedure tunarynode.concattolist(l : plinkedlist);
-
-      begin
-         left^.parent:=@self;
-         left^.concattolist(l);
-         inherited concattolist(l);
-      end;
-
-    function tunarynode.ischild(p : pnode) : boolean;
-
-      begin
-         ischild:=p=left;
-      end;
-
-    procedure tunarynode.det_resulttype;
-
-      begin
-         left^.det_resulttype;
-      end;
-
-    procedure tunarynode.det_temp;
-
-      begin
-         left^.det_temp;
-      end;
-
-{****************************************************************************
-                            TBINARYNODE
- ****************************************************************************}
-
-    constructor tbinarynode.init(l,r : pnode);
-
-      begin
-         inherited init(l);
-         right:=r
-      end;
-
-    procedure tbinarynode.concattolist(l : plinkedlist);
-
-      begin
-         { we could change that depending on the number of }
-         { required registers                              }
-         left^.parent:=@self;
-         left^.concattolist(l);
-         left^.parent:=@self;
-         left^.concattolist(l);
-         inherited concattolist(l);
-      end;
-
-    function tbinarynode.ischild(p : pnode) : boolean;
-
-      begin
-         ischild:=(p=right) or (p=right);
-      end;
-
-    procedure tbinarynode.det_resulttype;
-
-      begin
-         left^.det_resulttype;
-         right^.det_resulttype;
-      end;
-
-    procedure tbinarynode.det_temp;
-
-      begin
-         left^.det_temp;
-         right^.det_temp;
-      end;
-
-{****************************************************************************
-                            TBINOPYNODE
- ****************************************************************************}
-
-    constructor tbinopnode.init(l,r : pnode);
-
-      begin
-         inherited init(l,r);
-         swaped:=false;
-      end;
-
-{
-  $Log$
-  Revision 1.2  2000-07-13 11:32:54  michael
-  + removed logs
- 
-}

+ 0 - 118
compiler/new/nodeh.inc

@@ -1,118 +0,0 @@
-{
-    $Id$
-    Copyright (c) 1999-2000 by Florian Klaempfl
-
-    The declarations of the nodes for the new code generator
-
-    This program is free software; you can redistribute it and/or modify
-    it under the terms of the GNU General Public License as published by
-    the Free Software Foundation; either version 2 of the License, or
-    (at your option) any later version.
-
-    This program is distributed in the hope that it will be useful,
-    but WITHOUT ANY WARRANTY; without even the implied warranty of
-    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-    GNU General Public License for more details.
-
-    You should have received a copy of the GNU General Public License
-    along with this program; if not, write to the Free Software
-    Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
-
- ****************************************************************************
-}
-    type
-       tnodeflags = (nf_needs_truefalselabel,tf_callunique);
-
-       tnodeflagset = set of tnodeflags;
-
-       pnode = ^tnode;
-       tnode = object(tlinkedlist_item)
-          treetype : ttreetyp;
-          { the location of the result of this node }
-          location : tlocation;
-          { do we need to parse childs to set var state }
-          varstateset : boolean;
-          { the parent node of this is node    }
-          { this field is set by concattolist  }
-          parent : pnode;
-          { there are some properties about the node stored }
-          flags : tnodeflagset;
-          { the number of registers needed to evalute the node }
-          registersint,registersfpu : longint;  { must be longint !!!! }
-{$ifdef SUPPORT_MMX}
-          registersmmx,registerskni : longint;
-{$endif SUPPORT_MMX}
-          resulttype : pdef;
-          fileinfo : tfileposinfo;
-          localswitches : tlocalswitches;
-{$ifdef extdebug}
-          firstpasscount : longint;
-{$endif extdebug}
-          error : boolean;
-          list : paasmoutput;
-          constructor init;
-          destructor done;virtual;
-          { runs det_resulttype and det_temp }
-          procedure pass_1;
-          { dermines the resulttype of the node }
-          procedure det_resulttype;virtual;
-          { dermines the number of necessary temp. locations to evaluate
-            the node }
-          procedure det_temp;virtual;
-          procedure secondpass;virtual;
-{$ifdef EXTDEBUG}
-          { writes a node for debugging purpose, shouldn't be called }
-          { direct, because there is no test for nil, use writenode  }
-          { to write a complete tree                                 }
-          procedure dowrite;virtual;
-{$endif EXTDEBUG}
-          procedure concattolist(l : plinkedlist);virtual;
-          function ischild(p : pnode) : boolean;virtual;
-       end;
-
-       { this node is the anchestor for all classes with at least }
-       { one child, you have to use it if you want to use         }
-       { true- and falselabel                                     }
-       punarynode = ^tunarynode;
-       tunarynode = object(tnode)
-          left : pnode;
-          truelabel,falselabel : pasmlabel;
- {$ifdef extdebug}
-          procedure dowrite;virtual;
- {$endif extdebug}
-          constructor init(l : pnode);
-          procedure concattolist(l : plinkedlist);virtual;
-          function ischild(p : pnode) : boolean;virtual;
-          procedure det_resulttype;virtual;
-          procedure det_temp;virtual;
-       end;
-
-       pbinarynode = ^tbinarynode;
-       tbinarynode = object(tunarynode)
-          right : pnode;
-          constructor init(l,r : pnode);
-          procedure concattolist(l : plinkedlist);virtual;
-          function ischild(p : pnode) : boolean;virtual;
-          procedure det_resulttype;virtual;
-          procedure det_temp;virtual;
-       end;
-
-       pvecnode = ^tvecnode;
-       tvecnode = object(tbinarynode)
-       end;
-
-
-       pbinopnode = ^tbinopnode;
-       tbinopnode = object(tbinarynode)
-          { is true, if the right and left operand are swaped }
-          { against the original order                        }
-          swaped : boolean;
-          constructor init(l,r : pnode);
-       end;
-
-{
-  $Log$
-  Revision 1.2  2000-07-13 11:32:55  michael
-  + removed logs
- 
-}