From 70fc5dcee336fe2177e45805a0e07b2ea5763b74 Mon Sep 17 00:00:00 2001
From: Jonas Maebe <jonas@freepascal.org>
Date: Mon, 23 Feb 2015 22:53:29 +0000
Subject: [PATCH]   * don't pass TP-style objects as HFA or similar, because
 the calling     convention code is triggered before the object structure has
 been     finalised, so the result can be different in the interface and    
 implementation. To solve this, something like r20161 has to be    
 implemented for TP-style objects

git-svn-id: trunk@29930 -
---
 compiler/aarch64/cpupara.pas | 17 +++--------------
 1 file changed, 3 insertions(+), 14 deletions(-)

diff --git a/compiler/aarch64/cpupara.pas b/compiler/aarch64/cpupara.pas
index f6f8c841e2..41a5f72862 100644
--- a/compiler/aarch64/cpupara.pas
+++ b/compiler/aarch64/cpupara.pas
@@ -131,12 +131,8 @@ unit cpupara;
               inc(elecount);
               result:=true;
             end;
-          recorddef,
-          objectdef:
+          recorddef:
             begin
-              if (p.typ=objectdef) and
-                 not is_object(p) then
-                exit;
               for i:=0 to tabstractrecorddef(p).symtable.symlist.count-1 do
                 begin
                   sym:=tsym(tabstractrecorddef(p).symtable.symlist[i]);
@@ -197,11 +193,7 @@ unit cpupara;
               else
                 getparaloc:=LOC_MMREGISTER;
             objectdef:
-              if not is_object(p) or
-                 not is_hfa(p,hfabasedef) then
-                getparaloc:=LOC_REGISTER
-              else
-                getparaloc:=LOC_MMREGISTER;
+              getparaloc:=LOC_REGISTER;
             stringdef:
               if is_shortstring(p) or is_longstring(p) then
                 getparaloc:=LOC_REFERENCE
@@ -241,10 +233,7 @@ unit cpupara;
           end;
         case def.typ of
           objectdef:
-            result:=
-              is_object(def) and
-              not is_hfa(def,hfabasedef) and
-              (def.size>16);
+            result:=is_object(def);
           recorddef:
             { ABI: any composite > 16 bytes that not a hfa/hva
               Special case: MWPascal, which passes all const parameters by