Bladeren bron

* llvm: only set custom parameter alignments for byval parameters, the rest
is handled automatically by llvm (and since llvm 11.0 you get an error if
you specify an alignment for them anyway)

git-svn-id: trunk@48100 -

Jonas Maebe 4 jaren geleden
bovenliggende
commit
80282d6eff
1 gewijzigde bestanden met toevoegingen van 5 en 4 verwijderingen
  1. 5 4
      compiler/llvm/hlcgllvm.pas

+ 5 - 4
compiler/llvm/hlcgllvm.pas

@@ -477,10 +477,6 @@ implementation
           begin
             new(callpara);
             callpara^.def:=paraloc^.def;
-            if firstparaloc then
-              callpara^.alignment:=paras[i]^.Alignment
-            else
-              callpara^.alignment:=std_param_align;
             { if the paraloc doesn't contain the value itself, it's a byval
               parameter }
             if paraloc^.retvalloc then
@@ -493,6 +489,11 @@ implementation
                 callpara^.sret:=false;
                 callpara^.byval:=not paraloc^.llvmvalueloc;
               end;
+            if firstparaloc and
+               callpara^.byval then
+              callpara^.alignment:=paras[i]^.Alignment
+            else
+              callpara^.alignment:=std_param_align;
             llvmextractvalueextinfo(paras[i]^.def, callpara^.def, callpara^.valueext);
             case paraloc^.llvmloc.loc of
               LOC_CONSTANT: