From 2b3df1a506399e21dcdcc72bb835e66df7be3a74 Mon Sep 17 00:00:00 2001 From: Dan Gohman Date: Tue, 20 Mar 2018 12:15:59 -0700 Subject: [PATCH] Add `use` declarations for `std` features. Merge the `use` parts of the `no_std` branch. This reduces the diffs between master and the `no_std` branch, making it easier to maintain. Most of these changes are derived from patches by @lachlansneff in https://github.com/Cretonne/cretonne/tree/no_std. --- lib/cretonne/src/abi.rs | 1 + lib/cretonne/src/bforest/map.rs | 1 + lib/cretonne/src/bforest/node.rs | 1 + lib/cretonne/src/bforest/pool.rs | 1 + lib/cretonne/src/bforest/set.rs | 1 + lib/cretonne/src/dominator_tree.rs | 2 +- lib/cretonne/src/entity/list.rs | 1 + lib/cretonne/src/entity/map.rs | 1 + lib/cretonne/src/entity/primary.rs | 1 + lib/cretonne/src/entity/set.rs | 1 + lib/cretonne/src/entity/sparse.rs | 1 + lib/cretonne/src/flowgraph.rs | 1 + lib/cretonne/src/ir/condcodes.rs | 1 + lib/cretonne/src/ir/dfg.rs | 1 + lib/cretonne/src/ir/entities.rs | 1 + lib/cretonne/src/ir/extfunc.rs | 2 ++ lib/cretonne/src/ir/extname.rs | 1 + lib/cretonne/src/ir/immediates.rs | 1 + lib/cretonne/src/ir/instructions.rs | 2 ++ lib/cretonne/src/ir/jumptable.rs | 3 +++ lib/cretonne/src/ir/layout.rs | 1 + lib/cretonne/src/ir/libcall.rs | 1 + lib/cretonne/src/ir/progpoint.rs | 1 + lib/cretonne/src/ir/sourceloc.rs | 1 + lib/cretonne/src/ir/stackslot.rs | 2 ++ lib/cretonne/src/ir/trapcode.rs | 1 + lib/cretonne/src/ir/types.rs | 1 + lib/cretonne/src/isa/arm32/mod.rs | 1 + lib/cretonne/src/isa/arm32/registers.rs | 1 + lib/cretonne/src/isa/arm64/mod.rs | 1 + lib/cretonne/src/isa/arm64/registers.rs | 1 + lib/cretonne/src/isa/intel/mod.rs | 2 +- lib/cretonne/src/isa/intel/registers.rs | 1 + lib/cretonne/src/isa/mod.rs | 1 + lib/cretonne/src/isa/riscv/mod.rs | 2 ++ lib/cretonne/src/isa/riscv/registers.rs | 1 + lib/cretonne/src/isa/riscv/settings.rs | 1 + lib/cretonne/src/iterators.rs | 2 ++ lib/cretonne/src/legalizer/boundary.rs | 1 + lib/cretonne/src/legalizer/split.rs | 1 + lib/cretonne/src/licm.rs | 1 + lib/cretonne/src/loop_analysis.rs | 2 ++ lib/cretonne/src/partition_slice.rs | 1 + lib/cretonne/src/regalloc/allocatable_set.rs | 1 + lib/cretonne/src/regalloc/coalescing.rs | 1 + lib/cretonne/src/regalloc/diversion.rs | 1 + lib/cretonne/src/regalloc/live_value_tracker.rs | 1 + lib/cretonne/src/regalloc/liveness.rs | 1 + lib/cretonne/src/regalloc/liverange.rs | 1 + lib/cretonne/src/regalloc/pressure.rs | 1 + lib/cretonne/src/regalloc/reload.rs | 1 + lib/cretonne/src/regalloc/solver.rs | 2 ++ lib/cretonne/src/regalloc/spilling.rs | 1 + lib/cretonne/src/regalloc/virtregs.rs | 1 + lib/cretonne/src/settings.rs | 2 ++ lib/cretonne/src/simple_gvn.rs | 1 + lib/cretonne/src/topo_order.rs | 1 + lib/cretonne/src/verifier/mod.rs | 2 ++ lib/cretonne/src/write.rs | 2 ++ lib/frontend/src/ssa.rs | 1 + lib/wasm/src/code_translator.rs | 1 + lib/wasm/src/environ/dummy.rs | 2 ++ lib/wasm/src/environ/spec.rs | 2 ++ lib/wasm/src/module_translator.rs | 2 ++ lib/wasm/src/sections_translator.rs | 2 ++ lib/wasm/src/state.rs | 1 + 66 files changed, 82 insertions(+), 2 deletions(-) diff --git a/lib/cretonne/src/abi.rs b/lib/cretonne/src/abi.rs index 801d4bfe9e..b69821e657 100644 --- a/lib/cretonne/src/abi.rs +++ b/lib/cretonne/src/abi.rs @@ -5,6 +5,7 @@ use ir::{ArgumentLoc, AbiParam, ArgumentExtension, Type}; use std::cmp::Ordering; +use std::vec::Vec; /// Legalization action to perform on a single argument or return value when converting a /// signature. diff --git a/lib/cretonne/src/bforest/map.rs b/lib/cretonne/src/bforest/map.rs index 5aa19bceda..edf301aa4c 100644 --- a/lib/cretonne/src/bforest/map.rs +++ b/lib/cretonne/src/bforest/map.rs @@ -423,6 +423,7 @@ where #[cfg(test)] mod test { use std::mem; + use std::vec::Vec; use super::*; use super::super::NodeData; diff --git a/lib/cretonne/src/bforest/node.rs b/lib/cretonne/src/bforest/node.rs index 3c6b8c8774..d5c46f54bd 100644 --- a/lib/cretonne/src/bforest/node.rs +++ b/lib/cretonne/src/bforest/node.rs @@ -580,6 +580,7 @@ where #[cfg(test)] mod test { use std::mem; + use std::string::ToString; use super::*; // Forest impl for a set implementation. diff --git a/lib/cretonne/src/bforest/pool.rs b/lib/cretonne/src/bforest/pool.rs index 1ce9e83279..481271c8db 100644 --- a/lib/cretonne/src/bforest/pool.rs +++ b/lib/cretonne/src/bforest/pool.rs @@ -78,6 +78,7 @@ impl NodePool { { use std::borrow::Borrow; use std::cmp::Ordering; + use std::vec::Vec; use super::Comparator; use entity::SparseSet; diff --git a/lib/cretonne/src/bforest/set.rs b/lib/cretonne/src/bforest/set.rs index 6992265773..dd7f63ca17 100644 --- a/lib/cretonne/src/bforest/set.rs +++ b/lib/cretonne/src/bforest/set.rs @@ -351,6 +351,7 @@ where #[cfg(test)] mod test { use std::mem; + use std::vec::Vec; use super::*; use super::super::NodeData; diff --git a/lib/cretonne/src/dominator_tree.rs b/lib/cretonne/src/dominator_tree.rs index e643a42592..823469d081 100644 --- a/lib/cretonne/src/dominator_tree.rs +++ b/lib/cretonne/src/dominator_tree.rs @@ -8,8 +8,8 @@ use packed_option::PackedOption; use std::cmp; use std::mem; use timing; - use std::cmp::Ordering; +use std::vec::Vec; // RPO numbers are not first assigned in a contiguous way but as multiples of STRIDE, to leave // room for modifications of the dominator tree. diff --git a/lib/cretonne/src/entity/list.rs b/lib/cretonne/src/entity/list.rs index 6c963bc377..ad03dc6c85 100644 --- a/lib/cretonne/src/entity/list.rs +++ b/lib/cretonne/src/entity/list.rs @@ -3,6 +3,7 @@ use entity::EntityRef; use std::hash::{Hash, Hasher}; use std::marker::PhantomData; use std::mem; +use std::vec::Vec; /// A small list of entity references allocated from a pool. /// diff --git a/lib/cretonne/src/entity/map.rs b/lib/cretonne/src/entity/map.rs index 9622f93485..f251c2f831 100644 --- a/lib/cretonne/src/entity/map.rs +++ b/lib/cretonne/src/entity/map.rs @@ -3,6 +3,7 @@ use entity::{EntityRef, Keys}; use std::marker::PhantomData; use std::ops::{Index, IndexMut}; +use std::vec::Vec; /// A mapping `K -> V` for densely indexed entity references. /// diff --git a/lib/cretonne/src/entity/primary.rs b/lib/cretonne/src/entity/primary.rs index 137320f3e5..c06b818355 100644 --- a/lib/cretonne/src/entity/primary.rs +++ b/lib/cretonne/src/entity/primary.rs @@ -2,6 +2,7 @@ use entity::{EntityRef, Keys}; use std::marker::PhantomData; use std::ops::{Index, IndexMut}; +use std::vec::Vec; /// A primary mapping `K -> V` allocating dense entity references. /// diff --git a/lib/cretonne/src/entity/set.rs b/lib/cretonne/src/entity/set.rs index 82dc1384ee..e4acf47723 100644 --- a/lib/cretonne/src/entity/set.rs +++ b/lib/cretonne/src/entity/set.rs @@ -2,6 +2,7 @@ use entity::{EntityRef, Keys}; use std::marker::PhantomData; +use std::vec::Vec; /// A set of `K` for densely indexed entity references. /// diff --git a/lib/cretonne/src/entity/sparse.rs b/lib/cretonne/src/entity/sparse.rs index 82e1b49546..488fd55393 100644 --- a/lib/cretonne/src/entity/sparse.rs +++ b/lib/cretonne/src/entity/sparse.rs @@ -11,6 +11,7 @@ use entity::{EntityRef, EntityMap}; use std::mem; use std::slice; use std::u32; +use std::vec::Vec; /// Trait for extracting keys from values stored in a `SparseMap`. /// diff --git a/lib/cretonne/src/flowgraph.rs b/lib/cretonne/src/flowgraph.rs index fbc74b79d0..dce60162a4 100644 --- a/lib/cretonne/src/flowgraph.rs +++ b/lib/cretonne/src/flowgraph.rs @@ -204,6 +204,7 @@ mod tests { use super::*; use cursor::{Cursor, FuncCursor}; use ir::{Function, InstBuilder, types}; + use std::vec::Vec; #[test] fn empty() { diff --git a/lib/cretonne/src/ir/condcodes.rs b/lib/cretonne/src/ir/condcodes.rs index 4bbf82cb6f..11c438b10a 100644 --- a/lib/cretonne/src/ir/condcodes.rs +++ b/lib/cretonne/src/ir/condcodes.rs @@ -266,6 +266,7 @@ impl FromStr for FloatCC { #[cfg(test)] mod tests { use super::*; + use std::string::ToString; static INT_ALL: [IntCC; 10] = [ IntCC::Equal, diff --git a/lib/cretonne/src/ir/dfg.rs b/lib/cretonne/src/ir/dfg.rs index ccd08f1bb5..344483a6d9 100644 --- a/lib/cretonne/src/ir/dfg.rs +++ b/lib/cretonne/src/ir/dfg.rs @@ -944,6 +944,7 @@ mod tests { use cursor::{Cursor, FuncCursor}; use ir::types; use ir::{Function, Opcode, InstructionData, TrapCode}; + use std::string::ToString; #[test] fn make_inst() { diff --git a/lib/cretonne/src/ir/entities.rs b/lib/cretonne/src/ir/entities.rs index a9e6705d98..1a4e772be4 100644 --- a/lib/cretonne/src/ir/entities.rs +++ b/lib/cretonne/src/ir/entities.rs @@ -262,6 +262,7 @@ impl From for AnyEntity { mod tests { use super::*; use std::u32; + use std::string::ToString; #[test] fn value_with_number() { diff --git a/lib/cretonne/src/ir/extfunc.rs b/lib/cretonne/src/ir/extfunc.rs index b3c3a274e7..f8fe767970 100644 --- a/lib/cretonne/src/ir/extfunc.rs +++ b/lib/cretonne/src/ir/extfunc.rs @@ -10,6 +10,7 @@ use isa::{RegInfo, RegUnit}; use std::cmp; use std::fmt; use std::str::FromStr; +use std::vec::Vec; /// Function signature. /// @@ -378,6 +379,7 @@ impl FromStr for CallConv { mod tests { use super::*; use ir::types::{I32, F32, B8}; + use std::string::ToString; #[test] fn argument_type() { diff --git a/lib/cretonne/src/ir/extname.rs b/lib/cretonne/src/ir/extname.rs index f58f8d24ec..b7bcc7d94f 100644 --- a/lib/cretonne/src/ir/extname.rs +++ b/lib/cretonne/src/ir/extname.rs @@ -122,6 +122,7 @@ impl FromStr for ExternalName { mod tests { use super::ExternalName; use ir::LibCall; + use std::string::ToString; #[test] fn display_testcase() { diff --git a/lib/cretonne/src/ir/immediates.rs b/lib/cretonne/src/ir/immediates.rs index 69c9aab51a..2e6339cc01 100644 --- a/lib/cretonne/src/ir/immediates.rs +++ b/lib/cretonne/src/ir/immediates.rs @@ -652,6 +652,7 @@ mod tests { use std::{f32, f64}; use std::str::FromStr; use std::fmt::Display; + use std::string::ToString; #[test] fn format_imm64() { diff --git a/lib/cretonne/src/ir/instructions.rs b/lib/cretonne/src/ir/instructions.rs index 358c63d942..68ee656e85 100644 --- a/lib/cretonne/src/ir/instructions.rs +++ b/lib/cretonne/src/ir/instructions.rs @@ -9,6 +9,7 @@ use std::fmt::{self, Display, Formatter}; use std::str::FromStr; use std::ops::{Deref, DerefMut}; +use std::vec::Vec; use ir; use ir::{Value, Type, Ebb, JumpTable, SigRef, FuncRef}; @@ -537,6 +538,7 @@ pub enum ResolvedConstraint { #[cfg(test)] mod tests { use super::*; + use std::string::ToString; #[test] fn opcodes() { diff --git a/lib/cretonne/src/ir/jumptable.rs b/lib/cretonne/src/ir/jumptable.rs index 2d09aab4da..1c7bf79157 100644 --- a/lib/cretonne/src/ir/jumptable.rs +++ b/lib/cretonne/src/ir/jumptable.rs @@ -8,6 +8,7 @@ use ir::entities::Ebb; use std::iter; use std::slice; use std::fmt::{self, Display, Formatter}; +use std::vec::Vec; /// Contents of a jump table. /// @@ -141,6 +142,8 @@ mod tests { use super::JumpTableData; use ir::Ebb; use entity::EntityRef; + use std::vec::Vec; + use std::string::ToString; #[test] fn empty() { diff --git a/lib/cretonne/src/ir/layout.rs b/lib/cretonne/src/ir/layout.rs index de117b3ed8..0e6e010e7c 100644 --- a/lib/cretonne/src/ir/layout.rs +++ b/lib/cretonne/src/ir/layout.rs @@ -743,6 +743,7 @@ mod tests { use entity::EntityRef; use ir::{Ebb, Inst, ProgramOrder, SourceLoc}; use std::cmp::Ordering; + use std::vec::Vec; struct LayoutCursor<'f> { /// Borrowed function layout. Public so it can be re-borrowed from this cursor. diff --git a/lib/cretonne/src/ir/libcall.rs b/lib/cretonne/src/ir/libcall.rs index e8c848f71d..85133611be 100644 --- a/lib/cretonne/src/ir/libcall.rs +++ b/lib/cretonne/src/ir/libcall.rs @@ -100,6 +100,7 @@ impl LibCall { #[cfg(test)] mod test { use super::*; + use std::string::ToString; #[test] fn display() { diff --git a/lib/cretonne/src/ir/progpoint.rs b/lib/cretonne/src/ir/progpoint.rs index b7b2994c3b..ce5b108e54 100644 --- a/lib/cretonne/src/ir/progpoint.rs +++ b/lib/cretonne/src/ir/progpoint.rs @@ -148,6 +148,7 @@ mod tests { use super::*; use entity::EntityRef; use ir::{Inst, Ebb}; + use std::string::ToString; #[test] fn convert() { diff --git a/lib/cretonne/src/ir/sourceloc.rs b/lib/cretonne/src/ir/sourceloc.rs index ffcf0db943..36e5247488 100644 --- a/lib/cretonne/src/ir/sourceloc.rs +++ b/lib/cretonne/src/ir/sourceloc.rs @@ -51,6 +51,7 @@ impl fmt::Display for SourceLoc { #[cfg(test)] mod tests { use ir::SourceLoc; + use std::string::ToString; #[test] fn display() { diff --git a/lib/cretonne/src/ir/stackslot.rs b/lib/cretonne/src/ir/stackslot.rs index ebae8e2391..5f73fb4b37 100644 --- a/lib/cretonne/src/ir/stackslot.rs +++ b/lib/cretonne/src/ir/stackslot.rs @@ -10,6 +10,7 @@ use std::cmp; use std::fmt; use std::ops::{Index, IndexMut}; use std::str::FromStr; +use std::vec::Vec; /// The size of an object on the stack, or the size of a stack frame. /// @@ -319,6 +320,7 @@ mod tests { use ir::Function; use ir::types; use super::*; + use std::string::ToString; #[test] fn stack_slot() { diff --git a/lib/cretonne/src/ir/trapcode.rs b/lib/cretonne/src/ir/trapcode.rs index 68b836f309..fe712b7ffa 100644 --- a/lib/cretonne/src/ir/trapcode.rs +++ b/lib/cretonne/src/ir/trapcode.rs @@ -89,6 +89,7 @@ impl FromStr for TrapCode { #[cfg(test)] mod tests { use super::*; + use std::string::ToString; // Everything but user-defined codes. const CODES: [TrapCode; 8] = [ diff --git a/lib/cretonne/src/ir/types.rs b/lib/cretonne/src/ir/types.rs index f8774250ec..07cf97aefa 100644 --- a/lib/cretonne/src/ir/types.rs +++ b/lib/cretonne/src/ir/types.rs @@ -324,6 +324,7 @@ impl Default for Type { #[cfg(test)] mod tests { use super::*; + use std::string::ToString; #[test] fn basic_scalars() { diff --git a/lib/cretonne/src/isa/arm32/mod.rs b/lib/cretonne/src/isa/arm32/mod.rs index c3f295d4fb..02e0d5f1af 100644 --- a/lib/cretonne/src/isa/arm32/mod.rs +++ b/lib/cretonne/src/isa/arm32/mod.rs @@ -14,6 +14,7 @@ use isa::{TargetIsa, RegInfo, RegClass, EncInfo}; use ir; use regalloc; use std::fmt; +use std::boxed::Box; #[allow(dead_code)] struct Isa { diff --git a/lib/cretonne/src/isa/arm32/registers.rs b/lib/cretonne/src/isa/arm32/registers.rs index 7c6ac406e1..e2c4813bdd 100644 --- a/lib/cretonne/src/isa/arm32/registers.rs +++ b/lib/cretonne/src/isa/arm32/registers.rs @@ -8,6 +8,7 @@ include!(concat!(env!("OUT_DIR"), "/registers-arm32.rs")); mod tests { use super::{INFO, GPR, S, D}; use isa::RegUnit; + use std::string::{String, ToString}; #[test] fn unit_encodings() { diff --git a/lib/cretonne/src/isa/arm64/mod.rs b/lib/cretonne/src/isa/arm64/mod.rs index d0644ae2f6..8239cb01e9 100644 --- a/lib/cretonne/src/isa/arm64/mod.rs +++ b/lib/cretonne/src/isa/arm64/mod.rs @@ -14,6 +14,7 @@ use isa::{TargetIsa, RegInfo, RegClass, EncInfo}; use ir; use regalloc; use std::fmt; +use std::boxed::Box; #[allow(dead_code)] struct Isa { diff --git a/lib/cretonne/src/isa/arm64/registers.rs b/lib/cretonne/src/isa/arm64/registers.rs index 62311aaebe..2c1d85e091 100644 --- a/lib/cretonne/src/isa/arm64/registers.rs +++ b/lib/cretonne/src/isa/arm64/registers.rs @@ -8,6 +8,7 @@ include!(concat!(env!("OUT_DIR"), "/registers-arm64.rs")); mod tests { use super::INFO; use isa::RegUnit; + use std::string::{String, ToString}; #[test] fn unit_encodings() { diff --git a/lib/cretonne/src/isa/intel/mod.rs b/lib/cretonne/src/isa/intel/mod.rs index 3f02890a82..578dac2d16 100644 --- a/lib/cretonne/src/isa/intel/mod.rs +++ b/lib/cretonne/src/isa/intel/mod.rs @@ -16,7 +16,7 @@ use regalloc; use result; use timing; use std::fmt; - +use std::boxed::Box; #[allow(dead_code)] struct Isa { diff --git a/lib/cretonne/src/isa/intel/registers.rs b/lib/cretonne/src/isa/intel/registers.rs index c2b96f77d3..c972c10a13 100644 --- a/lib/cretonne/src/isa/intel/registers.rs +++ b/lib/cretonne/src/isa/intel/registers.rs @@ -8,6 +8,7 @@ include!(concat!(env!("OUT_DIR"), "/registers-intel.rs")); mod tests { use super::*; use isa::RegUnit; + use std::string::{String, ToString}; #[test] fn unit_encodings() { diff --git a/lib/cretonne/src/isa/mod.rs b/lib/cretonne/src/isa/mod.rs index 28b297860c..aefe93a05d 100644 --- a/lib/cretonne/src/isa/mod.rs +++ b/lib/cretonne/src/isa/mod.rs @@ -54,6 +54,7 @@ use result; use timing; use isa::enc_tables::Encodings; use std::fmt; +use std::boxed::Box; #[cfg(build_riscv)] mod riscv; diff --git a/lib/cretonne/src/isa/riscv/mod.rs b/lib/cretonne/src/isa/riscv/mod.rs index 2fd0d5cdb9..6fc976686b 100644 --- a/lib/cretonne/src/isa/riscv/mod.rs +++ b/lib/cretonne/src/isa/riscv/mod.rs @@ -14,6 +14,7 @@ use isa::{TargetIsa, RegInfo, RegClass, EncInfo}; use ir; use regalloc; use std::fmt; +use std::boxed::Box; #[allow(dead_code)] struct Isa { @@ -116,6 +117,7 @@ mod tests { use isa; use ir::{DataFlowGraph, InstructionData, Opcode}; use ir::{types, immediates}; + use std::string::{String, ToString}; fn encstr(isa: &isa::TargetIsa, enc: Result) -> String { match enc { diff --git a/lib/cretonne/src/isa/riscv/registers.rs b/lib/cretonne/src/isa/riscv/registers.rs index 3cce8c4988..e2073899b6 100644 --- a/lib/cretonne/src/isa/riscv/registers.rs +++ b/lib/cretonne/src/isa/riscv/registers.rs @@ -8,6 +8,7 @@ include!(concat!(env!("OUT_DIR"), "/registers-riscv.rs")); mod tests { use super::{INFO, GPR, FPR}; use isa::RegUnit; + use std::string::{String, ToString}; #[test] fn unit_encodings() { diff --git a/lib/cretonne/src/isa/riscv/settings.rs b/lib/cretonne/src/isa/riscv/settings.rs index 2aa78fa853..2f0f6822a9 100644 --- a/lib/cretonne/src/isa/riscv/settings.rs +++ b/lib/cretonne/src/isa/riscv/settings.rs @@ -12,6 +12,7 @@ include!(concat!(env!("OUT_DIR"), "/settings-riscv.rs")); mod tests { use super::{builder, Flags}; use settings::{self, Configurable}; + use std::string::ToString; #[test] fn display_default() { diff --git a/lib/cretonne/src/iterators.rs b/lib/cretonne/src/iterators.rs index 08866717e8..0524343028 100644 --- a/lib/cretonne/src/iterators.rs +++ b/lib/cretonne/src/iterators.rs @@ -48,6 +48,8 @@ where #[cfg(test)] mod tests { + use std::vec::Vec; + #[test] fn adjpairs() { use super::IteratorExtras; diff --git a/lib/cretonne/src/legalizer/boundary.rs b/lib/cretonne/src/legalizer/boundary.rs index 29af50b3ad..0c5479650c 100644 --- a/lib/cretonne/src/legalizer/boundary.rs +++ b/lib/cretonne/src/legalizer/boundary.rs @@ -25,6 +25,7 @@ use ir::{Function, DataFlowGraph, Inst, InstBuilder, Ebb, Type, Value, Signature use ir::instructions::CallInfo; use isa::TargetIsa; use legalizer::split::{isplit, vsplit}; +use std::vec::Vec; /// Legalize all the function signatures in `func`. /// diff --git a/lib/cretonne/src/legalizer/split.rs b/lib/cretonne/src/legalizer/split.rs index aafc050c26..cdc60974e0 100644 --- a/lib/cretonne/src/legalizer/split.rs +++ b/lib/cretonne/src/legalizer/split.rs @@ -68,6 +68,7 @@ use cursor::{Cursor, CursorPosition, FuncCursor}; use flowgraph::ControlFlowGraph; use ir::{self, Ebb, Inst, Value, Type, Opcode, ValueDef, InstructionData, InstBuilder}; use std::iter; +use std::vec::Vec; /// Split `value` into two values using the `isplit` semantics. Do this by reusing existing values /// if possible. diff --git a/lib/cretonne/src/licm.rs b/lib/cretonne/src/licm.rs index 1eb035d9bf..e767fc838b 100644 --- a/lib/cretonne/src/licm.rs +++ b/lib/cretonne/src/licm.rs @@ -8,6 +8,7 @@ use dominator_tree::DominatorTree; use entity::{EntityList, ListPool}; use loop_analysis::{Loop, LoopAnalysis}; use timing; +use std::vec::Vec; /// Performs the LICM pass by detecting loops within the CFG and moving /// loop-invariant instructions out of them. diff --git a/lib/cretonne/src/loop_analysis.rs b/lib/cretonne/src/loop_analysis.rs index f6dee54d71..431496b6e4 100644 --- a/lib/cretonne/src/loop_analysis.rs +++ b/lib/cretonne/src/loop_analysis.rs @@ -8,6 +8,7 @@ use flowgraph::ControlFlowGraph; use ir::{Function, Ebb, Layout}; use packed_option::PackedOption; use timing; +use std::vec::Vec; /// A opaque reference to a code loop. #[derive(Copy, Clone, PartialEq, Eq, Hash)] @@ -230,6 +231,7 @@ mod test { use loop_analysis::{Loop, LoopAnalysis}; use flowgraph::ControlFlowGraph; use dominator_tree::DominatorTree; + use std::vec::Vec; #[test] fn nested_loops_detection() { diff --git a/lib/cretonne/src/partition_slice.rs b/lib/cretonne/src/partition_slice.rs index 6f106e5bfc..7a94a9fe0d 100644 --- a/lib/cretonne/src/partition_slice.rs +++ b/lib/cretonne/src/partition_slice.rs @@ -33,6 +33,7 @@ where #[cfg(test)] mod tests { use super::partition_slice; + use std::vec::Vec; fn check(x: &[u32], want: &[u32]) { assert_eq!(x.len(), want.len()); diff --git a/lib/cretonne/src/regalloc/allocatable_set.rs b/lib/cretonne/src/regalloc/allocatable_set.rs index cc72066b5d..e0abf76d37 100644 --- a/lib/cretonne/src/regalloc/allocatable_set.rs +++ b/lib/cretonne/src/regalloc/allocatable_set.rs @@ -221,6 +221,7 @@ impl fmt::Display for AllocatableSet { mod tests { use super::*; use isa::registers::{RegClass, RegClassData}; + use std::vec::Vec; // Register classes for testing. const GPR: RegClass = &RegClassData { diff --git a/lib/cretonne/src/regalloc/coalescing.rs b/lib/cretonne/src/regalloc/coalescing.rs index 3b9d6d03bb..2437fd1a03 100644 --- a/lib/cretonne/src/regalloc/coalescing.rs +++ b/lib/cretonne/src/regalloc/coalescing.rs @@ -18,6 +18,7 @@ use std::cmp; use std::iter; use std::fmt; use std::slice; +use std::vec::Vec; use isa::{TargetIsa, EncInfo}; use timing; diff --git a/lib/cretonne/src/regalloc/diversion.rs b/lib/cretonne/src/regalloc/diversion.rs index 588ad040a5..16eb0e9b50 100644 --- a/lib/cretonne/src/regalloc/diversion.rs +++ b/lib/cretonne/src/regalloc/diversion.rs @@ -11,6 +11,7 @@ use ir::{Value, ValueLoc, ValueLocations, StackSlot}; use ir::{InstructionData, Opcode}; use isa::{RegUnit, RegInfo}; use std::fmt; +use std::vec::Vec; /// A diversion of a value from its original location to a new register or stack location. /// diff --git a/lib/cretonne/src/regalloc/live_value_tracker.rs b/lib/cretonne/src/regalloc/live_value_tracker.rs index f53b5ec8bd..bedd0480e5 100644 --- a/lib/cretonne/src/regalloc/live_value_tracker.rs +++ b/lib/cretonne/src/regalloc/live_value_tracker.rs @@ -13,6 +13,7 @@ use regalloc::affinity::Affinity; use regalloc::liveness::Liveness; use regalloc::liverange::LiveRange; use std::collections::HashMap; +use std::vec::Vec; type ValueList = EntityList; diff --git a/lib/cretonne/src/regalloc/liveness.rs b/lib/cretonne/src/regalloc/liveness.rs index 11e7d8cc3d..9a76cb5899 100644 --- a/lib/cretonne/src/regalloc/liveness.rs +++ b/lib/cretonne/src/regalloc/liveness.rs @@ -184,6 +184,7 @@ use regalloc::affinity::Affinity; use regalloc::liverange::{LiveRange, LiveRangeForest, LiveRangeContext}; use std::mem; use std::ops::Index; +use std::vec::Vec; use timing; /// A set of live ranges, indexed by value number. diff --git a/lib/cretonne/src/regalloc/liverange.rs b/lib/cretonne/src/regalloc/liverange.rs index 9462d32ad0..dbde52f05d 100644 --- a/lib/cretonne/src/regalloc/liverange.rs +++ b/lib/cretonne/src/regalloc/liverange.rs @@ -463,6 +463,7 @@ mod tests { use entity::EntityRef; use ir::{ProgramOrder, ExpandedProgramPoint}; use std::cmp::Ordering; + use std::vec::Vec; // Dummy program order which simply compares indexes. // It is assumed that EBBs have indexes that are multiples of 10, and instructions have indexes diff --git a/lib/cretonne/src/regalloc/pressure.rs b/lib/cretonne/src/regalloc/pressure.rs index c71037efdd..67e0e99b70 100644 --- a/lib/cretonne/src/regalloc/pressure.rs +++ b/lib/cretonne/src/regalloc/pressure.rs @@ -273,6 +273,7 @@ mod tests { use regalloc::AllocatableSet; use std::borrow::Borrow; use super::Pressure; + use std::boxed::Box; // Make an arm32 `TargetIsa`, if possible. fn arm32() -> Option> { diff --git a/lib/cretonne/src/regalloc/reload.rs b/lib/cretonne/src/regalloc/reload.rs index 2967081807..63e7354453 100644 --- a/lib/cretonne/src/regalloc/reload.rs +++ b/lib/cretonne/src/regalloc/reload.rs @@ -21,6 +21,7 @@ use regalloc::live_value_tracker::{LiveValue, LiveValueTracker}; use regalloc::liveness::Liveness; use timing; use topo_order::TopoOrder; +use std::vec::Vec; /// Reusable data structures for the reload pass. pub struct Reload { diff --git a/lib/cretonne/src/regalloc/solver.rs b/lib/cretonne/src/regalloc/solver.rs index 0e68099a67..7824444eec 100644 --- a/lib/cretonne/src/regalloc/solver.rs +++ b/lib/cretonne/src/regalloc/solver.rs @@ -108,6 +108,7 @@ use std::fmt; use std::mem; use super::AllocatableSet; use std::u16; +use std::vec::Vec; /// A variable in the constraint problem. /// @@ -1162,6 +1163,7 @@ mod tests { use isa::{TargetIsa, RegClass, RegUnit, RegInfo}; use regalloc::AllocatableSet; use super::{Solver, Move}; + use std::boxed::Box; // Make an arm32 `TargetIsa`, if possible. fn arm32() -> Option> { diff --git a/lib/cretonne/src/regalloc/spilling.rs b/lib/cretonne/src/regalloc/spilling.rs index 15739cd260..3c3f805cbf 100644 --- a/lib/cretonne/src/regalloc/spilling.rs +++ b/lib/cretonne/src/regalloc/spilling.rs @@ -26,6 +26,7 @@ use regalloc::liveness::Liveness; use regalloc::pressure::Pressure; use regalloc::virtregs::VirtRegs; use std::fmt; +use std::vec::Vec; use timing; use topo_order::TopoOrder; diff --git a/lib/cretonne/src/regalloc/virtregs.rs b/lib/cretonne/src/regalloc/virtregs.rs index fca213a62b..097a66cccd 100644 --- a/lib/cretonne/src/regalloc/virtregs.rs +++ b/lib/cretonne/src/regalloc/virtregs.rs @@ -21,6 +21,7 @@ use packed_option::PackedOption; use ref_slice::ref_slice; use std::cmp::Ordering; use std::fmt; +use std::vec::Vec; /// A virtual register reference. #[derive(Copy, Clone, PartialEq, Eq, Hash, PartialOrd, Ord)] diff --git a/lib/cretonne/src/settings.rs b/lib/cretonne/src/settings.rs index 2cfce65957..20ba99e0d9 100644 --- a/lib/cretonne/src/settings.rs +++ b/lib/cretonne/src/settings.rs @@ -24,6 +24,7 @@ use constant_hash::{probe, simple_hash}; use isa::TargetIsa; use std::fmt; use std::result; +use std::vec::Vec; /// A string-based configurator for settings groups. /// @@ -347,6 +348,7 @@ mod tests { use super::{builder, Flags}; use super::Error::*; use super::Configurable; + use std::string::ToString; #[test] fn display_default() { diff --git a/lib/cretonne/src/simple_gvn.rs b/lib/cretonne/src/simple_gvn.rs index 8642122593..dd0fb3b1aa 100644 --- a/lib/cretonne/src/simple_gvn.rs +++ b/lib/cretonne/src/simple_gvn.rs @@ -6,6 +6,7 @@ use dominator_tree::DominatorTree; use ir::{InstructionData, Function, Inst, Opcode, Type}; use scoped_hash_map::ScopedHashMap; use timing; +use std::vec::Vec; /// Test whether the given opcode is unsafe to even consider for GVN. fn trivially_unsafe_for_gvn(opcode: Opcode) -> bool { diff --git a/lib/cretonne/src/topo_order.rs b/lib/cretonne/src/topo_order.rs index cd783c928a..373ab69e0d 100644 --- a/lib/cretonne/src/topo_order.rs +++ b/lib/cretonne/src/topo_order.rs @@ -3,6 +3,7 @@ use entity::SparseSet; use dominator_tree::DominatorTree; use ir::{Ebb, Layout}; +use std::vec::Vec; /// Present EBBs in a topological order such that all dominating EBBs are guaranteed to be visited /// before the current EBB. diff --git a/lib/cretonne/src/verifier/mod.rs b/lib/cretonne/src/verifier/mod.rs index 33fd3582cb..26eb9a53d9 100644 --- a/lib/cretonne/src/verifier/mod.rs +++ b/lib/cretonne/src/verifier/mod.rs @@ -73,6 +73,8 @@ use std::collections::BTreeSet; use std::error as std_error; use std::fmt::{self, Display, Formatter, Write}; use std::result; +use std::vec::Vec; +use std::string::String; use timing; pub use self::cssa::verify_cssa; diff --git a/lib/cretonne/src/write.rs b/lib/cretonne/src/write.rs index 02f0fa3ab2..50acbbf553 100644 --- a/lib/cretonne/src/write.rs +++ b/lib/cretonne/src/write.rs @@ -9,6 +9,7 @@ use isa::{TargetIsa, RegInfo}; use std::fmt::{self, Result, Error, Write}; use std::result; use packed_option::ReservedValue; +use std::string::String; /// Write `func` to `w` as equivalent text. /// Use `isa` to emit ISA-dependent annotations. @@ -466,6 +467,7 @@ impl<'a> fmt::Display for DisplayValues<'a> { mod tests { use ir::{Function, ExternalName, StackSlotData, StackSlotKind}; use ir::types; + use std::string::ToString; #[test] fn basic() { diff --git a/lib/frontend/src/ssa.rs b/lib/frontend/src/ssa.rs index 5b974799bf..bd4a8d89fd 100644 --- a/lib/frontend/src/ssa.rs +++ b/lib/frontend/src/ssa.rs @@ -15,6 +15,7 @@ use std::u32; use cretonne::ir::types::{F32, F64}; use cretonne::ir::immediates::{Ieee32, Ieee64}; use std::mem; +use std::vec::Vec; /// Structure containing the data relevant the construction of SSA for a given function. /// diff --git a/lib/wasm/src/code_translator.rs b/lib/wasm/src/code_translator.rs index cccbae1368..940725600a 100644 --- a/lib/wasm/src/code_translator.rs +++ b/lib/wasm/src/code_translator.rs @@ -34,6 +34,7 @@ use state::{TranslationState, ControlStackFrame}; use std::collections::{HashMap, hash_map}; use environ::{FuncEnvironment, GlobalValue}; use std::{i32, u32}; +use std::vec::Vec; /// Translates wasm operators into Cretonne IL instructions. Returns `true` if it inserted /// a return. diff --git a/lib/wasm/src/environ/dummy.rs b/lib/wasm/src/environ/dummy.rs index 5557d842f6..de941f3b9a 100644 --- a/lib/wasm/src/environ/dummy.rs +++ b/lib/wasm/src/environ/dummy.rs @@ -10,6 +10,8 @@ use cretonne::cursor::FuncCursor; use cretonne::settings; use wasmparser; use std::error::Error; +use std::vec::Vec; +use std::string::String; /// Compute a `ir::ExternalName` for a given wasm function index. fn get_func_name(func_index: FunctionIndex) -> ir::ExternalName { diff --git a/lib/wasm/src/environ/spec.rs b/lib/wasm/src/environ/spec.rs index 7f73c3fc16..41583c1185 100644 --- a/lib/wasm/src/environ/spec.rs +++ b/lib/wasm/src/environ/spec.rs @@ -5,6 +5,8 @@ use cretonne::cursor::FuncCursor; use cretonne::settings::Flags; use translation_utils::{SignatureIndex, FunctionIndex, TableIndex, GlobalIndex, MemoryIndex, Global, Table, Memory}; +use std::vec::Vec; +use std::string::String; /// The value of a WebAssembly global variable. #[derive(Clone, Copy)] diff --git a/lib/wasm/src/module_translator.rs b/lib/wasm/src/module_translator.rs index df640cbb49..bb74db4276 100644 --- a/lib/wasm/src/module_translator.rs +++ b/lib/wasm/src/module_translator.rs @@ -8,6 +8,8 @@ use sections_translator::{SectionParsingError, parse_function_signatures, parse_ parse_elements_section, parse_data_section}; use environ::ModuleEnvironment; +use std::string::String; + /// Translate a sequence of bytes forming a valid Wasm binary into a list of valid Cretonne IL /// [`Function`](../cretonne/ir/function/struct.Function.html). /// Returns the functions and also the mappings for imported functions and signature between the diff --git a/lib/wasm/src/sections_translator.rs b/lib/wasm/src/sections_translator.rs index 359510547a..1bf7c9441c 100644 --- a/lib/wasm/src/sections_translator.rs +++ b/lib/wasm/src/sections_translator.rs @@ -16,6 +16,8 @@ use wasmparser::{Parser, ParserState, FuncType, ImportSectionEntryType, External use wasmparser; use std::str::from_utf8; use environ::ModuleEnvironment; +use std::vec::Vec; +use std::string::String; pub enum SectionParsingError { WrongSectionContent(String), diff --git a/lib/wasm/src/state.rs b/lib/wasm/src/state.rs index 1943f31326..5ced6d6056 100644 --- a/lib/wasm/src/state.rs +++ b/lib/wasm/src/state.rs @@ -7,6 +7,7 @@ use cretonne::ir::{self, Ebb, Inst, Value}; use environ::{FuncEnvironment, GlobalValue}; use std::collections::HashMap; use translation_utils::{GlobalIndex, MemoryIndex, SignatureIndex, FunctionIndex}; +use std::vec::Vec; /// A control stack frame can be an `if`, a `block` or a `loop`, each one having the following /// fields: