Skip to content

Commit 867ce76

Browse files
committed
Make rustc_mir::dataflow module pub
1 parent 5f42f3e commit 867ce76

File tree

2 files changed

+10
-10
lines changed

2 files changed

+10
-10
lines changed

src/librustc_mir/dataflow/mod.rs

+9-9
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ where
5656
/// string (as well as that of rendering up-front); in exchange, you
5757
/// don't have to hand over ownership of your value or deal with
5858
/// borrowing it.
59-
pub(crate) struct DebugFormatted(String);
59+
pub struct DebugFormatted(String);
6060

6161
impl DebugFormatted {
6262
pub fn new(input: &dyn fmt::Debug) -> DebugFormatted {
@@ -70,7 +70,7 @@ impl fmt::Debug for DebugFormatted {
7070
}
7171
}
7272

73-
pub(crate) trait Dataflow<'tcx, BD: BitDenotation<'tcx>> {
73+
pub trait Dataflow<'tcx, BD: BitDenotation<'tcx>> {
7474
/// Sets up and runs the dataflow problem, using `p` to render results if
7575
/// implementation so chooses.
7676
fn dataflow<P>(&mut self, p: P) where P: Fn(&BD, BD::Idx) -> DebugFormatted {
@@ -121,7 +121,7 @@ pub struct MoveDataParamEnv<'tcx> {
121121
pub(crate) param_env: ty::ParamEnv<'tcx>,
122122
}
123123

124-
pub(crate) fn do_dataflow<'a, 'tcx, BD, P>(
124+
pub fn do_dataflow<'a, 'tcx, BD, P>(
125125
tcx: TyCtxt<'tcx>,
126126
body: &'a Body<'tcx>,
127127
def_id: DefId,
@@ -565,7 +565,7 @@ pub struct GenKill<T> {
565565
pub(crate) kill_set: T,
566566
}
567567

568-
type GenKillSet<T> = GenKill<HybridBitSet<T>>;
568+
pub type GenKillSet<T> = GenKill<HybridBitSet<T>>;
569569

570570
impl<T> GenKill<T> {
571571
/// Creates a new tuple where `gen_set == kill_set == elem`.
@@ -580,28 +580,28 @@ impl<T> GenKill<T> {
580580
}
581581

582582
impl<E:Idx> GenKillSet<E> {
583-
pub(crate) fn clear(&mut self) {
583+
pub fn clear(&mut self) {
584584
self.gen_set.clear();
585585
self.kill_set.clear();
586586
}
587587

588-
fn gen(&mut self, e: E) {
588+
pub fn gen(&mut self, e: E) {
589589
self.gen_set.insert(e);
590590
self.kill_set.remove(e);
591591
}
592592

593-
fn gen_all(&mut self, i: impl IntoIterator<Item: Borrow<E>>) {
593+
pub fn gen_all(&mut self, i: impl IntoIterator<Item: Borrow<E>>) {
594594
for j in i {
595595
self.gen(*j.borrow());
596596
}
597597
}
598598

599-
fn kill(&mut self, e: E) {
599+
pub fn kill(&mut self, e: E) {
600600
self.gen_set.remove(e);
601601
self.kill_set.insert(e);
602602
}
603603

604-
fn kill_all(&mut self, i: impl IntoIterator<Item: Borrow<E>>) {
604+
pub fn kill_all(&mut self, i: impl IntoIterator<Item: Borrow<E>>) {
605605
for j in i {
606606
self.kill(*j.borrow());
607607
}

src/librustc_mir/lib.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ mod error_codes;
3636

3737
mod borrow_check;
3838
mod build;
39-
mod dataflow;
39+
pub mod dataflow;
4040
mod hair;
4141
mod lints;
4242
mod shim;

0 commit comments

Comments
 (0)