Browse Source

* 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 -

Jonas Maebe 10 years ago
parent
commit
70fc5dcee3
1 changed files with 3 additions and 14 deletions
  1. 3 14
      compiler/aarch64/cpupara.pas

+ 3 - 14
compiler/aarch64/cpupara.pas

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