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

2017-03-26 Thread Gor Nishanov via Phabricator via cfe-commits
GorNishanov closed this revision. GorNishanov added a comment. Commit: r298784 https://reviews.llvm.org/D30809 ___ cfe-commits mailing list cfe-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

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

2017-03-25 Thread Gor Nishanov via Phabricator via cfe-commits
GorNishanov updated this revision to Diff 93061. GorNishanov added a comment. Thank you very much for the review! Merged with the top of the trunk and preparing to land https://reviews.llvm.org/D30809 Files: lib/CodeGen/CGCoroutine.cpp lib/CodeGen/CGExprAgg.cpp lib/CodeGen/CGExprComplex.

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

2017-03-25 Thread John McCall via Phabricator via cfe-commits
rjmccall accepted this revision. rjmccall added a comment. This revision is now accepted and ready to land. Looks great, thanks. https://reviews.llvm.org/D30809 ___ cfe-commits mailing list cfe-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/ma

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

2017-03-20 Thread Gor Nishanov via Phabricator via cfe-commits
GorNishanov marked 2 inline comments as done. GorNishanov added a comment. Looks good now? https://reviews.llvm.org/D30809 ___ cfe-commits mailing list cfe-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

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

2017-03-14 Thread Gor Nishanov via Phabricator via cfe-commits
GorNishanov marked 4 inline comments as done. GorNishanov added inline comments. Comment at: lib/CodeGen/CGCoroutine.cpp:26 +enum class AwaitKind { Init, Normal, Yield, Final }; +char const *AwaitKindStr[] = {"init", "await", "yield", "final"}; +} majnemer wrote:

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

2017-03-14 Thread Gor Nishanov via Phabricator via cfe-commits
GorNishanov updated this revision to Diff 91790. GorNishanov added a comment. - reworked EmitAwait/Yield to has the signature similar to EmitAnyExpr - await expresions now support _Complex types. - s/Suffix/Prefix in buildCoroutineSuffix, since it was actually building a prefix - buildCoroutineSu

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

2017-03-14 Thread John McCall via Phabricator via cfe-commits
rjmccall added inline comments. Comment at: lib/CodeGen/CGCoroutine.cpp:32 struct CGCoroData { + AwaitKind CurrentAwaitKind = AwaitKind::Init; GorNishanov wrote: > majnemer wrote: > > Shouldn't this struct be in an anonymous namespace? > It is forward declare

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

2017-03-13 Thread David Majnemer via Phabricator via cfe-commits
majnemer added inline comments. Comment at: lib/CodeGen/CGCoroutine.cpp:85 + unsigned No = 0; + StringRef AwaitKindStr = 0; + switch (Kind) { I'd just let the default constructor do its thing. https://reviews.llvm.org/D30809 __

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

2017-03-12 Thread Gor Nishanov via Phabricator via cfe-commits
GorNishanov marked an inline comment as done. GorNishanov added inline comments. Comment at: lib/CodeGen/CGCoroutine.cpp:85 + unsigned No = 0; + const char* AwaitKindStr = 0; + switch (Kind) { majnemer wrote: > I'd use a StringRef here. StringRef it is. htt

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

2017-03-12 Thread Gor Nishanov via Phabricator via cfe-commits
GorNishanov updated this revision to Diff 91497. GorNishanov added a comment. Implemented review feedback: const char * => StringRef in buildSuspendSuffixStr https://reviews.llvm.org/D30809 Files: lib/CodeGen/CGCoroutine.cpp lib/CodeGen/CGExprAgg.cpp lib/CodeGen/CGExprScalar.cpp lib/Cod

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

2017-03-11 Thread David Majnemer via Phabricator via cfe-commits
majnemer added inline comments. Comment at: lib/CodeGen/CGCoroutine.cpp:85 + unsigned No = 0; + const char* AwaitKindStr = 0; + switch (Kind) { I'd use a StringRef here. https://reviews.llvm.org/D30809 ___ cfe-c

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

2017-03-11 Thread Gor Nishanov via Phabricator via cfe-commits
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 namespac

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

2017-03-11 Thread Gor Nishanov via Phabricator via cfe-commits
GorNishanov updated this revision to Diff 91486. GorNishanov added a comment. Addressed review feedback - clang-format three functions in CGExprScalar.cpp - got rid of AwaitKindStr array and select appropriate string in the switch statement in buildAwaitKindPrefix https://reviews.llvm.org/D308

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

2017-03-11 Thread David Majnemer via Phabricator via cfe-commits
majnemer added inline comments. Comment at: lib/CodeGen/CGCoroutine.cpp:26 +enum class AwaitKind { Init, Normal, Yield, Final }; +char const *AwaitKindStr[] = {"init", "await", "yield", "final"}; +} I'd move this into buildSuspendSuffixStr. Com

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

2017-03-11 Thread Gor Nishanov via Phabricator via cfe-commits
GorNishanov added a comment. + @majnemer who is most familiar with LLVM Coroutines representation. https://reviews.llvm.org/D30809 ___ cfe-commits mailing list cfe-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

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

2017-03-09 Thread Gor Nishanov via Phabricator via cfe-commits
GorNishanov created this revision. Herald added a subscriber: mehdi_amini. Emit suspend expression which roughly looks like: auto && x = CommonExpr(); if (!x.await_ready()) { llvm_coro_save(); x.await_suspend(...); (*) llvm_coro_suspend(); (**) } x.await_resume(); wher