[PATCH] D30809: [coroutines] Add codegen for await and yield expressions

Gor Nishanov via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Sat Mar 11 18:56:29 PST 2017


GorNishanov marked 4 inline comments as done.
GorNishanov added inline comments.


================
Comment at: lib/CodeGen/CGCoroutine.cpp:32
 
 struct CGCoroData {
+  AwaitKind CurrentAwaitKind = AwaitKind::Init;
----------------
majnemer wrote:
> Shouldn't this struct be in an anonymous namespace?
It is forward declared in CodeGenFunction.h and CodeGenFunction class holds a unique_ptr to CGCoroData as a member.
Here is the snippet from CodeGenFunction.h:

```
  // Holds coroutine data if the current function is a coroutine. We use a
  // wrapper to manage its lifetime, so that we don't have to define CGCoroData
  // in this header.
  struct CGCoroInfo {
    std::unique_ptr<CGCoroData> Data;
    CGCoroInfo();
    ~CGCoroInfo();
  };
  CGCoroInfo CurCoro;
```


https://reviews.llvm.org/D30809





More information about the cfe-commits mailing list