Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix codecov accuracy for optimized and dead statements #34254

Merged
merged 2 commits into from
Jan 15, 2020

Conversation

vtjnash
Copy link
Sponsor Member

@vtjnash vtjnash commented Jan 3, 2020

As people have noted (e.g #28192), Keno made the optimizer much too good. Rather than making the optimizer worse, we instead here preprocess the IR to inject a weak compiler barrier at each line change. This ensures we preserve the line number record, even if we drop all other side-effects at that point.

@KristofferC KristofferC merged commit 08ebedc into master Jan 15, 2020
@KristofferC KristofferC deleted the jn/codecov-accuracy branch January 15, 2020 15:50
codeloc = ci.codelocs[idx]
if coverage && codeloc != prevloc && codeloc != 0
# insert a side-effect instruction before the current instruction in the same basic block
insert!(code, idx, Expr(:code_coverage_marker))
Copy link
Sponsor Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

:code_coverage_effect?

Copy link
Sponsor Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

😭

timholy added a commit to timholy/Revise.jl that referenced this pull request Feb 4, 2020
Julia 1.5 introduced annotations to improve line-coverage analysis (see 
JuliaLang/julia#34254). We just have to make 
sure these don't contaminate our tests.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants