Every ABI has rules on how to lower complex user facing types like structs into primitive types like integers and pointers. adjust_for_foreign_abi implements those rules. After that LLVM handles assigning those primitive values to the right registers and stack locations. While LLVM can lower complex types, it does so in a way not conforming to any C ABI. Every frontend has to implement this lowering. If you want a reference on how to implement it for your target you could look at the implementation in clang. I believe multiple of the rustc implementations link to their clang counterpart.
I have now understood pub fn compute_abi_info<Ty>(fn_abi: &mut FnAbi<'_, Ty>) gets a struct representing the return value and an array of argument structs.
All of these need to have the .mode field set. This should respect the Conv field showing which convention is in force. The context is used to keep track of parts of complicated ISAs like SPARC.