rust/compiler/rustc_codegen_llvm/src
bors 91198820d7 Auto merge of #88575 - eddyb:fn-abi-queries, r=nagisa
Querify `FnAbi::of_{fn_ptr,instance}` as `fn_abi_of_{fn_ptr,instance}`.

*Note: opening this PR as draft because it's based on #88499*

This more or less replicates the `LayoutOf::layout_of` setup from #88499, to replace `FnAbi::of_{fn_ptr,instance}` with `FnAbiOf::fn_abi_of_{fn_ptr,instance}`, and also route them through queries (which `layout_of` has used for a while).

The two changes at the use sites (other than the names) are:
* return type is now wrapped in `&'tcx`
  * the value *is* interned, which may affect performance
* the `extra_args` list is now an interned `&'tcx ty::List<Ty<'tcx>>`
  * should be cheap (it's empty for anything other than C variadics)

Theoretically, a `FnAbiOfHelpers` implementer could choose to keep the `Result<...>` instead of eagerly erroring, but the only existing users of these APIs are codegen backends, so they don't (want to) take advantage of this.
At least miri could make use of this, since it prefers propagating errors (it "just" doesn't use `FnAbi` yet - cc `@RalfJung).`

The way this is done is probably less efficient than what is possible, because the queries handle the correctness-oriented API (i.e. the split into `fn` pointers vs instances), whereas a lower-level query could end up with more reuse between different instances with identical signatures.

r? `@nagisa` cc `@oli-obk` `@bjorn3`
2021-09-19 21:39:47 +00:00
..
back Move add_rlib and add_native_library to cg_ssa 2021-09-01 14:43:27 +02:00
coverageinfo Querify fn_abi_of_{fn_ptr,instance}. 2021-09-18 04:41:33 +03:00
debuginfo Querify fn_abi_of_{fn_ptr,instance}. 2021-09-18 04:41:33 +03:00
llvm
abi.rs Auto merge of #88759 - Amanieu:panic_in_drop, r=nagisa,eddyb 2021-09-12 20:48:09 +00:00
allocator.rs Include debug info for the allocator shim 2021-08-31 15:24:20 -07:00
asm.rs Make abi::Abi Copy and remove a *lot* of refs 2021-09-09 10:41:19 +02:00
attributes.rs
base.rs
builder.rs Querify fn_abi_of_{fn_ptr,instance}. 2021-09-18 04:41:33 +03:00
callee.rs Querify fn_abi_of_{fn_ptr,instance}. 2021-09-18 04:41:33 +03:00
common.rs Make abi::Abi Copy and remove a *lot* of refs 2021-09-09 10:41:19 +02:00
consts.rs Make abi::Abi Copy and remove a *lot* of refs 2021-09-09 10:41:19 +02:00
context.rs Querify fn_abi_of_{fn_ptr,instance}. 2021-09-18 04:41:33 +03:00
declare.rs
intrinsic.rs Auto merge of #88575 - eddyb:fn-abi-queries, r=nagisa 2021-09-19 21:39:47 +00:00
lib.rs Include debug info for the allocator shim 2021-08-31 15:24:20 -07:00
llvm_util.rs
mono_item.rs Querify fn_abi_of_{fn_ptr,instance}. 2021-09-18 04:41:33 +03:00
type_.rs
type_of.rs Querify fn_abi_of_{fn_ptr,instance}. 2021-09-18 04:41:33 +03:00
va_arg.rs rustc_target: move LayoutOf to ty::layout. 2021-09-02 01:17:14 +03:00
value.rs