[Coroutines] Define __coro_frame_ty in function scope
authorHongtao Yu <hoy@fb.com>
Fri, 25 Jun 2021 18:35:02 +0000 (11:35 -0700)
committerHongtao Yu <hoy@fb.com>
Fri, 25 Jun 2021 19:33:20 +0000 (12:33 -0700)
commit3638085ff01332afbd2eb555a32821802f0643c8
tree03f6fe649a789e96cf9b0a4f8d4ee948920b081f
parent34a164c93857f609862d74455d6801fe482ead8a
[Coroutines] Define __coro_frame_ty in function scope

Types should be defined in function scope instead of a local lexical scope. Field types should be defined inside in its parent type scope.

We were seeing a type defined in a local scope causing trouble to the dwarf emitter where a context is required to be a funciton scope, a namespace or a global scope.

Reviewed By: aprantl

Differential Revision: https://reviews.llvm.org/D104937
llvm/lib/Transforms/Coroutines/CoroFrame.cpp
llvm/test/Transforms/Coroutines/coro-debug-coro-frame.ll