flowistry_pdg_construction

Module encoder

Source
Expand description

Readers and writers for the intermediate artifacts we store per crate.

Most of this code is adapted/copied from EncodeContext and DecodeContext in rustc_metadata.

We use a lot of min_specialization here to change how DefIds, Spans and such are encoded since their default implementations are panics.

Specifically for CrateNum (e.g. DefId also), we use stable crate hashes. These appear to work fine, however I am not sure they are guaranteed to be stable across different crates. Rustc itself uses an explicit remapping replying on CrateMetadataRef, which we can construct but not use (relevant functions are hidden).

Note that we encode AllocIds simply as themselves. This is possibly incorrect but we’re not really relying on this information at the moment so we are not investing in it.

MacrosΒ§

StructsΒ§

ConstantsΒ§

FunctionsΒ§