diff options
author | jonas <jonas@3ad0048d-3df7-0310-abae-a5850022a9f2> | 2012-07-11 08:25:58 +0000 |
---|---|---|
committer | jonas <jonas@3ad0048d-3df7-0310-abae-a5850022a9f2> | 2012-07-11 08:25:58 +0000 |
commit | cf823b06514b909a94a8183a00c43347cf9c6a5c (patch) | |
tree | 19b4e42b1efc7fb670dd180af27875db4ae2cf78 /compiler/mips/hlcgcpu.pas | |
parent | 3797194d2b12effe232644866acae596455689f6 (diff) | |
download | fpc-cf823b06514b909a94a8183a00c43347cf9c6a5c.tar.gz |
* let thlcg.a_call_name() return the tcgpara representing the function
result location (NR_FUNCTION_RESULT_REG is not valid on all platforms)
o this requires passing the forced function result type (if any) to this
method
o a generic, basic thlcg.a_call_name() is now available that sets the
function result location; can be called by descendants
* the availability under all circumstances of the correct function return
type enables g_call_system_proc() on the JVM platform to now determine
by itself how many stack slots are removed by the call -> do so, instead
of manually counting them (or forgetting to do so and messing up the
maximum evaluation stack height calculations)
git-svn-id: http://svn.freepascal.org/svn/fpc/trunk@21862 3ad0048d-3df7-0310-abae-a5850022a9f2
Diffstat (limited to 'compiler/mips/hlcgcpu.pas')
-rw-r--r-- | compiler/mips/hlcgcpu.pas | 18 |
1 files changed, 10 insertions, 8 deletions
diff --git a/compiler/mips/hlcgcpu.pas b/compiler/mips/hlcgcpu.pas index ad03bee126..a0f243538c 100644 --- a/compiler/mips/hlcgcpu.pas +++ b/compiler/mips/hlcgcpu.pas @@ -32,12 +32,12 @@ uses globtype, aasmbase, aasmdata, cgbase, cgutils, - symdef, - hlcgobj, hlcg2ll; + symtype,symdef, + parabase, hlcgobj, hlcg2ll; type - thlcg2mips = class(thlcg2ll) - procedure a_call_name(list: TAsmList; pd: tprocdef; const s: TSymStr; weak: boolean);override; + thlcgmips = class(thlcg2ll) + function a_call_name(list: TAsmList; pd: tprocdef; const s: TSymStr; forceresdef: tdef; weak: boolean): tcgpara; override; procedure a_call_reg(list : TAsmList;pd : tabstractprocdef;reg : tregister);override; procedure a_call_ref(list : TAsmList;pd : tabstractprocdef;const ref : treference);override; end; @@ -53,7 +53,7 @@ implementation cpubase, cgcpu; - procedure thlcg2mips.a_call_name(list: TAsmList; pd: tprocdef; const s: TSymStr; weak: boolean); + function thlcgmips.a_call_name(list: TAsmList; pd: tprocdef; const s: TSymStr; forceresdef: tdef; weak: boolean): tcgpara; var ref : treference; begin @@ -73,9 +73,11 @@ implementation end else cg.a_call_name(list,s,weak); + { the default implementation only determines the result location } + result:=inherited; end; - procedure thlcg2mips.a_call_reg(list: TAsmList; pd: tabstractprocdef; reg: tregister); + procedure thlcgmips.a_call_reg(list: TAsmList; pd: tabstractprocdef; reg: tregister); begin if (pd.proccalloption=pocall_cdecl) and (reg<>NR_PIC_FUNC) then begin @@ -88,7 +90,7 @@ implementation cg.a_call_reg(list,reg); end; - procedure thlcg2mips.a_call_ref(list: TAsmList; pd: tabstractprocdef; const ref: treference); + procedure thlcgmips.a_call_ref(list: TAsmList; pd: tabstractprocdef; const ref: treference); begin if pd.proccalloption =pocall_cdecl then begin @@ -103,7 +105,7 @@ implementation procedure create_hlcodegen; begin - hlcg:=thlcg2mips.create; + hlcg:=thlcgmips.create; create_codegen; end; |