Similarly to byval, the inalloca aergument attribute (for MSVC compatibility) currently works by looking at the pointee type of its argument. This is no longer going to work with opaque pointers, and needs to be adapted reasonably early to allow any front-ends time to upgrade their usage.
So this patch adds an optional type, pretty much following byval's implementation directly from last year, so that part is probably pretty straightforward.
What might be worth thinking about is just where we enforce that byval and inalloca are incompatible. The situation I eneded up with was:
- AttrBuilder allows you to create an AttributeSet with both (as before, but needed a new Type field to implement).
- IR: they can exist together (as before)
- Verifier: complains about IR in that state (as before).
- CodeGen: shoves everything into a single "type" and "align" field. As before, but I've renamed them to be a bit more use-case agnostic in this patch.
I think that mostly makes sense, except possibly for the AttrBuilder. It might instead make sense to assert if someone tries to create a set with both.