fn codegen_fn_attrs(tcx: TyCtxt<'_>, did: LocalDefId) -> CodegenFnAttrs
Expand description
Generate the CodegenFnAttrs
for an item (identified by the LocalDefId
).
This happens in 4 stages:
- apply built-in attributes that directly translate to codegen attributes.
- handle lang items. These have special codegen attrs applied to them.
- apply overrides, like minimum requirements for alignment and other settings that don’t rely directly the built-in attrs on the item. overrides come after applying built-in attributes since they may only apply when certain attributes were already set in the stage before.
- check that the result is valid. There’s various ways in which this may not be the case, such as certain combinations of attrs.