Browse Source

* converted tcgtypeconvnode.second_nil_to_methodprocvar to the high level code
generator, so it handles i8086 near and far pointers generically
- removed t8086typeconvnode.second_nil_to_methodprocvar, since it's no longer
necessary

git-svn-id: trunk@27678 -

nickysn 11 years ago
parent
commit
e8b9d9bf41
2 changed files with 4 additions and 31 deletions
  1. 0 27
      compiler/i8086/n8086cnv.pas
  2. 4 4
      compiler/ncgcnv.pas

+ 0 - 27
compiler/i8086/n8086cnv.pas

@@ -36,7 +36,6 @@ interface
        protected
          function typecheck_proc_to_procvar: tnode;override;
          procedure second_proc_to_procvar;override;
-         procedure second_nil_to_methodprocvar;override;
        end;
 
 
@@ -73,32 +72,6 @@ implementation
       end;
 
 
-    procedure t8086typeconvnode.second_nil_to_methodprocvar;
-      begin
-        location_reset(location,LOC_REGISTER,def_cgsize(resultdef));
-        if current_settings.x86memorymodel in x86_far_data_models then
-          begin
-            location.registerhi:=cg.getintregister(current_asmdata.currasmlist,OS_32);
-            cg.a_load_const_reg(current_asmdata.currasmlist,OS_32,0,location.registerhi);
-          end
-        else
-          begin
-            location.registerhi:=cg.getaddressregister(current_asmdata.currasmlist);
-            cg.a_load_const_reg(current_asmdata.currasmlist,OS_ADDR,0,location.registerhi);
-          end;
-        if (resultdef.typ=procvardef) and is_proc_far(tprocvardef(resultdef)) then
-          begin
-            location.register:=cg.getintregister(current_asmdata.currasmlist,OS_32);
-            cg.a_load_const_reg(current_asmdata.currasmlist,OS_32,0,location.register);
-          end
-        else
-          begin
-            location.register:=cg.getaddressregister(current_asmdata.currasmlist);
-            cg.a_load_const_reg(current_asmdata.currasmlist,OS_ADDR,0,location.register);
-          end;
-      end;
-
-
 begin
   ctypeconvnode:=t8086typeconvnode
 end.

+ 4 - 4
compiler/ncgcnv.pas

@@ -583,10 +583,10 @@ interface
     procedure Tcgtypeconvnode.second_nil_to_methodprocvar;
     begin
       location_reset(location,LOC_REGISTER,def_cgsize(resultdef));
-      location.registerhi:=cg.getaddressregister(current_asmdata.currasmlist);
-      cg.a_load_const_reg(current_asmdata.currasmlist,OS_ADDR,0,location.registerhi);
-      location.register:=cg.getaddressregister(current_asmdata.currasmlist);
-      cg.a_load_const_reg(current_asmdata.currasmlist,OS_ADDR,0,location.register);
+      location.registerhi:=hlcg.getaddressregister(current_asmdata.currasmlist,voidpointertype);
+      hlcg.a_load_const_reg(current_asmdata.currasmlist,voidpointertype,0,location.registerhi);
+      location.register:=hlcg.getaddressregister(current_asmdata.currasmlist,voidcodepointertype);
+      hlcg.a_load_const_reg(current_asmdata.currasmlist,voidcodepointertype,0,location.register);
     end;
 
     procedure tcgtypeconvnode.second_bool_to_int;