summaryrefslogtreecommitdiffstats
path: root/clang/lib/Sema/SemaCoroutine.cpp
Commit message (Collapse)AuthorAgeFilesLines
* [coroutines] Add diagnostics for copy/move assignment operators and ↵Eric Fiselier2016-10-271-47/+78
| | | | | | | | | | | | | | functions with deduced return types. Summary: The title says it all. Additionally this patch refactors the diagnostic code into a separate function. Reviewers: GorNishanov, rsmith Subscribers: majnemer, mehdi_amini, cfe-commits Differential Revision: https://reviews.llvm.org/D25292 llvm-svn: 285331
* [coroutines] Add allocation and deallocation substatements.Gor Nishanov2016-10-271-11/+144
| | | | | | | | | | | | | | Summary: SemaCoroutine: Add allocation / deallocation substatements. CGCoroutine/Test: Emit allocation and deallocation + test. Reviewers: rsmith Subscribers: ABataev, EricWF, llvm-commits, mehdi_amini Differential Revision: https://reviews.llvm.org/D25879 llvm-svn: 285306
* [coroutines] Build fallthrough and set_exception statements.Eric Fiselier2016-10-271-5/+81
| | | | | | | | | | | | | | | | | | | | | | | | | Summary: This patch adds semantic checking and building of the fall-through `co_return;` statement as well as the `p.set_exception(std::current_exception())` call for handling uncaught exceptions. The fall-through statement is built and checked according to: > [dcl.fct.def.coroutine]/4 > The unqualified-ids return_void and return_value are looked up in the scope of class P. If > both are found, the program is ill-formed. If the unqualified-id return_void is found, flowing > off the end of a coroutine is equivalent to a co_return with no operand. Otherwise, flowing off > the end of a coroutine results in undefined behavior. Similarly the `set_exception` call is only built when that unqualified-id is found in the scope of class P. Additionally this patch adds fall-through warnings for non-void returning coroutines. Since it's surprising undefined behavior I thought it would be important to add the warning right away. Reviewers: majnemer, GorNishanov, rsmith Subscribers: mehdi_amini, cfe-commits Differential Revision: https://reviews.llvm.org/D25349 llvm-svn: 285271
* [coroutines] Fix co_return statement for initializer list argumentsEric Fiselier2016-10-061-1/+1
| | | | | | | | | | | | | | | Summary: Previously the statement `co_return {42}` would be transformed into `P.return_void()`, since the type of `{42}` is represented as `void` by Clang. This patch fixes the bug by checking for `InitListExpr` arguments and transforming them accordingly. Reviewers: majnemer, GorNishanov, rsmith Subscribers: mehdi_amini, cfe-commits Differential Revision: https://reviews.llvm.org/D25296 llvm-svn: 283495
* [coroutines] Switch to using std::experimental namespace per P0057R5Gor Nishanov2016-10-041-4/+5
| | | | | | | | | | | | | | Summary: Look for coroutine_traits and friends in std::experimental namespace. Patch (mostly) by EricWF. Reviewers: cfe-commits, EricWF, rsmith Subscribers: majnemer, mehdi_amini Differential Revision: https://reviews.llvm.org/D25068 llvm-svn: 283170
* [coroutines] Diagnose when 'main' is declared as a coroutine.Eric Fiselier2016-09-301-0/+5
| | | | | | | | | | | | Summary: The title says it all. Reviewers: rsmith, GorNishanov Subscribers: mehdi_amini, cfe-commits Differential Revision: https://reviews.llvm.org/D25078 llvm-svn: 282973
* [Coroutines] Fix assertion about uncorrected typos in ↵Eric Fiselier2016-09-291-1/+14
| | | | | | co_await/co_yield/co_return expressions llvm-svn: 282792
* Re-commit "[Temporary] Add an ExprWithCleanups for each C++ ↵Tim Shen2016-06-211-2/+2
| | | | | | | | | | MaterializeTemporaryExpr." Since D21243 fixes relative clang-tidy tests. This reverts commit a71d9fbd41e99def9159af2b01ef6509394eaeed. llvm-svn: 273312
* Revert "[Temporary] Add an ExprWithCleanups for each C++ ↵Tim Shen2016-06-091-2/+2
| | | | | | | | | MaterializeTemporaryExpr." This reverts r272296, since there are clang-tidy failures that appear to be caused by this change. llvm-svn: 272310
* [Temporary] Add an ExprWithCleanups for each C++ MaterializeTemporaryExpr.Tim Shen2016-06-091-2/+2
| | | | | | | | | | | These ExprWithCleanups are added for holding a RunCleanupsScope not for destructor calls; rather, they are for lifetime marks. This requires ExprWithCleanups to keep a bit to indicate whether it have cleanups with side effects (e.g. dtor calls). Differential Revision: http://reviews.llvm.org/D20498 llvm-svn: 272296
* [coroutines] Build a CoroutineBodyStmt when finishing parsing a coroutine, ↵Richard Smith2015-11-241-4/+65
| | | | | | and form the initial_suspend, final_suspend, and get_return_object calls. llvm-svn: 253946
* [coroutines] Check for overload sets in co_yield / co_return operands being ↵Richard Smith2015-11-221-11/+8
| | | | | | resolved by a call to yield_value / return_value before rejecting them. llvm-svn: 253817
* [coroutines] Build implicit return_value / return_void calls for co_return.Richard Smith2015-11-221-6/+22
| | | | llvm-svn: 253816
* [coroutines] Materialize the awaitable before generating the await_* calls.Richard Smith2015-11-221-5/+9
| | | | llvm-svn: 253812
* [coroutines] Factor out co_await representation into common base class for ↵Richard Smith2015-11-221-2/+16
| | | | | | co_await and co_yield, and use it to hold await_* calls. llvm-svn: 253811
* [coroutines] Better handling of placeholder types.Richard Smith2015-11-201-6/+30
| | | | llvm-svn: 253731
* [coroutines] Synthesize yield_value call for co_yield.Richard Smith2015-11-201-16/+50
| | | | llvm-svn: 253725
* [coroutines] Per latest wording paper, co_* are no longer permitted in anyRichard Smith2015-11-201-11/+14
| | | | | | unevaluated operands. llvm-svn: 253641
* [coroutines] Tweak diagnostics to always use fully-qualified name for ↵Richard Smith2015-11-191-0/+6
| | | | | | std::coroutine_traits. llvm-svn: 253535
* [coroutines] Creation of promise object, lookup of operator co_await, buildingRichard Smith2015-10-271-24/+207
| | | | | | of await_* calls, and AST representation for same. llvm-svn: 251387
* [coroutines] Initial stub Sema functionality for handling coroutine await / ↵Richard Smith2015-10-221-0/+106
yield / return. llvm-svn: 250993
OpenPOWER on IntegriCloud