From a9056f699e7a11cdecfeb7c44c039222bbe77737 Mon Sep 17 00:00:00 2001 From: Jakob Stoklund Olesen Date: Tue, 21 Mar 2017 15:33:23 -0700 Subject: [PATCH] Rename the 'cfg' module to 'flowgraph'. The 'cfg' name was easy to confuse with 'configuration'. --- cranelift/src/filetest/domtree.rs | 8 ++++---- cranelift/src/print_cfg.rs | 6 +++--- cranelift/tests/cfg_traversal.rs | 6 +++--- lib/cretonne/src/context.rs | 2 +- lib/cretonne/src/dominator_tree.rs | 8 ++++---- lib/cretonne/src/{cfg.rs => flowgraph.rs} | 0 lib/cretonne/src/lib.rs | 2 +- lib/cretonne/src/regalloc/context.rs | 4 ++-- lib/cretonne/src/regalloc/liveness.rs | 4 ++-- lib/cretonne/src/verifier.rs | 8 ++++---- 10 files changed, 24 insertions(+), 24 deletions(-) rename lib/cretonne/src/{cfg.rs => flowgraph.rs} (100%) diff --git a/cranelift/src/filetest/domtree.rs b/cranelift/src/filetest/domtree.rs index 84b63177ec..29bde6d13f 100644 --- a/cranelift/src/filetest/domtree.rs +++ b/cranelift/src/filetest/domtree.rs @@ -11,14 +11,14 @@ //! We verify that the dominator tree annotations are complete and correct. //! -use std::collections::HashMap; -use std::borrow::{Borrow, Cow}; +use cretonne::dominator_tree::DominatorTree; +use cretonne::flowgraph::ControlFlowGraph; use cretonne::ir::Function; use cretonne::ir::entities::AnyEntity; -use cretonne::cfg::ControlFlowGraph; -use cretonne::dominator_tree::DominatorTree; use cton_reader::TestCommand; use filetest::subtest::{SubTest, Context, Result}; +use std::borrow::{Borrow, Cow}; +use std::collections::HashMap; use utils::match_directive; struct TestDomtree; diff --git a/cranelift/src/print_cfg.rs b/cranelift/src/print_cfg.rs index 206f5430c2..d5b87d806b 100644 --- a/cranelift/src/print_cfg.rs +++ b/cranelift/src/print_cfg.rs @@ -7,12 +7,12 @@ use std::borrow::Cow; use std::fmt::{Result, Write, Display, Formatter}; use CommandResult; -use utils::read_to_string; -use filetest::subtest::{self, SubTest, Context, Result as STResult}; +use cretonne::flowgraph::ControlFlowGraph; use cretonne::ir::Function; -use cretonne::cfg::ControlFlowGraph; use cretonne::ir::instructions::BranchInfo; use cton_reader::{parse_functions, TestCommand}; +use filetest::subtest::{self, SubTest, Context, Result as STResult}; +use utils::read_to_string; pub fn run(files: Vec) -> CommandResult { for (i, f) in files.into_iter().enumerate() { diff --git a/cranelift/tests/cfg_traversal.rs b/cranelift/tests/cfg_traversal.rs index ff5cf6020c..f7fb119463 100644 --- a/cranelift/tests/cfg_traversal.rs +++ b/cranelift/tests/cfg_traversal.rs @@ -1,10 +1,10 @@ extern crate cretonne; extern crate cton_reader; -use self::cton_reader::parse_functions; -use self::cretonne::ir::Ebb; -use self::cretonne::cfg::ControlFlowGraph; use self::cretonne::entity_map::EntityMap; +use self::cretonne::flowgraph::ControlFlowGraph; +use self::cretonne::ir::Ebb; +use self::cton_reader::parse_functions; fn test_reverse_postorder_traversal(function_source: &str, ebb_order: Vec) { let func = &parse_functions(function_source).unwrap()[0]; diff --git a/lib/cretonne/src/context.rs b/lib/cretonne/src/context.rs index ce1e8b50ff..a4fc155c41 100644 --- a/lib/cretonne/src/context.rs +++ b/lib/cretonne/src/context.rs @@ -9,8 +9,8 @@ //! contexts concurrently. Typically, you would have one context per compilation thread and only a //! single ISA instance. -use cfg::ControlFlowGraph; use dominator_tree::DominatorTree; +use flowgraph::ControlFlowGraph; use ir::Function; use isa::TargetIsa; use legalize_function; diff --git a/lib/cretonne/src/dominator_tree.rs b/lib/cretonne/src/dominator_tree.rs index a426fedbea..b014e85ec1 100644 --- a/lib/cretonne/src/dominator_tree.rs +++ b/lib/cretonne/src/dominator_tree.rs @@ -1,8 +1,8 @@ //! A Dominator Tree represented as mappings of Ebbs to their immediate dominator. -use cfg::{ControlFlowGraph, BasicBlock}; -use ir::{Ebb, Inst, Function, Layout, ProgramOrder}; use entity_map::EntityMap; +use flowgraph::{ControlFlowGraph, BasicBlock}; +use ir::{Ebb, Inst, Function, Layout, ProgramOrder}; use packed_option::PackedOption; use std::cmp::Ordering; @@ -222,9 +222,9 @@ impl DominatorTree { #[cfg(test)] mod test { - use super::*; + use flowgraph::ControlFlowGraph; use ir::{Function, InstBuilder, Cursor, types}; - use cfg::ControlFlowGraph; + use super::*; #[test] fn empty() { diff --git a/lib/cretonne/src/cfg.rs b/lib/cretonne/src/flowgraph.rs similarity index 100% rename from lib/cretonne/src/cfg.rs rename to lib/cretonne/src/flowgraph.rs diff --git a/lib/cretonne/src/lib.rs b/lib/cretonne/src/lib.rs index 733506a605..079b9a4559 100644 --- a/lib/cretonne/src/lib.rs +++ b/lib/cretonne/src/lib.rs @@ -10,7 +10,7 @@ pub use write::write_function; /// Version number of the cretonne crate. pub const VERSION: &'static str = env!("CARGO_PKG_VERSION"); -pub mod cfg; +pub mod flowgraph; pub mod dominator_tree; pub mod entity_list; pub mod entity_map; diff --git a/lib/cretonne/src/regalloc/context.rs b/lib/cretonne/src/regalloc/context.rs index 75863fbc63..195c480372 100644 --- a/lib/cretonne/src/regalloc/context.rs +++ b/lib/cretonne/src/regalloc/context.rs @@ -5,12 +5,12 @@ //! avoids allocating data structures independently for each function begin compiled. use dominator_tree::DominatorTree; +use flowgraph::ControlFlowGraph; use ir::Function; +use isa::TargetIsa; use regalloc::coloring::Coloring; use regalloc::live_value_tracker::LiveValueTracker; use regalloc::liveness::Liveness; -use isa::TargetIsa; -use cfg::ControlFlowGraph; /// Persistent memory allocations for register allocation. pub struct Context { diff --git a/lib/cretonne/src/regalloc/liveness.rs b/lib/cretonne/src/regalloc/liveness.rs index 989d3bb8b7..0e384017c2 100644 --- a/lib/cretonne/src/regalloc/liveness.rs +++ b/lib/cretonne/src/regalloc/liveness.rs @@ -175,12 +175,12 @@ //! //! There is some room for improvement. -use cfg::ControlFlowGraph; +use flowgraph::ControlFlowGraph; use ir::dfg::ValueDef; use ir::{Function, Value, Inst, Ebb}; use isa::{TargetIsa, RecipeConstraints}; -use regalloc::liverange::LiveRange; use regalloc::affinity::Affinity; +use regalloc::liverange::LiveRange; use sparse_map::SparseMap; /// A set of live ranges, indexed by value number. diff --git a/lib/cretonne/src/verifier.rs b/lib/cretonne/src/verifier.rs index dbb57a5b3e..0e59b14e2e 100644 --- a/lib/cretonne/src/verifier.rs +++ b/lib/cretonne/src/verifier.rs @@ -53,11 +53,11 @@ //! - Swizzle and shuffle instructions take a variable number of lane arguments. The number //! of arguments must match the destination type, and the lane indexes must be in range. -use ir::{types, Function, ValueDef, Ebb, Inst, SigRef, FuncRef, ValueList, JumpTable, Value}; -use ir::instructions::{InstructionFormat, BranchInfo}; -use ir::entities::AnyEntity; -use cfg::ControlFlowGraph; use dominator_tree::DominatorTree; +use flowgraph::ControlFlowGraph; +use ir::entities::AnyEntity; +use ir::instructions::{InstructionFormat, BranchInfo}; +use ir::{types, Function, ValueDef, Ebb, Inst, SigRef, FuncRef, ValueList, JumpTable, Value}; use std::fmt::{self, Display, Formatter}; use std::result;