Find out if a function is called within a C++ project?

后端 未结 8 548
失恋的感觉
失恋的感觉 2021-02-01 19:15

I\'m trying to remove functions that are not used from a C++ project. Over time it\'s become bloated and I\'m looking to remove functions that aren\'t used at all.

I ha

8条回答
  •  南方客
    南方客 (楼主)
    2021-02-01 19:56

    If you want to know, dynamically, which functions are being used you could get the (vc++) compiler to insert callcap hooks and then use those to dump out usage information.

    This could be a useful compliment to static analysis based approaches, since it will see every piece of code that is entered during execution (regardless of how execution arrives there).

    See http://msdn.microsoft.com/en-us/library/ms254291(VS.80).aspx for info on call profile hooks in visual studio.

提交回复
热议问题