summaryrefslogtreecommitdiffstats
path: root/clang/lib/AST/StmtPrinter.cpp
diff options
context:
space:
mode:
authorEric Fiselier <eric@efcs.ca>2017-03-06 23:38:15 +0000
committerEric Fiselier <eric@efcs.ca>2017-03-06 23:38:15 +0000
commit20f25cb6dfb3364847f4c570b1914fe51e585def (patch)
tree6c03ba9aabbf6e916fd09ce2d78cb4a274540792 /clang/lib/AST/StmtPrinter.cpp
parentc3b4735b6f71b94c47964ca69afc0d38135d10fb (diff)
downloadbcm5719-llvm-20f25cb6dfb3364847f4c570b1914fe51e585def.tar.gz
bcm5719-llvm-20f25cb6dfb3364847f4c570b1914fe51e585def.zip
[coroutines] Add DependentCoawaitExpr and fix re-building CoroutineBodyStmt.
Summary: The changes contained in this patch are: 1. Defines a new AST node `CoawaitDependentExpr` for representing co_await expressions while the promise type is still dependent. 2. Correctly detect and transform the 'co_await' operand to `p.await_transform(<expr>)` when possible. 3. Change the initial/final suspend points to build during the initial parse, so they have the correct operator co_await lookup results. 4. Fix transformation of the CoroutineBodyStmt so that it doesn't re-build the final/initial suspends. @rsmith: This change is a little big, but it's not trivial for me to split it up. Please let me know if you would prefer this submitted as multiple patches. Reviewers: rsmith, GorNishanov Reviewed By: rsmith Subscribers: ABataev, rsmith, mehdi_amini, cfe-commits Differential Revision: https://reviews.llvm.org/D26057 llvm-svn: 297093
Diffstat (limited to 'clang/lib/AST/StmtPrinter.cpp')
-rw-r--r--clang/lib/AST/StmtPrinter.cpp7
1 files changed, 7 insertions, 0 deletions
diff --git a/clang/lib/AST/StmtPrinter.cpp b/clang/lib/AST/StmtPrinter.cpp
index 1ba1aa40ec5..21f5259c3ca 100644
--- a/clang/lib/AST/StmtPrinter.cpp
+++ b/clang/lib/AST/StmtPrinter.cpp
@@ -2475,6 +2475,13 @@ void StmtPrinter::VisitCoawaitExpr(CoawaitExpr *S) {
PrintExpr(S->getOperand());
}
+
+void StmtPrinter::VisitDependentCoawaitExpr(DependentCoawaitExpr *S) {
+ OS << "co_await ";
+ PrintExpr(S->getOperand());
+}
+
+
void StmtPrinter::VisitCoyieldExpr(CoyieldExpr *S) {
OS << "co_yield ";
PrintExpr(S->getOperand());
OpenPOWER on IntegriCloud