Automated Dead code detection in native C++ application on Windows?

前端 未结 3 616
暗喜
暗喜 2021-02-02 01:22

Background

I have an application written in native C++ over the course of several years that is around 60 KLOC. There are many many functions and classes that are dead

3条回答
  •  南方客
    南方客 (楼主)
    2021-02-02 01:40

    Ask the linker to remove unreferenced objects (/OPT:REF). If you use function-level linking, and verbose linker output, the linker output will list every function it can prove is unused. This list may be far from complete, but you already have the tools needed.

提交回复
热议问题