Jelajahi Sumber

- removed GetHigh, GetNextReg, GetLastReg, GetOffsetReg and GetOffsetReg64 from cpubase. The methods
in cg should be used instead, because they do better error checking on the register used.

git-svn-id: trunk@45147 -

nickysn 5 tahun lalu
induk
melakukan
69c95115f6
2 mengubah file dengan 1 tambahan dan 47 penghapusan
  1. 0 46
      compiler/z80/cpubase.pas
  2. 1 1
      compiler/z80/nz80mem.pas

+ 0 - 46
compiler/z80/cpubase.pas

@@ -288,19 +288,6 @@ unit cpubase;
     function dwarf_reg_no_error(r:tregister):shortint;
     function eh_return_data_regno(nr: longint): longint;
 
-    function GetHigh(const r : TRegister) : TRegister;
-
-    { returns the next virtual register }
-    function GetNextReg(const r : TRegister) : TRegister;
-
-    { returns the last virtual register }
-    function GetLastReg(const r : TRegister) : TRegister;
-
-    { returns the register with the offset of ofs of a continuous set of register starting with r }
-    function GetOffsetReg(const r : TRegister;ofs : shortint) : TRegister;
-    { returns the register with the offset of ofs of a continuous set of register starting with r and being continued with rhi }
-    function GetOffsetReg64(const r,rhi: TRegister;ofs : shortint): TRegister;
-
     function is_calljmp(o:tasmop):boolean;{$ifdef USEINLINE}inline;{$endif USEINLINE}
 
   implementation
@@ -464,39 +451,6 @@ unit cpubase;
       end;
 
 
-    function GetHigh(const r : TRegister) : TRegister;
-      begin
-        result:=TRegister(longint(r)+1)
-      end;
-
-
-    function GetNextReg(const r: TRegister): TRegister;
-      begin
-        result:=TRegister(longint(r)+1);
-      end;
-
-
-    function GetLastReg(const r: TRegister): TRegister;
-      begin
-        result:=TRegister(longint(r)-1);
-      end;
-
-
-    function GetOffsetReg(const r: TRegister;ofs : shortint): TRegister;
-      begin
-        result:=TRegister(longint(r)+ofs);
-      end;
-
-
-    function GetOffsetReg64(const r,rhi: TRegister;ofs : shortint): TRegister;
-      begin
-        if ofs>3 then
-          result:=TRegister(longint(rhi)+ofs-4)
-        else
-          result:=TRegister(longint(r)+ofs);
-      end;
-
-
     function is_calljmp(o:tasmop):boolean;{$ifdef USEINLINE}inline;{$endif USEINLINE}
       begin
         is_calljmp:= o in call_jmp_instructions;

+ 1 - 1
compiler/z80/nz80mem.pas

@@ -60,7 +60,7 @@ implementation
               location.register:=cg.getintregister(current_asmdata.CurrAsmList,OS_16);
               cg.a_load_reg_reg(current_asmdata.CurrAsmList,OS_8,OS_8,NR_L,location.register);
               cg.ungetcpuregister(current_asmdata.CurrAsmList,NR_L);
-              cg.a_load_reg_reg(current_asmdata.CurrAsmList,OS_8,OS_8,NR_H,GetNextReg(location.register));
+              cg.a_load_reg_reg(current_asmdata.CurrAsmList,OS_8,OS_8,NR_H,cg.GetNextReg(location.register));
               cg.ungetcpuregister(current_asmdata.CurrAsmList,NR_H);
             end;
         end;