diff options
author | Andrey Ali Khan Bolshakov <bolsh.andrey@yandex.ru> | 2024-05-16 01:39:12 +0300 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-05-15 15:39:12 -0700 |
commit | 050593fc4f9a7f2b9450ee093c4638b8539315b7 (patch) | |
tree | 0d79ca2bbaa25de1733baa72e2f95179b494845d /clang/lib/CodeGen/CoverageMappingGen.cpp | |
parent | 00179e92c147e16de1f7c653f88c8805aef820c1 (diff) | |
download | llvm-050593fc4f9a7f2b9450ee093c4638b8539315b7.zip llvm-050593fc4f9a7f2b9450ee093c4638b8539315b7.tar.gz llvm-050593fc4f9a7f2b9450ee093c4638b8539315b7.tar.bz2 |
[Coverage] Handle `CoroutineSuspendExpr` correctly (#88898)
This avoids visiting `co_await` or `co_yield` operand 5 times (it is
repeated under transformed awaiter subexpression, and under
`await_ready`, `await_suspend`, and `await_resume` generated call
subexpressions).
Diffstat (limited to 'clang/lib/CodeGen/CoverageMappingGen.cpp')
-rw-r--r-- | clang/lib/CodeGen/CoverageMappingGen.cpp | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/clang/lib/CodeGen/CoverageMappingGen.cpp b/clang/lib/CodeGen/CoverageMappingGen.cpp index ce2f39ae..e465600 100644 --- a/clang/lib/CodeGen/CoverageMappingGen.cpp +++ b/clang/lib/CodeGen/CoverageMappingGen.cpp @@ -1439,6 +1439,10 @@ struct CounterCoverageMappingBuilder terminateRegion(S); } + void VisitCoroutineSuspendExpr(const CoroutineSuspendExpr *E) { + Visit(E->getOperand()); + } + void VisitCXXThrowExpr(const CXXThrowExpr *E) { extendRegion(E); if (E->getSubExpr()) |