Looking at the amount of churn, especially around places setting withNoEscape, I'm considering adding those. The PR is very much in prototype state, not the final API.
That would be fine, so long as each method still checks invariants on the result before returning. The point is to have invariants being checked on every code path of construction.
update hints that some modification might be happening, but the method is const. I could've used builder but that sounded too close to the dual build method.
That shouldn't matter. If you look at the PR, I've actually moved the individual types to the top-level (the TLDR is this is needed because of a shared internal type ClangTypeInfo that is friend-ed and the inability to forward-declare nested types). So the PR now has swift::ASTExtInfo, swift::ASTExtInfoBuilder, swift::SILExtInfo and swift::SILExtInfoBuilder, instead of swift::AnyFunctionType::ExtInfo etc.
I'm afraid I don't understand this concern. We use the visitor pattern in many places, and the methods are called visitXYZ. To be clear, I'm not against adding withXYZ methods on the ExtInfo types to make things more ergonomic for call-sites which are only updating one field.
The idiom the code has been following so far is that ExtInfo values are immutable and you create slightly differing versions of it. The correct mental model is that new objects are being returned, it is not the case that the existing object is being mutated. So indeed, we have a newly constructed object, not an updated object.
Doesn't matter where it is, we can always rename stuff. Personally, I would've preferred if it were named CallingConvInfo or something, but I don't want to push for that change right now (also, [I think] escaping information is not part of the calling convention, so even that would not be technically correct). More generally, yeah it would be a digression to discuss how that type is (or should be) structured and named. Let's not go there.