[PATCH] D31627: [coroutines] Skip over passthrough operator co_await
Richard Smith via Phabricator via cfe-commits
cfe-commits at lists.llvm.org
Mon May 22 12:56:21 PDT 2017
rsmith accepted this revision.
rsmith added a comment.
This revision is now accepted and ready to land.
Does it still make sense for us to have a `UO_Coawait` at all? As I recall, the only purpose it ever had was to represent a dependent `co_await` expression that couldn't yet be resolved to a `CoawaitExpr`. But now we have (and need!) a separate `DependentCoawaitExpr` node to store unqualified lookup results, it seems that the `UnaryOperator` portion of the representation serves no purpose (and as seen in this patch, it's getting in the way). Can we remove it?
Anyway, this change LGTM for now.
================
Comment at: lib/CodeGen/CGCoroutine.cpp:146
+
+ // Skip paththrough operator co_await (present when awaiting on an LValue).
+ if (auto *UO = dyn_cast<UnaryOperator>(E))
----------------
paththrough -> passthrough
================
Comment at: lib/CodeGen/CGCoroutine.cpp:148-149
+ if (auto *UO = dyn_cast<UnaryOperator>(E))
+ if (UO->getOpcode() == UO_Coawait)
+ E = UO->getSubExpr();
+
----------------
Indent.
https://reviews.llvm.org/D31627
More information about the cfe-commits
mailing list