You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
- apply suggestions from code review
- include note about backends no overriding `va_end` and `va_copy` in
the doc comment.
- link to where `va_copy` is lowered to `memcpy`
Co-authored-by: Ralf Jung <post@ralfj.de>
Copy file name to clipboardExpand all lines: library/core/src/ffi/va_list.rs
+20-6Lines changed: 20 additions & 6 deletions
Original file line number
Diff line number
Diff line change
@@ -34,6 +34,10 @@ use crate::marker::PhantomCovariantLifetime;
34
34
//
35
35
// The Clang `BuiltinVaListKind` enumerates the `va_list` variations that Clang supports,
36
36
// and we mirror these here.
37
+
//
38
+
// For all current LLVM targets, `va_copy` lowers to `memcpy`. Hence the inner structs below all
39
+
// derive `Copy`. However, in the future we might want to support a target where `va_copy`
40
+
// allocates, or otherwise violates the requirements of `Copy`. Therefore `VaList` is only `Clone`.
37
41
crate::cfg_select! {
38
42
all(
39
43
target_arch = "aarch64",
@@ -45,6 +49,8 @@ crate::cfg_select! {
45
49
///
46
50
/// See the [AArch64 Procedure Call Standard] for more details.
47
51
///
52
+
/// `va_copy` is `memcpy`: <https://github.com/llvm/llvm-project/blob/5aee01a3df011e660f26660bc30a8c94a1651d8e/llvm/lib/Target/AArch64/AArch64ISelLowering.cpp#L12682-L12700>
/// See the [LLVM source] and [GCC header] for more details.
64
70
///
71
+
/// `va_copy` is `memcpy`: <https://github.com/llvm/llvm-project/blob/5aee01a3df011e660f26660bc30a8c94a1651d8e/llvm/lib/Target/PowerPC/PPCISelLowering.cpp#L3755-L3764>
/// See the [S/390x ELF Application Binary Interface Supplement] for more details.
83
91
///
92
+
/// `va_copy` is `memcpy`: <https://github.com/llvm/llvm-project/blob/5aee01a3df011e660f26660bc30a8c94a1651d8e/llvm/lib/Target/SystemZ/SystemZISelLowering.cpp#L4457-L4472>
/// See the [System V AMD64 ABI] for more details.
100
110
///
111
+
/// `va_copy` is `memcpy`: <https://github.com/llvm/llvm-project/blob/5aee01a3df011e660f26660bc30a8c94a1651d8e/llvm/lib/Target/X86/X86ISelLowering.cpp#26319>
112
+
/// (github won't render that file, look for `SDValue LowerVACOPY`)
/// `va_copy` is `memcpy`: <https://github.com/llvm/llvm-project/blob/5aee01a3df011e660f26660bc30a8c94a1651d8e/llvm/lib/Target/Xtensa/XtensaISelLowering.cpp#L1260>
/// See the [LLVM source] for more details. On bare metal Hexagon uses an opaque pointer.
134
149
///
150
+
/// `va_copy` is `memcpy`: <https://github.com/llvm/llvm-project/blob/5aee01a3df011e660f26660bc30a8c94a1651d8e/llvm/lib/Target/Hexagon/HexagonISelLowering.cpp#L1087-L1102>
0 commit comments