[PATCH] D34475: [AArch64] Add support for __builtin_ms_va_list on aarch64
Martin Storsjö via Phabricator via cfe-commits
cfe-commits at lists.llvm.org
Thu Jul 13 13:20:59 PDT 2017
mstorsjo 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")
----------------
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.
================
Comment at: include/clang/Basic/Specifiers.h:239
CC_X86Pascal, // __attribute__((pascal))
CC_X86_64Win64, // __attribute__((ms_abi))
CC_X86_64SysV, // __attribute__((sysv_abi))
----------------
rnk wrote:
> I think we might prefer to make this non-x86_64 specific. I suspect that this pattern will arise again on ARM32 if anyone goes back there in seriousness. We'll probably want sysv_abi as well as ms_abi, and all the logic should be independent of the ISA: ms_abi is a no-op when the target OS is already Windows, and sysv_abi is a no-op when the target OS isn't Windows.
FWIW, we already support ARM32 for windows, and there, varargs are identical to other platforms.
Extending this to all platforms probably also makes sense (although I'm a little weary about how it would work for signaling down to the LLVM IR).
https://reviews.llvm.org/D34475
More information about the cfe-commits
mailing list