Fix an issue where `if #available(...)` conditions were ignored in
emit-module-separately builds or when skipping non-inlinable function
bodies.
To handle functions for which parsing is delayed but type-checking is
not delayed, move up building the delayed TRC to the
TypeCheckFunctionBodyRequest service.
rdar://83166742
We used to build the full TypeRefinementContext of a source file before
parsing delayed function bodies. This can lead to availability checking
errors in delayed function bodies as the TRCs are incomplete.
Complete the TRC of each delayed function before type-checking them to
fix this.
rdar://82269657