pub struct Analysis {Show 13 fields
pub source: Source,
pub tokens: Vec<Token>,
pub unit: TranslationUnit,
pub diagnostics: Diagnostics,
pub expansions: Expansions,
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 options: Options,
}Expand description
The result of running the front end over one macro invocation.
Fields§
§source: SourceThe captured C source and its map back to Rust spans, headers and all.
tokens: Vec<Token>The preprocessed C token list, ending with lex::TokenKind::Eof.
unit: TranslationUnitThe parsed translation unit.
diagnostics: DiagnosticsEverything that went wrong.
expansions: ExpansionsThe macro invocations the preprocessor replaced, which later passes’ diagnostics are annotated from.
user_headers: Vec<PathBuf>The absolute paths of the user headers that were read, which the expansion mentions so that Cargo rebuilds when one changes.
embedded_files: Vec<PathBuf>The absolute paths of the resources #embed read, mentioned in the
expansion for the same reason.
link_libraries: Vec<String>The libraries #pragma cinrs link asked the expansion to be linked
against, each of which becomes an extern block of its own.
safe_functions: Vec<SafeName>The functions #pragma cinrs safe asked to be generated without
unsafe; see sema::check_safe.
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, so that the storage a variable length array or
alloca needs comes from alloc rather than from std.
crate_path: Option<String>The Rust path #pragma cinrs crate gave the cinrs facade crate, if
any; see ir::DEFAULT_CRATE_PATH.
options: OptionsThe options the rest of the pipeline is to run with.
These are the caller’s, with the target model resolved: whatever
TARGET_ENV_VAR and the unit’s own #pragma cinrs target had to say
is already in Options::target, so sema and code generation must use
these rather than the ones they were handed.