[llvm] [LangRef] allow omitting `va_end` (PR #203087)

via llvm-commits llvm-commits at lists.llvm.org
Wed Jun 10 12:50:15 PDT 2026


llvmorg-github-actions[bot] wrote:


<!--LLVM PR SUMMARY COMMENT-->

@llvm/pr-subscribers-llvm-ir

Author: Folkert de Vries (folkertdev)

<details>
<summary>Changes</summary>

In Rust we'd like to be able to omit `va_end`: it is a no-op on all currently supported targets, and the requirement that it is paired exactly with `va_start` and `va_copy` (in the same frame) cannot be unified with a language with move semantics.

cc https://github.com/rust-lang/rust/pull/157627 https://github.com/rust-lang/rust/pull/155697

---
Full diff: https://github.com/llvm/llvm-project/pull/203087.diff


1 Files Affected:

- (modified) llvm/docs/LangRef.rst (+6-3) 


``````````diff
diff --git a/llvm/docs/LangRef.rst b/llvm/docs/LangRef.rst
index cf052513c5ef8..fa363f77c4485 100644
--- a/llvm/docs/LangRef.rst
+++ b/llvm/docs/LangRef.rst
@@ -14631,10 +14631,13 @@ Semantics:
 
 The '``llvm.va_end``' intrinsic works just like the ``va_end`` macro
 available in C. In a target-dependent way, it destroys the ``va_list``
-element to which the argument points. Calls to
+element to which the argument points. Calls to ``llvm.va_end`` can be
+omitted when they are a no-op for the given target. ``llvm.va_end``
+is a no-op for all currently supported targets.
+
+When used, calls to ``llvm.va_end`` must be matched exactly with calls to
 :ref:`llvm.va_start <int_va_start>` and
-:ref:`llvm.va_copy <int_va_copy>` must be matched exactly with calls to
-``llvm.va_end``.
+:ref:`llvm.va_copy <int_va_copy>`.
 
 .. _int_va_copy:
 

``````````

</details>


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


More information about the llvm-commits mailing list