<div dir="ltr">Yes, it does seem more logical.<div><br></div><div>Unfortunately, this is not possible, at least with the current state of LLVM. Note in particular that <i>function calls</i> are also handled specially by the clang frontend for many architectures. On the LLVM side, there's not enough information to properly represent the function call convention for many architectures, as the calling conventions depend on C type information, and after converting the C types into LLVM types, some of the necessary information has been lost.<div><br></div><div>I think it would be great to move more of the calling convention logic down to LLVM -- and I have some half-baked ideas on how it could be done without pushing the entire C type system down. But, it's certainly not trivial.</div></div></div><div class="gmail_extra"><br><div class="gmail_quote">On Wed, Jan 27, 2016 at 8:11 AM, Gaël Jobin via llvm-dev <span dir="ltr"><<a href="mailto:llvm-dev@lists.llvm.org" target="_blank">llvm-dev@lists.llvm.org</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Hi all,<br>
<br>
I was playing with varargs and was wondering why the va_list variable<br>
in C is lowered by the frontend to a *i8 (x86) or a struct (x86_64)? I<br>
mean, if it depends on the architecture, it is more logical to have an<br>
IR intrinsic for va_list and let the backend lowering it to the right<br>
type. <br>
<br>
Regards,<br>
Gaël<br>
_______________________________________________<br>
LLVM Developers mailing list<br>
<a href="mailto:llvm-dev@lists.llvm.org">llvm-dev@lists.llvm.org</a><br>
<a href="http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev" rel="noreferrer" target="_blank">http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev</a><br>
</blockquote></div><br></div>