summaryrefslogtreecommitdiff
path: root/compiler/mips
diff options
context:
space:
mode:
authorpierre <pierre@3ad0048d-3df7-0310-abae-a5850022a9f2>2012-06-12 22:53:19 +0000
committerpierre <pierre@3ad0048d-3df7-0310-abae-a5850022a9f2>2012-06-12 22:53:19 +0000
commit92d4ee7947001479273dfea55475d70f9fe176d2 (patch)
treecc1a37a925bde6f27d822ec68e3c5974288b7f15 /compiler/mips
parentab7726d9e123ef6083de3f6877a517e220930f02 (diff)
downloadfpc-92d4ee7947001479273dfea55475d70f9fe176d2.tar.gz
+ computed_local_size new longint field in TMIPSProcInfo
to check that LocalSize stays constant. New function mips_extra_offset (needed for stabs debugging) git-svn-id: http://svn.freepascal.org/svn/fpc/trunk@21585 3ad0048d-3df7-0310-abae-a5850022a9f2
Diffstat (limited to 'compiler/mips')
-rw-r--r--compiler/mips/cpupi.pas24
1 files changed, 22 insertions, 2 deletions
diff --git a/compiler/mips/cpupi.pas b/compiler/mips/cpupi.pas
index 03cfa17f6c..486e17993d 100644
--- a/compiler/mips/cpupi.pas
+++ b/compiler/mips/cpupi.pas
@@ -27,7 +27,7 @@ interface
uses
cutils,
- globtype,
+ globtype,symdef,
procinfo,cpuinfo,cpupara,
psub;
@@ -42,15 +42,20 @@ interface
floatregssave : byte;
register_used : tparasupregsused;
register_offset : tparasupregsoffset;
+ computed_local_size : longint;
constructor create(aparent:tprocinfo);override;
function calc_stackframe_size:longint;override;
procedure set_first_temp_offset;override;
end;
+ { Used by Stabs debug info generator }
+
+ function mips_extra_offset(procdef : tprocdef) : longint;
+
implementation
uses
- systems,globals,
+ systems,globals,verbose,
cpubase,cgbase,cgobj,
tgobj,paramgr,symconst;
@@ -67,6 +72,7 @@ implementation
floatregssave:=11;
intregssave:=10;
+ computed_local_size:=-1;
end;
@@ -93,8 +99,22 @@ implementation
intregstart:=result;
inc(result,intregssave*4);
result:=Align(tg.lasttemp,max(current_settings.alignment.localalignmin,8));
+ if computed_local_size=-1 then
+ begin
+ computed_local_size:=result;
+ procdef.total_local_size:=result;
+ end
+ else if computed_local_size <> result then
+ Comment(V_Warning,'TMIPSProcInfo.calc_stackframe_size result changed');
end;
+ function mips_extra_offset(procdef : tprocdef) : longint;
+ begin
+ if procdef=nil then
+ mips_extra_offset:=0
+ else
+ mips_extra_offset:=procdef.total_local_size;
+ end;
begin
cprocinfo:=TMIPSProcInfo;