This builds on the code from D114963, and extends it to handle calls both direct and indirect. With the revised code structure (from series of previously landed NFCs), this is pretty straight forward.
One thing to note is that we can not infer writeonly for arguments which might be captured. If the pointer can be read back by the caller, and then read through, we have no way to track that. This is the same restriction we have for readonly, except that we get no mileage out of the "callee can be readonly" exception since a writeonly param on a readonly function is either a) readnone or b) UB. This means we can't actually infer much unless nocapture has already been inferred.
This could be written as CB.doesNotReadMemory() || CB.doesNotReadMemory(UseIndex) for symmetry with the other cases. Though personally I find the naming of these methods really unfortunate (they should probably be called onlyWritesMemory()) so maybe the explicit form is better.