diff options
| author | Camille GILLOT <gillot.camille@gmail.com> | 2021-01-05 19:53:07 +0100 |
|---|---|---|
| committer | Camille GILLOT <gillot.camille@gmail.com> | 2021-09-07 19:57:07 +0200 |
| commit | fd9c04fe32d3b7700d600ae1be72d5758ffd66ff (patch) | |
| tree | 9968ed2ae3ef44610f7669a5221d9a502f33765f /compiler/rustc_mir_dataflow/src/lib.rs | |
| parent | 81a600b6b7db07ebac28c8ddedd357e3c5b9951d (diff) | |
| download | rust-fd9c04fe32d3b7700d600ae1be72d5758ffd66ff.tar.gz rust-fd9c04fe32d3b7700d600ae1be72d5758ffd66ff.zip | |
Move the dataflow framework to its own crate.
Diffstat (limited to 'compiler/rustc_mir_dataflow/src/lib.rs')
| -rw-r--r-- | compiler/rustc_mir_dataflow/src/lib.rs | 71 |
1 files changed, 71 insertions, 0 deletions
diff --git a/compiler/rustc_mir_dataflow/src/lib.rs b/compiler/rustc_mir_dataflow/src/lib.rs new file mode 100644 index 00000000000..282ea8db1bb --- /dev/null +++ b/compiler/rustc_mir_dataflow/src/lib.rs @@ -0,0 +1,71 @@ +#![feature(associated_type_defaults)] +#![feature(bool_to_option)] +#![feature(box_patterns)] +#![feature(box_syntax)] +#![feature(const_panic)] +#![feature(exact_size_is_empty)] +#![feature(in_band_lifetimes)] +#![feature(iter_zip)] +#![feature(min_specialization)] +#![feature(once_cell)] +#![feature(stmt_expr_attributes)] +#![feature(trusted_step)] + +#[macro_use] +extern crate tracing; +#[macro_use] +extern crate rustc_middle; + +use rustc_ast::{self as ast, MetaItem}; +use rustc_middle::ty; +use rustc_session::Session; +use rustc_span::symbol::{sym, Symbol}; + +pub use self::drop_flag_effects::{ + drop_flag_effects_for_function_entry, drop_flag_effects_for_location, + move_path_children_matching, on_all_children_bits, on_all_drop_children_bits, + on_lookup_result_bits, +}; +pub use self::framework::{ + fmt, lattice, visit_results, Analysis, AnalysisDomain, Backward, Direction, Engine, Forward, + GenKill, GenKillAnalysis, JoinSemiLattice, Results, ResultsCursor, ResultsRefCursor, + ResultsVisitable, ResultsVisitor, +}; + +use self::move_paths::MoveData; + +pub mod drop_flag_effects; +pub mod elaborate_drops; +mod framework; +pub mod impls; +pub mod move_paths; +pub mod rustc_peek; +pub mod storage; + +pub(crate) mod indexes { + pub(crate) use super::move_paths::MovePathIndex; +} + +pub struct MoveDataParamEnv<'tcx> { + pub move_data: MoveData<'tcx>, + pub param_env: ty::ParamEnv<'tcx>, +} + +pub fn has_rustc_mir_with( + _sess: &Session, + attrs: &[ast::Attribute], + name: Symbol, +) -> Option<MetaItem> { + for attr in attrs { + if attr.has_name(sym::rustc_mir) { + let items = attr.meta_item_list(); + for item in items.iter().flat_map(|l| l.iter()) { + match item.meta_item() { + Some(mi) if mi.has_name(name) => return Some(mi.clone()), + _ => continue, + } + } + } + } + None +} |
