Skip to content

Detect dead code #22

Open
Open

Description

@calixteman

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.

Activity

  1. changed the title [-]shipit_code_coverage: detect dead code[/-] [+]Detect dead code[/+] on Oct 2, 2018
  2. marco-c commented on Dec 19, 2018

    @marco-c
    Collaborator

    @choller mentioned a similar idea recently.

  3. choller commented on Dec 19, 2018

    @choller
    Member

    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.

  4. marco-c commented on Jan 21, 2019

    @marco-c
    Collaborator

    @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'.

  5. marco-c commented on Jan 21, 2019

    @marco-c
    Collaborator

    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.

  6. added
    botPython Taskcluster Bot
    on Jul 17, 2019
  7. added a commit that references this issue on Oct 23, 2019
    5a9c01b
  8. marco-c commented on Oct 25, 2019

    @marco-c
    Collaborator

    Wrongly closed, as 5a9c01b was imported from another repo.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    botPython Taskcluster Bot

    Type

    No type

    Fields

    Priority

    None yet

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions