Open
Description
We have the FunctionToInstanceMethodPass which converts free functions into class methods. It is only applied manually. However, we can think about a heuristic approach which applies it automatically based on analysis of an entire unit. For example, if the selected language version is C and the first parameter of all functions in a unit take the same opaque pointer and there's one function which takes no parameters but returns this same opaque pointer, we could assume it would be more convenient to generate a class instead of static methods.
Constructing functions could be problematic to detect because there might be more than one or they might take parameters but we could leave those as static.