Browse Source

* don't write parameter attributes in procvardefs

git-svn-id: trunk@30499 -
Jonas Maebe 10 years ago
parent
commit
af61923dc3
1 changed files with 8 additions and 4 deletions
  1. 8 4
      compiler/llvm/llvmdef.pas

+ 8 - 4
compiler/llvm/llvmdef.pas

@@ -515,7 +515,7 @@ implementation
       end;
       end;
 
 
 
 
-    procedure llvmaddencodedparaloctype(hp: tparavarsym; proccalloption: tproccalloption; withparaname: boolean; var first: boolean; var encodedstr: TSymStr);
+    procedure llvmaddencodedparaloctype(hp: tparavarsym; proccalloption: tproccalloption; withparaname, withattributes: boolean; var first: boolean; var encodedstr: TSymStr);
       var
       var
         paraloc: PCGParaLocation;
         paraloc: PCGParaLocation;
         signext: tllvmvalueextension;
         signext: tllvmvalueextension;
@@ -544,10 +544,14 @@ implementation
           { in case signextstr<>'', there should be only one paraloc -> no need
           { in case signextstr<>'', there should be only one paraloc -> no need
             to clear (reason: it means that the paraloc is larger than the
             to clear (reason: it means that the paraloc is larger than the
             original parameter) }
             original parameter) }
-          encodedstr:=encodedstr+llvmvalueextension2str[signext];
+          if withattributes then
+            encodedstr:=encodedstr+llvmvalueextension2str[signext];
           { sret: hidden pointer for structured function result }
           { sret: hidden pointer for structured function result }
           if vo_is_funcret in hp.varoptions then
           if vo_is_funcret in hp.varoptions then
-            encodedstr:=encodedstr+' sret'
+            begin
+              if withattributes then
+                encodedstr:=encodedstr+' sret'
+            end
           else if not paramanager.push_addr_param(hp.varspez,hp.vardef,proccalloption) and
           else if not paramanager.push_addr_param(hp.varspez,hp.vardef,proccalloption) and
              llvmbyvalparaloc(paraloc) then
              llvmbyvalparaloc(paraloc) then
             encodedstr:=encodedstr+'* byval';
             encodedstr:=encodedstr+'* byval';
@@ -610,7 +614,7 @@ implementation
         for paranr:=0 to def.paras.count-1 do
         for paranr:=0 to def.paras.count-1 do
           begin
           begin
             hp:=tparavarsym(def.paras[paranr]);
             hp:=tparavarsym(def.paras[paranr]);
-            llvmaddencodedparaloctype(hp,def.proccalloption,pddecltype in [lpd_decl],first,encodedstr);
+            llvmaddencodedparaloctype(hp,def.proccalloption,pddecltype in [lpd_decl],not(pddecltype in [lpd_procvar]),first,encodedstr);
           end;
           end;
         if po_varargs in def.procoptions then
         if po_varargs in def.procoptions then
           begin
           begin