Currently CallOpInterface has a method getCallableForCallee to have a consistent way to get the callee from an operation with CallOpInterface, but missing a consistent way to set a callee for an operation with CallOpInterface.
A set callee method is useful for transformations that operate on CallOpInterface, and change the callee, e.g., a pass that specialize function, which clone the callee, and change the CallOpInterface's callee to the cloned version. Without such method, transformation would need to understand the implementation for every operations with CallOpInterface, and have a type switch to handle them.
This review adds a method to set callee for operation with CallOpInterface.
Could you document here what the expectected preconditions and post conditions of the method are?
E.g. if I have a func.call op is it a precondition of the method that $callee must be a FlatSymbolRefAttr or is it a post condition that the implementation should then simply do nothing if its not. Vice versa with ops like func.call_indirect and Value.
I also think that describing the meaning of what the SSA value represents should not be described here, given the meaning is dependent upon the Op that creates the value and/or the call op that uses it (could e.g. also be a function pointer, doesn't have to be a lambda-like operation with a region).