summaryrefslogtreecommitdiffstats
path: root/clang/lib/Parse/ParseExprCXX.cpp
diff options
context:
space:
mode:
authorRichard Smith <richard-llvm@metafoo.co.uk>2015-10-22 04:46:14 +0000
committerRichard Smith <richard-llvm@metafoo.co.uk>2015-10-22 04:46:14 +0000
commit0e304ea8a1a49f3c4443c335de448f667c43af1b (patch)
treee7d3e8654ce52c22e32c56236f4d6529be3af635 /clang/lib/Parse/ParseExprCXX.cpp
parent629aaaf143743c183babcd2c03227cbbd8b6104b (diff)
downloadbcm5719-llvm-0e304ea8a1a49f3c4443c335de448f667c43af1b.tar.gz
bcm5719-llvm-0e304ea8a1a49f3c4443c335de448f667c43af1b.zip
[coroutines] Add parsing support for co_await expression, co_yield expression,
co_await modifier on range-based for loop, co_return statement. llvm-svn: 250985
Diffstat (limited to 'clang/lib/Parse/ParseExprCXX.cpp')
-rw-r--r--clang/lib/Parse/ParseExprCXX.cpp14
1 files changed, 14 insertions, 0 deletions
diff --git a/clang/lib/Parse/ParseExprCXX.cpp b/clang/lib/Parse/ParseExprCXX.cpp
index 2bf4cba7984..c3df77300ca 100644
--- a/clang/lib/Parse/ParseExprCXX.cpp
+++ b/clang/lib/Parse/ParseExprCXX.cpp
@@ -1558,6 +1558,20 @@ ExprResult Parser::ParseThrowExpression() {
}
}
+/// \brief Parse the C++ Coroutines co_yield expression.
+///
+/// co_yield-expression:
+/// 'co_yield' assignment-expression[opt]
+ExprResult Parser::ParseCoyieldExpression() {
+ assert(Tok.is(tok::kw_co_yield) && "Not co_yield!");
+
+ SourceLocation Loc = ConsumeToken();
+ ExprResult Expr = ParseAssignmentExpression();
+ (void)Loc;
+ // FIXME: Pass to Sema.
+ return Expr;
+}
+
/// ParseCXXThis - This handles the C++ 'this' pointer.
///
/// C++ 9.3.2: In the body of a non-static member function, the keyword this is
OpenPOWER on IntegriCloud