We should pass foreign references as Direct_Unowned calling convention,
this happened for non-const pointers. Unfortunately, we passed the const
variants as Indirect_In. This resulted in SILGen trying to insert a
non-sensical conversion. This triggered an assertion failure or a
miscompilation depending on how the compiler was compiled.
rdar://149398905
This corresponds to the parameter-passing convention of the Itanium C++
ABI, in which the argument is passed indirectly and possibly modified,
but not destroyed, by the callee.
@in_cxx is handled the same way as @in in callers and @in_guaranteed in
callees. OwnershipModelEliminator emits the call to destroy_addr that is
needed to destroy the argument in the caller.
rdar://122707697