InlineCostAnalysis is an analysis pass without any need for it to be one. Once it stops being an analysis pass, it doesn't maintain any useful state and the member functions inside can be made free functions. NFC.
(Note: InlineCost.h has the following comment for getInlineCost, a member function of InlineCostAnalysis:
- // Note: This is used by out-of-tree passes, please do not remove without
- // adding a replacement API.
I am not sure what this means, but this refactoring makes this into a free function with extra parameters)