[clang] [Clang][LLVM][Coroutines] Prevent __coro_gro from outliving __promise (PR #66706)

Chuanqi Xu via cfe-commits cfe-commits at lists.llvm.org
Wed Sep 20 18:59:52 PDT 2023


================
@@ -6691,6 +6691,22 @@ sections that the user does not want removed after linking.
   ...
   !0 = !{}
 
+'``coro.outside.frame``' Metadata
+^^^^^^^^^^^^^^^^^^^^^^
+
+``coro.outside.frame`` metadata may be attached to an alloca instruction to
+to signify that it shouldn't be promoted to the coroutine frame, useful for
+filtering allocas out by the frontend when emitting internal control mechanisms.
+Additionally, this metadata is only used as a flag, so the associated
+node must be empty.
+
+.. code-block:: text
+
+  %__coro_gro = alloca %struct.GroType, align 1, !coro.outside.frame !0
+
+  ...
+  !0 = !{}
+
----------------
ChuanqiXu9 wrote:

Maybe it is better to add this to a new section of  `Coroutines.rst`. We add the coroutines related things there generally.

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


More information about the cfe-commits mailing list