From 49ee40abeb6f8ea1e19d75dc928867b26479d0f6 Mon Sep 17 00:00:00 2001 From: Shadaj Laddad Date: Wed, 6 Nov 2024 11:37:57 -0800 Subject: [PATCH] refactor(hydroflow_plus): move rewrites to a submodule --- hydroflow_plus/src/builder/built.rs | 2 +- hydroflow_plus/src/lib.rs | 5 +---- hydroflow_plus/src/rewrites/mod.rs | 3 +++ hydroflow_plus/src/{ => rewrites}/persist_pullup.rs | 0 hydroflow_plus/src/{ => rewrites}/profiler.rs | 4 ++-- hydroflow_plus/src/{ => rewrites}/properties.rs | 0 6 files changed, 7 insertions(+), 7 deletions(-) create mode 100644 hydroflow_plus/src/rewrites/mod.rs rename hydroflow_plus/src/{ => rewrites}/persist_pullup.rs (100%) rename hydroflow_plus/src/{ => rewrites}/profiler.rs (96%) rename hydroflow_plus/src/{ => rewrites}/properties.rs (100%) diff --git a/hydroflow_plus/src/builder/built.rs b/hydroflow_plus/src/builder/built.rs index 440dabe41973..ee196b3f3016 100644 --- a/hydroflow_plus/src/builder/built.rs +++ b/hydroflow_plus/src/builder/built.rs @@ -73,7 +73,7 @@ impl<'a> BuiltFlow<'a> { } pub fn with_default_optimize(self) -> BuiltFlow<'a> { - self.optimize_with(crate::persist_pullup::persist_pullup) + self.optimize_with(crate::rewrites::persist_pullup::persist_pullup) } fn into_deploy>(mut self) -> DeployFlow<'a, D> { diff --git a/hydroflow_plus/src/lib.rs b/hydroflow_plus/src/lib.rs index bbc38afb76d8..2e7f322ec1d8 100644 --- a/hydroflow_plus/src/lib.rs +++ b/hydroflow_plus/src/lib.rs @@ -34,10 +34,7 @@ pub use builder::FlowBuilder; pub mod ir; -pub mod persist_pullup; -pub mod profiler; - -pub mod properties; +pub mod rewrites; mod staging_util; diff --git a/hydroflow_plus/src/rewrites/mod.rs b/hydroflow_plus/src/rewrites/mod.rs new file mode 100644 index 000000000000..20c3302f0fe3 --- /dev/null +++ b/hydroflow_plus/src/rewrites/mod.rs @@ -0,0 +1,3 @@ +pub mod persist_pullup; +pub mod profiler; +pub mod properties; diff --git a/hydroflow_plus/src/persist_pullup.rs b/hydroflow_plus/src/rewrites/persist_pullup.rs similarity index 100% rename from hydroflow_plus/src/persist_pullup.rs rename to hydroflow_plus/src/rewrites/persist_pullup.rs diff --git a/hydroflow_plus/src/profiler.rs b/hydroflow_plus/src/rewrites/profiler.rs similarity index 96% rename from hydroflow_plus/src/profiler.rs rename to hydroflow_plus/src/rewrites/profiler.rs index 4e4ded0833cc..60ffb9bbcd08 100644 --- a/hydroflow_plus/src/profiler.rs +++ b/hydroflow_plus/src/rewrites/profiler.rs @@ -3,8 +3,8 @@ use std::cell::RefCell; use hydroflow::futures::channel::mpsc::UnboundedSender; use stageleft::*; -use crate::ir::*; -use crate::{profiler as myself, RuntimeContext}; +use crate::{ir::*, RuntimeContext}; +use super::profiler as myself; // TODO(shadaj): stageleft does not support `self::...` pub fn increment_counter(count: &mut u64) { *count += 1; diff --git a/hydroflow_plus/src/properties.rs b/hydroflow_plus/src/rewrites/properties.rs similarity index 100% rename from hydroflow_plus/src/properties.rs rename to hydroflow_plus/src/rewrites/properties.rs