+ 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 -
This commit is contained in:
nickysn 2014-04-13 15:17:43 +00:00
parent 86b9a0eed1
commit d8d3706462

View File

@ -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;