Reapply "OpaquePtr: Add type to sret attribute"

This reverts commit eb9f7c28e5fe6d75fed3587023e17f2997c8024b.

Previously this was incorrectly handling linking of the contained
type, so this merges the fixes from D88973.

GitOrigin-RevId: 0a7cd99a702595ccf73c957be0127af9f25fb9a2
34 files changed