Previously, source-based coverage analysis does not work properly for coroutine.
This patch adds processing of coroutine body and co_return in the coverage analysis, so that we can handle them properly.
For coroutine body, we should only look at the actual function body and ignore the compiler-generated things; for co_return, we need to terminate the region similar to return statement.
Added a test, and confirms that it now works properly. (without this patch, the statement after the if statement will be treated wrongly)
Details
Details
Diff Detail
Diff Detail
- Repository
- rG LLVM Github Monorepo
Event Timeline
Comment Actions
Looks like this causes a bunch of build bot failures, e.g http://lab.llvm.org:8011/builders/clang-x86_64-debian-fast/builds/31465 b
It would be great if you could take a look.
Comment Actions
Let me revert it for now while fixing it. If you could accept: https://reviews.llvm.org/D82984
clang/test/CoverageMapping/coroutine.cpp | ||
---|---|---|
1 | Since this line is missing an -o /dev/null, it writes a .ll file into the test directory, which lit tries to run as test next time, causing check-clang to fail: http://45.33.8.238/linux/21841/step_7.txt Please add -o /dev/null, and please also add a RUN: rm -f %S/coroutine.ll to clean up bots (with a fixme to remove that rm line once it's been in the tree for a week or so) |
Since this line is missing an -o /dev/null, it writes a .ll file into the test directory, which lit tries to run as test next time, causing check-clang to fail: http://45.33.8.238/linux/21841/step_7.txt
Please add -o /dev/null, and please also add a RUN: rm -f %S/coroutine.ll to clean up bots (with a fixme to remove that rm line once it's been in the tree for a week or so)