From 3e22ec43b50c461dcf4cdc31918b367ce59c09d3 Mon Sep 17 00:00:00 2001 From: nickysn Date: Sun, 19 May 2013 18:37:55 +0000 Subject: [PATCH] + added method TCGPara.locations_count git-svn-id: trunk@24530 - --- compiler/parabase.pas | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/compiler/parabase.pas b/compiler/parabase.pas index 60ffaddadd..4807bea4f6 100644 --- a/compiler/parabase.pas +++ b/compiler/parabase.pas @@ -72,6 +72,8 @@ unit parabase; register : tregister); end; + { TCGPara } + TCGPara = object Def : tdef; { Type of the parameter } Location : PCGParalocation; @@ -88,6 +90,7 @@ unit parabase; procedure check_simple_location; function add_location:pcgparalocation; procedure get_location(var newloc:tlocation); + function locations_count:integer; procedure buildderef; procedure deref; @@ -257,6 +260,20 @@ implementation end; + function TCGPara.locations_count: integer; + var + hlocation: pcgparalocation; + begin + result:=0; + hlocation:=location; + while assigned(hlocation) do + begin + inc(result); + hlocation:=hlocation^.next; + end; + end; + + procedure TCGPara.buildderef; begin defderef.build(def);