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.
This commit is contained in:
Dan Gohman
2018-03-20 12:15:59 -07:00
parent da4cf27780
commit 2b3df1a506
66 changed files with 82 additions and 2 deletions

View File

@@ -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 {

View File

@@ -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;

View File

@@ -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.
///

View File

@@ -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<Value>;

View File

@@ -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.

View File

@@ -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

View File

@@ -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<Box<TargetIsa>> {

View File

@@ -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 {

View File

@@ -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<Box<TargetIsa>> {

View File

@@ -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;

View File

@@ -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)]