[llvm] [LangRef] Clarifying the copying behaviour of byval (PR #205576)

Ralf Jung via llvm-commits llvm-commits at lists.llvm.org
Thu Jun 25 09:09:47 PDT 2026


================
@@ -1357,7 +1357,11 @@ Currently, only the following parameter attributes are defined:
     ``byval`` parameters). This is not a valid attribute for return
     values.
 
-    The byval type argument indicates the in-memory value type.
+    The byval type argument is only used for its allocation size and alignment
----------------
RalfJung wrote:

I see. The LangRef does not define that term, does it?

And it does use "allocation size" in the way I understood it, when talking about `realloc`:
> “realloc”: the function returns a new block of memory or null. If the result is non-null the memory contents from the start of the block up to the smaller of the original allocation size and the new allocation size will match that of the allocptr argument and the allocptr argument is invalidated, even if the function returns the same address.

https://github.com/llvm/llvm-project/pull/205576


More information about the llvm-commits mailing list