← All projects
Project record1 mention
Originally shared on Hacker News

LLVM unreachable-function locator

A small LLVM-based tool that prints the source code locations of functions unreachable from main, used to identify code that can be safely deleted without altering functionality. It was used to remove roughly 3000 lines of code in minutes, though integration with CMake is still a work in progress.

Last shared
01 / The problem

What it addresses

Removing unused functionality safely is difficult without knowing which functions are unreachable from main.

02 / Source history

Shared over time

Each entry reflects what was shared on that date. Details may have changed since then.

  1. LLVM unreachable-function locator

    A small LLVM-based tool that prints the source code locations of functions unreachable from main, used to identify code that can be safely deleted without altering functionality. It was used to remove roughly 3000 lines of code in minutes, though integration with CMake is still a work in progress.

    Problem: Removing unused functionality safely is difficult without knowing which functions are unreachable from main.

    Posted by @FattiMei · Original source ↗

    Source text · @FattiMei · · Source ↗

    For the task of removing functionality I developed a small tool based on LLVM that prints the source code location of functions that are unreachable from main, so that I can safely remove them without altering functionality, deleted ~3000 LOC in a couple of minutes