[PATCH] D34475: [AArch64] Add support for __builtin_ms_va_list on aarch64

Reid Kleckner via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Thu Jul 13 13:25:37 PDT 2017


rnk added inline comments.


================
Comment at: include/clang/Basic/BuiltinsAArch64.def:65
+// Win64-compatible va_list functions
+BUILTIN(__builtin_ms_va_start, "vc*&.", "nt")
+BUILTIN(__builtin_ms_va_end, "vc*&", "n")
----------------
mstorsjo wrote:
> rnk wrote:
> > I strongly suspect that Microsoft will never adopt a varargs calling convention that uses a complex, non-`char*` va_list.
> > 
> > I'm starting to think we should move this to the generic builtin list and make it available everywhere. The semantics are that you can only use __builtin_ms_va_start in ms_abi functions. It always produces a `char*`-style va_list.
> > 
> Yes, that seems probable.
> 
> I'm a little weary about making this available anywhere though, since it is coupled with the x86_64/aarch64 specific calling convention for lowering va_start, and there we only support it specifically on those two arches.
We should have Sema checking that rejects it when not targeting x64 or aarch64. Ultimately the codegen is shared and simple: just call llvm.va.start.


https://reviews.llvm.org/D34475





More information about the cfe-commits mailing list