Skip to content

Commit

Permalink
Auto merge of #65672 - ecstatic-morse:unified-dataflow-proto, r=pnkfelix
Browse files Browse the repository at this point in the history
A single framework for gen-kill and generic dataflow problems

This is the prototype implementation discussed in rust-lang/compiler-team#202. You can read a high-level description of it in [the proposal](https://hackmd.io/@39Qr_z9cQhasi25sGjmFnA/Skvd9rztS) for that design meeting. This would eventually supersede the existing `BitDenotation` interface.

r? @ghost

cc @rust-lang/compiler (esp. @eddyb and @pnkfelix)
  • Loading branch information
bors committed Jan 21, 2020
2 parents ce361fb + 7b4dca2 commit 2cf24ab
Show file tree
Hide file tree
Showing 10 changed files with 1,824 additions and 721 deletions.
25 changes: 25 additions & 0 deletions src/librustc/mir/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -215,6 +215,31 @@ impl<'tcx> Body<'tcx> {
}
}

/// Returns a partially initialized MIR body containing only a list of basic blocks.
///
/// The returned MIR contains no `LocalDecl`s (even for the return place) or source scopes. It
/// is only useful for testing but cannot be `#[cfg(test)]` because it is used in a different
/// crate.
pub fn new_cfg_only(basic_blocks: IndexVec<BasicBlock, BasicBlockData<'tcx>>) -> Self {
Body {
phase: MirPhase::Build,
basic_blocks,
source_scopes: IndexVec::new(),
yield_ty: None,
generator_drop: None,
generator_layout: None,
local_decls: IndexVec::new(),
user_type_annotations: IndexVec::new(),
arg_count: 0,
spread_arg: None,
span: DUMMY_SP,
control_flow_destroyed: Vec::new(),
generator_kind: None,
var_debug_info: Vec::new(),
ignore_interior_mut_in_const_validation: false,
}
}

#[inline]
pub fn basic_blocks(&self) -> &IndexVec<BasicBlock, BasicBlockData<'tcx>> {
&self.basic_blocks
Expand Down
Loading

0 comments on commit 2cf24ab

Please sign in to comment.