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

Bruno Cardoso Lopes via cfe-commits cfe-commits at lists.llvm.org
Thu Sep 21 11:44:19 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 = !{}
+
----------------
bcardosolopes wrote:

Done!

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


More information about the cfe-commits mailing list