Skip to content

Commit 2cf24ab

Browse files
committed
Auto merge of rust-lang#65672 - ecstatic-morse:unified-dataflow-proto, r=pnkfelix
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)
2 parents ce361fb + 7b4dca2 commit 2cf24ab

File tree

10 files changed

+1824
-721
lines changed

10 files changed

+1824
-721
lines changed

src/librustc/mir/mod.rs

+25
Original file line numberDiff line numberDiff line change
@@ -215,6 +215,31 @@ impl<'tcx> Body<'tcx> {
215215
}
216216
}
217217

218+
/// Returns a partially initialized MIR body containing only a list of basic blocks.
219+
///
220+
/// The returned MIR contains no `LocalDecl`s (even for the return place) or source scopes. It
221+
/// is only useful for testing but cannot be `#[cfg(test)]` because it is used in a different
222+
/// crate.
223+
pub fn new_cfg_only(basic_blocks: IndexVec<BasicBlock, BasicBlockData<'tcx>>) -> Self {
224+
Body {
225+
phase: MirPhase::Build,
226+
basic_blocks,
227+
source_scopes: IndexVec::new(),
228+
yield_ty: None,
229+
generator_drop: None,
230+
generator_layout: None,
231+
local_decls: IndexVec::new(),
232+
user_type_annotations: IndexVec::new(),
233+
arg_count: 0,
234+
spread_arg: None,
235+
span: DUMMY_SP,
236+
control_flow_destroyed: Vec::new(),
237+
generator_kind: None,
238+
var_debug_info: Vec::new(),
239+
ignore_interior_mut_in_const_validation: false,
240+
}
241+
}
242+
218243
#[inline]
219244
pub fn basic_blocks(&self) -> &IndexVec<BasicBlock, BasicBlockData<'tcx>> {
220245
&self.basic_blocks

0 commit comments

Comments
 (0)