فهرست منبع

* handle cdecl varargs parameters in llvm procdef string representations

git-svn-id: branches/hlcgllvm@28355 -
Jonas Maebe 11 سال پیش
والد
کامیت
bae1f72896
1فایلهای تغییر یافته به همراه16 افزوده شده و 0 حذف شده
  1. 16 0
      compiler/llvm/llvmdef.pas

+ 16 - 0
compiler/llvm/llvmdef.pas

@@ -519,6 +519,16 @@ implementation
         signext: tllvmvalueextension;
         usedef: tdef;
       begin
+        if (proccalloption in cdecl_pocalls) and
+           is_array_of_const(hp.vardef) then
+          begin
+            if not first then
+               encodedstr:=encodedstr+', '
+            else
+              first:=false;
+            encodedstr:=encodedstr+'...';
+            exit
+          end;
         paraloc:=hp.paraloc[calleeside].location;
         repeat
           usedef:=paraloc^.def;
@@ -600,6 +610,12 @@ implementation
             hp:=tparavarsym(def.paras[paranr]);
             llvmaddencodedparaloctype(hp,def.proccalloption,pddecltype in [lpd_decl],first,encodedstr);
           end;
+        if po_varargs in def.procoptions then
+          begin
+            if not first then
+              encodedstr:=encodedstr+', ';
+            encodedstr:=encodedstr+'...';
+          end;
         encodedstr:=encodedstr+')'
       end;