pub struct Preprocessed {
pub tokens: Vec<Token>,
pub expansions: Expansions,
pub included: Vec<IncludedFile>,
pub user_headers: Vec<PathBuf>,
pub embedded_files: Vec<PathBuf>,
pub link_libraries: Vec<String>,
pub safe_functions: Vec<SafeName>,
pub export: bool,
pub no_std: bool,
pub crate_path: Option<String>,
pub pack_events: Vec<(usize, Option<u32>)>,
pub target_events: Vec<(usize, Vec<(String, SourceRange)>)>,
}Expand description
Everything one run of the preprocessor produced.
Fields§
§tokens: Vec<Token>The token list, always ending with TokenKind::Eof.
expansions: ExpansionsThe macro invocations that were replaced.
included: Vec<IncludedFile>The files #include opened, in the order they were opened, which is
also the order they must be added to a source map: a file is always
listed after the one whose directive pulled it in.
user_headers: Vec<PathBuf>The absolute paths of the user headers that were read, for rebuild tracking. A bundled header cannot change without the crate changing, so it is not listed.
embedded_files: Vec<PathBuf>The absolute paths of the resources #embed read, for the same reason
and by the same route — except that they are bytes rather than text, so
the expansion tracks them with include_bytes!.
link_libraries: Vec<String>The libraries #pragma cinrs link asked for, in the order asked.
safe_functions: Vec<SafeName>The functions #pragma cinrs safe named, in the order named.
export: boolWhether #pragma cinrs export asked for real C symbols.
no_std: boolWhether #pragma cinrs no_std said the expansion goes into a
#![no_std] crate.
crate_path: Option<String>The Rust path #pragma cinrs crate gave the cinrs facade crate,
which the generated code names when it needs the runtime.
pack_events: Vec<(usize, Option<u32>)>Every #pragma pack the unit wrote, as (token index, alignment).
A pragma is not a token, so the change is recorded against the position
in Preprocessed::tokens it takes effect at; PackMap answers what
was in force where a struct was defined.
target_events: Vec<(usize, Vec<(String, SourceRange)>)>Every #pragma GCC target the unit wrote, as (token index, names).
Recorded the same way Preprocessed::pack_events is, and read the
same way: TargetOptionMap answers what was in force where a
function was defined.