Przeglądaj źródła

+ override hlcg.a_call_name for i8086 and dispatch to the appropriate type of
call (near or far), according to whether the procdef is near or far, instead
of relying on the default for the memory model

git-svn-id: trunk@27562 -

nickysn 11 lat temu
rodzic
commit
d8d3706462
1 zmienionych plików z 15 dodań i 3 usunięć
  1. 15 3
      compiler/i8086/hlcgcpu.pas

+ 15 - 3
compiler/i8086/hlcgcpu.pas

@@ -29,7 +29,7 @@ unit hlcgcpu;
 interface
 
   uses
-    globals,
+    globals,globtype,
     aasmdata,
     symtype,symdef,parabase,
     cgbase,cgutils,
@@ -67,6 +67,8 @@ interface
 
       procedure reference_reset_base(var ref: treference; regsize: tdef; reg: tregister; offset, alignment: longint); override;
 
+      function a_call_name(list : TAsmList;pd : tprocdef;const s : TSymStr; forceresdef: tdef; weak: boolean): tcgpara;override;
+
       procedure a_load_loc_ref(list : TAsmList;fromsize, tosize: tdef; const loc: tlocation; const ref : treference);override;
       procedure a_loadaddr_ref_reg(list : TAsmList;fromsize, tosize : tdef;const ref : treference;r : tregister);override;
 
@@ -81,11 +83,11 @@ interface
 implementation
 
   uses
-    globtype,verbose,
+    verbose,
     paramgr,
     cpubase,cpuinfo,tgobj,cgobj,cgcpu,
     defutil,
-    symconst,
+    symconst,symcpu,
     procinfo,
     aasmcpu;
 
@@ -256,6 +258,16 @@ implementation
     end;
 
 
+  function thlcgcpu.a_call_name(list: TAsmList; pd: tprocdef; const s: TSymStr; forceresdef: tdef; weak: boolean): tcgpara;
+    begin
+      if is_proc_far(pd) then
+        tcg8086(cg).a_call_name_far(list,s,weak)
+      else
+        tcg8086(cg).a_call_name_near(list,s,weak);
+      result:=get_call_result_cgpara(pd,forceresdef);
+    end;
+
+
   procedure thlcgcpu.a_load_loc_ref(list: TAsmList; fromsize, tosize: tdef; const loc: tlocation; const ref: treference);
     var
       tmpref: treference;