You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The basic idea is to write a clang plugin which is able to detect if a function in an uncovered file is called (directly or via a call to another function) by an other function in a covered file.
That would avoid manual inspection and give the files with a high probability to be dead.
It might be that we don't even need a Clang plugin for this because we already have extensive data being generated for searchfox. In fact, I am working on a prototype based on this already and will probably also have this as a Q1 goal to evaluate. I can provide you with the first results once I have them. The first target I am looking at is intl/ because I suspect major amounts of dead code there. Unfortunately it is also one of the uglier targets because it uses weird macro magic to rename several entrypoints on the fly.
@choller implemented the solution in https://github.com/MozillaSecurity/reachable.
We could extract the analysis code in a library (that we will share between our project and the reachable project), and use it to add another column to our zero coverage report: 'Is Reachable'.
Activity
[-]shipit_code_coverage: detect dead code[/-][+]Detect dead code[/+]marco-c commentedon Dec 19, 2018
@choller mentioned a similar idea recently.
choller commentedon Dec 19, 2018
It might be that we don't even need a Clang plugin for this because we already have extensive data being generated for searchfox. In fact, I am working on a prototype based on this already and will probably also have this as a Q1 goal to evaluate. I can provide you with the first results once I have them. The first target I am looking at is
intl/because I suspect major amounts of dead code there. Unfortunately it is also one of the uglier targets because it uses weird macro magic to rename several entrypoints on the fly.marco-c commentedon Jan 21, 2019
@choller implemented the solution in https://github.com/MozillaSecurity/reachable.
We could extract the analysis code in a library (that we will share between our project and the
reachableproject), and use it to add another column to our zero coverage report: 'Is Reachable'.marco-c commentedon Jan 21, 2019
I've created a temporary lib at https://github.com/marco-c/reachablelib, which we could move to either mozilla or MozillaSecurity org at some point.
Rename ccov build from opt to debug. Fixes mozilla#22
marco-c commentedon Oct 25, 2019
Wrongly closed, as 5a9c01b was imported from another repo.