Ver Fonte

* specify the "byval" attribute also at the caller side

git-svn-id: trunk@34301 -
Jonas Maebe há 9 anos atrás
pai
commit
819f0c39fa
3 ficheiros alterados com 6 adições e 0 exclusões
  1. 1 0
      compiler/llvm/aasmllvm.pas
  2. 2 0
      compiler/llvm/agllvm.pas
  3. 3 0
      compiler/llvm/hlcgllvm.pas

+ 1 - 0
compiler/llvm/aasmllvm.pas

@@ -184,6 +184,7 @@ interface
     tllvmcallpara = record
       def: tdef;
       valueext: tllvmvalueextension;
+      byval: boolean;
       case loc: tcgloc of
         LOC_REFERENCE,
         LOC_REGISTER,

+ 2 - 0
compiler/llvm/agllvm.pas

@@ -244,6 +244,8 @@ implementation
            result:=result+llvmencodetypename(para^.def);
            if para^.valueext<>lve_none then
              result:=result+llvmvalueextension2str[para^.valueext];
+           if para^.byval then
+             result:=result+' byval';
            case para^.loc of
              LOC_REGISTER,
              LOC_FPUREGISTER,

+ 3 - 0
compiler/llvm/hlcgllvm.pas

@@ -440,6 +440,9 @@ implementation
           begin
             new(callpara);
             callpara^.def:=paraloc^.def;
+            { if the paraloc doesn't contain the value itself, it's a byval
+              parameter }
+            callpara^.byval:=not paraloc^.llvmvalueloc;
             llvmextractvalueextinfo(paras[i]^.def, callpara^.def, callpara^.valueext);
             if paraloc^.llvmloc.loc=LOC_CONSTANT then
               begin