Expand description
Passes that finish translation, i.e. required for the output to be a valid output.
Modules§
- duplicate_
defaulted_ methods - Add missing methods to trait impls by duplicating the default method.
- filter_
invisible_ trait_ impls - We cannot filter trait impls by name before translating them, because we need to know the trait/type pair that is being implemented. We therefore filter them in a post-processing pass.
- insert_
assign_ return_ unit - When the function’s return type is unit, the generated MIR doesn’t
set the return value to
()
. This can be a concern: in the case of AENEAS, it means the return variable contains ⊥ upon returning. For this reason, when the function has return type unit, we insert an extra assignment just before returning. - insert_
ptr_ metadata - insert_
storage_ lives - Add missing StorageLives – in MIR, some locals are considered “always” initialised, and have no StorageLive and StorageDead instructions associated; this always includes the arguments and the return value, but also sometimes includes other locals. We make sure these additional locals get initialised at the start of the function if they’re used anywhere.
- remove_
unused_ methods - Remove the trait/impl methods that were not translated.