This is a rewrite of the existing code. It isn't even close to NFC as it fixes several problems with the existing code. Changes detailed below.
- Argument attributes on an indirect call site are honored. We'd previously only been honoring these on unknown direct calls, which is just weird.
- Consistently treat calling a function pointer as an operation which reads the function pointer. Previously, we gave it different treatment based on which attributes were on the callsite. (e.g. a readonly callsite vs a writeonly callsite changed the intepretation of the function pointer access for an indirect call)
- Honor attributes on vararg function declarations when visiting a vararg argument. (Previously, we aborted the entire analysis.)
In addition to the previously described functional changes, the resulting code is both shorter, and easier to follow.
clang-format: please reformat the code