Module deduce_param_attrs

Module deduce_param_attrs 

Source
Expand description

Deduces supplementary parameter attributes from MIR.

Deduced parameter attributes are those that can only be soundly determined by examining the body of the function instead of just the signature. These can be useful for optimization purposes on a best-effort basis. We compute them here and store them into the crate metadata so dependent crates can use them.

Note that this crucially relies on codegen not doing any more MIR-level transformations after optimized_mir! We check for things that are not guaranteed to be preserved by MIR transforms, such as which local variables happen to be mutated.

StructsΒ§

DeduceParamAttrs πŸ”’
A visitor that determines how a return place and arguments are used inside MIR body. To determine whether a local is mutated we can’t use the mutability field on LocalDecl because it has no meaning post-optimization.

FunctionsΒ§

deduced_param_attrs πŸ”’
Returns the deduced parameter attributes for a function.
type_will_always_be_passed_directly πŸ”’
Returns true if values of a given type will never be passed indirectly, regardless of ABI.